X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/eebe401675d1c558516d20506a4e43cccb36d182..9b64e79868d4d32c3541bbd049d3f9f94c8edbfe:/src/gtk1/dialog.cpp diff --git a/src/gtk1/dialog.cpp b/src/gtk1/dialog.cpp index 9812ec9c7b..275b1eb4e9 100644 --- a/src/gtk1/dialog.cpp +++ b/src/gtk1/dialog.cpp @@ -20,6 +20,11 @@ #include "wx/gtk/win_gtk.h" #include "wx/cursor.h" +/* +#include "gdk/gdkprivate.h" +#include "gdk/gdkx.h" +*/ + //----------------------------------------------------------------------------- // idle system //----------------------------------------------------------------------------- @@ -33,6 +38,33 @@ extern bool g_isIdle; extern wxList wxPendingDelete; +/* +//----------------------------------------------------------------------------- +// instruct X to set the WM hint for positioning +//----------------------------------------------------------------------------- + +extern "C" { + +static void gdk_window_set_position_hint( GdkWindow *window, gint x, gint y ) +{ + GdkWindowPrivate *priv; + XSizeHints size_hints; + + g_return_if_fail (window != NULL); + + priv = (GdkWindowPrivate*) window; + if (priv->destroyed) return; + + size_hints.flags = PPosition; + size_hints.x = x; + size_hints.y = y; + + XSetWMNormalHints (priv->xdisplay, priv->xwindow, &size_hints); +} + +} +*/ + //----------------------------------------------------------------------------- // "delete_event" //----------------------------------------------------------------------------- @@ -118,6 +150,10 @@ gtk_dialog_realized_callback( GtkWidget *widget, wxDialog *win ) position in "realize" and "map" */ gtk_widget_set_uposition( widget, win->m_x, win->m_y ); +/* + gdk_window_set_position_hint( widget->window, win->m_x, win->m_y ); +*/ + /* reset the icon */ if (win->m_icon != wxNullIcon) { @@ -252,7 +288,7 @@ bool wxDialog::Create( wxWindow *parent, if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name )) { - wxFAIL_MSG( _T("wxDialog creation failed") ); + wxFAIL_MSG( T("wxDialog creation failed") ); return FALSE; } @@ -320,7 +356,7 @@ wxDialog::~wxDialog() void wxDialog::SetTitle( const wxString& title ) { m_title = title; - if (m_title.IsNull()) m_title = _T(""); + if (m_title.IsNull()) m_title = T(""); gtk_window_set_title( GTK_WINDOW(m_widget), m_title.mbc_str() ); } @@ -406,7 +442,7 @@ bool wxDialog::Destroy() void wxDialog::OnSize( wxSizeEvent &WXUNUSED(event) ) { - wxASSERT_MSG( (m_widget != NULL), _T("invalid dialog") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid dialog") ); #if wxUSE_CONSTRAINTS if (GetAutoLayout()) @@ -441,8 +477,8 @@ void wxDialog::OnSize( wxSizeEvent &WXUNUSED(event) ) void wxDialog::DoSetSize( int x, int y, int width, int height, int sizeFlags ) { - wxASSERT_MSG( (m_widget != NULL), _T("invalid dialog") ); - wxASSERT_MSG( (m_wxwindow != NULL), _T("invalid dialog") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid dialog") ); + wxASSERT_MSG( (m_wxwindow != NULL), T("invalid dialog") ); if (m_resizing) return; /* I don't like recursions */ m_resizing = TRUE; @@ -531,7 +567,7 @@ void wxDialog::GtkOnSize( int WXUNUSED(x), int WXUNUSED(y), int width, int heigh void wxDialog::Centre( int direction ) { - wxASSERT_MSG( (m_widget != NULL), _T("invalid dialog") ); + wxASSERT_MSG( (m_widget != NULL), T("invalid dialog") ); int x = 0; int y = 0; @@ -546,6 +582,8 @@ void wxDialog::OnInternalIdle() { if (!m_sizeSet && GTK_WIDGET_REALIZED(m_wxwindow)) GtkOnSize( m_x, m_y, m_width, m_height ); + + wxWindow::OnInternalIdle(); } bool wxDialog::Show( bool show ) @@ -585,14 +623,14 @@ void wxDialog::SetModal( bool WXUNUSED(flag) ) else if (m_windowStyle & wxDIALOG_MODAL) m_windowStyle -= wxDIALOG_MODAL; */ - wxFAIL_MSG( _T("wxDialog:SetModal obsolete now") ); + wxFAIL_MSG( T("wxDialog:SetModal obsolete now") ); } int wxDialog::ShowModal() { if (IsModal()) { - wxFAIL_MSG( _T("wxDialog:ShowModal called twice") ); + wxFAIL_MSG( T("wxDialog:ShowModal called twice") ); return GetReturnCode(); } @@ -615,7 +653,7 @@ void wxDialog::EndModal( int retCode ) if (!IsModal()) { - wxFAIL_MSG( _T("wxDialog:EndModal called twice") ); + wxFAIL_MSG( T("wxDialog:EndModal called twice") ); return; }