1 <?xml version=
"1.0" encoding=
"ISO-8859-1"?>
2 <resource version=
"2.3.0.1" xmlns=
"http://www.wxwidgets.org/wxxrc">
3 <object class=
"wxDialog" name=
"objref_dialog">
4 <object class=
"wxFlexGridSizer">
5 <object class=
"sizeritem">
6 <object class=
"wxNotebook" name=
"objref_notebook">
7 <object class=
"notebookpage">
8 <object class=
"wxPanel" name=
"page1">
9 <object class=
"wxFlexGridSizer">
10 <object class=
"sizeritem">
11 <object class=
"wxTextCtrl" name=
"description_text">
12 <value>This dialog demonstrates the use of object references and ID arrays.\n\nAs you turn the pages of the notebook, you will notice that each has an identical section at the bottom. Instead of writing that section's xml several times, this is done just once, as a wxPanel named 'bottom__panel'. The panel is then added to each page's sizer by the single line:
<object__ref ref=
"bottom__panel
"/
></value>
13 <style>wxTE_MULTILINE|wxTE_READONLY
</style>
16 <flag>wxALL|wxEXPAND
</flag>
19 <object class=
"sizeritem">
20 <object_ref ref=
"bottom_panel"/>
27 <growablecols>0</growablecols>
28 <growablerows>0</growablerows>
29 <growablerows>1</growablerows>
34 <object class=
"notebookpage">
35 <object_ref ref=
"page1"/>
36 <label>Page
1 copy
</label>
38 <object class=
"notebookpage">
39 <object class=
"wxPanel" name=
"page2">
40 <object class=
"wxFlexGridSizer">
41 <object class=
"sizeritem">
42 <object class=
"wxTextCtrl" name=
"description_text">
43 <value>ID ranges are a way to simplify the management of several similar controls, especially their event-handling.\nAn ID range is declared by putting something like this into the XRC file:\n
<ids-range name=
"check
" size=
"3" start=
"10000" /
>\n'size' and 'start' being optional.\n\nIf you then give an item the name 'check[
2]', it will be allocated that ID in the range.\n\nBy default the IDs in a range are negative, being assigned by wxWindow::NewControlId. If you wish, you can specify the start of the range; if so, the IDs *must* be positive (and it's your responsibility to avoid clashes, so start above wxID__HIGHEST).
</value>
44 <style>wxTE_MULTILINE|wxTE_READONLY
</style>
47 <flag>wxALL|wxEXPAND
</flag>
50 <object class=
"sizeritem">
51 <object class=
"wxBoxSizer">
52 <object class=
"spacer">
57 <object class=
"sizeritem">
58 <object class=
"wxBoxSizer">
59 <object class=
"sizeritem">
60 <object class=
"wxStaticText">
61 <label>Uncheck to disable a row
</label>
64 <object class=
"sizeritem">
65 <object_ref ref=
"checkboxes"/>
66 <flag>wxALIGN_CENTRE
</flag>
68 <orient>wxVERTICAL
</orient>
70 <flag>wxALIGN_CENTRE_VERTICAL
</flag>
72 <orient>wxHORIZONTAL
</orient>
73 <object class=
"spacer">
76 <object class=
"sizeritem">
77 <object class=
"wxStaticBoxSizer">
78 <object class=
"sizeritem">
79 <object class=
"wxGridSizer">
80 <object class=
"sizeritem">
81 <object class=
"wxStaticBitmap" name=
"first_row[0]">
82 <bitmap>update.gif
</bitmap>
83 <tooltip>See the tooltip!
</tooltip>
86 <object class=
"sizeritem">
87 <object class=
"wxStaticBitmap" name=
"first_row[1]">
88 <bitmap>basicdlg.xpm
</bitmap>
91 <object class=
"sizeritem">
92 <object class=
"wxStaticBitmap" name=
"first_row[2]">
93 <bitmap>controls.xpm
</bitmap>
96 <object class=
"sizeritem">
97 <object class=
"wxStaticBitmap" name=
"second_row[0]">
98 <bitmap>custclas.xpm
</bitmap>
101 <object class=
"sizeritem">
102 <object class=
"wxStaticBitmap" name=
"second_row[1]">
103 <bitmap>derivdlg.xpm
</bitmap>
106 <object class=
"sizeritem">
107 <object class=
"wxStaticBitmap" name=
"second_row[2]">
108 <bitmap>platform.xpm
</bitmap>
111 <object class=
"sizeritem">
112 <object class=
"wxStaticBitmap" name=
"third_row[0]">
113 <bitmap>objrefdlg.xpm
</bitmap>
116 <object class=
"sizeritem">
117 <object class=
"wxStaticBitmap" name=
"third_row[1]">
118 <bitmap>uncenter.xpm
</bitmap>
121 <object class=
"sizeritem">
122 <object class=
"wxStaticBitmap" name=
"third_row[2]">
123 <bitmap>variable.xpm
</bitmap>
134 <orient>wxVERTICAL
</orient>
136 <flag>wxALIGN_CENTRE_VERTICAL
</flag>
138 <object class=
"spacer">
144 <flag>wxTOP|wxBOTTOM|wxEXPAND
</flag>
147 <object class=
"sizeritem">
148 <object_ref ref=
"bottom_panel"/>
150 <flag>wxEXPAND
</flag>
156 <growablecols>0</growablecols>
157 <growablerows>0</growablerows>
158 <growablerows>2</growablerows>
163 <object class=
"notebookpage">
164 <object class=
"wxPanel" name=
"page3">
165 <object class=
"wxFlexGridSizer">
166 <object class=
"sizeritem">
167 <object class=
"wxTextCtrl" name=
"description_text">
168 <value>This not very useful calculator demonstrates some features of ID ranges. One range is defined for the number keys, and another for the operators.\n\nIf you look at the .xrc file, you'll see that I wrote:\n
<ids-range name=
"digits
" size=
"8"/
>\ncreating that range with a size of
8 (I must have forgotten to count my thumbs). The code will still work, though: the actual number of range items is counted when the file is loaded, and the range extended if necessary to accommodate them. However if the size is too big, it isn't truncated.\n\nAn ID range always has the special items defined:
<rangename
>[start] and
<rangename
>[end]. So, for the range 'digits', digits[start] == digits[
0], and digits[end] == digits[
9]. [end] will always refer to the end of the range, even if there's no object with that ID.\n\nThe digits of the calculator are named 'digits[
0]' to 'digits[
9]'. Adjacent range items are guaranteed to be assigned consecutive IDs, so code such as this will work as expected:\n for (int n=XRCID(
"digits[start]
"); n
< XRCID(
"digits[end]
"); ++n) { DoFoo(n); }\nor\n int index = event.GetId() - XRCID(
"digits[
0]
");
</value>
169 <style>wxTE_MULTILINE|wxTE_READONLY
</style>
172 <flag>wxALL|wxEXPAND
</flag>
175 <object class=
"sizeritem">
176 <object class=
"wxStaticBoxSizer">
177 <object class=
"sizeritem">
178 <object class=
"wxGridBagSizer">
179 <object class=
"sizeritem">
180 <object class=
"wxButton" name=
"digits[7]">
182 <style>wxBU_EXACTFIT
</style>
184 <flag>wxEXPAND
</flag>
185 <cellpos>0,
0</cellpos>
187 <object class=
"sizeritem">
188 <object class=
"wxButton" name=
"digits[8]">
190 <style>wxBU_EXACTFIT
</style>
192 <flag>wxEXPAND
</flag>
193 <cellpos>0,
1</cellpos>
195 <object class=
"sizeritem">
196 <object class=
"wxButton" name=
"digits[9]">
198 <style>wxBU_EXACTFIT
</style>
200 <flag>wxEXPAND
</flag>
201 <cellpos>0,
2</cellpos>
203 <object class=
"sizeritem">
204 <object class=
"wxButton" name=
"operators[3]">
206 <style>wxBU_EXACTFIT
</style>
208 <flag>wxEXPAND
</flag>
209 <cellpos>0,
3</cellpos>
211 <object class=
"sizeritem">
212 <object class=
"wxButton" name=
"digits[4]">
214 <style>wxBU_EXACTFIT
</style>
216 <flag>wxEXPAND
</flag>
217 <cellpos>1,
0</cellpos>
219 <object class=
"sizeritem">
220 <object class=
"wxButton" name=
"digits[5]">
222 <style>wxBU_EXACTFIT
</style>
224 <flag>wxEXPAND
</flag>
225 <cellpos>1,
1</cellpos>
227 <object class=
"sizeritem">
228 <object class=
"wxButton" name=
"digits[6]">
230 <style>wxBU_EXACTFIT
</style>
232 <flag>wxEXPAND
</flag>
233 <cellpos>1,
2</cellpos>
235 <object class=
"sizeritem">
236 <object class=
"wxButton" name=
"operators[2]">
238 <style>wxBU_EXACTFIT
</style>
240 <flag>wxEXPAND
</flag>
241 <cellpos>1,
3</cellpos>
243 <object class=
"sizeritem">
244 <object class=
"wxButton" name=
"digits[1]">
246 <style>wxBU_EXACTFIT
</style>
248 <flag>wxEXPAND
</flag>
249 <cellpos>2,
0</cellpos>
251 <object class=
"sizeritem">
252 <object class=
"wxButton" name=
"digits[2]">
254 <style>wxBU_EXACTFIT
</style>
256 <flag>wxEXPAND
</flag>
257 <cellpos>2,
1</cellpos>
259 <object class=
"sizeritem">
260 <object class=
"wxButton" name=
"digits[3]">
262 <style>wxBU_EXACTFIT
</style>
264 <flag>wxEXPAND
</flag>
265 <cellpos>2,
2</cellpos>
267 <object class=
"sizeritem">
268 <object class=
"wxButton" name=
"operators[1]">
270 <style>wxBU_EXACTFIT
</style>
272 <flag>wxEXPAND
</flag>
273 <cellpos>2,
3</cellpos>
275 <object class=
"sizeritem">
276 <object class=
"wxButton" name=
"digits[0]">
278 <style>wxBU_EXACTFIT
</style>
280 <flag>wxEXPAND
</flag>
281 <cellpos>3,
0</cellpos>
283 <object class=
"sizeritem">
284 <object class=
"wxButton" name=
"operators[4]">
286 <style>wxBU_EXACTFIT
</style>
288 <flag>wxEXPAND
</flag>
289 <cellpos>3,
1</cellpos>
291 <object class=
"sizeritem">
292 <object class=
"wxButton" name=
"operators[end]">
294 <style>wxBU_EXACTFIT
</style>
296 <flag>wxEXPAND
</flag>
297 <cellpos>3,
2</cellpos>
299 <object class=
"sizeritem">
300 <object class=
"wxButton" name=
"operators[0]">
302 <style>wxBU_EXACTFIT
</style>
304 <flag>wxEXPAND
</flag>
305 <cellpos>3,
3</cellpos>
307 <object class=
"sizeritem">
308 <object class=
"wxTextCtrl" name=
"result"/>
309 <flag>wxEXPAND
</flag>
310 <cellpos>4,
0</cellpos>
311 <cellspan>1,
4</cellspan>
319 <label>Calculator
</label>
320 <orient>wxVERTICAL
</orient>
322 <flag>wxTOP|wxALIGN_CENTRE_HORIZONTAL
</flag>
325 <object class=
"sizeritem">
326 <object_ref ref=
"bottom_panel"/>
328 <flag>wxEXPAND
</flag>
334 <growablecols>0</growablecols>
335 <growablerows>0</growablerows>
336 <growablerows>2</growablerows>
343 <flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxALL
</flag>
346 <object class=
"sizeritem">
347 <object class=
"wxButton" name=
"wxID_OK">
351 <flag>wxTOP|wxBOTTOM|wxALIGN_CENTRE
</flag>
358 <growablecols>0</growablecols>
359 <growablerows>0</growablerows>
361 <title>Object References and ID Ranges Example
</title>
362 <centered>1</centered>
363 <style>wxCAPTION|wxSYSTEM_MENU|wxRESIZE_BORDER
</style>
364 <exstyle>wxDIALOG_EX_CONTEXTHELP
</exstyle>
366 <object class=
"wxPanel" name=
"bottom_panel">
367 <object class=
"wxBoxSizer">
368 <orient>wxVERTICAL
</orient>
369 <object class=
"sizeritem">
370 <object class=
"wxStaticLine">
371 <style>wxLI_HORIZONTAL
</style>
373 <flag>wxTOP|wxEXPAND
</flag>
376 <object class=
"sizeritem">
377 <object class=
"wxStaticText">
378 <label>Log window:
</label>
383 <object class=
"sizeritem">
384 <object class=
"wxTextCtrl" name=
"log_text">
386 <style>wxTE_MULTILINE
</style>
389 <flag>wxEXPAND
</flag>
393 <object class=
"wxPanel" name=
"checkboxes">
394 <object class=
"wxBoxSizer">
395 <orient>wxVERTICAL
</orient>
396 <object class=
"sizeritem">
397 <object class=
"wxCheckBox" name=
"check[0]">
401 <object class=
"sizeritem">
402 <object class=
"wxCheckBox" name=
"check[1]">
406 <object class=
"sizeritem">
407 <object class=
"wxCheckBox" name=
"check[2]">
413 <ids-range name=
"check" size=
"3" start=
"10000"/>
414 <ids-range name=
"first_row"/>
415 <ids-range name=
"second_row"/>
416 <ids-range name=
"third_row"/>
417 <ids-range name=
"digits" size=
"8"/>
418 <ids-range name=
"operators"/>