Made wxBORDER_THEME the same as wxBORDER_DEFAULT

Moved wxControl::GetBorderStyle into wxWindowMSW::GetBorderStyle
but added GetBorderStyle to have the same behaviour as before (so e.g.
notebook panels don't get borders)
Improved help window borders


git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47963 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2007-08-08 12:39:56 +00:00
parent f196316400
commit 6f3f9b50aa
7 changed files with 30 additions and 18 deletions

View File

@@ -1407,7 +1407,7 @@ enum wxBorder
wxBORDER_RAISED = 0x04000000, wxBORDER_RAISED = 0x04000000,
wxBORDER_SUNKEN = 0x08000000, wxBORDER_SUNKEN = 0x08000000,
wxBORDER_DOUBLE = 0x10000000, /* deprecated */ wxBORDER_DOUBLE = 0x10000000, /* deprecated */
wxBORDER_THEME = 0x10000000, wxBORDER_THEME = wxBORDER_DEFAULT,
/* a mask to extract border style from the combination of flags */ /* a mask to extract border style from the combination of flags */
wxBORDER_MASK = 0x1f200000 wxBORDER_MASK = 0x1f200000

View File

@@ -79,6 +79,8 @@ public:
virtual bool IsCanvasWindow() const { return true; } virtual bool IsCanvasWindow() const { return true; }
#endif #endif
// choose the default border for this window
virtual wxBorder GetDefaultBorder() const { return wxWindowBase::GetDefaultBorder(); }
WX_DECLARE_CONTROL_CONTAINER(); WX_DECLARE_CONTROL_CONTAINER();

View File

@@ -72,9 +72,6 @@ public:
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const; virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
protected: protected:
// choose the default border for this window
virtual wxBorder GetDefaultBorder() const;
// return default best size (doesn't really make any sense, override this) // return default best size (doesn't really make any sense, override this)
virtual wxSize DoGetBestSize() const; virtual wxSize DoGetBestSize() const;

View File

@@ -438,6 +438,9 @@ public:
// wxControl // wxControl
virtual wxBorder GetDefaultBorderForControl() const; virtual wxBorder GetDefaultBorderForControl() const;
// choose the default border for this window
virtual wxBorder GetDefaultBorder() const;
// synthesize a wxEVT_LEAVE_WINDOW event and set m_mouseInWindow to false // synthesize a wxEVT_LEAVE_WINDOW event and set m_mouseInWindow to false
void GenerateMouseLeave(); void GenerateMouseLeave();

View File

@@ -108,8 +108,9 @@ class wxHtmlHelpHashData : public wxObject
class wxHtmlHelpHtmlWindow : public wxHtmlWindow class wxHtmlHelpHtmlWindow : public wxHtmlWindow
{ {
public: public:
wxHtmlHelpHtmlWindow(wxHtmlHelpWindow *win, wxWindow *parent) wxHtmlHelpHtmlWindow(wxHtmlHelpWindow *win, wxWindow *parent, wxWindowID id = wxID_ANY,
: wxHtmlWindow(parent), m_Window(win) const wxPoint& pos = wxDefaultPosition, const wxSize& sz = wxDefaultSize, long style = wxHW_DEFAULT_STYLE)
: wxHtmlWindow(parent, id, pos, sz, style), m_Window(win)
{ {
SetStandardFonts(); SetStandardFonts();
} }
@@ -361,6 +362,14 @@ bool wxHtmlHelpWindow::Create(wxWindow* parent, wxWindowID id,
wxSizer *navigSizer = NULL; wxSizer *navigSizer = NULL;
#ifdef __WXMSW__
wxBorder htmlWindowBorder = GetDefaultBorder();
if (htmlWindowBorder == wxBORDER_SUNKEN)
htmlWindowBorder = wxBORDER_SIMPLE;
#else
wxBorder htmlWindowBorder = wxBORDER_SIMPLE;
#endif
if (helpStyle & (wxHF_CONTENTS | wxHF_INDEX | wxHF_SEARCH)) if (helpStyle & (wxHF_CONTENTS | wxHF_INDEX | wxHF_SEARCH))
{ {
// traditional help controller; splitter window with html page on the // traditional help controller; splitter window with html page on the
@@ -369,7 +378,7 @@ bool wxHtmlHelpWindow::Create(wxWindow* parent, wxWindowID id,
topWindowSizer->Add(m_Splitter, 1, wxEXPAND); topWindowSizer->Add(m_Splitter, 1, wxEXPAND);
m_HtmlWin = new wxHtmlHelpHtmlWindow(this, m_Splitter); m_HtmlWin = new wxHtmlHelpHtmlWindow(this, m_Splitter, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_DEFAULT_STYLE|htmlWindowBorder);
m_NavigPan = new wxPanel(m_Splitter, wxID_ANY); m_NavigPan = new wxPanel(m_Splitter, wxID_ANY);
m_NavigNotebook = new wxNotebook(m_NavigPan, wxID_HTML_NOTEBOOK, m_NavigNotebook = new wxNotebook(m_NavigPan, wxID_HTML_NOTEBOOK,
wxDefaultPosition, wxDefaultSize); wxDefaultPosition, wxDefaultSize);
@@ -382,7 +391,7 @@ bool wxHtmlHelpWindow::Create(wxWindow* parent, wxWindowID id,
else else
{ {
// only html window, no notebook with index,contents etc // only html window, no notebook with index,contents etc
m_HtmlWin = new wxHtmlWindow(this); m_HtmlWin = new wxHtmlWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_DEFAULT_STYLE|htmlWindowBorder);
topWindowSizer->Add(m_HtmlWin, 1, wxEXPAND); topWindowSizer->Add(m_HtmlWin, 1, wxEXPAND);
} }

View File

@@ -226,11 +226,6 @@ bool wxControl::MSWCreateControl(const wxChar *classname,
// various accessors // various accessors
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
wxBorder wxControl::GetDefaultBorder() const
{
return GetDefaultBorderForControl();
}
WXDWORD wxControl::MSWGetStyle(long style, WXDWORD *exstyle) const WXDWORD wxControl::MSWGetStyle(long style, WXDWORD *exstyle) const
{ {
long msStyle = wxWindow::MSWGetStyle(style, exstyle); long msStyle = wxWindow::MSWGetStyle(style, exstyle);

View File

@@ -1286,6 +1286,11 @@ void wxWindowMSW::MSWUpdateStyle(long flagsOld, long exflagsOld)
} }
} }
wxBorder wxWindowMSW::GetDefaultBorder() const
{
return GetDefaultBorderForControl();
}
wxBorder wxWindowMSW::GetDefaultBorderForControl() const wxBorder wxWindowMSW::GetDefaultBorderForControl() const
{ {
// we want to automatically give controls a sunken style (confusingly, // we want to automatically give controls a sunken style (confusingly,
@@ -1354,14 +1359,11 @@ WXDWORD wxWindowMSW::MSWGetStyle(long flags, WXDWORD *exstyle) const
switch ( border ) switch ( border )
{ {
default: case wxBORDER_DEFAULT: // also wxBORDER_THEME
case wxBORDER_DEFAULT: break;
wxFAIL_MSG( _T("unknown border style") );
// fall through
case wxBORDER_NONE: case wxBORDER_NONE:
case wxBORDER_SIMPLE: case wxBORDER_SIMPLE:
case wxBORDER_THEME:
break; break;
case wxBORDER_STATIC: case wxBORDER_STATIC:
@@ -1377,6 +1379,10 @@ WXDWORD wxWindowMSW::MSWGetStyle(long flags, WXDWORD *exstyle) const
style &= ~WS_BORDER; style &= ~WS_BORDER;
break; break;
default:
wxFAIL_MSG( _T("unknown border style") );
break;
// case wxBORDER_DOUBLE: // case wxBORDER_DOUBLE:
// *exstyle |= WS_EX_DLGMODALFRAME; // *exstyle |= WS_EX_DLGMODALFRAME;
// break; // break;