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>1</growablerows>
33 <object class=
"notebookpage">
34 <object_ref ref=
"page1"/>
35 <label>Page
1 copy
</label>
37 <object class=
"notebookpage">
38 <object class=
"wxPanel" name=
"page2">
39 <object class=
"wxFlexGridSizer">
40 <object class=
"sizeritem">
41 <object class=
"wxTextCtrl" name=
"description_text">
42 <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>
43 <style>wxTE_MULTILINE|wxTE_READONLY
</style>
46 <flag>wxALL|wxEXPAND
</flag>
49 <object class=
"sizeritem">
50 <object class=
"wxBoxSizer">
51 <object class=
"spacer">
56 <object class=
"sizeritem">
57 <object class=
"wxBoxSizer">
58 <object class=
"sizeritem">
59 <object class=
"wxStaticText">
60 <label>Uncheck to disable a row
</label>
63 <object class=
"sizeritem">
64 <object_ref ref=
"checkboxes"/>
65 <flag>wxALIGN_CENTRE
</flag>
67 <orient>wxVERTICAL
</orient>
69 <flag>wxALIGN_CENTRE_VERTICAL
</flag>
71 <orient>wxHORIZONTAL
</orient>
72 <object class=
"spacer">
75 <object class=
"sizeritem">
76 <object class=
"wxStaticBoxSizer">
77 <object class=
"sizeritem">
78 <object class=
"wxGridSizer">
79 <object class=
"sizeritem">
80 <object class=
"wxStaticBitmap" name=
"first_row[0]">
81 <bitmap>update.gif
</bitmap>
82 <tooltip>See the tooltip!
</tooltip>
85 <object class=
"sizeritem">
86 <object class=
"wxStaticBitmap" name=
"first_row[1]">
87 <bitmap>basicdlg.xpm
</bitmap>
90 <object class=
"sizeritem">
91 <object class=
"wxStaticBitmap" name=
"first_row[2]">
92 <bitmap>controls.xpm
</bitmap>
95 <object class=
"sizeritem">
96 <object class=
"wxStaticBitmap" name=
"second_row[0]">
97 <bitmap>custclas.xpm
</bitmap>
100 <object class=
"sizeritem">
101 <object class=
"wxStaticBitmap" name=
"second_row[1]">
102 <bitmap>derivdlg.xpm
</bitmap>
105 <object class=
"sizeritem">
106 <object class=
"wxStaticBitmap" name=
"second_row[2]">
107 <bitmap>platform.xpm
</bitmap>
110 <object class=
"sizeritem">
111 <object class=
"wxStaticBitmap" name=
"third_row[0]">
112 <bitmap>objrefdlg.xpm
</bitmap>
115 <object class=
"sizeritem">
116 <object class=
"wxStaticBitmap" name=
"third_row[1]">
117 <bitmap>uncenter.xpm
</bitmap>
120 <object class=
"sizeritem">
121 <object class=
"wxStaticBitmap" name=
"third_row[2]">
122 <bitmap>variable.xpm
</bitmap>
133 <orient>wxVERTICAL
</orient>
135 <flag>wxALIGN_CENTRE_VERTICAL
</flag>
137 <object class=
"spacer">
143 <flag>wxTOP|wxBOTTOM|wxEXPAND
</flag>
146 <object class=
"sizeritem">
147 <object_ref ref=
"bottom_panel"/>
149 <flag>wxEXPAND
</flag>
155 <growablecols>0</growablecols>
156 <growablerows>2</growablerows>
161 <object class=
"notebookpage">
162 <object class=
"wxPanel" name=
"page3">
163 <object class=
"wxFlexGridSizer">
164 <object class=
"sizeritem">
165 <object class=
"wxTextCtrl" name=
"description_text">
166 <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>
167 <style>wxTE_MULTILINE|wxTE_READONLY
</style>
170 <flag>wxALL|wxEXPAND
</flag>
173 <object class=
"sizeritem">
174 <object class=
"wxStaticBoxSizer">
175 <object class=
"sizeritem">
176 <object class=
"wxGridBagSizer">
177 <object class=
"sizeritem">
178 <object class=
"wxButton" name=
"digits[7]">
180 <style>wxBU_EXACTFIT
</style>
182 <flag>wxEXPAND
</flag>
183 <cellpos>0,
0</cellpos>
185 <object class=
"sizeritem">
186 <object class=
"wxButton" name=
"digits[8]">
188 <style>wxBU_EXACTFIT
</style>
190 <flag>wxEXPAND
</flag>
191 <cellpos>0,
1</cellpos>
193 <object class=
"sizeritem">
194 <object class=
"wxButton" name=
"digits[9]">
196 <style>wxBU_EXACTFIT
</style>
198 <flag>wxEXPAND
</flag>
199 <cellpos>0,
2</cellpos>
201 <object class=
"sizeritem">
202 <object class=
"wxButton" name=
"operators[3]">
204 <style>wxBU_EXACTFIT
</style>
206 <flag>wxEXPAND
</flag>
207 <cellpos>0,
3</cellpos>
209 <object class=
"sizeritem">
210 <object class=
"wxButton" name=
"digits[4]">
212 <style>wxBU_EXACTFIT
</style>
214 <flag>wxEXPAND
</flag>
215 <cellpos>1,
0</cellpos>
217 <object class=
"sizeritem">
218 <object class=
"wxButton" name=
"digits[5]">
220 <style>wxBU_EXACTFIT
</style>
222 <flag>wxEXPAND
</flag>
223 <cellpos>1,
1</cellpos>
225 <object class=
"sizeritem">
226 <object class=
"wxButton" name=
"digits[6]">
228 <style>wxBU_EXACTFIT
</style>
230 <flag>wxEXPAND
</flag>
231 <cellpos>1,
2</cellpos>
233 <object class=
"sizeritem">
234 <object class=
"wxButton" name=
"operators[2]">
236 <style>wxBU_EXACTFIT
</style>
238 <flag>wxEXPAND
</flag>
239 <cellpos>1,
3</cellpos>
241 <object class=
"sizeritem">
242 <object class=
"wxButton" name=
"digits[1]">
244 <style>wxBU_EXACTFIT
</style>
246 <flag>wxEXPAND
</flag>
247 <cellpos>2,
0</cellpos>
249 <object class=
"sizeritem">
250 <object class=
"wxButton" name=
"digits[2]">
252 <style>wxBU_EXACTFIT
</style>
254 <flag>wxEXPAND
</flag>
255 <cellpos>2,
1</cellpos>
257 <object class=
"sizeritem">
258 <object class=
"wxButton" name=
"digits[3]">
260 <style>wxBU_EXACTFIT
</style>
262 <flag>wxEXPAND
</flag>
263 <cellpos>2,
2</cellpos>
265 <object class=
"sizeritem">
266 <object class=
"wxButton" name=
"operators[1]">
268 <style>wxBU_EXACTFIT
</style>
270 <flag>wxEXPAND
</flag>
271 <cellpos>2,
3</cellpos>
273 <object class=
"sizeritem">
274 <object class=
"wxButton" name=
"digits[0]">
276 <style>wxBU_EXACTFIT
</style>
278 <flag>wxEXPAND
</flag>
279 <cellpos>3,
0</cellpos>
281 <object class=
"sizeritem">
282 <object class=
"wxButton" name=
"operators[4]">
284 <style>wxBU_EXACTFIT
</style>
286 <flag>wxEXPAND
</flag>
287 <cellpos>3,
1</cellpos>
289 <object class=
"sizeritem">
290 <object class=
"wxButton" name=
"operators[end]">
292 <style>wxBU_EXACTFIT
</style>
294 <flag>wxEXPAND
</flag>
295 <cellpos>3,
2</cellpos>
297 <object class=
"sizeritem">
298 <object class=
"wxButton" name=
"operators[0]">
300 <style>wxBU_EXACTFIT
</style>
302 <flag>wxEXPAND
</flag>
303 <cellpos>3,
3</cellpos>
305 <object class=
"sizeritem">
306 <object class=
"wxTextCtrl" name=
"result"/>
307 <flag>wxEXPAND
</flag>
308 <cellpos>4,
0</cellpos>
309 <cellspan>1,
4</cellspan>
317 <label>Calculator
</label>
318 <orient>wxVERTICAL
</orient>
320 <flag>wxTOP|wxALIGN_CENTRE_HORIZONTAL
</flag>
323 <object class=
"sizeritem">
324 <object_ref ref=
"bottom_panel"/>
326 <flag>wxEXPAND
</flag>
332 <growablecols>0</growablecols>
333 <growablerows>2</growablerows>
340 <flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxALL
</flag>
343 <object class=
"sizeritem">
344 <object class=
"wxButton" name=
"wxID_OK">
348 <flag>wxTOP|wxBOTTOM|wxALIGN_CENTRE
</flag>
355 <growablecols>0</growablecols>
356 <growablerows>0</growablerows>
358 <title>Object References and ID Ranges Example
</title>
359 <centered>1</centered>
360 <style>wxCAPTION|wxSYSTEM_MENU|wxRESIZE_BORDER
</style>
361 <exstyle>wxDIALOG_EX_CONTEXTHELP
</exstyle>
363 <object class=
"wxPanel" name=
"bottom_panel">
364 <object class=
"wxBoxSizer">
365 <orient>wxVERTICAL
</orient>
366 <object class=
"sizeritem">
367 <object class=
"wxStaticLine">
368 <style>wxLI_HORIZONTAL
</style>
370 <flag>wxTOP|wxEXPAND
</flag>
373 <object class=
"sizeritem">
374 <object class=
"wxStaticText">
375 <label>Log window:
</label>
380 <object class=
"sizeritem">
381 <object class=
"wxTextCtrl" name=
"log_text">
383 <style>wxTE_MULTILINE
</style>
386 <flag>wxEXPAND
</flag>
390 <object class=
"wxPanel" name=
"checkboxes">
391 <object class=
"wxBoxSizer">
392 <orient>wxVERTICAL
</orient>
393 <object class=
"sizeritem">
394 <object class=
"wxCheckBox" name=
"check[0]">
398 <object class=
"sizeritem">
399 <object class=
"wxCheckBox" name=
"check[1]">
403 <object class=
"sizeritem">
404 <object class=
"wxCheckBox" name=
"check[2]">
410 <ids-range name=
"check" size=
"3" start=
"10000"/>
411 <ids-range name=
"first_row"/>
412 <ids-range name=
"second_row"/>
413 <ids-range name=
"third_row"/>
414 <ids-range name=
"digits" size=
"8"/>
415 <ids-range name=
"operators"/>