From 80629c8bf6da26587a0f96bc37f3add34a912326 Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Thu, 16 Mar 2000 20:41:27 +0000 Subject: [PATCH] Next take at getting mini-frames even with Life! to work... git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@6774 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- docs/latex/wx/frame.tex | 2 +- src/gtk/frame.cpp | 8 +++++--- src/gtk/minifram.cpp | 6 +----- src/gtk1/frame.cpp | 8 +++++--- src/gtk1/minifram.cpp | 6 +----- 5 files changed, 13 insertions(+), 17 deletions(-) diff --git a/docs/latex/wx/frame.tex b/docs/latex/wx/frame.tex index b775220626..e6ec525ca4 100644 --- a/docs/latex/wx/frame.tex +++ b/docs/latex/wx/frame.tex @@ -38,7 +38,7 @@ application windows. \twocolitem{\windowstyle{wxRESIZE\_BORDER}}{Displays a resizeable border around the window (Unix only).} \twocolitem{\windowstyle{wxFRAME\_FLOAT\_ON\_PARENT}}{Causes the frame to be above the parent window in the z-order and not shown in the taskbar. Without this style, frames are created as top-level windows that may be obscured by -the parent window, and frame titles are shown in the taskbar. Windows only. } +the parent window, and frame titles are shown in the taskbar. Windows and GTK. } \twocolitem{\windowstyle{wxFRAME\_TOOL\_WINDOW}}{Causes a frame with a small titlebar to be created; the frame title does not appear in the taskbar. Windows only. } \end{twocollist} diff --git a/src/gtk/frame.cpp b/src/gtk/frame.cpp index a5e3a916d9..6f7ffa47a8 100644 --- a/src/gtk/frame.cpp +++ b/src/gtk/frame.cpp @@ -253,9 +253,9 @@ gtk_frame_realized_callback( GtkWidget *widget, wxFrame *win ) position in "realize" */ gtk_widget_set_uposition( widget, win->m_x, win->m_y ); - if (win->m_miniEdge > 0) + if ((win->m_miniEdge > 0) || (win->HasFlag(wxSIMPLE_BORDER))) { - /* This is a mini-frame. */ + /* This is a mini-frame or a borderless frame. */ gdk_window_set_decorations( win->m_widget->window, (GdkWMDecoration)0 ); gdk_window_set_functions( win->m_widget->window, (GdkWMFunction)0 ); } @@ -440,10 +440,12 @@ bool wxFrame::Create( wxWindow *parent, m_insertCallback = (wxInsertChildFunction) wxInsertChildInFrame; GtkWindowType win_type = GTK_WINDOW_TOPLEVEL; - if (style & wxSIMPLE_BORDER) win_type = GTK_WINDOW_POPUP; m_widget = gtk_window_new( win_type ); + if ((m_parent) && (HasFlag(wxFRAME_FLOAT_ON_PARENT)) && (GTK_IS_WINDOW(m_parent->m_widget))) + gtk_window_set_transient_for( GTK_WINDOW(m_widget), GTK_WINDOW(m_parent->m_widget) ); + if (!name.IsEmpty()) gtk_window_set_wmclass( GTK_WINDOW(m_widget), name.mb_str(), name.mb_str() ); diff --git a/src/gtk/minifram.cpp b/src/gtk/minifram.cpp index 49de6bc095..4a48fe1ecf 100644 --- a/src/gtk/minifram.cpp +++ b/src/gtk/minifram.cpp @@ -303,8 +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 | wxCAPTION; + style = style | wxCAPTION | wxFRAME_FLOAT_ON_PARENT; if ((style & wxCAPTION) || (style & wxTINY_CAPTION_HORIZ) || (style & wxTINY_CAPTION_VERT)) m_miniTitle = 13; @@ -318,9 +317,6 @@ 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/frame.cpp b/src/gtk1/frame.cpp index a5e3a916d9..6f7ffa47a8 100644 --- a/src/gtk1/frame.cpp +++ b/src/gtk1/frame.cpp @@ -253,9 +253,9 @@ gtk_frame_realized_callback( GtkWidget *widget, wxFrame *win ) position in "realize" */ gtk_widget_set_uposition( widget, win->m_x, win->m_y ); - if (win->m_miniEdge > 0) + if ((win->m_miniEdge > 0) || (win->HasFlag(wxSIMPLE_BORDER))) { - /* This is a mini-frame. */ + /* This is a mini-frame or a borderless frame. */ gdk_window_set_decorations( win->m_widget->window, (GdkWMDecoration)0 ); gdk_window_set_functions( win->m_widget->window, (GdkWMFunction)0 ); } @@ -440,10 +440,12 @@ bool wxFrame::Create( wxWindow *parent, m_insertCallback = (wxInsertChildFunction) wxInsertChildInFrame; GtkWindowType win_type = GTK_WINDOW_TOPLEVEL; - if (style & wxSIMPLE_BORDER) win_type = GTK_WINDOW_POPUP; m_widget = gtk_window_new( win_type ); + if ((m_parent) && (HasFlag(wxFRAME_FLOAT_ON_PARENT)) && (GTK_IS_WINDOW(m_parent->m_widget))) + gtk_window_set_transient_for( GTK_WINDOW(m_widget), GTK_WINDOW(m_parent->m_widget) ); + if (!name.IsEmpty()) gtk_window_set_wmclass( GTK_WINDOW(m_widget), name.mb_str(), name.mb_str() ); diff --git a/src/gtk1/minifram.cpp b/src/gtk1/minifram.cpp index 49de6bc095..4a48fe1ecf 100644 --- a/src/gtk1/minifram.cpp +++ b/src/gtk1/minifram.cpp @@ -303,8 +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 | wxCAPTION; + style = style | wxCAPTION | wxFRAME_FLOAT_ON_PARENT; if ((style & wxCAPTION) || (style & wxTINY_CAPTION_HORIZ) || (style & wxTINY_CAPTION_VERT)) m_miniTitle = 13; @@ -318,9 +317,6 @@ 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))) { -- 2.45.2