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"/> wxALL|wxEXPAND 5 wxEXPAND 1 0 0 10 0 0 1 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). wxALL|wxEXPAND 5 wxLEFT 100 wxALIGN_CENTRE wxVERTICAL wxALIGN_CENTRE_VERTICAL wxHORIZONTAL 50,-1 update.gif See the tooltip! basicdlg.xpm controls.xpm custclas.xpm derivdlg.xpm platform.xpm objrefdlg.xpm uncenter.xpm variable.xpm 3 7 7 wxALL 3 wxVERTICAL wxALIGN_CENTRE_VERTICAL wxLEFT 100 wxTOP|wxBOTTOM|wxEXPAND 15 wxEXPAND 1 0 0 10 0 0 2 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]"); wxALL|wxEXPAND 5 wxEXPAND 0,0 wxEXPAND 0,1 wxEXPAND 0,2 wxEXPAND 0,3 wxEXPAND 1,0 wxEXPAND 1,1 wxEXPAND 1,2 wxEXPAND 1,3 wxEXPAND 2,0 wxEXPAND 2,1 wxEXPAND 2,2 wxEXPAND 2,3 wxEXPAND 3,0 wxEXPAND 3,1 wxEXPAND 3,2 wxEXPAND 3,3 wxEXPAND 4,0 1,4 5 5 wxALL 5 wxVERTICAL wxTOP|wxALIGN_CENTRE_HORIZONTAL 10 wxEXPAND 1 0 0 10 0 0 2 wxGROW|wxALIGN_CENTER_VERTICAL|wxALL 5 1 wxTOP|wxBOTTOM|wxALIGN_CENTRE 20 1 0 0 0 0 0 Object References and ID Ranges Example 1 wxDIALOG_EX_CONTEXTHELP wxVERTICAL wxTOP|wxEXPAND 20 wxTOP 5 -1,100 wxEXPAND wxVERTICAL 1 1 1