]> git.saurik.com Git - wxWidgets.git/blame - samples/xrc/rc/variable.xrc
Applied patch [ 892511 ] wxUniversal: fix of segfault in toolbar.cpp
[wxWidgets.git] / samples / xrc / rc / variable.xrc
CommitLineData
af1337b0
JS
1<?xml version="1.0" encoding="ISO-8859-1"?>
2
3<resource xmlns="http://www.wxwindows.org/wxxrc" version="2.3.0.1">
4
5<object class="wxDialog" name="variable_expansion_dialog">
6 <title>Variable Expansion Example</title>
7 <centered>1</centered>
8 <object class="wxFlexGridSizer">
9 <cols>1</cols>
10 <rows>0</rows>
11 <vgap>0</vgap>
12 <hgap>0</hgap>
13 <growablecols>0</growablecols>
14 <growablerows>0</growablerows>
15 <object class="sizeritem">
16 <flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxALL</flag>
17 <border>5</border>
18 <object class="wxTextCtrl" name="message_textctrl">
19 <size>500,150</size>
20 <style>wxTE_MULTILINE</style>
21 <value>VARIABLE EXPANSION ISN'T IMPLEMENTED CURRENTLY. You can use variable expansion in your XRC files. The steps to do this are:\n\n(1)Enclose a variable inside a dollarsign and round brackets, like this: dollarsign(version).\n\n(2) Set the XmlResource flags to allow expansion of variables.\n\n(3)Before you use that XML resource, inform the XmlResourceHandler what you want that variable's value to be, via wxResourceHandler::Get()-&gt;SetVariable( "version", "2.4.0")\n\n Now, at runtime, the variable will be automatically replace by its value before the control is constructed.\n\nThe number in the version at the bottom of this dialog is an example of this expansion in action.\n\nThis is very handy for things like replacing the text in a wxStaticText, since it is a much simpler way to make a wxStaticText be a proper size: by creating it the proper size. This is in contrast to the alternative way of having using some static non-variable value in your XRC, having XRC construct it, then your application having code to change the text of it, then your app getting its best size, then setting the statictext's size, then laying out the dialog's sizer again, and other work.</value>
22 </object>
23 </object>
24 <object class="sizeritem">
25 <flag>wxGROW|wxALIGN_BOTTOM</flag>
26 <object class="wxFlexGridSizer">
27 <cols>3</cols>
28 <rows>0</rows>
29 <vgap>0</vgap>
30 <hgap>0</hgap>
31 <growablecols>2</growablecols>
32 <growablerows>0</growablerows>
33 <object class="sizeritem">
34 <flag>wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM</flag>
35 <border>5</border>
36 <object class="wxStaticText" name="build_information_statictext">
37 <label>This build is:</label>
38 </object>
39 </object>
40 <object class="sizeritem">
41 <flag>wxALIGN_CENTRE|wxALL</flag>
42 <border>5</border>
43 <object class="wxStaticText" name="version_statictext">
44 <label>$(version)</label>
45 </object>
46 </object>
47 <object class="sizeritem">
48 <flag>wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL</flag>
49 <border>5</border>
50 <object class="wxButton" name="wxID_OK">
51 <label>OK</label>
52 </object>
53 </object>
54 </object>
55 </object>
56 </object>
57</object>
58
59</resource>