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
wxBORDER_RAISED = 0x04000000,
wxBORDER_SUNKEN = 0x08000000,
wxBORDER_DOUBLE = 0x10000000, /* deprecated */
wxBORDER_RAISED = 0x04000000,
wxBORDER_SUNKEN = 0x08000000,
wxBORDER_DOUBLE = 0x10000000, /* deprecated */
- wxBORDER_THEME = 0x10000000,
+ wxBORDER_THEME = wxBORDER_DEFAULT,
/* a mask to extract border style from the combination of flags */
wxBORDER_MASK = 0x1f200000
/* a mask to extract border style from the combination of flags */
wxBORDER_MASK = 0x1f200000
virtual bool IsCanvasWindow() const { return true; }
#endif
virtual bool IsCanvasWindow() const { return true; }
#endif
+ // choose the default border for this window
+ virtual wxBorder GetDefaultBorder() const { return wxWindowBase::GetDefaultBorder(); }
WX_DECLARE_CONTROL_CONTAINER();
WX_DECLARE_CONTROL_CONTAINER();
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
protected:
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
protected:
- // choose the default border for this window
- virtual wxBorder GetDefaultBorder() const;
-
// return default best size (doesn't really make any sense, override this)
virtual wxSize DoGetBestSize() const;
// return default best size (doesn't really make any sense, override this)
virtual wxSize DoGetBestSize() const;
// wxControl
virtual wxBorder GetDefaultBorderForControl() const;
// wxControl
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
void GenerateMouseLeave();
// synthesize a wxEVT_LEAVE_WINDOW event and set m_mouseInWindow to false
void GenerateMouseLeave();
class wxHtmlHelpHtmlWindow : public wxHtmlWindow
{
public:
class wxHtmlHelpHtmlWindow : public wxHtmlWindow
{
public:
- wxHtmlHelpHtmlWindow(wxHtmlHelpWindow *win, wxWindow *parent)
- : wxHtmlWindow(parent), m_Window(win)
+ wxHtmlHelpHtmlWindow(wxHtmlHelpWindow *win, wxWindow *parent, wxWindowID id = wxID_ANY,
+ const wxPoint& pos = wxDefaultPosition, const wxSize& sz = wxDefaultSize, long style = wxHW_DEFAULT_STYLE)
+ : wxHtmlWindow(parent, id, pos, sz, style), m_Window(win)
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))
{
// traditional help controller; splitter window with html page on the
if (helpStyle & (wxHF_CONTENTS | wxHF_INDEX | wxHF_SEARCH))
{
// traditional help controller; splitter window with html page on the
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_NavigNotebook = new wxNotebook(m_NavigPan, wxID_HTML_NOTEBOOK,
wxDefaultPosition, wxDefaultSize);
m_NavigPan = new wxPanel(m_Splitter, wxID_ANY);
m_NavigNotebook = new wxNotebook(m_NavigPan, wxID_HTML_NOTEBOOK,
wxDefaultPosition, wxDefaultSize);
else
{
// only html window, no notebook with index,contents etc
else
{
// 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);
}
// various accessors
// ----------------------------------------------------------------------------
// various accessors
// ----------------------------------------------------------------------------
-wxBorder wxControl::GetDefaultBorder() const
-{
- return GetDefaultBorderForControl();
-}
-
WXDWORD wxControl::MSWGetStyle(long style, WXDWORD *exstyle) const
{
long msStyle = wxWindow::MSWGetStyle(style, exstyle);
WXDWORD wxControl::MSWGetStyle(long style, WXDWORD *exstyle) const
{
long msStyle = wxWindow::MSWGetStyle(style, exstyle);
+wxBorder wxWindowMSW::GetDefaultBorder() const
+{
+ return GetDefaultBorderForControl();
+}
+
wxBorder wxWindowMSW::GetDefaultBorderForControl() const
{
// we want to automatically give controls a sunken style (confusingly,
wxBorder wxWindowMSW::GetDefaultBorderForControl() const
{
// we want to automatically give controls a sunken style (confusingly,
- default:
- case wxBORDER_DEFAULT:
- wxFAIL_MSG( _T("unknown border style") );
- // fall through
+ case wxBORDER_DEFAULT: // also wxBORDER_THEME
+ break;
case wxBORDER_NONE:
case wxBORDER_SIMPLE:
case wxBORDER_NONE:
case wxBORDER_SIMPLE:
break;
case wxBORDER_STATIC:
break;
case wxBORDER_STATIC:
style &= ~WS_BORDER;
break;
style &= ~WS_BORDER;
break;
+ default:
+ wxFAIL_MSG( _T("unknown border style") );
+ break;
+
// case wxBORDER_DOUBLE:
// *exstyle |= WS_EX_DLGMODALFRAME;
// break;
// case wxBORDER_DOUBLE:
// *exstyle |= WS_EX_DLGMODALFRAME;
// break;