#define wxMINIMIZE wxICONIZE
#define wxMAXIMIZE 0x2000
#define wxTHICK_FRAME 0x1000
-#define wxSYSTEM_MENU 0x0800
+#define wxSYSTEM_MENU 0x0800
#define wxMINIMIZE_BOX 0x0400
#define wxMAXIMIZE_BOX 0x0200
#define wxTINY_CAPTION_HORIZ 0x0100
/* Add for normal Windows frame behaviour */
#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
#define wxDEFAULT_FRAME wxDEFAULT_FRAME_STYLE
#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
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",
"Message box text", wxYES_NO|wxCANCEL);
::wxMessageBox("MsgBox with a really long long string",
"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) )
wxGenericMessageDialog::wxGenericMessageDialog( wxWindow *parent, const wxString& message,
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;
/* 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_ALL;
- long func = (long) GDK_FUNC_ALL;
+ long decor = (long) GDK_DECOR_BORDER ;
+ long func = (long) GDK_FUNC_MOVE ;
- if ((win->m_windowStyle & wxCAPTION) == 0)
+ if ((win->m_windowStyle & wxCAPTION) != 0)
decor |= GDK_DECOR_TITLE;
- if ((win->m_windowStyle & wxSYSTEM_MENU) == 0)
- decor |= GDK_DECOR_MENU;
- if ((win->m_windowStyle & wxMINIMIZE_BOX) == 0)
+ if ((win->m_windowStyle & wxSYSTEM_MENU) != 0)
+ {
+ decor |= GDK_DECOR_MENU;
+ func |= GDK_FUNC_CLOSE;
+ }
+ if ((win->m_windowStyle & wxMINIMIZE_BOX) != 0)
{
func |= GDK_FUNC_MINIMIZE;
decor |= GDK_DECOR_MINIMIZE;
}
- if ((win->m_windowStyle & wxMAXIMIZE_BOX) == 0)
+ if ((win->m_windowStyle & wxMAXIMIZE_BOX) != 0)
{
decor |= GDK_DECOR_MAXIMIZE;
func |= GDK_FUNC_MAXIMIZE;
}
- if ((win->m_windowStyle & wxRESIZE_BORDER) == 0)
- func |= GDK_FUNC_RESIZE;
-
+ if ((win->m_windowStyle & 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);
/* 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_ALL;
- long func = (long) GDK_FUNC_ALL;
+ long decor = (long) 0;
+ 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;
- if ((win->m_windowStyle & wxSYSTEM_MENU) == 0)
- decor |= GDK_DECOR_MENU;
- if ((win->m_windowStyle & wxMINIMIZE_BOX) == 0)
+ if ((win->m_windowStyle & wxSYSTEM_MENU) != 0)
+ {
+ decor |= GDK_DECOR_MENU;
+ func |= GDK_FUNC_CLOSE;
+ }
+ if ((win->m_windowStyle & wxMINIMIZE_BOX) != 0)
{
func |= GDK_FUNC_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;
decor |= GDK_DECOR_MAXIMIZE;
+ decor |= GDK_DECOR_BORDER;
}
- if ((win->m_windowStyle & wxRESIZE_BORDER) == 0)
- func |= GDK_FUNC_RESIZE;
-
+ if ((win->m_windowStyle & wxRESIZE_BORDER) != 0)
+ {
+ 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_functions( win->m_widget->window, (GdkWMFunction)func);
/* 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_ALL;
- long func = (long) GDK_FUNC_ALL;
+ long decor = (long) GDK_DECOR_BORDER ;
+ long func = (long) GDK_FUNC_MOVE ;
- if ((win->m_windowStyle & wxCAPTION) == 0)
+ if ((win->m_windowStyle & wxCAPTION) != 0)
decor |= GDK_DECOR_TITLE;
- if ((win->m_windowStyle & wxSYSTEM_MENU) == 0)
- decor |= GDK_DECOR_MENU;
- if ((win->m_windowStyle & wxMINIMIZE_BOX) == 0)
+ if ((win->m_windowStyle & wxSYSTEM_MENU) != 0)
+ {
+ decor |= GDK_DECOR_MENU;
+ func |= GDK_FUNC_CLOSE;
+ }
+ if ((win->m_windowStyle & wxMINIMIZE_BOX) != 0)
{
func |= GDK_FUNC_MINIMIZE;
decor |= GDK_DECOR_MINIMIZE;
}
- if ((win->m_windowStyle & wxMAXIMIZE_BOX) == 0)
+ if ((win->m_windowStyle & wxMAXIMIZE_BOX) != 0)
{
decor |= GDK_DECOR_MAXIMIZE;
func |= GDK_FUNC_MAXIMIZE;
}
- if ((win->m_windowStyle & wxRESIZE_BORDER) == 0)
- func |= GDK_FUNC_RESIZE;
-
+ if ((win->m_windowStyle & 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);
/* 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_ALL;
- long func = (long) GDK_FUNC_ALL;
+ long decor = (long) 0;
+ 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;
- if ((win->m_windowStyle & wxSYSTEM_MENU) == 0)
- decor |= GDK_DECOR_MENU;
- if ((win->m_windowStyle & wxMINIMIZE_BOX) == 0)
+ if ((win->m_windowStyle & wxSYSTEM_MENU) != 0)
+ {
+ decor |= GDK_DECOR_MENU;
+ func |= GDK_FUNC_CLOSE;
+ }
+ if ((win->m_windowStyle & wxMINIMIZE_BOX) != 0)
{
func |= GDK_FUNC_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;
decor |= GDK_DECOR_MAXIMIZE;
+ decor |= GDK_DECOR_BORDER;
}
- if ((win->m_windowStyle & wxRESIZE_BORDER) == 0)
- func |= GDK_FUNC_RESIZE;
-
+ if ((win->m_windowStyle & wxRESIZE_BORDER) != 0)
+ {
+ 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_functions( win->m_widget->window, (GdkWMFunction)func);