Modified WM hints handling which should be much better now.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2347 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Karsten Ballüder
1999-05-05 21:16:16 +00:00
parent 08fc17448a
commit aa64626e23
7 changed files with 82 additions and 49 deletions

View File

@@ -388,7 +388,7 @@ typedef void (*wxFunction) (wxObject&, wxEvent&);
#define wxMINIMIZE wxICONIZE #define wxMINIMIZE wxICONIZE
#define wxMAXIMIZE 0x2000 #define wxMAXIMIZE 0x2000
#define wxTHICK_FRAME 0x1000 #define wxTHICK_FRAME 0x1000
#define wxSYSTEM_MENU 0x0800 #define wxSYSTEM_MENU 0x0800
#define wxMINIMIZE_BOX 0x0400 #define wxMINIMIZE_BOX 0x0400
#define wxMAXIMIZE_BOX 0x0200 #define wxMAXIMIZE_BOX 0x0200
#define wxTINY_CAPTION_HORIZ 0x0100 #define wxTINY_CAPTION_HORIZ 0x0100
@@ -400,13 +400,21 @@ typedef void (*wxFunction) (wxObject&, wxEvent&);
/* Add for normal Windows frame behaviour */ /* Add for normal Windows frame behaviour */
#define wxFRAME_FLOAT_ON_PARENT 0x0020 #define wxFRAME_FLOAT_ON_PARENT 0x0020
#define wxDEFAULT_FRAME_STYLE (wxRESIZE_BORDER | wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN)
#if WXWIN_COMPATIBILITY #if WXWIN_COMPATIBILITY
#define wxDEFAULT_FRAME wxDEFAULT_FRAME_STYLE #define wxDEFAULT_FRAME wxDEFAULT_FRAME_STYLE
#endif #endif
#define wxDEFAULT_DIALOG_STYLE (wxSYSTEM_MENU|wxCAPTION|wxTHICK_FRAME) #define wxDEFAULT_FRAME_STYLE (wxSYSTEM_MENU|wxRESIZE_BORDER | wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxTHICK_FRAME | wxSYSTEM_MENU | wxCAPTION | wxCLIP_CHILDREN)
#ifdef __WXMSW__
# define wxDEFAULT_DIALOG_STYLE (wxSYSTEM_MENU|wxCAPTION|wxTHICK_FRAME)
#else
// Under Unix, the dialogs don't have a system menu. Specifying
// wxSYSTEM_MENU here, will make a close button appear.
# define wxDEFAULT_DIALOG_STYLE (wxCAPTION)
#endif
/* /*
* Subwindow style flags * Subwindow style flags

View File

@@ -189,7 +189,6 @@ void MyFrame::ChooseFontGeneric(wxCommandEvent& WXUNUSED(event) )
void MyFrame::MessageBox(wxCommandEvent& WXUNUSED(event) ) void MyFrame::MessageBox(wxCommandEvent& WXUNUSED(event) )
{ {
#if 0
wxMessageDialog dialog(NULL, "This is a message box\nA long, long string to test out the message box properly", wxMessageDialog dialog(NULL, "This is a message box\nA long, long string to test out the message box properly",
"Message box text", wxYES_NO|wxCANCEL); "Message box text", wxYES_NO|wxCANCEL);
@@ -197,10 +196,6 @@ void MyFrame::MessageBox(wxCommandEvent& WXUNUSED(event) )
::wxMessageBox("MsgBox with a really long long string", ::wxMessageBox("MsgBox with a really long long string",
"this is the text", wxYES_NO|wxICON_EXCLAMATION); "this is the text", wxYES_NO|wxICON_EXCLAMATION);
#endif
::wxMessageBox("Short",
"This is the text", wxYES_NO|wxICON_EXCLAMATION);
} }
void MyFrame::TextEntry(wxCommandEvent& WXUNUSED(event) ) void MyFrame::TextEntry(wxCommandEvent& WXUNUSED(event) )

View File

@@ -87,7 +87,7 @@ IMPLEMENT_CLASS(wxGenericMessageDialog, wxDialog)
wxGenericMessageDialog::wxGenericMessageDialog( wxWindow *parent, const wxString& message, wxGenericMessageDialog::wxGenericMessageDialog( wxWindow *parent, const wxString& message,
const wxString& caption, long style, const wxPoint& pos) : const wxString& caption, long style, const wxPoint& pos) :
wxDialog( parent, -1, caption, pos, wxDefaultSize ) wxDialog( parent, -1, caption, pos, wxDefaultSize, wxDEFAULT_DIALOG_STYLE )
{ {
m_dialogStyle = style; m_dialogStyle = style;

View File

@@ -133,26 +133,31 @@ gtk_dialog_map_callback( GtkWidget *widget, wxDialog *win )
/* all this is for Motif Window Manager "hints" and is supposed to be /* all this is for Motif Window Manager "hints" and is supposed to be
recognized by other WM as well. not tested. */ recognized by other WM as well. not tested. */
long decor = (long) GDK_DECOR_ALL; long decor = (long) GDK_DECOR_BORDER ;
long func = (long) GDK_FUNC_ALL; long func = (long) GDK_FUNC_MOVE ;
if ((win->m_windowStyle & wxCAPTION) == 0) if ((win->m_windowStyle & wxCAPTION) != 0)
decor |= GDK_DECOR_TITLE; decor |= GDK_DECOR_TITLE;
if ((win->m_windowStyle & wxSYSTEM_MENU) == 0) if ((win->m_windowStyle & wxSYSTEM_MENU) != 0)
decor |= GDK_DECOR_MENU; {
if ((win->m_windowStyle & wxMINIMIZE_BOX) == 0) decor |= GDK_DECOR_MENU;
func |= GDK_FUNC_CLOSE;
}
if ((win->m_windowStyle & wxMINIMIZE_BOX) != 0)
{ {
func |= GDK_FUNC_MINIMIZE; func |= GDK_FUNC_MINIMIZE;
decor |= GDK_DECOR_MINIMIZE; decor |= GDK_DECOR_MINIMIZE;
} }
if ((win->m_windowStyle & wxMAXIMIZE_BOX) == 0) if ((win->m_windowStyle & wxMAXIMIZE_BOX) != 0)
{ {
decor |= GDK_DECOR_MAXIMIZE; decor |= GDK_DECOR_MAXIMIZE;
func |= GDK_FUNC_MAXIMIZE; func |= GDK_FUNC_MAXIMIZE;
} }
if ((win->m_windowStyle & wxRESIZE_BORDER) == 0) if ((win->m_windowStyle & wxRESIZE_BORDER) != 0)
func |= GDK_FUNC_RESIZE; {
func |= GDK_FUNC_RESIZE;
decor |= GDK_DECOR_RESIZEH;
}
gdk_window_set_decorations( win->m_widget->window, (GdkWMDecoration)decor); gdk_window_set_decorations( win->m_widget->window, (GdkWMDecoration)decor);
gdk_window_set_functions( win->m_widget->window, (GdkWMFunction)func); gdk_window_set_functions( win->m_widget->window, (GdkWMFunction)func);

