allocate HPEN on demand instead of doing every time a pen property is modified; also significant code cleanup (finally)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@44790 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2007-03-13 22:01:27 +00:00
parent 8e34db1d94
commit 8c58338193
2 changed files with 489 additions and 387 deletions

View File

@@ -22,10 +22,10 @@
class WXDLLEXPORT wxPen : public wxGDIObject
{
public:
wxPen();
wxPen() { }
wxPen(const wxColour& col, int width = 1, int style = wxSOLID);
wxPen(const wxBitmap& stipple, int width);
virtual ~wxPen();
virtual ~wxPen() { }
bool operator==(const wxPen& pen) const;
bool operator!=(const wxPen& pen) const { return !(*this == pen); }
@@ -54,16 +54,19 @@ public:
int GetDashCount() const;
wxBitmap* GetStipple() const;
// Internal
bool RealizeResource();
bool FreeResource(bool force = false);
WXHANDLE GetResourceHandle() const;
bool IsFree() const;
// internal: wxGDIObject methods
virtual bool RealizeResource();
virtual bool FreeResource(bool force = false);
virtual WXHANDLE GetResourceHandle() const;
virtual bool IsFree() const;
protected:
virtual wxObjectRefData* CreateRefData() const;
virtual wxObjectRefData* CloneRefData(const wxObjectRefData* data) const;
// same as FreeResource() + RealizeResource()
bool Recreate();
DECLARE_DYNAMIC_CLASS(wxPen)
};