Added: Common attributes to h1..h6 elements

This commit is contained in:
Nimetu 2015-12-02 20:37:44 +02:00
parent e35db6756d
commit 9014aa6fad
2 changed files with 102 additions and 0 deletions

View file

@ -221,6 +221,48 @@ namespace NLGUI
HTML_ATTR(SPAN,STYLE), HTML_ATTR(SPAN,STYLE),
}; };
enum
{
HTML_ATTR(H1,CLASS) = 0,
HTML_ATTR(H1,ID),
HTML_ATTR(H1,STYLE),
};
enum
{
HTML_ATTR(H2,CLASS) = 0,
HTML_ATTR(H2,ID),
HTML_ATTR(H2,STYLE),
};
enum
{
HTML_ATTR(H3,CLASS) = 0,
HTML_ATTR(H3,ID),
HTML_ATTR(H3,STYLE),
};
enum
{
HTML_ATTR(H4,CLASS) = 0,
HTML_ATTR(H4,ID),
HTML_ATTR(H4,STYLE),
};
enum
{
HTML_ATTR(H5,CLASS) = 0,
HTML_ATTR(H5,ID),
HTML_ATTR(H5,STYLE),
};
enum
{
HTML_ATTR(H6,CLASS) = 0,
HTML_ATTR(H6,ID),
HTML_ATTR(H6,STYLE),
};
#undef HTML_ATTR #undef HTML_ATTR

View file

@ -226,6 +226,54 @@ namespace NLGUI
{ 0 } { 0 }
}; };
HTAttr h1_attr[] =
{
HTML_ATTR(H1,CLASS),
HTML_ATTR(H1,ID),
HTML_ATTR(H1,STYLE),
{ 0 }
};
HTAttr h2_attr[] =
{
HTML_ATTR(H2,CLASS),
HTML_ATTR(H2,ID),
HTML_ATTR(H2,STYLE),
{ 0 }
};
HTAttr h3_attr[] =
{
HTML_ATTR(H3,CLASS),
HTML_ATTR(H3,ID),
HTML_ATTR(H3,STYLE),
{ 0 }
};
HTAttr h4_attr[] =
{
HTML_ATTR(H4,CLASS),
HTML_ATTR(H4,ID),
HTML_ATTR(H4,STYLE),
{ 0 }
};
HTAttr h5_attr[] =
{
HTML_ATTR(H5,CLASS),
HTML_ATTR(H5,ID),
HTML_ATTR(H5,STYLE),
{ 0 }
};
HTAttr h6_attr[] =
{
HTML_ATTR(H6,CLASS),
HTML_ATTR(H6,ID),
HTML_ATTR(H6,STYLE),
{ 0 }
};
// *************************************************************************** // ***************************************************************************
// Read a width HTML parameter. "100" or "100%". Returns true if percent (0 ~ 1) else false // Read a width HTML parameter. "100" or "100%". Returns true if percent (0 ~ 1) else false
@ -449,6 +497,18 @@ namespace NLGUI
HTML_DTD->tags[HTML_DIV].number_of_attributes = sizeof(div_attr) / sizeof(HTAttr) - 1; HTML_DTD->tags[HTML_DIV].number_of_attributes = sizeof(div_attr) / sizeof(HTAttr) - 1;
HTML_DTD->tags[HTML_SPAN].attributes = span_attr; HTML_DTD->tags[HTML_SPAN].attributes = span_attr;
HTML_DTD->tags[HTML_SPAN].number_of_attributes = sizeof(span_attr) / sizeof(HTAttr) - 1; HTML_DTD->tags[HTML_SPAN].number_of_attributes = sizeof(span_attr) / sizeof(HTAttr) - 1;
HTML_DTD->tags[HTML_H1].attributes = h1_attr;
HTML_DTD->tags[HTML_H1].number_of_attributes = sizeof(h1_attr) / sizeof(HTAttr) - 1;
HTML_DTD->tags[HTML_H2].attributes = h2_attr;
HTML_DTD->tags[HTML_H2].number_of_attributes = sizeof(h2_attr) / sizeof(HTAttr) - 1;
HTML_DTD->tags[HTML_H3].attributes = h3_attr;
HTML_DTD->tags[HTML_H3].number_of_attributes = sizeof(h3_attr) / sizeof(HTAttr) - 1;
HTML_DTD->tags[HTML_H4].attributes = h4_attr;
HTML_DTD->tags[HTML_H4].number_of_attributes = sizeof(h4_attr) / sizeof(HTAttr) - 1;
HTML_DTD->tags[HTML_H5].attributes = h5_attr;
HTML_DTD->tags[HTML_H5].number_of_attributes = sizeof(h5_attr) / sizeof(HTAttr) - 1;
HTML_DTD->tags[HTML_H6].attributes = h6_attr;
HTML_DTD->tags[HTML_H6].number_of_attributes = sizeof(h6_attr) / sizeof(HTAttr) - 1;
// Initialized // Initialized
initialized = true; initialized = true;