Take care of some focus issues with the AutoComp list box and also a
crash at exit when losing focus. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@27723 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -684,6 +684,7 @@ public:
|
|||||||
: wxListView(parent, id, pos, size, style)
|
: wxListView(parent, id, pos, size, style)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
void OnFocus(wxFocusEvent& event) {
|
void OnFocus(wxFocusEvent& event) {
|
||||||
GetParent()->SetFocus();
|
GetParent()->SetFocus();
|
||||||
event.Skip();
|
event.Skip();
|
||||||
@@ -692,7 +693,24 @@ public:
|
|||||||
void OnKillFocus(wxFocusEvent& WXUNUSED(event)) {
|
void OnKillFocus(wxFocusEvent& WXUNUSED(event)) {
|
||||||
// Do nothing. Prevents base class from resetting the colors...
|
// Do nothing. Prevents base class from resetting the colors...
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __WXMAC__
|
||||||
|
// For some reason I don't understand yet the focus doesn't really leave
|
||||||
|
// the listbox like it should, so if we get any events feed them back to
|
||||||
|
// the wxSTC
|
||||||
|
void OnKeyDown(wxKeyEvent& event) {
|
||||||
|
GetGrandParent()->GetEventHandler()->ProcessEvent(event);
|
||||||
|
}
|
||||||
|
void OnChar(wxKeyEvent& event) {
|
||||||
|
GetGrandParent()->GetEventHandler()->ProcessEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
// And we need to force the focus back when being destroyed
|
||||||
|
~wxSTCListBox() {
|
||||||
|
GetGrandParent()->SetFocus();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
@@ -700,6 +718,10 @@ private:
|
|||||||
BEGIN_EVENT_TABLE(wxSTCListBox, wxListView)
|
BEGIN_EVENT_TABLE(wxSTCListBox, wxListView)
|
||||||
EVT_SET_FOCUS( wxSTCListBox::OnFocus)
|
EVT_SET_FOCUS( wxSTCListBox::OnFocus)
|
||||||
EVT_KILL_FOCUS(wxSTCListBox::OnKillFocus)
|
EVT_KILL_FOCUS(wxSTCListBox::OnKillFocus)
|
||||||
|
#ifdef __WXMAC__
|
||||||
|
EVT_KEY_DOWN( wxSTCListBox::OnKeyDown)
|
||||||
|
EVT_CHAR( wxSTCListBox::OnChar)
|
||||||
|
#endif
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
|
|
||||||
@@ -736,7 +758,7 @@ public:
|
|||||||
// immediately.
|
// immediately.
|
||||||
bool Destroy() {
|
bool Destroy() {
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
// There bottom edge of this window is not getting properly
|
// The bottom edge of this window is not getting properly
|
||||||
// refreshed upon deletion, so help it out...
|
// refreshed upon deletion, so help it out...
|
||||||
wxWindow* p = GetParent();
|
wxWindow* p = GetParent();
|
||||||
wxRect r(GetPosition(), GetSize());
|
wxRect r(GetPosition(), GetSize());
|
||||||
|
@@ -2720,7 +2720,10 @@ void wxStyledTextCtrl::OnKeyDown(wxKeyEvent& evt) {
|
|||||||
|
|
||||||
|
|
||||||
void wxStyledTextCtrl::OnLoseFocus(wxFocusEvent& evt) {
|
void wxStyledTextCtrl::OnLoseFocus(wxFocusEvent& evt) {
|
||||||
m_swx->DoLoseFocus();
|
#ifdef __WXMAC__
|
||||||
|
if (! (IsBeingDeleted() || GetParent()->IsBeingDeleted()))
|
||||||
|
#endif
|
||||||
|
m_swx->DoLoseFocus();
|
||||||
evt.Skip();
|
evt.Skip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -529,7 +529,10 @@ void wxStyledTextCtrl::OnKeyDown(wxKeyEvent& evt) {
|
|||||||
|
|
||||||
|
|
||||||
void wxStyledTextCtrl::OnLoseFocus(wxFocusEvent& evt) {
|
void wxStyledTextCtrl::OnLoseFocus(wxFocusEvent& evt) {
|
||||||
m_swx->DoLoseFocus();
|
#ifdef __WXMAC__
|
||||||
|
if (! (IsBeingDeleted() || GetParent()->IsBeingDeleted()))
|
||||||
|
#endif
|
||||||
|
m_swx->DoLoseFocus();
|
||||||
evt.Skip();
|
evt.Skip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -684,6 +684,7 @@ public:
|
|||||||
: wxListView(parent, id, pos, size, style)
|
: wxListView(parent, id, pos, size, style)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
void OnFocus(wxFocusEvent& event) {
|
void OnFocus(wxFocusEvent& event) {
|
||||||
GetParent()->SetFocus();
|
GetParent()->SetFocus();
|
||||||
event.Skip();
|
event.Skip();
|
||||||
@@ -692,7 +693,24 @@ public:
|
|||||||
void OnKillFocus(wxFocusEvent& WXUNUSED(event)) {
|
void OnKillFocus(wxFocusEvent& WXUNUSED(event)) {
|
||||||
// Do nothing. Prevents base class from resetting the colors...
|
// Do nothing. Prevents base class from resetting the colors...
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __WXMAC__
|
||||||
|
// For some reason I don't understand yet the focus doesn't really leave
|
||||||
|
// the listbox like it should, so if we get any events feed them back to
|
||||||
|
// the wxSTC
|
||||||
|
void OnKeyDown(wxKeyEvent& event) {
|
||||||
|
GetGrandParent()->GetEventHandler()->ProcessEvent(event);
|
||||||
|
}
|
||||||
|
void OnChar(wxKeyEvent& event) {
|
||||||
|
GetGrandParent()->GetEventHandler()->ProcessEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
// And we need to force the focus back when being destroyed
|
||||||
|
~wxSTCListBox() {
|
||||||
|
GetGrandParent()->SetFocus();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
private:
|
private:
|
||||||
DECLARE_EVENT_TABLE()
|
DECLARE_EVENT_TABLE()
|
||||||
};
|
};
|
||||||
@@ -700,6 +718,10 @@ private:
|
|||||||
BEGIN_EVENT_TABLE(wxSTCListBox, wxListView)
|
BEGIN_EVENT_TABLE(wxSTCListBox, wxListView)
|
||||||
EVT_SET_FOCUS( wxSTCListBox::OnFocus)
|
EVT_SET_FOCUS( wxSTCListBox::OnFocus)
|
||||||
EVT_KILL_FOCUS(wxSTCListBox::OnKillFocus)
|
EVT_KILL_FOCUS(wxSTCListBox::OnKillFocus)
|
||||||
|
#ifdef __WXMAC__
|
||||||
|
EVT_KEY_DOWN( wxSTCListBox::OnKeyDown)
|
||||||
|
EVT_CHAR( wxSTCListBox::OnChar)
|
||||||
|
#endif
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
|
|
||||||
@@ -736,7 +758,7 @@ public:
|
|||||||
// immediately.
|
// immediately.
|
||||||
bool Destroy() {
|
bool Destroy() {
|
||||||
#ifdef __WXMAC__
|
#ifdef __WXMAC__
|
||||||
// There bottom edge of this window is not getting properly
|
// The bottom edge of this window is not getting properly
|
||||||
// refreshed upon deletion, so help it out...
|
// refreshed upon deletion, so help it out...
|
||||||
wxWindow* p = GetParent();
|
wxWindow* p = GetParent();
|
||||||
wxRect r(GetPosition(), GetSize());
|
wxRect r(GetPosition(), GetSize());
|
||||||
|
@@ -2720,7 +2720,10 @@ void wxStyledTextCtrl::OnKeyDown(wxKeyEvent& evt) {
|
|||||||
|
|
||||||
|
|
||||||
void wxStyledTextCtrl::OnLoseFocus(wxFocusEvent& evt) {
|
void wxStyledTextCtrl::OnLoseFocus(wxFocusEvent& evt) {
|
||||||
m_swx->DoLoseFocus();
|
#ifdef __WXMAC__
|
||||||
|
if (! (IsBeingDeleted() || GetParent()->IsBeingDeleted()))
|
||||||
|
#endif
|
||||||
|
m_swx->DoLoseFocus();
|
||||||
evt.Skip();
|
evt.Skip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -529,7 +529,10 @@ void wxStyledTextCtrl::OnKeyDown(wxKeyEvent& evt) {
|
|||||||
|
|
||||||
|
|
||||||
void wxStyledTextCtrl::OnLoseFocus(wxFocusEvent& evt) {
|
void wxStyledTextCtrl::OnLoseFocus(wxFocusEvent& evt) {
|
||||||
m_swx->DoLoseFocus();
|
#ifdef __WXMAC__
|
||||||
|
if (! (IsBeingDeleted() || GetParent()->IsBeingDeleted()))
|
||||||
|
#endif
|
||||||
|
m_swx->DoLoseFocus();
|
||||||
evt.Skip();
|
evt.Skip();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user