1 \chapter{Functions
}\label{functions
}
2 \setheader{{\it CHAPTER
\thechapter}}{}{}{}{}{{\it CHAPTER
\thechapter}}%
3 \setfooter{\thepage}{}{}{}{}{\thepage}
5 Deprecated functions and macros defined in wxWindows are described here: you can
6 either look up a function using the alphabetical listing of them or find it in
7 the corresponding topic.
9 \section{Alphabetical functions and macros list
}
11 %\helpref{wxGetResource}{wxgetresource}\\
12 %\helpref{wxLoadUserResource}{wxloaduserresource}\\
13 %\helpref{wxMakeMetafilePlaceable}{wxmakemetafileplaceable}\\
14 %\helpref{wxNewId}{wxnewid}\\
15 \helpref{wxLoadFromResource
}{wxloadfromresource
}\\
16 \helpref{wxResourceAddIdentifier
}{wxresourceaddidentifier
}\\
17 \helpref{wxResourceClear
}{wxresourceclear
}\\
18 \helpref{wxResourceCreateBitmap
}{wxresourcecreatebitmap
}\\
19 \helpref{wxResourceCreateIcon
}{wxresourcecreateicon
}\\
20 \helpref{wxResourceCreateMenuBar
}{wxresourcecreatemenubar
}\\
21 \helpref{wxResourceGetIdentifier
}{wxresourcegetidentifier
}\\
22 \helpref{wxResourceParseData
}{wxresourcedata
}\\
23 \helpref{wxResourceParseFile
}{wxresourceparsefile
}\\
24 \helpref{wxResourceParseString
}{wxresourceparsestring
}\\
25 \helpref{wxResourceRegisterBitmapData
}{registerbitmapdata
}\\
26 \helpref{wxResourceRegisterIconData
}{wxresourceregistericondata
}\\
27 %\helpref{wxSetPrinterCommand}{wxsetprintercommand}\\
28 %\helpref{wxSetPrinterFile}{wxsetprinterfile}\\
29 %\helpref{wxSetPrinterMode}{wxsetprintermode}\\
30 %\helpref{wxSetPrinterOptions}{wxsetprinteroptions}\\
31 %\helpref{wxSetPrinterOrientation}{wxsetprinterorientation}\\
32 %\helpref{wxSetPrinterPreviewCommand}{wxsetprinterpreviewcommand}\\
33 %\helpref{wxSetPrinterScaling}{wxsetprinterscaling}\\
34 %\helpref{wxSetPrinterTranslation}{wxsetprintertranslation}\\
36 \section{Printer settings
}\label{printersettings
}
38 {\bf NB:
} These routines are obsolete and should no longer be used!
40 The following functions are used to control PostScript printing. Under
41 Windows, PostScript output can only be sent to a file.
43 \wxheading{Include files
}
47 \membersection{::wxGetPrinterCommand
}\label{wxgetprintercommand
}
49 \func{wxString
}{wxGetPrinterCommand
}{\void}
51 Gets the printer command used to print a file. The default is
{\tt lpr
}.
53 \membersection{::wxGetPrinterFile
}\label{wxgetprinterfile
}
55 \func{wxString
}{wxGetPrinterFile
}{\void}
57 Gets the PostScript output filename.
59 \membersection{::wxGetPrinterMode
}\label{wxgetprintermode
}
61 \func{int
}{wxGetPrinterMode
}{\void}
63 Gets the printing mode controlling where output is sent (PS
\_PREVIEW, PS
\_FILE or PS
\_PRINTER).
64 The default is PS
\_PREVIEW.
66 \membersection{::wxGetPrinterOptions
}\label{wxgetprinteroptions
}
68 \func{wxString
}{wxGetPrinterOptions
}{\void}
70 Gets the additional options for the print command (e.g. specific printer). The default is nothing.
72 \membersection{::wxGetPrinterOrientation
}\label{wxgetprinterorientation
}
74 \func{int
}{wxGetPrinterOrientation
}{\void}
76 Gets the orientation (PS
\_PORTRAIT or PS
\_LANDSCAPE). The default is PS
\_PORTRAIT.
78 \membersection{::wxGetPrinterPreviewCommand
}\label{wxgetprinterpreviewcommand
}
80 \func{wxString
}{wxGetPrinterPreviewCommand
}{\void}
82 Gets the command used to view a PostScript file. The default depends on the platform.
84 \membersection{::wxGetPrinterScaling
}\label{wxgetprinterscaling
}
86 \func{void
}{wxGetPrinterScaling
}{\param{float *
}{x
},
\param{float *
}{y
}}
88 Gets the scaling factor for PostScript output. The default is
1.0,
1.0.
90 \membersection{::wxGetPrinterTranslation
}\label{wxgetprintertranslation
}
92 \func{void
}{wxGetPrinterTranslation
}{\param{float *
}{x
},
\param{float *
}{y
}}
94 Gets the translation (from the top left corner) for PostScript output. The default is
0.0,
0.0.
96 \membersection{::wxSetPrinterCommand
}\label{wxsetprintercommand
}
98 \func{void
}{wxSetPrinterCommand
}{\param{const wxString\&
}{command
}}
100 Sets the printer command used to print a file. The default is
{\tt lpr
}.
102 \membersection{::wxSetPrinterFile
}\label{wxsetprinterfile
}
104 \func{void
}{wxSetPrinterFile
}{\param{const wxString\&
}{filename
}}
106 Sets the PostScript output filename.
108 \membersection{::wxSetPrinterMode
}\label{wxsetprintermode
}
110 \func{void
}{wxSetPrinterMode
}{\param{int
}{mode
}}
112 Sets the printing mode controlling where output is sent (PS
\_PREVIEW, PS
\_FILE or PS
\_PRINTER).
113 The default is PS
\_PREVIEW.
115 \membersection{::wxSetPrinterOptions
}\label{wxsetprinteroptions
}
117 \func{void
}{wxSetPrinterOptions
}{\param{const wxString\&
}{options
}}
119 Sets the additional options for the print command (e.g. specific printer). The default is nothing.
121 \membersection{::wxSetPrinterOrientation
}\label{wxsetprinterorientation
}
123 \func{void
}{wxSetPrinterOrientation
}{\param{int
}{ orientation
}}
125 Sets the orientation (PS
\_PORTRAIT or PS
\_LANDSCAPE). The default is PS
\_PORTRAIT.
127 \membersection{::wxSetPrinterPreviewCommand
}\label{wxsetprinterpreviewcommand
}
129 \func{void
}{wxSetPrinterPreviewCommand
}{\param{const wxString\&
}{command
}}
131 Sets the command used to view a PostScript file. The default depends on the platform.
133 \membersection{::wxSetPrinterScaling
}\label{wxsetprinterscaling
}
135 \func{void
}{wxSetPrinterScaling
}{\param{float
}{x
},
\param{float
}{y
}}
137 Sets the scaling factor for PostScript output. The default is
1.0,
1.0.
139 \membersection{::wxSetPrinterTranslation
}\label{wxsetprintertranslation
}
141 \func{void
}{wxSetPrinterTranslation
}{\param{float
}{x
},
\param{float
}{y
}}
143 Sets the translation (from the top left corner) for PostScript output. The default is
0.0,
0.0.
145 \section{Resource functions
}\label{resourcefunctions
}
147 \overview{Resource functions
}{resourceformats
}
149 This section details functions for manipulating wxWindows (.WXR) resource
150 files and loading user interface elements from resources.
152 \normalbox{Please note that this use of the word `resource' is different from that used when talking
153 about initialisation file resource reading and writing, using such functions
154 as wxWriteResource and wxGetResource. It is just an unfortunate clash of terminology.
}
156 \helponly{For an overview of the wxWindows resource mechanism, see
\helpref{the wxWindows resource system
}{resourceformats
}.
}
158 See also
\helpref{wxWindow::LoadFromResource
}{wxwindowloadfromresource
} for
159 loading from resource data.
161 \membersection{wxLoadFromResource
}\label{wxloadfromresource
}
163 \func{virtual bool
}{LoadFromResource
}{\param{wxWindow* thisWindow
},
\param{wxWindow*
}{parent
},
\rtfsp
164 \param{const wxString\&
}{resourceName
},
\param{const wxResourceTable*
}{resourceTable = NULL
}}
166 Loads a panel or dialog from a resource file.
168 \wxheading{Parameters
}
170 \docparam{thisWindow
}{Window to load the resource into.
}
172 \docparam{parent
}{Parent window.
}
174 \docparam{resourceName
}{The name of the resource to load.
}
176 \docparam{resourceTable
}{The resource table to load it from. If this is NULL, the
177 default resource table will be used.
}
179 \wxheading{Return value
}
181 {\tt true
} if the operation succeeded, otherwise
{\tt false
}.
183 \membersection{::wxResourceAddIdentifier
}\label{wxresourceaddidentifier
}
185 \func{bool
}{wxResourceAddIdentifier
}{\param{const wxString\&
}{name
},
\param{int
}{value
}}
187 Used for associating a name with an integer identifier (equivalent to dynamically
\rtfsp
188 {\tt\#
}defining a name to an integer). Unlikely to be used by an application except
189 perhaps for implementing resource functionality for interpreted languages.
191 \membersection{::wxResourceClear
}\label{wxresourceclear
}
193 \func{void
}{wxResourceClear
}{\void}
195 Clears the wxWindows resource table.
197 \membersection{::wxResourceCreateBitmap
}\label{wxresourcecreatebitmap
}
199 \func{wxBitmap *
}{wxResourceCreateBitmap
}{\param{const wxString\&
}{resource
}}
201 Creates a new bitmap from a file, static data, or Windows resource, given a valid
202 wxWindows bitmap resource identifier. For example, if the .WXR file contains
206 static const wxString\& project_resource = "bitmap(name = 'project_resource',\
207 bitmap =
['project', wxBITMAP_TYPE_BMP_RESOURCE, 'WINDOWS'
],\
208 bitmap =
['project.xpm', wxBITMAP_TYPE_XPM, 'X'
]).";
211 then this function can be called as follows:
214 wxBitmap *bitmap = wxResourceCreateBitmap("project_resource");
217 \membersection{::wxResourceCreateIcon
}\label{wxresourcecreateicon
}
219 \func{wxIcon *
}{wxResourceCreateIcon
}{\param{const wxString\&
}{resource
}}
221 Creates a new icon from a file, static data, or Windows resource, given a valid
222 wxWindows icon resource identifier. For example, if the .WXR file contains
226 static const wxString\& project_resource = "icon(name = 'project_resource',\
227 icon =
['project', wxBITMAP_TYPE_ICO_RESOURCE, 'WINDOWS'
],\
228 icon =
['project', wxBITMAP_TYPE_XBM_DATA, 'X'
]).";
231 then this function can be called as follows:
234 wxIcon *icon = wxResourceCreateIcon("project_resource");
237 \membersection{::wxResourceCreateMenuBar
}\label{wxresourcecreatemenubar
}
239 \func{wxMenuBar *
}{wxResourceCreateMenuBar
}{\param{const wxString\&
}{resource
}}
241 Creates a new menu bar given a valid wxWindows menubar resource
242 identifier. For example, if the .WXR file contains the following:
245 static const wxString\& menuBar11 = "menu(name = 'menuBar11',\
249 ['&Open File',
2, 'Open a file'
],\
250 ['&Save File',
3, 'Save a file'
],\
252 ['E&xit',
4, 'Exit program'
]\
255 ['&About',
6, 'About this program'
]\
260 then this function can be called as follows:
263 wxMenuBar *menuBar = wxResourceCreateMenuBar("menuBar11");
267 \membersection{::wxResourceGetIdentifier
}\label{wxresourcegetidentifier
}
269 \func{int
}{wxResourceGetIdentifier
}{\param{const wxString\&
}{name
}}
271 Used for retrieving the integer value associated with an identifier.
272 A zero value indicates that the identifier was not found.
274 See
\helpref{wxResourceAddIdentifier
}{wxresourceaddidentifier
}.
276 \membersection{::wxResourceParseData
}\label{wxresourcedata
}
278 \func{bool
}{wxResourceParseData
}{\param{const wxString\&
}{resource
},
\param{wxResourceTable *
}{table = NULL
}}
280 Parses a string containing one or more wxWindows resource objects. If
281 the resource objects are global static data that are included into the
282 C++ program, then this function must be called for each variable
283 containing the resource data, to make it known to wxWindows.
285 {\it resource
} should contain data in the following form:
288 dialog(name = 'dialog1',
289 style = 'wxCAPTION | wxDEFAULT_DIALOG_STYLE',
290 title = 'Test dialog box',
291 x =
312, y =
234, width =
400, height =
300,
293 control =
[1000, wxStaticBox, 'Groupbox', '
0', 'group6',
5,
4,
380,
262,
294 [11, 'wxSWISS', 'wxNORMAL', 'wxNORMAL',
0]],
295 control =
[1001, wxTextCtrl, '', 'wxTE_MULTILINE', 'text3',
296 156,
126,
200,
70, 'wxWindows is a multi-platform, GUI toolkit.',
297 [11, 'wxSWISS', 'wxNORMAL', 'wxNORMAL',
0],
298 [11, 'wxSWISS', 'wxNORMAL', 'wxNORMAL',
0]]).
301 This function will typically be used after including a
{\tt .wxr
} file into
302 a C++ program as follows:
305 #include "dialog1.wxr"
308 Each of the contained resources will declare a new C++ variable, and each
309 of these variables should be passed to wxResourceParseData.
311 \membersection{::wxResourceParseFile
}\label{wxresourceparsefile
}
313 \func{bool
}{wxResourceParseFile
}{\param{const wxString\&
}{filename
},
\param{wxResourceTable *
}{table = NULL
}}
315 Parses a file containing one or more wxWindows resource objects
316 in C++-compatible syntax. Use this function to dynamically load
317 wxWindows resource data.
319 \membersection{::wxResourceParseString
}\label{wxresourceparsestring
}
321 \func{bool
}{wxResourceParseString
}{\param{char *
}{s
},
\param{wxResourceTable *
}{table = NULL
}}
323 Parses a string containing one or more wxWindows resource objects. If
324 the resource objects are global static data that are included into the
325 C++ program, then this function must be called for each variable
326 containing the resource data, to make it known to wxWindows.
328 {\it resource
} should contain data with the following form:
331 dialog(name = 'dialog1',
332 style = 'wxCAPTION | wxDEFAULT_DIALOG_STYLE',
333 title = 'Test dialog box',
334 x =
312, y =
234, width =
400, height =
300,
336 control =
[1000, wxStaticBox, 'Groupbox', '
0', 'group6',
5,
4,
380,
262,
337 [11, 'wxSWISS', 'wxNORMAL', 'wxNORMAL',
0]],
338 control =
[1001, wxTextCtrl, '', 'wxTE_MULTILINE', 'text3',
339 156,
126,
200,
70, 'wxWindows is a multi-platform, GUI toolkit.',
340 [11, 'wxSWISS', 'wxNORMAL', 'wxNORMAL',
0],
341 [11, 'wxSWISS', 'wxNORMAL', 'wxNORMAL',
0]]).
344 This function will typically be used after calling
\helpref{wxLoadUserResource
}{wxloaduserresource
} to
345 load an entire
{\tt .wxr file
} into a string.
347 \membersection{::wxResourceRegisterBitmapData
}\label{registerbitmapdata
}
349 \func{bool
}{wxResourceRegisterBitmapData
}{\param{const wxString\&
}{name
},
\param{char *
}{xbm
\_data},
\param{int
}{width
},
350 \param{int
}{height
},
\param{wxResourceTable *
}{table = NULL
}}
352 \func{bool
}{wxResourceRegisterBitmapData
}{\param{const wxString\&
}{name
},
\param{char **
}{xpm
\_data}}
354 Makes
{\tt\#
}included XBM or XPM bitmap data known to the wxWindows resource system.
355 This is required if other resources will use the bitmap data, since otherwise there
356 is no connection between names used in resources, and the global bitmap data.
358 \membersection{::wxResourceRegisterIconData
}\label{wxresourceregistericondata
}
360 Another name for
\helpref{wxResourceRegisterBitmapData
}{registerbitmapdata
}.