From: Robert Roebling Date: Wed, 7 Nov 2007 11:12:08 +0000 (+0000) Subject: Upport hint window improvement using custom GTK+ code X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/952a3bd46dc50f95c462606fac8214573022f612?ds=inline Upport hint window improvement using custom GTK+ code git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49715 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/aui/framemanager.cpp b/src/aui/framemanager.cpp index 4827dbedac..6e38dd291d 100644 --- a/src/aui/framemanager.cpp +++ b/src/aui/framemanager.cpp @@ -74,6 +74,8 @@ IMPLEMENT_CLASS(wxAuiManager, wxEvtHandler) const int auiToolBarLayer = 10; +#ifndef __WXGTK20__ + class wxPseudoTransparentFrame : public wxFrame { @@ -209,6 +211,72 @@ BEGIN_EVENT_TABLE(wxPseudoTransparentFrame, wxFrame) END_EVENT_TABLE() +#else + // __WXGTK20__ + +#include "wx/gtk/private.h" + +static void +gtk_pseudo_window_realized_callback( GtkWidget *m_widget, void *WXUNUSED(win) ) +{ + wxSize disp = wxGetDisplaySize(); + int amount = 128; + wxRegion region; + for (int y=0; ywindow, region.GetRegion(), 0, 0); +} + + +class wxPseudoTransparentFrame: public wxFrame +{ +public: + wxPseudoTransparentFrame(wxWindow* parent = NULL, + wxWindowID id = wxID_ANY, + const wxString& title = wxEmptyString, + const wxPoint& pos = wxDefaultPosition, + const wxSize& size = wxDefaultSize, + long style = wxDEFAULT_FRAME_STYLE, + const wxString &name = wxT("frame")) + { + if (!CreateBase( parent, id, pos, size, style, wxDefaultValidator, name )) + return; + + m_title = title; + + m_widget = gtk_window_new( GTK_WINDOW_POPUP ); + + g_signal_connect( m_widget, "realize", + G_CALLBACK (gtk_pseudo_window_realized_callback), this ); + + GdkColor col; + col.red = 128 * 256; + col.green = 192 * 256; + col.blue = 255 * 256; + gtk_widget_modify_bg( m_widget, GTK_STATE_NORMAL, &col ); + } + + bool SetTransparent(wxByte WXUNUSED(alpha)) + { + return true; + } + +private: + DECLARE_DYNAMIC_CLASS(wxPseudoTransparentFrame) +}; + +IMPLEMENT_DYNAMIC_CLASS(wxPseudoTransparentFrame, wxFrame) + +#endif + // __WXGTK20__ + + + // -- static utility functions -- static wxBitmap wxPaneCreateStippleBitmap() diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index 7ad3b37a46..de88a66586 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -829,10 +829,6 @@ void wxTopLevelWindowGTK::DoSetSize( int x, int y, int width, int height, int si { wxCHECK_RET( m_widget, wxT("invalid frame") ); - // this shouldn't happen: wxFrame, wxMDIParentFrame and wxMDIChildFrame have m_wxwindow - wxASSERT_MSG( (m_wxwindow != NULL), wxT("invalid frame") ); - - // deal with the position first int old_x = m_x; int old_y = m_y;