From 50c16da687643ed30f9162b8217ba14f42321d74 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Wed, 6 Jul 2016 18:48:35 +0200 Subject: [PATCH] Remove invalid "option" elements from XRC sample file wxALL|wxEXPAND 5 @@ -42,7 +41,6 @@ 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 @@ -145,7 +143,6 @@ - wxEXPAND 1 @@ -166,7 +163,6 @@ 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 @@ -322,7 +318,6 @@ - wxEXPAND 1 @@ -336,7 +331,6 @@ - wxGROW|wxALIGN_CENTER_VERTICAL|wxALL 5