From 7282b0678a879077a109495cb3cd20b28ea9cf45 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin <vadim@wxwidgets.org> Date: Mon, 10 May 2010 21:09:57 +0000 Subject: [PATCH] Replace wxTINY_CAPTION_{HORIZ,VERT} with a single wxTINY_CAPTION. These two styles were always equivalent so we can just as well replace them with a single one and stop wasting an extra bit. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@64279 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/gtk1/minifram.h | 4 ++-- include/wx/motif/minifram.h | 2 +- include/wx/osx/minifram.h | 2 +- include/wx/toplevel.h | 13 ++++++++++--- include/wx/x11/minifram.h | 2 +- interface/wx/minifram.h | 4 ---- src/gtk1/minifram.cpp | 10 ++++------ src/motif/toplevel.cpp | 3 +-- src/msw/toplevel.cpp | 2 +- src/os2/toplevel.cpp | 4 +--- src/osx/carbon/nonownedwnd.cpp | 4 ++-- src/x11/toplevel.cpp | 3 +-- 12 files changed, 25 insertions(+), 28 deletions(-) diff --git a/include/wx/gtk1/minifram.h b/include/wx/gtk1/minifram.h index 122d4f74c2..394bb49529 100644 --- a/include/wx/gtk1/minifram.h +++ b/include/wx/gtk1/minifram.h @@ -38,7 +38,7 @@ public: const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE | wxTINY_CAPTION_HORIZ, + long style = wxDEFAULT_FRAME_STYLE | wxTINY_CAPTION, const wxString& name = wxFrameNameStr) { Create(parent, id, title, pos, size, style, name); @@ -49,7 +49,7 @@ public: const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE | wxTINY_CAPTION_HORIZ, + long style = wxDEFAULT_FRAME_STYLE | wxTINY_CAPTION, const wxString& name = wxFrameNameStr); virtual void SetTitle( const wxString &title ); diff --git a/include/wx/motif/minifram.h b/include/wx/motif/minifram.h index 1ee9fcc9ec..c8ff834b69 100644 --- a/include/wx/motif/minifram.h +++ b/include/wx/motif/minifram.h @@ -27,7 +27,7 @@ public: const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE|wxTINY_CAPTION_HORIZ, + long style = wxDEFAULT_FRAME_STYLE|wxTINY_CAPTION, const wxString& name = wxFrameNameStr) { // Use wxFrame constructor in absence of more specific code. diff --git a/include/wx/osx/minifram.h b/include/wx/osx/minifram.h index ba00ddd1a4..a71887c579 100644 --- a/include/wx/osx/minifram.h +++ b/include/wx/osx/minifram.h @@ -27,7 +27,7 @@ public: const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxCAPTION | wxRESIZE_BORDER | wxTINY_CAPTION_HORIZ, + long style = wxCAPTION | wxRESIZE_BORDER | wxTINY_CAPTION, const wxString& name = wxFrameNameStr) { // Use wxFrame constructor in absence of more specific code. diff --git a/include/wx/toplevel.h b/include/wx/toplevel.h index 99e7a99345..b70a6466a7 100644 --- a/include/wx/toplevel.h +++ b/include/wx/toplevel.h @@ -48,7 +48,7 @@ class WXDLLIMPEXP_FWD_CORE wxTopLevelWindowBase; | | | | | | | | | | \________________ | | | | | | | | | \___________________ wxRESIZE_BORDER | | | | | | | | \______________________ wxTINY_CAPTION_VERT - | | | | | | | \_________________________ wxTINY_CAPTION_HORIZ + | | | | | | | \_________________________ | | | | | | \____________________________ wxMAXIMIZE_BOX | | | | | \_______________________________ wxMINIMIZE_BOX | | | | \__________________________________ wxSYSTEM_MENU @@ -74,10 +74,17 @@ class WXDLLIMPEXP_FWD_CORE wxTopLevelWindowBase; #define wxSYSTEM_MENU 0x0800 #define wxMINIMIZE_BOX 0x0400 #define wxMAXIMIZE_BOX 0x0200 -#define wxTINY_CAPTION_HORIZ 0x0100 -#define wxTINY_CAPTION_VERT 0x0080 + +#define wxTINY_CAPTION 0x0080 // clashes with wxNO_DEFAULT #define wxRESIZE_BORDER 0x0040 +#if WXWIN_COMPATIBILITY_2_8 + // HORIZ and VERT styles are equivalent anyhow so don't use different names + // for them + #define wxTINY_CAPTION_HORIZ wxTINY_CAPTION + #define wxTINY_CAPTION_VERT wxTINY_CAPTION +#endif + #if WXWIN_COMPATIBILITY_2_6 // deprecated versions defined for compatibility reasons diff --git a/include/wx/x11/minifram.h b/include/wx/x11/minifram.h index 551a5813a2..63494971c9 100644 --- a/include/wx/x11/minifram.h +++ b/include/wx/x11/minifram.h @@ -27,7 +27,7 @@ public: const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, - long style = wxDEFAULT_FRAME_STYLE|wxTINY_CAPTION_HORIZ, + long style = wxDEFAULT_FRAME_STYLE|wxTINY_CAPTION, const wxString& name = wxFrameNameStr) { // Use wxFrame constructor in absence of more specific code. diff --git a/interface/wx/minifram.h b/interface/wx/minifram.h index f9e621d723..34098bc593 100644 --- a/interface/wx/minifram.h +++ b/interface/wx/minifram.h @@ -34,10 +34,6 @@ Stay on top of other windows (Windows only). @style{wxSYSTEM_MENU} Displays a system menu (Windows and Motif only). - @style{wxTINY_CAPTION_HORIZ} - This style is obsolete and not used any longer. - @style{wxTINY_CAPTION_VERT} - This style is obsolete and not used any longer. @style{wxRESIZE_BORDER} Displays a resizeable border around the window. @endStyleTable diff --git a/src/gtk1/minifram.cpp b/src/gtk1/minifram.cpp index 7f24e602ee..9014e2cd50 100644 --- a/src/gtk1/minifram.cpp +++ b/src/gtk1/minifram.cpp @@ -88,8 +88,7 @@ static void gtk_window_own_expose_callback( GtkWidget *widget, GdkEventExpose *g if (!win->GetTitle().empty() && ((win->GetWindowStyle() & wxCAPTION) || - (win->GetWindowStyle() & wxTINY_CAPTION_HORIZ) || - (win->GetWindowStyle() & wxTINY_CAPTION_VERT))) + (win->GetWindowStyle() & wxTINY_CAPTION))) { wxClientDC dc(win); dc.SetFont( *wxSMALL_FONT ); @@ -134,8 +133,7 @@ static void gtk_window_own_draw_callback( GtkWidget *widget, GdkRectangle *WXUNU if (!win->GetTitle().empty() && ((win->GetWindowStyle() & wxCAPTION) || - (win->GetWindowStyle() & wxTINY_CAPTION_HORIZ) || - (win->GetWindowStyle() & wxTINY_CAPTION_VERT))) + (win->GetWindowStyle() & wxTINY_CAPTION))) { wxClientDC dc(win); dc.SetFont( *wxSMALL_FONT ); @@ -330,7 +328,7 @@ bool wxMiniFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title { style = style | wxCAPTION; - if ((style & wxCAPTION) || (style & wxTINY_CAPTION_HORIZ) || (style & wxTINY_CAPTION_VERT)) + if ((style & wxCAPTION) || (style & wxTINY_CAPTION)) m_miniTitle = 13; m_miniEdge = 3; @@ -348,7 +346,7 @@ bool wxMiniFrame::Create( wxWindow *parent, wxWindowID id, const wxString &title } if ((style & wxSYSTEM_MENU) && - ((style & wxCAPTION) || (style & wxTINY_CAPTION_HORIZ) || (style & wxTINY_CAPTION_VERT))) + ((style & wxCAPTION) || (style & wxTINY_CAPTION))) { GdkBitmap *mask = NULL; GdkPixmap *pixmap = gdk_pixmap_create_from_xpm_d diff --git a/src/motif/toplevel.cpp b/src/motif/toplevel.cpp index 4f219ee426..ec58a6fa71 100644 --- a/src/motif/toplevel.cpp +++ b/src/motif/toplevel.cpp @@ -153,8 +153,7 @@ bool wxTopLevelWindowMotif::Create( wxWindow *parent, wxWindowID id, if( m_windowStyle & wxSYSTEM_MENU ) decor |= MWM_DECOR_MENU; if( ( m_windowStyle & wxCAPTION ) || - ( m_windowStyle & wxTINY_CAPTION_HORIZ ) || - ( m_windowStyle & wxTINY_CAPTION_VERT ) ) + ( m_windowStyle & wxTINY_CAPTION) ) decor |= MWM_DECOR_TITLE; if( m_windowStyle & wxRESIZE_BORDER ) decor |= MWM_DECOR_BORDER; diff --git a/src/msw/toplevel.cpp b/src/msw/toplevel.cpp index 88cc5dc683..a61f3336a7 100644 --- a/src/msw/toplevel.cpp +++ b/src/msw/toplevel.cpp @@ -225,7 +225,7 @@ WXDWORD wxTopLevelWindowMSW::MSWGetStyle(long style, WXDWORD *exflags) const msflags |= WS_MAXIMIZE; // Keep this here because it saves recoding this function in wxTinyFrame - if ( style & (wxTINY_CAPTION_VERT | wxTINY_CAPTION_HORIZ) ) + if ( style & wxTINY_CAPTION ) msflags |= WS_CAPTION; if ( exflags ) diff --git a/src/os2/toplevel.cpp b/src/os2/toplevel.cpp index cdde443bac..e5623cd6f3 100644 --- a/src/os2/toplevel.cpp +++ b/src/os2/toplevel.cpp @@ -246,9 +246,7 @@ WXDWORD wxTopLevelWindowOS2::OS2GetStyle( // Invalid for frame windows under PM } - if (lStyle & wxTINY_CAPTION_VERT) - lMsflags |= FCF_TASKLIST; - if (lStyle & wxTINY_CAPTION_HORIZ) + if (lStyle & wxTINY_CAPTION) lMsflags |= FCF_TASKLIST; if ((lStyle & wxRESIZE_BORDER) == 0) diff --git a/src/osx/carbon/nonownedwnd.cpp b/src/osx/carbon/nonownedwnd.cpp index d5b1f74570..2a44f32486 100644 --- a/src/osx/carbon/nonownedwnd.cpp +++ b/src/osx/carbon/nonownedwnd.cpp @@ -1229,7 +1229,7 @@ void wxNonOwnedWindowCarbonImpl::Create( if ( ( style & wxMINIMIZE_BOX ) || ( style & wxMAXIMIZE_BOX ) || ( style & wxSYSTEM_MENU ) || ( style & wxCAPTION ) || - ( style &wxTINY_CAPTION_HORIZ) || ( style &wxTINY_CAPTION_VERT) + ( style & wxTINY_CAPTION) ) { if ( ( style & wxSTAY_ON_TOP ) ) @@ -1237,7 +1237,7 @@ void wxNonOwnedWindowCarbonImpl::Create( else wclass = kFloatingWindowClass ; - if ( ( style &wxTINY_CAPTION_VERT) ) + if ( ( style & wxTINY_CAPTION) ) attr |= kWindowSideTitlebarAttribute ; } else diff --git a/src/x11/toplevel.cpp b/src/x11/toplevel.cpp index 14525801b3..f92651ed70 100644 --- a/src/x11/toplevel.cpp +++ b/src/x11/toplevel.cpp @@ -693,8 +693,7 @@ bool wxSetWMDecorations(Window w, long style) } if ((style & wxCAPTION) || - (style & wxTINY_CAPTION_HORIZ) || - (style & wxTINY_CAPTION_VERT)) + (style & wxTINY_CAPTION)) { wmProp.props |= GR_WM_PROPS_CAPTION ; wmProp.flags |= GR_WM_FLAGS_PROPS ; -- 2.47.2