Added wxBORDER_THEME, wxWindow::GetDefaultBorderForControl(), wxWindow::CanApplyThemeBorder().

wxTextCtrl and wxSearchCtrl now get the correct border on wxMSW, and the wxRichTextCtrl sample
also now demonstrates correct borders.



git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@47927 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Julian Smart
2007-08-07 19:22:43 +00:00
parent e081b01f4d
commit a047aff270
30 changed files with 241 additions and 29 deletions

View File

@@ -58,6 +58,9 @@ public:
virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *item);
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
// returns true if the platform should explicitly apply a theme border
virtual bool CanApplyThemeBorder() const { return false; }
private:
void MakeOwnerDrawn();

View File

@@ -47,6 +47,9 @@ public:
virtual bool SetForegroundColour(const wxColour& colour);
virtual bool MSWOnDraw(WXDRAWITEMSTRUCT *item);
// returns true if the platform should explicitly apply a theme border
virtual bool CanApplyThemeBorder() const { return false; }
protected:
virtual wxSize DoGetBestSize() const;

View File

@@ -85,6 +85,9 @@ public:
virtual bool MSWShouldPreProcessMessage(WXMSG *pMsg);
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
// returns true if the platform should explicitly apply a theme border
virtual bool CanApplyThemeBorder() const { return false; }
protected:
// common part of all ctors
void Init() { m_lastAcceptedSelection = wxID_NONE; }

View File

@@ -57,6 +57,9 @@ public:
virtual bool MSWOnNotify(int idCtrl, WXLPARAM lParam, WXLPARAM *result);
// returns true if the platform should explicitly apply a theme border
virtual bool CanApplyThemeBorder() const { return false; }
protected:
virtual wxSize DoGetBestSize() const;

View File

@@ -58,6 +58,9 @@ public:
WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
// returns true if the platform should explicitly apply a theme border
virtual bool CanApplyThemeBorder() const { return false; }
protected:
virtual wxSize DoGetBestSize() const;

View File

@@ -133,6 +133,9 @@ public:
return GetCompositeControlsDefaultAttributes(variant);
}
// returns true if the platform should explicitly apply a theme border
virtual bool CanApplyThemeBorder() const { return false; }
protected:
virtual void DoSetSelection(int n, bool select);

View File

@@ -115,6 +115,9 @@ public:
// it to behave normally
virtual bool AcceptsFocus() const { return wxControl::AcceptsFocus(); }
// returns true if the platform should explicitly apply a theme border
virtual bool CanApplyThemeBorder() const { return false; }
void SetLabelFont(const wxFont& WXUNUSED(font)) {}
void SetButtonFont(const wxFont& font) { SetFont(font); }

View File

@@ -58,6 +58,9 @@ public:
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
// returns true if the platform should explicitly apply a theme border
virtual bool CanApplyThemeBorder() const { return false; }
protected:
virtual wxSize DoGetBestSize() const;

View File

@@ -83,6 +83,8 @@ public:
// we should let background show through the slider (and its labels)
virtual bool HasTransparentBackground() { return true; }
// returns true if the platform should explicitly apply a theme border
virtual bool CanApplyThemeBorder() const { return false; }
void Command(wxCommandEvent& event);
virtual bool MSWOnScroll(int orientation, WXWORD wParam,

View File

@@ -57,6 +57,9 @@ public:
// a wxSpinButton can't do anything useful with focus, only wxSpinCtrl can
virtual bool AcceptsFocus() const { return false; }
// returns true if the platform should explicitly apply a theme border
virtual bool CanApplyThemeBorder() const { return false; }
protected:
virtual wxSize DoGetBestSize() const;

View File

@@ -54,6 +54,9 @@ public:
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
// returns true if the platform should explicitly apply a theme border
virtual bool CanApplyThemeBorder() const { return false; }
protected:
virtual wxBorder GetDefaultBorder() const;
virtual wxSize DoGetBestSize() const;

View File

@@ -40,6 +40,9 @@ public:
virtual WXDWORD MSWGetStyle(long style, WXDWORD *exstyle) const;
// returns true if the platform should explicitly apply a theme border
virtual bool CanApplyThemeBorder() const { return false; }
protected:
virtual wxSize DoGetBestSize() const;

View File

@@ -170,6 +170,9 @@ public:
virtual bool AcceptsFocus() const;
// returns true if the platform should explicitly apply a theme border
virtual bool CanApplyThemeBorder() const;
// callbacks
void OnDropFiles(wxDropFilesEvent& event);
void OnChar(wxKeyEvent& event); // Process 'enter' if required

View File

@@ -48,6 +48,9 @@ public:
virtual void Command(wxCommandEvent& event);
virtual WXDWORD MSWGetStyle(long flags, WXDWORD *exstyle = NULL) const;
// returns true if the platform should explicitly apply a theme border
virtual bool CanApplyThemeBorder() const { return false; }
protected:
virtual wxSize DoGetBestSize() const;
virtual wxBorder GetDefaultBorder() const;

View File

@@ -107,6 +107,9 @@ public:
// window proc for the frames
WXLRESULT MSWWindowProc(WXUINT message, WXWPARAM wParam, WXLPARAM lParam);
// returns true if the platform should explicitly apply a theme border
virtual bool CanApplyThemeBorder() const { return false; }
protected:
// common part of all ctors
void Init();

View File

@@ -210,6 +210,9 @@ public:
void SetState(const wxTreeItemId& node, int state);
int GetState(const wxTreeItemId& node);
// returns true if the platform should explicitly apply a theme border
virtual bool CanApplyThemeBorder() const { return false; }
protected:
// SetImageList helper
void SetAnyImageList(wxImageList *imageList, int which);

View File

@@ -433,6 +433,11 @@ public:
// check if a native double-buffering applies for this window
virtual bool IsDoubleBuffered() const;
// this allows you to implement standard control borders without
// repeating the code in different classes that are not derived from
// wxControl
virtual wxBorder GetDefaultBorderForControl() const;
// synthesize a wxEVT_LEAVE_WINDOW event and set m_mouseInWindow to false
void GenerateMouseLeave();