af1337b041
By Robert O'Connor (robertoconnor) This patch is a draft which successfully allows a wxArtProvider to serve out icons to bitmaps for XRC files. The syntax to use a wxArtProvider bitmap is: <bitmap stock_id="wxART_INFORMATION" stock_client="wxART_TOOLBAR">somefallbackicon.png</bitmap> The bitmap is optional, and will only be used as a fallback image, if the wxArtProvider returned a wxNullBitmap for some reason. The client attribute, if not specified, currently will be wxART_OTHER. Perhaps there should be a guessing heuristic of it being in a menu node to call wxART_MENU. Usage of XRC resouces and wxArtProvider together can be seen in an updated /contrib/samples/xrc demo, which is a separate patch. Search the wx-dev mailing lists for "wxArtProvider" and "XRC" for the full discussions on this feature's API design. Applied patch [ 594932 ] Extended XRC XML resources sample By Robert O'Connor (robertoconnor) This is a more comprehensive introduction to how to get up and running using XRC in your new wxWindows project. It describes both the basics (for new users) and advanced features. It consists of a demo of dialogs and frames loaded from XRC. Each dialog has a textctrl at the top of the dialog, which walks the new user through that feature. There are 8 demos: The 4 basic ones: -A non-derived dialog, as typically used for an about dialog. -A derived dialog that loads its resources from an XRC (a frequently-asked question on the mailing lists), and responds to some simple events, including the disable-another-control-via-EVT_UPDATE_UI that is another FAQ, and powerful and simple-to-use feature. -A XRC reference "Controls" dialog, using a notebook. Each tab has a single control. All XRC handled widgets can be seen at a glance, and how to use them under XRC. -An uncentered dialog, to demonstrate the easy use of <centered>1</centered> to automatically place a Dialog centered on its parent.. The 4 advanced ones: -Embedding a custom class into an XRC dialog, by using the "unknown" class. -Using wxArtProvider to use stock icons from within your your XRC resources. -Using the platform attribute to selectively show a part of XRC based on the current OS. -Runtime variable expansion (demo only. Not implemented at this time). Also: -The main frame is now demonstrated as being loaded as an XRC. - The toolbar has longhelp tag demonstrated, and are hooked up to the same events as the menu to show how XRCID() works on the same tool and menuitem XRCID. -Some custom icons for the demonstration were created, and put into the toolbar and menubar. A custom icon also for the demonstration. -The example code has been put in 1 class per file (both .cpp and a matching .xrc), to make it much less confusing for a newcomer to figure out what class is what, expecially with all the wx macros for declaration and implementation. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16542 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
146 lines
7.4 KiB
XML
146 lines
7.4 KiB
XML
<?xml version="1.0" encoding="ISO-8859-1"?>
|
|
|
|
<resource xmlns="http://www.wxwindows.org/wxxrc" version="2.3.0.1">
|
|
|
|
<object class="wxDialog" name="platform_property_dialog">
|
|
<title>Platform Property Example</title>
|
|
<centered>1</centered>
|
|
<object class="wxFlexGridSizer">
|
|
<cols>1</cols>
|
|
<rows>0</rows>
|
|
<vgap>0</vgap>
|
|
<hgap>0</hgap>
|
|
<growablecols>0</growablecols>
|
|
<growablerows>0</growablerows>
|
|
<object class="sizeritem">
|
|
<flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxALL</flag>
|
|
<border>5</border>
|
|
<object class="wxTextCtrl" name="message_textctrl">
|
|
<size>500,150</size>
|
|
<style>wxTE_MULTILINE</style>
|
|
<value>You can specify certain nodes of an XRC file to only be used for a certain platform.\n\nTo do this, there is a "platform" property that can be placed in any node [ie inside an opening tag]. The value of the tag can be any combination of the following: mac, win, unix, or os2. Use a | symbol between multiple platforms, for example <label platform="win|mac">\n\nAt runtime, if there is a platform property in the tag, if it matches the current operating system, that node will be included, otherwise it won't.\n\nThe notebook example below shows how you can specify a high level node to only appear on a certain platform: the example here being a page of preferences that only make sense on a certain platform.\n\nThe second example shows how to replace a single attribute of a control: here the label of a download link. It is also very useful for specifying menu item accelerators keystrokes on the target platform.</value>
|
|
</object>
|
|
</object>
|
|
<object class="sizeritem">
|
|
<flag>wxGROW|wxALIGN_CENTER_VERTICAL|wxALL</flag>
|
|
<border>5</border>
|
|
<object class="wxNotebook" name="platform_notebook">
|
|
<usenotebooksizer>1</usenotebooksizer>
|
|
<size>200,160</size>
|
|
<object class="notebookpage">
|
|
<label>Shared options</label>
|
|
<object class="wxPanel" name="shared_tab">
|
|
<object class="wxBoxSizer">
|
|
<orient>wxVERTICAL</orient>
|
|
<object class="sizeritem">
|
|
<flag>wxALIGN_CENTRE|wxALL</flag>
|
|
<border>5</border>
|
|
<object class="wxCheckBox" name="shared_checkbox">
|
|
<label>This preference is for all operating systems</label>
|
|
</object>
|
|
</object>
|
|
</object>
|
|
</object>
|
|
</object>
|
|
<object platform="mac" class="notebookpage">
|
|
<label>Macintosh options</label>
|
|
<object class="wxPanel" name="mac_specific">
|
|
<object class="wxBoxSizer">
|
|
<orient>wxVERTICAL</orient>
|
|
<object class="sizeritem">
|
|
<flag>wxALIGN_CENTRE|wxALL</flag>
|
|
<border>5</border>
|
|
<object class="wxCheckBox" name="mac_checkbox">
|
|
<label>Save output in iMovie compatible format</label>
|
|
</object>
|
|
</object>
|
|
</object>
|
|
</object>
|
|
</object>
|
|
<object platform="win" class="notebookpage">
|
|
<label>Windows options</label>
|
|
<object class="wxPanel" name="win_specific">
|
|
<object class="wxBoxSizer">
|
|
<orient>wxVERTICAL</orient>
|
|
<object class="sizeritem">
|
|
<flag>wxALIGN_CENTRE|wxALL</flag>
|
|
<border>5</border>
|
|
<object class="wxCheckBox" name="win_checkbox">
|
|
<label>Show application in icon tray instead of taskbar</label>
|
|
</object>
|
|
</object>
|
|
</object>
|
|
</object>
|
|
</object>
|
|
<object platform="unix" class="notebookpage">
|
|
<label>Linux options</label>
|
|
<object class="wxPanel" name="unix_specific">
|
|
<object class="wxBoxSizer">
|
|
<orient>wxVERTICAL</orient>
|
|
<object class="sizeritem">
|
|
<flag>wxALIGN_CENTRE|wxALL</flag>
|
|
<border>5</border>
|
|
<object class="wxCheckBox" name="unix_checkbox">
|
|
<label>Check my home directory for previous files</label>
|
|
</object>
|
|
</object>
|
|
</object>
|
|
</object>
|
|
</object>
|
|
<object platform="os2" class="notebookpage">
|
|
<label>OS2 options</label>
|
|
<object class="wxPanel" name="os2_specific">
|
|
<object class="wxBoxSizer">
|
|
<orient>wxVERTICAL</orient>
|
|
<object class="sizeritem">
|
|
<flag>wxALIGN_CENTRE|wxALL</flag>
|
|
<border>5</border>
|
|
<object class="wxCheckBox" name="os2_checkbox">
|
|
<label>Use WarpIn installer</label>
|
|
</object>
|
|
</object>
|
|
</object>
|
|
</object>
|
|
</object>
|
|
</object>
|
|
</object>
|
|
<object platform="mac" class="sizeritem">
|
|
<flag>wxALIGN_CENTRE|wxALL</flag>
|
|
<border>5</border>
|
|
<object class="wxStaticText" name="download_mac_statictext">
|
|
<label>Get latest update at www.mycompany.com/download/mac</label>
|
|
</object>
|
|
</object>
|
|
<object platform="win" class="sizeritem">
|
|
<flag>wxALIGN_CENTRE|wxALL</flag>
|
|
<border>5</border>
|
|
<object class="wxStaticText" name="download_win_statictext">
|
|
<label>Get latest update at www.mycompany.com/download/win</label>
|
|
</object>
|
|
</object>
|
|
<object platform="unix" class="sizeritem">
|
|
<flag>wxALIGN_CENTRE|wxALL</flag>
|
|
<border>5</border>
|
|
<object class="wxStaticText" name="download_unix_statictext">
|
|
<label>Get latest update at www.mycompany.com/download/unix</label>
|
|
</object>
|
|
</object>
|
|
<object platform="os2kurva" class="sizeritem">
|
|
<flag>wxALIGN_CENTRE|wxALL</flag>
|
|
<border>5</border>
|
|
<object class="wxStaticText" name="download_os2_statictext">
|
|
<label>Get latest update at www.mycompany.com/download/os2</label>
|
|
</object>
|
|
</object>
|
|
<object class="sizeritem">
|
|
<flag>wxALIGN_CENTRE|wxALL</flag>
|
|
<border>5</border>
|
|
<object class="wxButton" name="wxID_OK">
|
|
<label>OK</label>
|
|
</object>
|
|
</object>
|
|
</object>
|
|
</object>
|
|
|
|
</resource>
|