From 8185521695af751c39e16b7bce9370c4f82bc9a5 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Thu, 16 Mar 2000 19:47:23 +0000 Subject: [PATCH] Fixed mini-frame problems. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6772 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- src/gtk/frame.cpp | 63 ++++++++++++++++++++++++------------------- src/gtk/minifram.cpp | 2 +- src/gtk1/frame.cpp | 63 ++++++++++++++++++++++++------------------- src/gtk1/minifram.cpp | 2 +- 4 files changed, 74 insertions(+), 56 deletions(-) diff --git a/src/gtk/frame.cpp b/src/gtk/frame.cpp index 13d018c53b..a5e3a916d9 100644 --- a/src/gtk/frame.cpp +++ b/src/gtk/frame.cpp @@ -216,7 +216,7 @@ gtk_frame_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventConfigure *ev if (!win->m_hasVMT) return FALSE; - + #if (GTK_MINOR_VERSION > 0) int x = 0; int y = 0; @@ -253,37 +253,46 @@ gtk_frame_realized_callback( GtkWidget *widget, wxFrame *win ) position in "realize" */ gtk_widget_set_uposition( widget, win->m_x, win->m_y ); - /* all this is for Motif Window Manager "hints" and is supposed to be - recognized by other WM as well. not tested. */ - long decor = (long) GDK_DECOR_BORDER; - long func = (long) GDK_FUNC_MOVE; - - if ((win->GetWindowStyle() & wxCAPTION) != 0) - decor |= GDK_DECOR_TITLE; - if ((win->GetWindowStyle() & wxSYSTEM_MENU) != 0) - { - decor |= GDK_DECOR_MENU; - func |= GDK_FUNC_CLOSE; - } - if ((win->GetWindowStyle() & wxMINIMIZE_BOX) != 0) + if (win->m_miniEdge > 0) { - func |= GDK_FUNC_MINIMIZE; - decor |= GDK_DECOR_MINIMIZE; + /* This is a mini-frame. */ + gdk_window_set_decorations( win->m_widget->window, (GdkWMDecoration)0 ); + gdk_window_set_functions( win->m_widget->window, (GdkWMFunction)0 ); } - if ((win->GetWindowStyle() & wxMAXIMIZE_BOX) != 0) - { - func |= GDK_FUNC_MAXIMIZE; - decor |= GDK_DECOR_MAXIMIZE; - } - if ((win->GetWindowStyle() & wxRESIZE_BORDER) != 0) + else { - func |= GDK_FUNC_RESIZE; - decor |= GDK_DECOR_RESIZEH; + /* All this is for Motif Window Manager "hints" and is supposed to be + recognized by other WM as well. Not tested. */ + long decor = (long) GDK_DECOR_BORDER; + long func = (long) GDK_FUNC_MOVE; + + if ((win->GetWindowStyle() & wxCAPTION) != 0) + decor |= GDK_DECOR_TITLE; + if ((win->GetWindowStyle() & wxSYSTEM_MENU) != 0) + { + decor |= GDK_DECOR_MENU; + func |= GDK_FUNC_CLOSE; + } + if ((win->GetWindowStyle() & wxMINIMIZE_BOX) != 0) + { + func |= GDK_FUNC_MINIMIZE; + decor |= GDK_DECOR_MINIMIZE; + } + if ((win->GetWindowStyle() & wxMAXIMIZE_BOX) != 0) + { + func |= GDK_FUNC_MAXIMIZE; + decor |= GDK_DECOR_MAXIMIZE; + } + if ((win->GetWindowStyle() & wxRESIZE_BORDER) != 0) + { + func |= GDK_FUNC_RESIZE; + decor |= GDK_DECOR_RESIZEH; + } + + gdk_window_set_decorations( win->m_widget->window, (GdkWMDecoration)decor); + gdk_window_set_functions( win->m_widget->window, (GdkWMFunction)func); } - gdk_window_set_decorations( win->m_widget->window, (GdkWMDecoration)decor); - gdk_window_set_functions( win->m_widget->window, (GdkWMFunction)func); - /* GTK's shrinking/growing policy */ if ((win->GetWindowStyle() & wxRESIZE_BORDER) == 0) gtk_window_set_policy(GTK_WINDOW(win->m_widget), 0, 0, 1); diff --git a/src/gtk/minifram.cpp b/src/gtk/minifram.cpp index 7b0c2ad433..49de6bc095 100644 --- a/src/gtk/minifram.cpp +++ b/src/gtk/minifram.cpp @@ -303,7 +303,7 @@ bool wxMiniFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title const wxPoint &pos, const wxSize &size, long style, const wxString &name ) { - style = style | wxSIMPLE_BORDER; +// style = style | wxSIMPLE_BORDER; style = style | wxCAPTION; if ((style & wxCAPTION) || (style & wxTINY_CAPTION_HORIZ) || (style & wxTINY_CAPTION_VERT)) diff --git a/src/gtk1/frame.cpp b/src/gtk1/frame.cpp index 13d018c53b..a5e3a916d9 100644 --- a/src/gtk1/frame.cpp +++ b/src/gtk1/frame.cpp @@ -216,7 +216,7 @@ gtk_frame_configure_callback( GtkWidget *WXUNUSED(widget), GdkEventConfigure *ev if (!win->m_hasVMT) return FALSE; - + #if (GTK_MINOR_VERSION > 0) int x = 0; int y = 0; @@ -253,37 +253,46 @@ gtk_frame_realized_callback( GtkWidget *widget, wxFrame *win ) position in "realize" */ gtk_widget_set_uposition( widget, win->m_x, win->m_y ); - /* all this is for Motif Window Manager "hints" and is supposed to be - recognized by other WM as well. not tested. */ - long decor = (long) GDK_DECOR_BORDER; - long func = (long) GDK_FUNC_MOVE; - - if ((win->GetWindowStyle() & wxCAPTION) != 0) - decor |= GDK_DECOR_TITLE; - if ((win->GetWindowStyle() & wxSYSTEM_MENU) != 0) - { - decor |= GDK_DECOR_MENU; - func |= GDK_FUNC_CLOSE; - } - if ((win->GetWindowStyle() & wxMINIMIZE_BOX) != 0) + if (win->m_miniEdge > 0) { - func |= GDK_FUNC_MINIMIZE; - decor |= GDK_DECOR_MINIMIZE; + /* This is a mini-frame. */ + gdk_window_set_decorations( win->m_widget->window, (GdkWMDecoration)0 ); + gdk_window_set_functions( win->m_widget->window, (GdkWMFunction)0 ); } - if ((win->GetWindowStyle() & wxMAXIMIZE_BOX) != 0) - { - func |= GDK_FUNC_MAXIMIZE; - decor |= GDK_DECOR_MAXIMIZE; - } - if ((win->GetWindowStyle() & wxRESIZE_BORDER) != 0) + else { - func |= GDK_FUNC_RESIZE; - decor |= GDK_DECOR_RESIZEH; + /* All this is for Motif Window Manager "hints" and is supposed to be + recognized by other WM as well. Not tested. */ + long decor = (long) GDK_DECOR_BORDER; + long func = (long) GDK_FUNC_MOVE; + + if ((win->GetWindowStyle() & wxCAPTION) != 0) + decor |= GDK_DECOR_TITLE; + if ((win->GetWindowStyle() & wxSYSTEM_MENU) != 0) + { + decor |= GDK_DECOR_MENU; + func |= GDK_FUNC_CLOSE; + } + if ((win->GetWindowStyle() & wxMINIMIZE_BOX) != 0) + { + func |= GDK_FUNC_MINIMIZE; + decor |= GDK_DECOR_MINIMIZE; + } + if ((win->GetWindowStyle() & wxMAXIMIZE_BOX) != 0) + { + func |= GDK_FUNC_MAXIMIZE; + decor |= GDK_DECOR_MAXIMIZE; + } + if ((win->GetWindowStyle() & wxRESIZE_BORDER) != 0) + { + func |= GDK_FUNC_RESIZE; + decor |= GDK_DECOR_RESIZEH; + } + + gdk_window_set_decorations( win->m_widget->window, (GdkWMDecoration)decor); + gdk_window_set_functions( win->m_widget->window, (GdkWMFunction)func); } - gdk_window_set_decorations( win->m_widget->window, (GdkWMDecoration)decor); - gdk_window_set_functions( win->m_widget->window, (GdkWMFunction)func); - /* GTK's shrinking/growing policy */ if ((win->GetWindowStyle() & wxRESIZE_BORDER) == 0) gtk_window_set_policy(GTK_WINDOW(win->m_widget), 0, 0, 1); diff --git a/src/gtk1/minifram.cpp b/src/gtk1/minifram.cpp index 7b0c2ad433..49de6bc095 100644 --- a/src/gtk1/minifram.cpp +++ b/src/gtk1/minifram.cpp @@ -303,7 +303,7 @@ bool wxMiniFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title const wxPoint &pos, const wxSize &size, long style, const wxString &name ) { - style = style | wxSIMPLE_BORDER; +// style = style | wxSIMPLE_BORDER; style = style | wxCAPTION; if ((style & wxCAPTION) || (style & wxTINY_CAPTION_HORIZ) || (style & wxTINY_CAPTION_VERT)) -- 2.45.2