View File

@@ -191,26 +191,36 @@ gtk_frame_realized_callback( GtkWidget *widget, wxFrame *win )
/* all this is for Motif Window Manager "hints" and is supposed to be /* all this is for Motif Window Manager "hints" and is supposed to be
recognized by other WM as well. not tested. */ recognized by other WM as well. not tested. */
long decor = (long) GDK_DECOR_ALL; long decor = (long) 0;
long func = (long) GDK_FUNC_ALL; long func = (long) GDK_FUNC_MOVE|GDK_FUNC_CLOSE;
if ((win->m_windowStyle & wxCAPTION) == 0) if ((win->m_windowStyle & wxCAPTION) != 0)
decor |= GDK_DECOR_TITLE; decor |= GDK_DECOR_TITLE;
if ((win->m_windowStyle & wxSYSTEM_MENU) == 0) if ((win->m_windowStyle & wxSYSTEM_MENU) != 0)
decor |= GDK_DECOR_MENU; {
if ((win->m_windowStyle & wxMINIMIZE_BOX) == 0) decor |= GDK_DECOR_MENU;
func |= GDK_FUNC_CLOSE;
}
if ((win->m_windowStyle & wxMINIMIZE_BOX) != 0)
{ {
func |= GDK_FUNC_MINIMIZE; func |= GDK_FUNC_MINIMIZE;
decor |= GDK_DECOR_MINIMIZE; decor |= GDK_DECOR_MINIMIZE;
decor |= GDK_DECOR_BORDER;
} }
if ((win->m_windowStyle & wxMAXIMIZE_BOX) == 0) if ((win->m_windowStyle & wxMAXIMIZE_BOX) != 0)
{ {
func |= GDK_FUNC_MAXIMIZE; func |= GDK_FUNC_MAXIMIZE;
decor |= GDK_DECOR_MAXIMIZE; decor |= GDK_DECOR_MAXIMIZE;
decor |= GDK_DECOR_BORDER;
} }
if ((win->m_windowStyle & wxRESIZE_BORDER) == 0) if ((win->m_windowStyle & wxRESIZE_BORDER) != 0)
func |= GDK_FUNC_RESIZE; {
func |= GDK_FUNC_RESIZE;
decor |= GDK_DECOR_RESIZEH;
decor |= GDK_DECOR_BORDER;
}
gdk_window_set_decorations( win->m_widget->window, (GdkWMDecoration)decor); gdk_window_set_decorations( win->m_widget->window, (GdkWMDecoration)decor);
gdk_window_set_functions( win->m_widget->window, (GdkWMFunction)func); gdk_window_set_functions( win->m_widget->window, (GdkWMFunction)func);

View File

