Commit Graph

16 Commits

Author SHA1 Message Date
Václav Slavík
7a442f311a minor rewrite of XRC's stock_id/stock_client handling, now guesses client id from context
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16635 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-08-20 22:27:24 +00:00
Julian Smart
af1337b041 Applied [ 594925 ] Implement wxArtProvider and XRC together
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
2002-08-16 11:24:46 +00:00
Václav Slavík
11032cd905 compatibility macro
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15047 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-04-08 22:50:56 +00:00
Václav Slavík
ee1046d1cf don't translate accelerators in XRC menus
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14238 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-02-15 19:41:43 +00:00
Václav Slavík
5ed345b7ed XMLID->XRCID, XMLCTRL->XRCCTRL
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13867 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-01-27 23:42:16 +00:00
Julian Smart
273b399fe9 Some comments modified to help with documentation
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13761 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-01-23 11:55:09 +00:00
Václav Slavík
546b00063e slight corrections, moved bwd compat macros to the end of the file
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13646 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-01-18 23:16:16 +00:00
Václav Slavík
824e8eaacc added singleton interface to wxXmlResource, replaces wxTheXmlResource
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13618 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-01-17 23:41:53 +00:00
Václav Slavík
47793ab85a implemented Alex's <object_ref> symlinks in XRC
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13608 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-01-17 00:16:54 +00:00
Václav Slavík
4a1b95962f merged another part of Alex's work (LoadMenuBar w/ parent)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13589 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2002-01-15 23:37:55 +00:00
Václav Slavík
daa85ee3af implemented subclassing in XRC
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13225 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-12-29 16:13:43 +00:00
Václav Slavík
150e58d8ae compilation fix
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11506 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-08-28 22:11:54 +00:00
Václav Slavík
77b2f9b185 ProcessPlatformProperty should not be a member of wxXmlResource
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11444 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-08-23 18:57:19 +00:00
Václav Slavík
00393283ff Unicode complation fixes
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@11096 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-07-18 23:01:31 +00:00
Kendall Bennett
5ab8bd570e Updates to xmlres.h to allow compiling XML code into a DLL correctly.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10553 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-06-12 19:49:51 +00:00
Václav Slavík
999d9a9f79 changed wxXML to XRC, wx/xml/*.h->wx/xrc/*.h
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10489 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2001-06-09 22:18:45 +00:00