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