@@ -133,26 +133,31 @@ gtk_dialog_map_callback( GtkWidget *widget, wxDialog *win )
/* all this is for Motif Window Manager "hints" and is supposed to be /* all this is for Motif Window Manager "hints" and is supposed to be
recognized by other WM as well. not tested. */ recognized by other WM as well. not tested. */
long decor = (long) GDK_DECOR_ALL; long decor = (long) GDK_DECOR_BORDER ;
long func = (long) GDK_FUNC_ALL; long func = (long) GDK_FUNC_MOVE ;
if ((win->m_windowStyle & wxCAPTION) == 0) if ((win->m_windowStyle & wxCAPTION) != 0)
decor |= GDK_DECOR_TITLE; decor |= GDK_DECOR_TITLE;
if ((win->m_windowStyle & wxSYSTEM_MENU) == 0) if ((win->m_windowStyle & wxSYSTEM_MENU) != 0)
decor |= GDK_DECOR_MENU; {
if ((win->m_windowStyle & wxMINIMIZE_BOX) == 0) decor |= GDK_DECOR_MENU;
func |= GDK_FUNC_CLOSE;
}
if ((win->m_windowStyle & wxMINIMIZE_BOX) != 0)
{ {
func |= GDK_FUNC_MINIMIZE; func |= GDK_FUNC_MINIMIZE;
decor |= GDK_DECOR_MINIMIZE; decor |= GDK_DECOR_MINIMIZE;
} }
if ((win->m_windowStyle & wxMAXIMIZE_BOX) == 0) if ((win->m_windowStyle & wxMAXIMIZE_BOX) != 0)
{ {
decor |= GDK_DECOR_MAXIMIZE; decor |= GDK_DECOR_MAXIMIZE;
func |= GDK_FUNC_MAXIMIZE; func |= GDK_FUNC_MAXIMIZE;
} }
if ((win->m_windowStyle & wxRESIZE_BORDER) == 0) if ((win->m_windowStyle & wxRESIZE_BORDER) != 0)
func |= GDK_FUNC_RESIZE; {
func |= GDK_FUNC_RESIZE;
decor |= GDK_DECOR_RESIZEH;
}
gdk_window_set_decorations( win->m_widget->window, (GdkWMDecoration)decor); gdk_window_set_decorations( win->m_widget->window, (GdkWMDecoration)decor);
gdk_window_set_functions( win->m_widget->window, (GdkWMFunction)func); gdk_window_set_functions( win->m_widget->window, (GdkWMFunction)func);

View File

@@ -191,26 +191,36 @@ gtk_frame_realized_callback( GtkWidget *widget, wxFrame *win )
/* all this is for Motif Window Manager "hints" and is supposed to be /* all this is for Motif Window Manager "hints" and is supposed to be
recognized by other WM as well. not tested. */ recognized by other WM as well. not tested. */
long decor = (long) GDK_DECOR_ALL; long decor = (long) 0;
long func = (long) GDK_FUNC_ALL; long func = (long) GDK_FUNC_MOVE|GDK_FUNC_CLOSE;
if ((win->m_windowStyle & wxCAPTION) == 0) if ((win->m_windowStyle & wxCAPTION) != 0)
decor |= GDK_DECOR_TITLE; decor |= GDK_DECOR_TITLE;
if ((win->m_windowStyle & wxSYSTEM_MENU) == 0) if ((win->m_windowStyle & wxSYSTEM_MENU) != 0)
decor |= GDK_DECOR_MENU; {
if ((win->m_windowStyle & wxMINIMIZE_BOX) == 0) decor |= GDK_DECOR_MENU;
func |= GDK_FUNC_CLOSE;
}
if ((win->m_windowStyle & wxMINIMIZE_BOX) != 0)
{ {
func |= GDK_FUNC_MINIMIZE; func |= GDK_FUNC_MINIMIZE;
decor |= GDK_DECOR_MINIMIZE; decor |= GDK_DECOR_MINIMIZE;
decor |= GDK_DECOR_BORDER;
} }
if ((win->m_windowStyle & wxMAXIMIZE_BOX) == 0) if ((win->m_windowStyle & wxMAXIMIZE_BOX) != 0)
{ {
func |= GDK_FUNC_MAXIMIZE; func |= GDK_FUNC_MAXIMIZE;
decor |= GDK_DECOR_MAXIMIZE; decor |= GDK_DECOR_MAXIMIZE;
decor |= GDK_DECOR_BORDER;
} }
if ((win->m_windowStyle & wxRESIZE_BORDER) == 0) if ((win->m_windowStyle & wxRESIZE_BORDER) != 0)
func |= GDK_FUNC_RESIZE; {
func |= GDK_FUNC_RESIZE;
decor |= GDK_DECOR_RESIZEH;
decor |= GDK_DECOR_BORDER;
}
gdk_window_set_decorations( win->m_widget->window, (GdkWMDecoration)decor); gdk_window_set_decorations( win->m_widget->window, (GdkWMDecoration)decor);
gdk_window_set_functions( win->m_widget->window, (GdkWMFunction)func); gdk_window_set_functions( win->m_widget->window, (GdkWMFunction)func);