From 2c990ec083c4fefba2bf4c0bafa3fc45313f5b73 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Sun, 27 Jan 2002 19:54:13 +0000 Subject: [PATCH] wxMiniFrame works again. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@13858 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/minifram.cpp | 14 +++++++++++++- src/gtk/toplevel.cpp | 4 ++-- src/gtk1/minifram.cpp | 14 +++++++++++++- src/gtk1/toplevel.cpp | 4 ++-- 4 files changed, 30 insertions(+), 6 deletions(-) diff --git a/src/gtk/minifram.cpp b/src/gtk/minifram.cpp index 53d01860b9..6f0c63d0d3 100644 --- a/src/gtk/minifram.cpp +++ b/src/gtk/minifram.cpp @@ -164,6 +164,13 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton if (win->m_isDragging) return TRUE; + GtkPizza *pizza = GTK_PIZZA(widget); + if (gdk_event->window != pizza->bin_window) return TRUE; + + GdkFont *font = wxSMALL_FONT->GetInternalFont(1.0); + int height = font->ascent + font->descent+1; + if (gdk_event->y > height) return TRUE; + gdk_window_raise( win->m_widget->window ); gdk_pointer_grab( widget->window, FALSE, @@ -303,7 +310,7 @@ bool wxMiniFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title const wxPoint &pos, const wxSize &size, long style, const wxString &name ) { - style = style | wxCAPTION | wxFRAME_FLOAT_ON_PARENT; + style = style | wxCAPTION; if ((style & wxCAPTION) || (style & wxTINY_CAPTION_HORIZ) || (style & wxTINY_CAPTION_VERT)) m_miniTitle = 13; @@ -317,6 +324,11 @@ bool wxMiniFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title wxFrame::Create( parent, id, title, pos, size, style, name ); + if (m_parent && (GTK_IS_WINDOW(m_parent->m_widget))) + { + gtk_window_set_transient_for( GTK_WINDOW(m_widget), GTK_WINDOW(m_parent->m_widget) ); + } + if ((style & wxSYSTEM_MENU) && ((style & wxCAPTION) || (style & wxTINY_CAPTION_HORIZ) || (style & wxTINY_CAPTION_VERT))) { diff --git a/src/gtk/toplevel.cpp b/src/gtk/toplevel.cpp index 28f810cdf2..52199f7191 100644 --- a/src/gtk/toplevel.cpp +++ b/src/gtk/toplevel.cpp @@ -358,7 +358,7 @@ bool wxTopLevelWindowGTK::Create( wxWindow *parent, wxTopLevelWindows.Append( this ); m_needParent = FALSE; - + if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name )) { @@ -381,7 +381,7 @@ bool wxTopLevelWindowGTK::Create( wxWindow *parent, m_widget = gtk_window_new( win_type ); if (m_parent && (GTK_IS_WINDOW(m_parent->m_widget)) && - (HasFlag(wxFRAME_FLOAT_ON_PARENT) || (GetExtraStyle() & wxTOPLEVEL_EX_DIALOG))) + (GetExtraStyle() & wxTOPLEVEL_EX_DIALOG)) { gtk_window_set_transient_for( GTK_WINDOW(m_widget), GTK_WINDOW(m_parent->m_widget) ); } diff --git a/src/gtk1/minifram.cpp b/src/gtk1/minifram.cpp index 53d01860b9..6f0c63d0d3 100644 --- a/src/gtk1/minifram.cpp +++ b/src/gtk1/minifram.cpp @@ -164,6 +164,13 @@ static gint gtk_window_button_press_callback( GtkWidget *widget, GdkEventButton if (win->m_isDragging) return TRUE; + GtkPizza *pizza = GTK_PIZZA(widget); + if (gdk_event->window != pizza->bin_window) return TRUE; + + GdkFont *font = wxSMALL_FONT->GetInternalFont(1.0); + int height = font->ascent + font->descent+1; + if (gdk_event->y > height) return TRUE; + gdk_window_raise( win->m_widget->window ); gdk_pointer_grab( widget->window, FALSE, @@ -303,7 +310,7 @@ bool wxMiniFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title const wxPoint &pos, const wxSize &size, long style, const wxString &name ) { - style = style | wxCAPTION | wxFRAME_FLOAT_ON_PARENT; + style = style | wxCAPTION; if ((style & wxCAPTION) || (style & wxTINY_CAPTION_HORIZ) || (style & wxTINY_CAPTION_VERT)) m_miniTitle = 13; @@ -317,6 +324,11 @@ bool wxMiniFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title wxFrame::Create( parent, id, title, pos, size, style, name ); + if (m_parent && (GTK_IS_WINDOW(m_parent->m_widget))) + { + gtk_window_set_transient_for( GTK_WINDOW(m_widget), GTK_WINDOW(m_parent->m_widget) ); + } + if ((style & wxSYSTEM_MENU) && ((style & wxCAPTION) || (style & wxTINY_CAPTION_HORIZ) || (style & wxTINY_CAPTION_VERT))) { diff --git a/src/gtk1/toplevel.cpp b/src/gtk1/toplevel.cpp index 28f810cdf2..52199f7191 100644 --- a/src/gtk1/toplevel.cpp +++ b/src/gtk1/toplevel.cpp @@ -358,7 +358,7 @@ bool wxTopLevelWindowGTK::Create( wxWindow *parent, wxTopLevelWindows.Append( this ); m_needParent = FALSE; - + if (!PreCreation( parent, pos, size ) || !CreateBase( parent, id, pos, size, style, wxDefaultValidator, name )) { @@ -381,7 +381,7 @@ bool wxTopLevelWindowGTK::Create( wxWindow *parent, m_widget = gtk_window_new( win_type ); if (m_parent && (GTK_IS_WINDOW(m_parent->m_widget)) && - (HasFlag(wxFRAME_FLOAT_ON_PARENT) || (GetExtraStyle() & wxTOPLEVEL_EX_DIALOG))) + (GetExtraStyle() & wxTOPLEVEL_EX_DIALOG)) { gtk_window_set_transient_for( GTK_WINDOW(m_widget), GTK_WINDOW(m_parent->m_widget) ); }