Added code for better mouse click detection in various
native controls. wxChoice and wxSpinCtrl look better, wxListBox doesn't. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@21745 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -479,5 +479,15 @@ wxSize wxChoice::DoGetBestSize() const
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool wxChoice::IsOwnGtkWindow( GdkWindow *window )
|
||||
{
|
||||
#ifdef __WXGTK20__
|
||||
return GTK_BUTTON(m_widget)->event_window;
|
||||
#else
|
||||
return (window == m_widget->window);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#endif // wxUSE_CHOICE
|
||||
|
||||
|
||||
@@ -957,6 +957,8 @@ GtkWidget *wxListBox::GetConnectWidget()
|
||||
|
||||
bool wxListBox::IsOwnGtkWindow( GdkWindow *window )
|
||||
{
|
||||
if (m_widget->window == window) return TRUE;
|
||||
|
||||
if (GTK_WIDGET(m_list)->window == window) return TRUE;
|
||||
|
||||
GList *child = m_list->children;
|
||||
|
||||
@@ -282,7 +282,11 @@ void wxSpinCtrl::OnChar( wxKeyEvent &event )
|
||||
|
||||
bool wxSpinCtrl::IsOwnGtkWindow( GdkWindow *window )
|
||||
{
|
||||
return GTK_SPIN_BUTTON(m_widget)->panel == window;
|
||||
if (GTK_SPIN_BUTTON(m_widget)->entry.text_area == window) return TRUE;
|
||||
|
||||
if (GTK_SPIN_BUTTON(m_widget)->panel == window) return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void wxSpinCtrl::ApplyWidgetStyle()
|
||||
|
||||
@@ -479,5 +479,15 @@ wxSize wxChoice::DoGetBestSize() const
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool wxChoice::IsOwnGtkWindow( GdkWindow *window )
|
||||
{
|
||||
#ifdef __WXGTK20__
|
||||
return GTK_BUTTON(m_widget)->event_window;
|
||||
#else
|
||||
return (window == m_widget->window);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
#endif // wxUSE_CHOICE
|
||||
|
||||
|
||||
@@ -957,6 +957,8 @@ GtkWidget *wxListBox::GetConnectWidget()
|
||||
|
||||
bool wxListBox::IsOwnGtkWindow( GdkWindow *window )
|
||||
{
|
||||
if (m_widget->window == window) return TRUE;
|
||||
|
||||
if (GTK_WIDGET(m_list)->window == window) return TRUE;
|
||||
|
||||
GList *child = m_list->children;
|
||||
|
||||
@@ -282,7 +282,11 @@ void wxSpinCtrl::OnChar( wxKeyEvent &event )
|
||||
|
||||
bool wxSpinCtrl::IsOwnGtkWindow( GdkWindow *window )
|
||||
{
|
||||
return GTK_SPIN_BUTTON(m_widget)->panel == window;
|
||||
if (GTK_SPIN_BUTTON(m_widget)->entry.text_area == window) return TRUE;
|
||||
|
||||
if (GTK_SPIN_BUTTON(m_widget)->panel == window) return TRUE;
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
void wxSpinCtrl::ApplyWidgetStyle()
|
||||
|
||||
Reference in New Issue
Block a user