add missing GTK3 implementations of GTKGetWindow()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@75864 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -14,8 +14,10 @@
|
||||
#ifdef __WXGTK3__
|
||||
typedef struct _cairo cairo_t;
|
||||
typedef struct _GtkStyleProvider GtkStyleProvider;
|
||||
#define WXUNUSED_IN_GTK2(x) x
|
||||
#define WXUNUSED_IN_GTK3(x)
|
||||
#else
|
||||
#define WXUNUSED_IN_GTK2(x)
|
||||
#define WXUNUSED_IN_GTK3(x) x
|
||||
#endif
|
||||
|
||||
@@ -427,6 +429,11 @@ protected:
|
||||
|
||||
void ConstrainSize();
|
||||
|
||||
#ifdef __WXGTK3__
|
||||
static GdkWindow* GTKFindWindow(GtkWidget* widget);
|
||||
static void GTKFindWindow(GtkWidget* widget, wxArrayGdkWindows& windows);
|
||||
#endif
|
||||
|
||||
private:
|
||||
void Init();
|
||||
|
||||
|
@@ -278,8 +278,7 @@ GtkWidget* wxComboBox::GetConnectWidget()
|
||||
GdkWindow* wxComboBox::GTKGetWindow(wxArrayGdkWindows& /* windows */) const
|
||||
{
|
||||
#ifdef __WXGTK3__
|
||||
// no access to internal GdkWindows
|
||||
return NULL;
|
||||
return GTKFindWindow(GTK_WIDGET(GetEntry()));
|
||||
#else
|
||||
return gtk_entry_get_text_window(GetEntry());
|
||||
#endif
|
||||
|
@@ -594,7 +594,9 @@ GdkWindow *wxNotebook::GTKGetWindow(wxArrayGdkWindows& windows) const
|
||||
{
|
||||
windows.push_back(gtk_widget_get_window(m_widget));
|
||||
#ifdef __WXGTK3__
|
||||
// no access to internal GdkWindows
|
||||
GdkWindow* window = GTKFindWindow(m_widget);
|
||||
if (window)
|
||||
windows.push_back(window);
|
||||
#else
|
||||
windows.push_back(GTK_NOTEBOOK(m_widget)->event_window);
|
||||
#endif
|
||||
|
@@ -508,8 +508,7 @@ int wxSlider::GetLineSize() const
|
||||
GdkWindow *wxSlider::GTKGetWindow(wxArrayGdkWindows& WXUNUSED(windows)) const
|
||||
{
|
||||
#ifdef __WXGTK3__
|
||||
// no access to internal GdkWindows
|
||||
return NULL;
|
||||
return GTKFindWindow(m_scale);
|
||||
#else
|
||||
return GTK_RANGE(m_scale)->event_window;
|
||||
#endif
|
||||
|
@@ -174,10 +174,10 @@ void wxSpinButton::GtkEnableEvents() const
|
||||
(gpointer)gtk_value_changed, (void*) this);
|
||||
}
|
||||
|
||||
GdkWindow *wxSpinButton::GTKGetWindow(wxArrayGdkWindows& WXUNUSED(windows)) const
|
||||
GdkWindow *wxSpinButton::GTKGetWindow(wxArrayGdkWindows& WXUNUSED_IN_GTK2(windows)) const
|
||||
{
|
||||
#ifdef __WXGTK3__
|
||||
// no access to internal GdkWindows
|
||||
GTKFindWindow(m_widget, windows);
|
||||
return NULL;
|
||||
#else
|
||||
return GTK_SPIN_BUTTON(m_widget)->panel;
|
||||
|
@@ -342,8 +342,7 @@ void wxSpinCtrlGTKBase::OnChar( wxKeyEvent &event )
|
||||
GdkWindow *wxSpinCtrlGTKBase::GTKGetWindow(wxArrayGdkWindows& windows) const
|
||||
{
|
||||
#ifdef __WXGTK3__
|
||||
// no access to internal GdkWindows
|
||||
wxUnusedVar(windows);
|
||||
GTKFindWindow(m_widget, windows);
|
||||
#else
|
||||
GtkSpinButton* spinbutton = GTK_SPIN_BUTTON(m_widget);
|
||||
|
||||
|
@@ -1650,16 +1650,7 @@ GdkWindow *wxTextCtrl::GTKGetWindow(wxArrayGdkWindows& WXUNUSED(windows)) const
|
||||
else
|
||||
{
|
||||
#ifdef __WXGTK3__
|
||||
GdkWindow* window = gtk_widget_get_window(m_text);
|
||||
for (const GList* p = gdk_window_peek_children(window); p; p = p->next)
|
||||
{
|
||||
window = GDK_WINDOW(p->data);
|
||||
void* data;
|
||||
gdk_window_get_user_data(window, &data);
|
||||
if (data == m_text)
|
||||
return window;
|
||||
}
|
||||
return NULL;
|
||||
return GTKFindWindow(m_text);
|
||||
#else
|
||||
return gtk_entry_get_text_window(GTK_ENTRY(m_text));
|
||||
#endif
|
||||
|
@@ -4358,6 +4358,35 @@ bool wxWindowGTK::IsTransparentBackgroundSupported(wxString* reason) const
|
||||
#endif // wxGTK_HAS_COMPOSITING_SUPPORT/!wxGTK_HAS_COMPOSITING_SUPPORT
|
||||
}
|
||||
|
||||
#ifdef __WXGTK3__
|
||||
GdkWindow* wxWindowGTK::GTKFindWindow(GtkWidget* widget)
|
||||
{
|
||||
GdkWindow* window = gtk_widget_get_window(widget);
|
||||
for (const GList* p = gdk_window_peek_children(window); p; p = p->next)
|
||||
{
|
||||
window = GDK_WINDOW(p->data);
|
||||
void* data;
|
||||
gdk_window_get_user_data(window, &data);
|
||||
if (data == widget)
|
||||
return window;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
void wxWindowGTK::GTKFindWindow(GtkWidget* widget, wxArrayGdkWindows& windows)
|
||||
{
|
||||
GdkWindow* window = gtk_widget_get_window(widget);
|
||||
for (const GList* p = gdk_window_peek_children(window); p; p = p->next)
|
||||
{
|
||||
window = GDK_WINDOW(p->data);
|
||||
void* data;
|
||||
gdk_window_get_user_data(window, &data);
|
||||
if (data == widget)
|
||||
windows.push_back(window);
|
||||
}
|
||||
}
|
||||
#endif // __WXGTK3__
|
||||
|
||||
// ----------------------------------------------------------------------------
|
||||
// Pop-up menu stuff
|
||||
// ----------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user