Tim Burgess
2014-04-10 09:47:26 UTC
Hi,
I have the following scenario:
1 - A frame containing a list box and a variable number of static/text
control pairs (these latter being created at run-time depending on data
coming into the application). Each pair of static/text controls have their
own horizontal sizer and the whole thing is stored as follows:
struct DisplayElement
{
wxBoxSizer * ElementSizer;
wxStaticText * DisplayLabel;
RBTextCtrl * DisplayContents; // This class is just a wxTextCtl with the
read-only property set and enabled for tab navigation
};
2 - I store instances of DisplayElement in a std::map <std::wstring,
DisplayElement>, the key to the map being the value of the text in the
static;
3 - I'm attempting to use MoveBeforeInTabOrder and MoveAfterInTabOrder to
add the first and last DisplayElement instances into the tab order with
respect to the list box (tab navigation works fine between the instances of
DisplayElement within the map). This is done imediately after a
DisplayElement instance has been instantiated and the individual element
values set: In the snippet below, MyDisplays is the name of the map
mentioned above:
Std::pair <std::wstring, DisplayElement> myDisplayPair;
// ... controls created here, added to the pair and inserted into the map
// If this is the first DisplayElement that has been created we want it to
be after the list box in the tab order
if (myDisplays.size() == 1)
{
lbxSurfaces->MoveBeforeInTabOrder(
myDisplayPair.second.DisplayLabel);
}
// Always set the new DisplayElement's text control to the tab order
position immediately prior to the list box.
lbxSurfaces->MoveAfterInTabOrder( myDisplayPair.second.DisplayContents);
This doesn't work. If I click into any of the text controls I can
tab/shift+tab happily between the text controls and get as far as tabbing
onto the list box. However, as soon as I land on the list box I can't tab
away from it again.
Is there any way that I can interrogate the tab order index values so that I
can try to debug this, please? Alternatively, can anybody spot my error?
Best wishes and thanks in advance.
Tim Burgess
I have the following scenario:
1 - A frame containing a list box and a variable number of static/text
control pairs (these latter being created at run-time depending on data
coming into the application). Each pair of static/text controls have their
own horizontal sizer and the whole thing is stored as follows:
struct DisplayElement
{
wxBoxSizer * ElementSizer;
wxStaticText * DisplayLabel;
RBTextCtrl * DisplayContents; // This class is just a wxTextCtl with the
read-only property set and enabled for tab navigation
};
2 - I store instances of DisplayElement in a std::map <std::wstring,
DisplayElement>, the key to the map being the value of the text in the
static;
3 - I'm attempting to use MoveBeforeInTabOrder and MoveAfterInTabOrder to
add the first and last DisplayElement instances into the tab order with
respect to the list box (tab navigation works fine between the instances of
DisplayElement within the map). This is done imediately after a
DisplayElement instance has been instantiated and the individual element
values set: In the snippet below, MyDisplays is the name of the map
mentioned above:
Std::pair <std::wstring, DisplayElement> myDisplayPair;
// ... controls created here, added to the pair and inserted into the map
// If this is the first DisplayElement that has been created we want it to
be after the list box in the tab order
if (myDisplays.size() == 1)
{
lbxSurfaces->MoveBeforeInTabOrder(
myDisplayPair.second.DisplayLabel);
}
// Always set the new DisplayElement's text control to the tab order
position immediately prior to the list box.
lbxSurfaces->MoveAfterInTabOrder( myDisplayPair.second.DisplayContents);
This doesn't work. If I click into any of the text controls I can
tab/shift+tab happily between the text controls and get as far as tabbing
onto the list box. However, as soon as I land on the list box I can't tab
away from it again.
Is there any way that I can interrogate the tab order index values so that I
can try to debug this, please? Alternatively, can anybody spot my error?
Best wishes and thanks in advance.
Tim Burgess
--
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users
Please read http://www.wxwidgets.org/support/mlhowto.htm before posting.
To unsubscribe, send email to wx-users+***@googlegroups.com
or visit http://groups.google.com/group/wx-users