projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[ 1936700 ] wxCAL_SHOW_WEEK_NUMBERS, slightly modified
[wxWidgets.git]
/
src
/
common
/
containr.cpp
diff --git
a/src/common/containr.cpp
b/src/common/containr.cpp
index d441b5c7c469e30d08e690437f460c9889359af4..43de0255b06a98d0b881e65a8649f950c7ec4a82 100644
(file)
--- a/
src/common/containr.cpp
+++ b/
src/common/containr.cpp
@@
-316,7
+316,10
@@
wxRadioButton* wxGetSelectedButtonInGroup(wxRadioButton *btn)
void wxControlContainer::HandleOnNavigationKey( wxNavigationKeyEvent& event )
{
void wxControlContainer::HandleOnNavigationKey( wxNavigationKeyEvent& event )
{
- wxWindow *parent = m_winParent->GetParent();
+ // for a TLW we shouldn't involve the parent window, it has nothing to do
+ // with keyboard navigation inside this TLW
+ wxWindow *parent = m_winParent->IsTopLevel() ? NULL
+ : m_winParent->GetParent();
// the event is propagated downwards if the event emitter was our parent
bool goingDown = event.GetEventObject() == parent;
// the event is propagated downwards if the event emitter was our parent
bool goingDown = event.GetEventObject() == parent;
@@
-529,24
+532,27
@@
void wxControlContainer::HandleOnNavigationKey( wxNavigationKeyEvent& event )
wxIsKindOf(m_winLastFocused, wxRadioButton) &&
!m_winLastFocused->HasFlag(wxRB_SINGLE) )
{
wxIsKindOf(m_winLastFocused, wxRadioButton) &&
!m_winLastFocused->HasFlag(wxRB_SINGLE) )
{
+ wxRadioButton * const
+ lastBtn = wx_static_cast(wxRadioButton *, m_winLastFocused);
+
// cursor keys don't navigate out of a radio button group so
// find the correct radio button to focus
if ( forward )
{
// cursor keys don't navigate out of a radio button group so
// find the correct radio button to focus
if ( forward )
{
- child = wxGetNextButtonInGroup(
(wxRadioButton*)m_winLastFocused
);
+ child = wxGetNextButtonInGroup(
lastBtn
);
if ( !child )
{
// no next button in group, set it to the first button
if ( !child )
{
// no next button in group, set it to the first button
- child = wxGetFirstButtonInGroup(
(wxRadioButton*)m_winLastFocused
);
+ child = wxGetFirstButtonInGroup(
lastBtn
);
}
}
else
{
}
}
else
{
- child = wxGetPreviousButtonInGroup(
(wxRadioButton*)m_winLastFocused
);
+ child = wxGetPreviousButtonInGroup(
lastBtn
);
if ( !child )
{
// no previous button in group, set it to the last button
if ( !child )
{
// no previous button in group, set it to the last button
- child = wxGetLastButtonInGroup(
(wxRadioButton*)m_winLastFocused
);
+ child = wxGetLastButtonInGroup(
lastBtn
);
}
}
}
}