Added wxSP_NO_XP_THEME style to wxSplitterWindow to switch off
theming (some applications look bad without 3D borders) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@26064 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -77,8 +77,18 @@ OTHER CHANGES
|
|||||||
2.5.2
|
2.5.2
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
All:
|
||||||
|
|
||||||
|
All (GUI):
|
||||||
|
|
||||||
|
- wxHtmlWindow now delays image scaling until rendering,
|
||||||
|
resulting in much better display of scaled images
|
||||||
|
|
||||||
wxMSW:
|
wxMSW:
|
||||||
|
|
||||||
- wxWindow::Freeze()/Thaw() can now be nested
|
- wxWindow::Freeze()/Thaw() can now be nested
|
||||||
|
- Added wxSP_NO_XP_THEME style to wxSplitterWindow to switch off
|
||||||
|
XP theming (some applications look bad without 3D borders)
|
||||||
|
|
||||||
|
|
||||||
2.5.1
|
2.5.1
|
||||||
|
@@ -6,10 +6,6 @@ This class manages up to two subwindows. The current view can be
|
|||||||
split into two programmatically (perhaps from a menu command), and unsplit
|
split into two programmatically (perhaps from a menu command), and unsplit
|
||||||
either programmatically or via the wxSplitterWindow user interface.
|
either programmatically or via the wxSplitterWindow user interface.
|
||||||
|
|
||||||
Appropriate 3D shading for the Windows 95 user interface is an option -
|
|
||||||
this is also recommended for GTK. Optionally, the sash can be made to
|
|
||||||
look more like the native control under MacOS X.
|
|
||||||
|
|
||||||
\wxheading{Window styles}
|
\wxheading{Window styles}
|
||||||
|
|
||||||
\begin{twocollist}\itemsep=0pt
|
\begin{twocollist}\itemsep=0pt
|
||||||
@@ -18,6 +14,8 @@ look more like the native control under MacOS X.
|
|||||||
\twocolitem{\windowstyle{wxSP\_3DBORDER}}{Synonym for wxSP\_BORDER.}
|
\twocolitem{\windowstyle{wxSP\_3DBORDER}}{Synonym for wxSP\_BORDER.}
|
||||||
\twocolitem{\windowstyle{wxSP\_BORDER}}{Draws a standard border.}
|
\twocolitem{\windowstyle{wxSP\_BORDER}}{Draws a standard border.}
|
||||||
\twocolitem{\windowstyle{wxSP\_NOBORDER}}{No border (default).}
|
\twocolitem{\windowstyle{wxSP\_NOBORDER}}{No border (default).}
|
||||||
|
\twocolitem{\windowstyle{wxSP\_NO\_XP\_THEME}}{Under Windows XP, switches off the attempt to draw the
|
||||||
|
splitter using Windows XP theming, so the borders and sash will take on the pre-XP look.}
|
||||||
\twocolitem{\windowstyle{wxSP\_PERMIT\_UNSPLIT}}{Always allow to
|
\twocolitem{\windowstyle{wxSP\_PERMIT\_UNSPLIT}}{Always allow to
|
||||||
unsplit, even with the minimum pane size other than zero.}
|
unsplit, even with the minimum pane size other than zero.}
|
||||||
\twocolitem{\windowstyle{wxSP\_LIVE\_UPDATE}}{Don't draw XOR line but resize the child windows immediately.}
|
\twocolitem{\windowstyle{wxSP\_LIVE\_UPDATE}}{Don't draw XOR line but resize the child windows immediately.}
|
||||||
|
@@ -13,6 +13,7 @@
|
|||||||
#define wxSP_LIVE_UPDATE 0x0080
|
#define wxSP_LIVE_UPDATE 0x0080
|
||||||
#define wxSP_3DSASH 0x0100
|
#define wxSP_3DSASH 0x0100
|
||||||
#define wxSP_3DBORDER 0x0200
|
#define wxSP_3DBORDER 0x0200
|
||||||
|
#define wxSP_NO_XP_THEME 0x0400
|
||||||
#define wxSP_BORDER wxSP_3DBORDER
|
#define wxSP_BORDER wxSP_3DBORDER
|
||||||
#define wxSP_3D (wxSP_3DBORDER | wxSP_3DSASH)
|
#define wxSP_3D (wxSP_3DBORDER | wxSP_3DSASH)
|
||||||
|
|
||||||
|
@@ -356,7 +356,8 @@ END_EVENT_TABLE()
|
|||||||
MySplitterWindow::MySplitterWindow(wxFrame *parent)
|
MySplitterWindow::MySplitterWindow(wxFrame *parent)
|
||||||
: wxSplitterWindow(parent, -1,
|
: wxSplitterWindow(parent, -1,
|
||||||
wxDefaultPosition, wxDefaultSize,
|
wxDefaultPosition, wxDefaultSize,
|
||||||
0x700| wxSP_LIVE_UPDATE | wxCLIP_CHILDREN)
|
wxSP_3D | wxSP_LIVE_UPDATE |
|
||||||
|
wxCLIP_CHILDREN /* | wxSP_NO_XP_THEME */ )
|
||||||
{
|
{
|
||||||
m_frame = parent;
|
m_frame = parent;
|
||||||
}
|
}
|
||||||
|
@@ -30,8 +30,8 @@
|
|||||||
#include "wx/dc.h"
|
#include "wx/dc.h"
|
||||||
#endif //WX_PRECOMP
|
#endif //WX_PRECOMP
|
||||||
|
|
||||||
|
#include "wx/splitter.h"
|
||||||
#include "wx/renderer.h"
|
#include "wx/renderer.h"
|
||||||
|
|
||||||
#include "wx/msw/uxtheme.h"
|
#include "wx/msw/uxtheme.h"
|
||||||
|
|
||||||
// ----------------------------------------------------------------------------
|
// ----------------------------------------------------------------------------
|
||||||
@@ -116,17 +116,24 @@ wxRendererNative& wxRendererXP::Get()
|
|||||||
static const wxCoord SASH_WIDTH = 4;
|
static const wxCoord SASH_WIDTH = 4;
|
||||||
|
|
||||||
wxSplitterRenderParams
|
wxSplitterRenderParams
|
||||||
wxRendererXP::GetSplitterParams(const wxWindow * WXUNUSED(win))
|
wxRendererXP::GetSplitterParams(const wxWindow * win)
|
||||||
{
|
{
|
||||||
return wxSplitterRenderParams(SASH_WIDTH, 0, false);
|
if (win->GetWindowStyle() & wxSP_NO_XP_THEME)
|
||||||
|
return m_rendererNative.GetSplitterParams(win);
|
||||||
|
else
|
||||||
|
return wxSplitterRenderParams(SASH_WIDTH, 0, false);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
wxRendererXP::DrawSplitterBorder(wxWindow * WXUNUSED(win),
|
wxRendererXP::DrawSplitterBorder(wxWindow * win,
|
||||||
wxDC& WXUNUSED(dc),
|
wxDC& dc,
|
||||||
const wxRect& WXUNUSED(rect),
|
const wxRect& rect,
|
||||||
int WXUNUSED(flags))
|
int flags)
|
||||||
{
|
{
|
||||||
|
if (win->GetWindowStyle() & wxSP_NO_XP_THEME)
|
||||||
|
{
|
||||||
|
m_rendererNative.DrawSplitterBorder(win, dc, rect, flags);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -135,8 +142,15 @@ wxRendererXP::DrawSplitterSash(wxWindow *win,
|
|||||||
const wxSize& size,
|
const wxSize& size,
|
||||||
wxCoord position,
|
wxCoord position,
|
||||||
wxOrientation orient,
|
wxOrientation orient,
|
||||||
int WXUNUSED(flags))
|
int flags)
|
||||||
{
|
{
|
||||||
|
if (win->GetWindowStyle() & wxSP_NO_XP_THEME)
|
||||||
|
{
|
||||||
|
m_rendererNative.DrawSplitterSash(
|
||||||
|
win, dc, size, position, orient, flags);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// I don't know if it is correct to use the rebar background for the
|
// I don't know if it is correct to use the rebar background for the
|
||||||
// splitter but it least this works ok in the default theme
|
// splitter but it least this works ok in the default theme
|
||||||
wxUxThemeHandle hTheme(win, L"REBAR");
|
wxUxThemeHandle hTheme(win, L"REBAR");
|
||||||
|
Reference in New Issue
Block a user