本文整理汇总了C++中wxHtmlTag类的典型用法代码示例。如果您正苦于以下问题:C++ wxHtmlTag类的具体用法?C++ wxHtmlTag怎么用?C++ wxHtmlTag使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了wxHtmlTag类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: AddRow
void wxHtmlTableCell::AddRow(const wxHtmlTag& tag)
{
m_ActualCol = -1;
// VS: real allocation of row entry is done in AddCell in order
// to correctly handle empty rows (i.e. "<tr></tr>")
// m_ActualCol == -1 indicates that AddCell has to allocate new row.
// scan params:
m_rBkg = m_tBkg;
tag.GetParamAsColour(wxT("BGCOLOR"), &m_rBkg);
if (!tag.GetParamAsString(wxT("VALIGN"), &m_rValign))
m_rValign = m_tValign;
}
开发者ID:idobatter,项目名称:wxWidgets,代码行数:13,代码来源:m_tables.cpp
示例2: wxHtmlContainerCell
wxHtmlTableCell::wxHtmlTableCell(wxHtmlContainerCell *parent, const wxHtmlTag& tag, double pixel_scale)
: wxHtmlContainerCell(parent)
{
m_PixelScale = pixel_scale;
m_HasBorders =
(tag.HasParam(wxT("BORDER")) && tag.GetParam(wxT("BORDER")) != wxT("0"));
m_ColsInfo = NULL;
m_NumCols = m_NumRows = 0;
m_CellInfo = NULL;
m_ActualCol = m_ActualRow = -1;
/* scan params: */
if (tag.HasParam(wxT("BGCOLOR")))
{
tag.GetParamAsColour(wxT("BGCOLOR"), &m_tBkg);
if (m_tBkg.Ok())
SetBackgroundColour(m_tBkg);
}
if (tag.HasParam(wxT("VALIGN")))
m_tValign = tag.GetParam(wxT("VALIGN"));
else
m_tValign = wxEmptyString;
if (!tag.GetParamAsInt(wxT("CELLSPACING"), &m_Spacing))
m_Spacing = 2;
if (!tag.GetParamAsInt(wxT("CELLPADDING"), &m_Padding))
m_Padding = 3;
m_Spacing = (int)(m_PixelScale * (double)m_Spacing);
m_Padding = (int)(m_PixelScale * (double)m_Padding);
if (m_HasBorders)
SetBorder(TABLE_BORDER_CLR_1, TABLE_BORDER_CLR_2);
}
开发者ID:czxxjtu,项目名称:wxPython-1,代码行数:32,代码来源:m_tables.cpp
示例3: AddTag
void wxHtmlParser::AddTag(const wxHtmlTag& tag)
{
bool inner = false;
wxHtmlTagHandlersHash::const_iterator h = m_HandlersHash.find(tag.GetName());
if (h != m_HandlersHash.end())
{
inner = h->second->HandleTag(tag);
if (m_stopParsing)
return;
}
if (!inner)
{
if (tag.HasEnding())
DoParsing(tag.GetBeginIter(), tag.GetEndIter1());
}
}
开发者ID:Richard-Ni,项目名称:wxWidgets,代码行数:17,代码来源:htmlpars.cpp
示例4: SetAlign
void wxHtmlContainerCell::SetAlign(const wxHtmlTag& tag)
{
if (tag.HasParam(wxT("ALIGN")))
{
wxString alg = tag.GetParam(wxT("ALIGN"));
alg.MakeUpper();
if (alg == wxT("CENTER"))
SetAlignHor(wxHTML_ALIGN_CENTER);
else if (alg == wxT("LEFT"))
SetAlignHor(wxHTML_ALIGN_LEFT);
else if (alg == wxT("JUSTIFY"))
SetAlignHor(wxHTML_ALIGN_JUSTIFY);
else if (alg == wxT("RIGHT"))
SetAlignHor(wxHTML_ALIGN_RIGHT);
m_LastLayout = -1;
}
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:17,代码来源:htmlcell.cpp
示例5: if
wxHtmlTableCell::wxHtmlTableCell(wxHtmlContainerCell *parent, const wxHtmlTag& tag, double pixel_scale)
: wxHtmlContainerCell(parent)
{
m_PixelScale = pixel_scale;
m_ColsInfo = NULL;
m_NumCols = m_NumRows = 0;
m_CellInfo = NULL;
m_ActualCol = m_ActualRow = -1;
/* scan params: */
if (tag.GetParamAsColour(wxT("BGCOLOR"), &m_tBkg))
SetBackgroundColour(m_tBkg);
m_tValign = tag.GetParam(wxT("VALIGN"));
if (!tag.GetParamAsInt(wxT("CELLSPACING"), &m_Spacing))
m_Spacing = 2;
if (!tag.GetParamAsInt(wxT("CELLPADDING"), &m_Padding))
m_Padding = 3;
m_Spacing = (int)(m_PixelScale * (double)m_Spacing);
m_Padding = (int)(m_PixelScale * (double)m_Padding);
if(tag.HasParam(wxT("BORDER")))
{
if(tag.GetParam("BORDER").IsEmpty())
m_Border = 1;
else
tag.GetParamAsInt(wxT("BORDER"), &m_Border);
}
if (m_Border == 1)
SetBorder(TABLE_BORDER_CLR_1, TABLE_BORDER_CLR_2, m_Border); // special case see wxHtmlContainerCell::Draw
else if (m_Border> 0)
SetBorder(TABLE_BORDER_CLR_1, TABLE_BORDER_CLR_2, (int)(m_PixelScale * (double)m_Border));
else
m_Border = 0;
}
开发者ID:idobatter,项目名称:wxWidgets,代码行数:35,代码来源:m_tables.cpp
示例6: AddTag
void wxHtmlParser::AddTag(const wxHtmlTag& tag)
{
wxHtmlTagHandler *h;
bool inner = false;
h = (wxHtmlTagHandler*) m_HandlersHash.Get(tag.GetName());
if (h)
{
inner = h->HandleTag(tag);
if (m_stopParsing)
return;
}
if (!inner)
{
if (tag.HasEnding())
DoParsing(tag.GetBeginPos(), tag.GetEndPos1());
}
}
开发者ID:BasCreator,项目名称:rpcs3,代码行数:18,代码来源:htmlpars.cpp
示例7: tkz
wxHtmlStyleParams::wxHtmlStyleParams(const wxHtmlTag& tag)
{
wxString wd = tag.GetParam(wxT("STYLE"));
// Make sure no whitespace
wd.Trim(true).Trim(false);
if ( wd.empty() )
return;
// Check for bracketed entries
// Only support element properties and not pseudo-element or pseudo-classes
if (wd.Find('{') == 0)
{
// Extract string up to end bracket
int endBracket = wd.Find('}');
if (endBracket != wxNOT_FOUND)
{
// Replace original string with bracketed options
wd = wd.SubString(1, endBracket - 1);
// Make sure no whitespace
wd.Trim(true).Trim(false);
}
else
{
// Syntax problem change to blank string
wd.clear();
}
}
// Should now have a semi-colon delimited list of options
// Each option is a name and a value separated by a colon
// Split the list into names and values
wxStringTokenizer tkz(wd, wxT(";"), wxTOKEN_STRTOK);
while ( tkz.HasMoreTokens() )
{
wxString token = tkz.GetNextToken();
// Split into name and value
int colonIndex = token.Find(':');
if ((colonIndex != wxNOT_FOUND) && // Not a name value pair
(colonIndex != 0)) // No name
{
wxString tempString;
// Extract and trim name
tempString = token.SubString(0, colonIndex - 1);
tempString.Trim(true).Trim(false);
// Add to name list
m_names.Add(tempString);
// Extract and trim values
tempString = token.SubString(colonIndex + 1, token.Length() - 1);
tempString.Trim(true).Trim(false);
// Add to values list
m_values.Add(tempString);
}
}
}
开发者ID:CodeSmithyIDE,项目名称:wxWidgets,代码行数:56,代码来源:styleparams.cpp
示例8: SetWidthFloat
void wxHtmlContainerCell::SetWidthFloat(const wxHtmlTag& tag, double pixel_scale)
{
if (tag.HasParam(wxT("WIDTH")))
{
int wdi;
wxString wd = tag.GetParam(wxT("WIDTH"));
if (wd[wd.Length()-1] == wxT('%'))
{
wxSscanf(wd.c_str(), wxT("%i%%"), &wdi);
SetWidthFloat(wdi, wxHTML_UNITS_PERCENT);
}
else
{
wxSscanf(wd.c_str(), wxT("%i"), &wdi);
SetWidthFloat((int)(pixel_scale * (double)wdi), wxHTML_UNITS_PIXELS);
}
m_LastLayout = -1;
}
}
开发者ID:gitrider,项目名称:wxsj2,代码行数:20,代码来源:htmlcell.cpp
示例9: HandleTag
bool wxMetaTagHandler::HandleTag(const wxHtmlTag& tag)
{
if (tag.GetName() == wxT("BODY"))
{
m_Parser->StopParsing();
return false;
}
if (tag.HasParam(wxT("HTTP-EQUIV")) &&
tag.GetParam(wxT("HTTP-EQUIV")).IsSameAs(wxT("Content-Type"), false) &&
tag.HasParam(wxT("CONTENT")))
{
wxString content = tag.GetParam(wxT("CONTENT")).Lower();
if (content.Left(19) == wxT("text/html; charset="))
{
*m_retval = content.Mid(19);
m_Parser->StopParsing();
}
}
return false;
}
开发者ID:Richard-Ni,项目名称:wxWidgets,代码行数:21,代码来源:htmlpars.cpp
示例10: HandleTag
bool wxMetaTagHandler::HandleTag(const wxHtmlTag& tag)
{
if (tag.GetName() == wxT("BODY"))
{
m_Parser->StopParsing();
return false;
}
wxString httpEquiv,
content;
if (tag.GetParamAsString(wxT("HTTP-EQUIV"), &httpEquiv) &&
httpEquiv.IsSameAs(wxT("Content-Type"), false) &&
tag.GetParamAsString(wxT("CONTENT"), &content))
{
content.MakeLower();
if (content.Left(19) == wxT("text/html; charset="))
{
*m_retval = content.Mid(19);
m_Parser->StopParsing();
}
}
return false;
}
开发者ID:chromylei,项目名称:third_party,代码行数:23,代码来源:htmlpars.cpp
示例11: AddTag
void wxHtmlParser::AddTag(const wxHtmlTag& tag)
{
bool inner = false;
wxHtmlTagHandlersHash::const_iterator h = m_HandlersHash.find(tag.GetName());
if (h != m_HandlersHash.end())
{
inner = h->second->HandleTag(tag);
if (m_stopParsing)
return;
}
#if wxDEBUG_LEVEL
else if (m_HandlersHash.empty())
{
wxFAIL_MSG( "No HTML tag handlers registered, is your program linked "
"correctly (you might need to use FORCE_WXHTML_MODULES)?" );
}
#endif // wxDEBUG_LEVEL
if (!inner)
{
if (tag.HasEnding())
DoParsing(tag.GetBeginIter(), tag.GetEndIter1());
}
}
开发者ID:AaronDP,项目名称:wxWidgets,代码行数:24,代码来源:htmlpars.cpp
示例12: HandleTag
bool HP_TagHandler::HandleTag(const wxHtmlTag& tag)
{
if (tag.GetName() == wxT("UL"))
{
wxHtmlHelpDataItem *oldparent = m_parentItem;
m_level++;
m_parentItem = (m_count > 0) ? &(*m_data)[m_data->size()-1] : NULL;
ParseInner(tag);
m_level--;
m_parentItem = oldparent;
return true;
}
else if (tag.GetName() == wxT("OBJECT"))
{
m_name = m_page = wxEmptyString;
ParseInner(tag);
#if 0
if (!page.IsEmpty())
/* Valid HHW's file may contain only two object tags:
<OBJECT type="text/site properties">
<param name="ImageType" value="Folder">
</OBJECT>
or
<OBJECT type="text/sitemap">
<param name="Name" value="main page">
<param name="Local" value="another.htm">
</OBJECT>
We're interested in the latter. !page.IsEmpty() is valid
condition because text/site properties does not contain Local param
*/
#endif
if (tag.GetParam(wxT("TYPE")) == wxT("text/sitemap"))
{
wxHtmlHelpDataItem *item = new wxHtmlHelpDataItem();
item->parent = m_parentItem;
item->level = m_level;
item->id = m_id;
item->page = m_page;
item->name = m_name;
item->book = m_book;
m_data->Add(item);
m_count++;
}
return true;
}
else
{ // "PARAM"
if (m_name.empty() && tag.GetParam(wxT("NAME")) == wxT("Name"))
m_name = tag.GetParam(wxT("VALUE"));
if (tag.GetParam(wxT("NAME")) == wxT("Local"))
m_page = tag.GetParam(wxT("VALUE"));
if (tag.GetParam(wxT("NAME")) == wxT("ID"))
tag.GetParamAsInt(wxT("VALUE"), &m_id);
return false;
}
}
开发者ID:CobaltBlues,项目名称:wxWidgets,代码行数:63,代码来源:helpdata.cpp
示例13: GetInnerSource
wxString wxHtmlParser::GetInnerSource(const wxHtmlTag& tag)
{
return wxString(tag.GetBeginIter(), tag.GetEndIter1());
}
开发者ID:AaronDP,项目名称:wxWidgets,代码行数:4,代码来源:htmlpars.cpp
示例14: GetInnerSource
wxString wxHtmlParser::GetInnerSource(const wxHtmlTag& tag)
{
return GetSource()->Mid(tag.GetBeginPos(),
tag.GetEndPos1() - tag.GetBeginPos());
}
开发者ID:BasCreator,项目名称:rpcs3,代码行数:5,代码来源:htmlpars.cpp
示例15: AddCell
void wxHtmlTableCell::AddCell(wxHtmlContainerCell *cell, const wxHtmlTag& tag)
{
// Is this cell in new row?
// VS: we can't do it in AddRow, see my comment there
if (m_ActualCol == -1)
{
if (m_ActualRow + 1 > m_NumRows - 1)
ReallocRows(m_ActualRow + 2);
m_ActualRow++;
}
// cells & columns:
do
{
m_ActualCol++;
} while ((m_ActualCol < m_NumCols) &&
(m_CellInfo[m_ActualRow][m_ActualCol].flag != cellFree));
if (m_ActualCol > m_NumCols - 1)
ReallocCols(m_ActualCol + 1);
int r = m_ActualRow, c = m_ActualCol;
m_CellInfo[r][c].cont = cell;
m_CellInfo[r][c].colspan = 1;
m_CellInfo[r][c].rowspan = 1;
m_CellInfo[r][c].flag = cellUsed;
m_CellInfo[r][c].minheight = 0;
m_CellInfo[r][c].valign = wxHTML_ALIGN_TOP;
/* scan for parameters: */
// id:
wxString idvalue;
if (tag.GetParamAsString(wxT("ID"), &idvalue))
{
cell->SetId(idvalue);
}
// width:
{
int width = 0;
bool wpercent = false;
if (tag.GetParamAsIntOrPercent(wxT("WIDTH"), &width, wpercent))
{
if (wpercent)
{
m_ColsInfo[c].width = width;
m_ColsInfo[c].units = wxHTML_UNITS_PERCENT;
}
else
{
m_ColsInfo[c].width = (int)(m_PixelScale * (double)width);
m_ColsInfo[c].units = wxHTML_UNITS_PIXELS;
}
}
}
// spanning:
{
tag.GetParamAsInt(wxT("COLSPAN"), &m_CellInfo[r][c].colspan);
tag.GetParamAsInt(wxT("ROWSPAN"), &m_CellInfo[r][c].rowspan);
// VS: the standard says this about col/rowspan:
// "This attribute specifies the number of rows spanned by the
// current cell. The default value of this attribute is one ("1").
// The value zero ("0") means that the cell spans all rows from the
// current row to the last row of the table." All mainstream
// browsers act as if 0==1, though, and so does wxHTML.
if (m_CellInfo[r][c].colspan < 1)
m_CellInfo[r][c].colspan = 1;
if (m_CellInfo[r][c].rowspan < 1)
m_CellInfo[r][c].rowspan = 1;
if ((m_CellInfo[r][c].colspan > 1) || (m_CellInfo[r][c].rowspan > 1))
{
int i, j;
if (r + m_CellInfo[r][c].rowspan > m_NumRows)
ReallocRows(r + m_CellInfo[r][c].rowspan);
if (c + m_CellInfo[r][c].colspan > m_NumCols)
ReallocCols(c + m_CellInfo[r][c].colspan);
for (i = r; i < r + m_CellInfo[r][c].rowspan; i++)
for (j = c; j < c + m_CellInfo[r][c].colspan; j++)
m_CellInfo[i][j].flag = cellSpan;
m_CellInfo[r][c].flag = cellUsed;
}
}
//background color:
{
wxColour bk = m_rBkg;
tag.GetParamAsColour(wxT("BGCOLOR"), &bk);
if (bk.IsOk())
cell->SetBackgroundColour(bk);
}
if (m_Border > 0)
cell->SetBorder(TABLE_BORDER_CLR_2, TABLE_BORDER_CLR_1);
//.........这里部分代码省略.........
开发者ID:idobatter,项目名称:wxWidgets,代码行数:101,代码来源:m_tables.cpp
注:本文中的wxHtmlTag类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论