summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
587ce56)
2. wxPoint now has += and -=
3. Validate() takes "wxWindow *" (and not wxWindowBase) again
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2555
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
- if ( ++m_countVisible > 0 )
+ if ( m_countVisible++ == 0 )
- if ( --m_countVisible < 1 )
+ if ( --m_countVisible == 0 )
// ---------------------------------------------------------------------------
// Point classes: with real or integer coordinates
// ---------------------------------------------------------------------------
// ---------------------------------------------------------------------------
// Point classes: with real or integer coordinates
// ---------------------------------------------------------------------------
class WXDLLEXPORT wxRealPoint
{
public:
class WXDLLEXPORT wxRealPoint
{
public:
// no copy ctor or assignment operator - the defaults are ok
// no copy ctor or assignment operator - the defaults are ok
- bool operator==(const wxPoint& pt) const { return x == pt.x && y == pt.y; }
+ // comparison
+ bool operator==(const wxPoint& p) const { return x == p.x && y == p.y; }
+ bool operator!=(const wxPoint& p) const { return !(*this == p); }
+
+ // arithmetic operations (component wise)
+ wxPoint operator+(const wxPoint& p) { return wxPoint(x + p.x, y + p.y); }
+ wxPoint operator-(const wxPoint& p) { return wxPoint(x - p.x, y - p.y); }
- wxPoint operator + (const wxPoint& pt) { return wxPoint(x + pt.x, y + pt.y); }
- wxPoint operator - (const wxPoint& pt) { return wxPoint(x - pt.x, y - pt.y); }
+ wxPoint& operator+=(const wxPoint& p) { x += p.x; y += p.y; return *this; }
+ wxPoint& operator-=(const wxPoint& p) { x -= p.x; y -= p.y; return *this; }
};
#if WXWIN_COMPATIBILITY
};
#if WXWIN_COMPATIBILITY
long GetBottom() const { return y + height; }
long GetRight() const { return x + width; }
long GetBottom() const { return y + height; }
long GetRight() const { return x + width; }
- bool operator == (const wxRect& rect) const;
- bool operator != (const wxRect& rect) const { return !(*this == rect); }
+ bool operator==(const wxRect& rect) const;
+ bool operator!=(const wxRect& rect) const { return !(*this == rect); }
public:
long x, y, width, height;
public:
long x, y, width, height;
+class WXDLLEXPORT wxWindow;
class WXDLLEXPORT wxWindowBase;
/*
class WXDLLEXPORT wxWindowBase;
/*
// Called when the value in the window must be validated.
// This function can pop up an error message.
// Called when the value in the window must be validated.
// This function can pop up an error message.
- virtual bool Validate(wxWindowBase *WXUNUSED(parent)) { return FALSE; };
+ virtual bool Validate(wxWindow *WXUNUSED(parent)) { return FALSE; };
// Called to transfer data to the window
virtual bool TransferToWindow() { return FALSE; }
// Called to transfer data to the window
virtual bool TransferToWindow() { return FALSE; }
virtual bool TransferFromWindow() { return FALSE; };
// accessors
virtual bool TransferFromWindow() { return FALSE; };
// accessors
- wxWindowBase *GetWindow() const { return m_validatorWindow; }
+ wxWindow *GetWindow() const { return (wxWindow *)m_validatorWindow; }
void SetWindow(wxWindowBase *win) { m_validatorWindow = win; }
// validators beep by default if invalid key is pressed, these functions
void SetWindow(wxWindowBase *win) { m_validatorWindow = win; }
// validators beep by default if invalid key is pressed, these functions
{
wxWindowBase *child = node->GetData();
wxValidator *validator = child->GetValidator();
{
wxWindowBase *child = node->GetData();
wxValidator *validator = child->GetValidator();
- if ( validator && validator->Validate(this) )
+ if ( validator && validator->Validate((wxWindow *)this) )