]> git.saurik.com Git - wxWidgets.git/blame - docs/latex/wx/httag.tex
BC++ and Watcom C++ makefile and source fixes
[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
8This class represents single HTML tag.
9It is used by \helpref{tag handlers}{handlers}.
10
704a4b75
VS
11\wxheading{Derived from}
12
13wxObject
14
15\latexignore{\rtfignore{\wxheading{Members}}}
16
704a4b75
VS
17\membersection{wxHtmlTag::wxHtmlTag}\label{wxhtmltagwxhtmltag}
18
19\func{}{wxHtmlTag}{\param{const wxString\& }{source}, \param{int }{pos}, \param{int }{end\_pos}, \param{wxHtmlTagsCache* }{cache}}
20
21Constructor. You'll probably never have to construct wxHtmlTag object
22yourself. Feel free to ignore the constructor parameters...
23(have a look at lib/htmlparser.cpp if you're interested in creating it)
24
559fe022 25\membersection{wxHtmlTag::GetAllParams}\label{wxhtmltaggetallparams}
704a4b75 26
559fe022 27\constfunc{const wxString\&}{GetAllParams}{\void}
704a4b75 28
559fe022 29Returns string with all params.
704a4b75 30
559fe022
VS
31Example : tag contains {\tt <FONT SIZE=+2 COLOR="\#000000">}. Call to
32tag.GetAllParams() would return {\tt SIZE=+2 COLOR="\#000000"}.
704a4b75 33
559fe022 34\membersection{wxHtmlTag::GetBeginPos}\label{wxhtmltaggetbeginpos}
704a4b75 35
559fe022 36\constfunc{int}{GetBeginPos}{\void}
704a4b75 37
559fe022
VS
38Returns beginning position of the text {\it between} this tag and paired
39ending tag.
40See explanation (returned position is marked with '^'):
704a4b75 41
559fe022
VS
42\begin{verbatim}
43bla bla bla <MYTAG> bla bla intenal text</MYTAG> bla bla
44 ^
45\end{verbatim}
46
47\membersection{wxHtmlTag::GetEndPos1}\label{wxhtmltaggetendpos1}
48
49\constfunc{int}{GetEndPos1}{\void}
50
51Returns ending position of the text {\it between} this tag and paired
52ending tag.
53See explanation (returned position is marked with '^'):
54
55\begin{verbatim}
56bla bla bla <MYTAG> bla bla intenal text</MYTAG> bla bla
57 ^
58\end{verbatim}
59
60\membersection{wxHtmlTag::GetEndPos2}\label{wxhtmltaggetendpos2}
61
62\constfunc{int}{GetEndPos2}{\void}
63
64Returns ending position 2 of the text {\it between} this tag and paired
65ending tag.
66See explanation (returned position is marked with '^'):
67
68\begin{verbatim}
69bla bla bla <MYTAG> bla bla intenal text</MYTAG> bla bla
70 ^
71\end{verbatim}
72
73\membersection{wxHtmlTag::GetName}\label{wxhtmltaggetname}
74
75\constfunc{wxString}{GetName}{\void}
76
77Returns tag's name. The name is always in uppercase and it doesn't contain
78'<' or '/' characters. (So the name of {\tt <FONT SIZE=+2>} tag is "FONT"
79and name of {\tt </table>} is "TABLE")
704a4b75
VS
80
81\membersection{wxHtmlTag::GetParam}\label{wxhtmltaggetparam}
82
83\constfunc{wxString}{GetParam}{\param{const wxString\& }{par}, \param{bool }{with\_commas = FALSE}}
84
85Retuns the value of the parameter. You should check whether the
86param exists or not (use \helpref{HasParam}{wxhtmltaghasparam}) first.
87
88\wxheading{Parameters}
89
90\docparam{par}{The parameter's name in uppercase}
91
92\docparam{with\_commas}{TRUE if you want to get commas as well. See example.}
93
94\wxheading{Example}
95
96\begin{verbatim}
97...
98/* you have wxHtmlTag variable tag which is equal to
99 HTML tag <FONT SIZE=+2 COLOR="#0000FF"> */
100dummy = tag.GetParam("SIZE");
101 // dummy == "+2"
102dummy = tag.GetParam("COLOR");
103 // dummy == "#0000FF"
104dummy = tag.GetParam("COLOR", TRUE);
105 // dummy == "\"#0000FF\"" -- see the difference!!
106\end{verbatim}
107
704a4b75
VS
108\membersection{wxHtmlTag::HasEnding}\label{wxhtmltaghasending}
109
110\constfunc{bool}{HasEnding}{\void}
111
112Returns TRUE if this tag is paired with ending tag, FALSE otherwise.
113
114See the example of HTML document:
115
116\begin{verbatim}
117<html><body>
118Hello<p>
119How are you?
120<p align=center>This is centered...</p>
121Oops<br>Oooops!
122</body></html>
123\end{verbatim}
124
125In this example tags HTML and BODY have ending tags, first P and BR
126doesn't have ending tag while the second P has. The third P tag (which
127is ending itself) of course doesn't have ending tag.
128
559fe022 129\membersection{wxHtmlTag::HasParam}\label{wxhtmltaghasparam}
704a4b75 130
559fe022 131\constfunc{bool}{HasParam}{\param{const wxString\& }{par}}
704a4b75 132
559fe022
VS
133Returns TRUE if the tag has parameter of the given name.
134Example : {\tt <FONT SIZE=+2 COLOR="\#FF00FF">} has two parameters named
135"SIZE" and "COLOR".
704a4b75 136
559fe022 137\wxheading{Parameters}
704a4b75 138
559fe022 139\docparam{par}{the parameter you're looking for. It must {\it always} be in uppercase!}
704a4b75 140
559fe022 141\membersection{wxHtmlTag::IsEnding}\label{wxhtmltagisending}
704a4b75 142
559fe022 143\constfunc{bool}{IsEnding}{\void}
704a4b75 144
559fe022
VS
145Returns TRUE if this tag is ending one.
146({\tt </FONT>} is ending tag, {\tt <FONT>} is not)
704a4b75 147
704a4b75 148
559fe022 149\membersection{wxHtmlTag::ScanParam}\label{wxhtmltagscanparam}
704a4b75 150
559fe022 151\constfunc{wxString}{ScanParam}{\param{const wxString\& }{par}, \param{const char *}{format}, fuck}
704a4b75 152
559fe022
VS
153This method scans given parameter. Usage is exatly the same as sscanf's
154usage except that you don't pass string but param name as the first parameter.
155
156\wxheading{Parameters}
157
158\docparam{par}{The name of tag you wanna query (in uppercase)}
159
160\docparam{format}{scanf()-like format string.}
161
162\wxheading{Cygwin and Mingw32}
163
164If you're using Cygwin beta 20 or Mingw32 compiler please remember
165that ScanParam() is only partially implemented!! The problem is
166that under Cygnus' GCC vsscanf() function is not implemented. I workarounded
167this in a way which causes that you can use only one parameter in ...
168(and only one \% in {\it format})
704a4b75 169