From dfc3d7e025e919d9cf0d2e59d3c74bfab0b07e55 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Tue, 1 Jun 1999 07:38:28 +0000 Subject: [PATCH] Moving frames and dialogs now reports correct positions. Typo in BMP loading. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2606 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/common/image.cpp | 2 +- src/gtk/dialog.cpp | 10 +++++++--- src/gtk/frame.cpp | 10 +++++++--- src/gtk1/dialog.cpp | 10 +++++++--- src/gtk1/frame.cpp | 10 +++++++--- 5 files changed, 29 insertions(+), 13 deletions(-) diff --git a/src/common/image.cpp b/src/common/image.cpp index 08cf535a6a..2aa061e627 100644 --- a/src/common/image.cpp +++ b/src/common/image.cpp @@ -642,7 +642,7 @@ bool wxBMPHandler::LoadFile( wxImage *image, wxInputStream& stream ) planes = (int)word; stream.Read(&word, 2); bpp = (int)word; - if (bpp != 1 && bpp != 4 && bpp != 8 && bpp && 16 && bpp != 24 && bpp != 32) + if (bpp!=1 && bpp!=4 && bpp!=8 && bpp !=16 && bpp!=24 && bpp!=32) { wxLogError( _T("unknown bitdepth in file\n") ); return FALSE; diff --git a/src/gtk/dialog.cpp b/src/gtk/dialog.cpp index 480a949a13..f9914dbc04 100644 --- a/src/gtk/dialog.cpp +++ b/src/gtk/dialog.cpp @@ -69,15 +69,19 @@ static void gtk_dialog_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation // "configure_event" //----------------------------------------------------------------------------- -static gint gtk_dialog_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventConfigure *event, wxDialog *win ) +static gint gtk_dialog_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventConfigure *WXUNUSED(event), wxDialog *win ) { if (g_isIdle) wxapp_install_idle_handler(); if (!win->m_hasVMT) return FALSE; - win->m_x = event->x; - win->m_y = event->y; + int x = 0; + int y = 0; + gdk_window_get_root_origin( win->m_widget->window, &x, &y ); + + win->m_x = x; + win->m_y = y; wxMoveEvent mevent( wxPoint(win->m_x,win->m_y), win->GetId() ); mevent.SetEventObject( win ); diff --git a/src/gtk/frame.cpp b/src/gtk/frame.cpp index ddf2120556..258bf92514 100644 --- a/src/gtk/frame.cpp +++ b/src/gtk/frame.cpp @@ -146,15 +146,19 @@ static void gtk_toolbar_detached_callback( GtkWidget *widget, GtkWidget *WXUNUSE // "configure_event" //----------------------------------------------------------------------------- -static gint gtk_frame_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventConfigure *event, wxFrame *win ) +static gint gtk_frame_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventConfigure *WXUNUSED(event), wxFrame *win ) { if (g_isIdle) wxapp_install_idle_handler(); if (!win->m_hasVMT) return FALSE; - win->m_x = event->x; - win->m_y = event->y; + int x = 0; + int y = 0; + gdk_window_get_root_origin( win->m_widget->window, &x, &y ); + + win->m_x = x; + win->m_y = y; wxMoveEvent mevent( wxPoint(win->m_x,win->m_y), win->GetId() ); mevent.SetEventObject( win ); diff --git a/src/gtk1/dialog.cpp b/src/gtk1/dialog.cpp index 480a949a13..f9914dbc04 100644 --- a/src/gtk1/dialog.cpp +++ b/src/gtk1/dialog.cpp @@ -69,15 +69,19 @@ static void gtk_dialog_size_callback( GtkWidget *WXUNUSED(widget), GtkAllocation // "configure_event" //----------------------------------------------------------------------------- -static gint gtk_dialog_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventConfigure *event, wxDialog *win ) +static gint gtk_dialog_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventConfigure *WXUNUSED(event), wxDialog *win ) { if (g_isIdle) wxapp_install_idle_handler(); if (!win->m_hasVMT) return FALSE; - win->m_x = event->x; - win->m_y = event->y; + int x = 0; + int y = 0; + gdk_window_get_root_origin( win->m_widget->window, &x, &y ); + + win->m_x = x; + win->m_y = y; wxMoveEvent mevent( wxPoint(win->m_x,win->m_y), win->GetId() ); mevent.SetEventObject( win ); diff --git a/src/gtk1/frame.cpp b/src/gtk1/frame.cpp index ddf2120556..258bf92514 100644 --- a/src/gtk1/frame.cpp +++ b/src/gtk1/frame.cpp @@ -146,15 +146,19 @@ static void gtk_toolbar_detached_callback( GtkWidget *widget, GtkWidget *WXUNUSE // "configure_event" //----------------------------------------------------------------------------- -static gint gtk_frame_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventConfigure *event, wxFrame *win ) +static gint gtk_frame_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventConfigure *WXUNUSED(event), wxFrame *win ) { if (g_isIdle) wxapp_install_idle_handler(); if (!win->m_hasVMT) return FALSE; - win->m_x = event->x; - win->m_y = event->y; + int x = 0; + int y = 0; + gdk_window_get_root_origin( win->m_widget->window, &x, &y ); + + win->m_x = x; + win->m_y = y; wxMoveEvent mevent( wxPoint(win->m_x,win->m_y), win->GetId() ); mevent.SetEventObject( win ); -- 2.45.2