]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/httag.tex
Added some standard further identifiers to help with WinCE toolbars
[wxWidgets.git] / docs / latex / wx / httag.tex
CommitLineData
704a4b75
VS
1%
2% automatically generated by HelpGen from
3% htmltag.tex at 14/Mar/99 20:13:37
4%
5
704a4b75
VS
6\section{\class{wxHtmlTag}}\label{wxhtmltag}
7
448af9a4 8This class represents a single HTML tag.
704a4b75
VS
9It is used by \helpref{tag handlers}{handlers}.
10
704a4b75
VS
11\wxheading{Derived from}
12
13wxObject
14
9704b250
VS
15\wxheading{Include files}
16
17<wx/html/htmltag.h>
18
704a4b75
VS
19\latexignore{\rtfignore{\wxheading{Members}}}
20
704a4b75
VS
21\membersection{wxHtmlTag::wxHtmlTag}\label{wxhtmltagwxhtmltag}
22
23\func{}{wxHtmlTag}{\param{const wxString\& }{source}, \param{int }{pos}, \param{int }{end\_pos}, \param{wxHtmlTagsCache* }{cache}}
24
f6bcfd97 25Constructor. You will probably never have to construct a wxHtmlTag object
448af9a4 26yourself. Feel free to ignore the constructor parameters.
cc6e1950 27Have a look at src/html/htmlpars.cpp if you're interested in creating it.
704a4b75 28
559fe022 29\membersection{wxHtmlTag::GetAllParams}\label{wxhtmltaggetallparams}
704a4b75 30
559fe022 31\constfunc{const wxString\&}{GetAllParams}{\void}
704a4b75 32
cc6e1950 33Returns a string containing all parameters.
704a4b75 34
559fe022
VS
35Example : tag contains {\tt <FONT SIZE=+2 COLOR="\#000000">}. Call to
36tag.GetAllParams() would return {\tt SIZE=+2 COLOR="\#000000"}.
704a4b75 37
605d715d 38
559fe022 39\membersection{wxHtmlTag::GetBeginPos}\label{wxhtmltaggetbeginpos}
704a4b75 40
559fe022 41\constfunc{int}{GetBeginPos}{\void}
704a4b75 42
559fe022
VS
43Returns beginning position of the text {\it between} this tag and paired
44ending tag.
605d715d 45See explanation (returned position is marked with `|'):
704a4b75 46
559fe022 47\begin{verbatim}
2edb0bde 48bla bla bla <MYTAG> bla bla internal text</MYTAG> bla bla
605d715d 49 |
559fe022
VS
50\end{verbatim}
51
605d715d 52
559fe022
VS
53\membersection{wxHtmlTag::GetEndPos1}\label{wxhtmltaggetendpos1}
54
55\constfunc{int}{GetEndPos1}{\void}
56
57Returns ending position of the text {\it between} this tag and paired
58ending tag.
605d715d 59See explanation (returned position is marked with `|'):
559fe022
VS
60
61\begin{verbatim}
2edb0bde 62bla bla bla <MYTAG> bla bla internal text</MYTAG> bla bla
605d715d 63 |
559fe022
VS
64\end{verbatim}
65
605d715d 66
559fe022
VS
67\membersection{wxHtmlTag::GetEndPos2}\label{wxhtmltaggetendpos2}
68
69\constfunc{int}{GetEndPos2}{\void}
70
71Returns ending position 2 of the text {\it between} this tag and paired
72ending tag.
605d715d 73See explanation (returned position is marked with `|'):
559fe022
VS
74
75\begin{verbatim}
2edb0bde 76bla bla bla <MYTAG> bla bla internal text</MYTAG> bla bla
605d715d 77 |
559fe022
VS
78\end{verbatim}
79
80\membersection{wxHtmlTag::GetName}\label{wxhtmltaggetname}
81
82\constfunc{wxString}{GetName}{\void}
83
84Returns tag's name. The name is always in uppercase and it doesn't contain
85'<' or '/' characters. (So the name of {\tt <FONT SIZE=+2>} tag is "FONT"
86and name of {\tt </table>} is "TABLE")
704a4b75 87
605d715d 88
704a4b75
VS
89\membersection{wxHtmlTag::GetParam}\label{wxhtmltaggetparam}
90
cc81d32f 91\constfunc{wxString}{GetParam}{\param{const wxString\& }{par}, \param{bool }{with\_commas = false}}
704a4b75 92
cc6e1950
VS
93Returns the value of the parameter. You should check whether the
94parameter exists or not (use \helpref{HasParam}{wxhtmltaghasparam}) first.
704a4b75
VS
95
96\wxheading{Parameters}
97
cc6e1950 98\docparam{par}{The parameter's name.}
704a4b75 99
cc81d32f 100\docparam{with\_commas}{true if you want to get commas as well. See example.}
704a4b75
VS
101
102\wxheading{Example}
103
104\begin{verbatim}
105...
106/* you have wxHtmlTag variable tag which is equal to
107 HTML tag <FONT SIZE=+2 COLOR="#0000FF"> */
108dummy = tag.GetParam("SIZE");
109 // dummy == "+2"
110dummy = tag.GetParam("COLOR");
111 // dummy == "#0000FF"
cc81d32f 112dummy = tag.GetParam("COLOR", true);
704a4b75
VS
113 // dummy == "\"#0000FF\"" -- see the difference!!
114\end{verbatim}
115
8ca46841
VS
116\membersection{wxHtmlTag::GetParamAsColour}\label{wxhtmltaggetparamascolour}
117
118\constfunc{bool}{GetParamAsColour}{\param{const wxString\& }{par}, \param{wxColour *}{clr}}
119
120Interprets tag parameter {\it par} as colour specification and saves its value
121into wxColour variable pointed by {\it clr}.
122
cc81d32f 123Returns true on success and false if {\it par} is not colour specification or
8ca46841
VS
124if the tag has no such parameter.
125
126\membersection{wxHtmlTag::GetParamAsInt}\label{wxhtmltaggetparamasint}
127
128\constfunc{bool}{GetParamAsInt}{\param{const wxString\& }{par}, \param{int *}{value}}
129
130Interprets tag parameter {\it par} as an integer and saves its value
131into int variable pointed by {\it value}.
132
cc81d32f 133Returns true on success and false if {\it par} is not an integer or
8ca46841
VS
134if the tag has no such parameter.
135
704a4b75
VS
136\membersection{wxHtmlTag::HasEnding}\label{wxhtmltaghasending}
137
138\constfunc{bool}{HasEnding}{\void}
139
cc81d32f 140Returns true if this tag is paired with ending tag, false otherwise.
704a4b75
VS
141
142See the example of HTML document:
143
144\begin{verbatim}
145<html><body>
146Hello<p>
147How are you?
148<p align=center>This is centered...</p>
149Oops<br>Oooops!
150</body></html>
151\end{verbatim}
152
153In this example tags HTML and BODY have ending tags, first P and BR
154doesn't have ending tag while the second P has. The third P tag (which
155is ending itself) of course doesn't have ending tag.
156
559fe022 157\membersection{wxHtmlTag::HasParam}\label{wxhtmltaghasparam}
704a4b75 158
559fe022 159\constfunc{bool}{HasParam}{\param{const wxString\& }{par}}
704a4b75 160
cc81d32f 161Returns true if the tag has a parameter of the given name.
559fe022
VS
162Example : {\tt <FONT SIZE=+2 COLOR="\#FF00FF">} has two parameters named
163"SIZE" and "COLOR".
704a4b75 164
559fe022 165\wxheading{Parameters}
704a4b75 166
cc6e1950 167\docparam{par}{the parameter you're looking for.}
704a4b75 168
559fe022 169\membersection{wxHtmlTag::IsEnding}\label{wxhtmltagisending}
704a4b75 170
559fe022 171\constfunc{bool}{IsEnding}{\void}
704a4b75 172
cc81d32f 173Returns true if this tag is ending one.
559fe022 174({\tt </FONT>} is ending tag, {\tt <FONT>} is not)
704a4b75 175
559fe022 176\membersection{wxHtmlTag::ScanParam}\label{wxhtmltagscanparam}
704a4b75 177
cc6e1950 178\constfunc{wxString}{ScanParam}{\param{const wxString\& }{par}, \param{const wxChar *}{format}, \param{void *}{value}}
704a4b75 179
2edb0bde
VZ
180This method scans the given parameter. Usage is exactly the same as sscanf's
181usage except that you don't pass a string but a parameter name as the first
182argument
183and you can only retrieve one value (i.e. you can use only one "\%" element
cc6e1950
VS
184in {\it format}).
185
559fe022
VS
186
187\wxheading{Parameters}
188
2edb0bde 189\docparam{par}{The name of the tag you want to query}
559fe022
VS
190
191\docparam{format}{scanf()-like format string.}
192
2edb0bde 193\docparam{value}{pointer to a variable to store the value in }
704a4b75 194