wxCalendarCtrl works under MSW too
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@5149 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -40,7 +40,8 @@ public:
|
||||
const wxSize& size = wxDefaultSize,
|
||||
long style = 0,
|
||||
const wxString& name = wxCalendarNameStr)
|
||||
: wxControl(parent, id, pos, size, style, wxDefaultValidator, name)
|
||||
: wxControl(parent, id, pos, size,
|
||||
style | wxWANTS_CHARS, wxDefaultValidator, name)
|
||||
{
|
||||
Init();
|
||||
|
||||
@@ -55,6 +56,8 @@ public:
|
||||
long style = 0,
|
||||
const wxString& name = wxCalendarNameStr);
|
||||
|
||||
virtual ~wxCalendarCtrl();
|
||||
|
||||
// set/get the current date
|
||||
void SetDate(const wxDateTime& date);
|
||||
const wxDateTime& GetDate() const { return m_date; }
|
||||
@@ -63,17 +66,12 @@ public:
|
||||
// value
|
||||
bool HitTest(const wxPoint& pos, wxDateTime *date);
|
||||
|
||||
private:
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
// implementation only from now on
|
||||
// -------------------------------
|
||||
|
||||
// override some base class virtuals
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags);
|
||||
virtual void DoMoveWindow(int x, int y, int width, int height);
|
||||
|
||||
// (re)calc m_widthCol and m_heightRow
|
||||
void RecalcGeometry();
|
||||
// forward these functions to all subcontrols
|
||||
virtual bool Enable(bool enable = TRUE);
|
||||
virtual bool Show(bool show = TRUE);
|
||||
|
||||
// event handlers
|
||||
void OnPaint(wxPaintEvent& event);
|
||||
@@ -82,6 +80,20 @@ private:
|
||||
void OnMonthChange(wxCommandEvent& event);
|
||||
void OnYearChange(wxSpinEvent& event);
|
||||
|
||||
private:
|
||||
// common part of all ctors
|
||||
void Init();
|
||||
|
||||
// override some base class virtuals
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
virtual void DoGetPosition(int *x, int *y) const;
|
||||
virtual void DoGetSize(int *width, int *height) const;
|
||||
virtual void DoSetSize(int x, int y, int width, int height, int sizeFlags);
|
||||
virtual void DoMoveWindow(int x, int y, int width, int height);
|
||||
|
||||
// (re)calc m_widthCol and m_heightRow
|
||||
void RecalcGeometry();
|
||||
|
||||
// set the date and send the notification
|
||||
void SetDateAndNotify(const wxDateTime& date);
|
||||
|
||||
|
@@ -74,7 +74,7 @@ protected:
|
||||
virtual wxClientData* DoGetItemClientObject( int n ) const;
|
||||
|
||||
// MSW implementation
|
||||
virtual wxSize DoGetBestSize();
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
virtual void DoSetSize(int x, int y,
|
||||
int width, int height,
|
||||
int sizeFlags = wxSIZE_AUTO);
|
||||
|
@@ -78,9 +78,8 @@ public:
|
||||
virtual bool MSWCommand(WXUINT param, WXWORD id);
|
||||
|
||||
protected:
|
||||
virtual void DoSetSize(int x, int y,
|
||||
int width, int height,
|
||||
int sizeFlags = wxSIZE_AUTO);
|
||||
virtual void DoMoveWindow(int x, int y, int width, int height);
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
};
|
||||
|
||||
#endif // wxUSE_COMBOBOX
|
||||
|
@@ -54,11 +54,16 @@ public:
|
||||
// because the base class already has one returning int!)
|
||||
void SetValue(const wxString& text);
|
||||
|
||||
// override some of the base class virtuals
|
||||
// implementation only from now on
|
||||
// -------------------------------
|
||||
|
||||
virtual void SetValue(int val) { wxSpinButton::SetValue(val); }
|
||||
virtual int GetValue() const;
|
||||
virtual bool SetFont(const wxFont &font);
|
||||
|
||||
virtual bool Enable(bool enable = TRUE);
|
||||
virtual bool Show(bool show = TRUE);
|
||||
|
||||
protected:
|
||||
virtual void DoMoveWindow(int x, int y, int width, int height);
|
||||
virtual wxSize DoGetBestSize() const;
|
||||
|
Reference in New Issue
Block a user