]> git.saurik.com Git - wxWidgets.git/commitdiff
fix also wxPen to use wxPenStyle,wxPenJoin,wxPenCap enums instead of plain int; remov...
authorFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Sun, 16 Mar 2008 21:11:12 +0000 (21:11 +0000)
committerFrancesco Montorsi <f18m_cpp217828@yahoo.it>
Sun, 16 Mar 2008 21:11:12 +0000 (21:11 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@52573 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

27 files changed:
docs/changes.txt
include/wx/brush.h
include/wx/button.h
include/wx/cocoa/pen.h
include/wx/defs.h
include/wx/dfb/pen.h
include/wx/font.h
include/wx/gdicmn.h
include/wx/gtk/pen.h
include/wx/gtk1/pen.h
include/wx/mac/carbon/pen.h
include/wx/mgl/pen.h
include/wx/msw/pen.h
include/wx/os2/pen.h
include/wx/palmos/pen.h
include/wx/pen.h
include/wx/x11/pen.h
src/common/gdicmn.cpp
src/dfb/pen.cpp
src/gtk/pen.cpp
src/gtk1/pen.cpp
src/mac/carbon/pen.cpp
src/mgl/pen.cpp
src/msw/pen.cpp
src/os2/pen.cpp
src/palmos/pen.cpp
src/x11/pen.cpp

index 34c968e069f594b22cc2bd1c211298ce1d2449a8..ace17e1a0fde8b90971dec31d9f58b4c900347b6 100644 (file)
@@ -173,10 +173,10 @@ Deprecated methods and their replacements
 - wxMenuItem::GetText has been deprecated in favour of wxMenuItem::GetItemLabel
 - wxMenuItem::GetLabelFromText has been deprecated in favour of wxMenuItem::GetLabelText
 - wxMenuItem::SetText has been deprecated in favour of wxMenuItem::SetItemLabel
-- wxBrush::SetStyle and wxBrush:GetStyle as well as the wxBrush ctor now take
-  a wxBrushStyle value instead of a plain "int style".
-  Use the new wxBrush style names (wxBRUSHSTYLE_XXX) instead of the old deprecated
-  wxXXX styles (which are still available however).
+- wxBrush's, wxPen's SetStyle() and GetStyle() as well as the wxBrush/wxPen ctor now take
+  respectively a wxBrushStyle and a wxPenStyle value instead of a plain "int style";
+  use the new wxBrush/wxPen style names (wxBRUSHSTYLE_XXX and wxPENSTYLE_XXX) instead
+  of the old deprecated wxXXX styles (which however are still available).
 
 Major new features in this release
 ----------------------------------
index 69b187b7dc16cead096b4e1dc5550c8026eac6cd..201e53e91a904abbd9111fa07959f62bbe2fd73d 100644 (file)
 // NOTE: these values cannot be combined together!
 enum wxBrushStyle
 {
-#ifdef WXWIN_COMPATIBILITY_2_8
+#if WXWIN_COMPATIBILITY_2_8
     /* start of deprecated values */
-    wxSOLID      =   100,
-    wxDOT,
-    wxLONG_DASH,
-    wxSHORT_DASH,
-    wxDOT_DASH,
-    wxUSER_DASH,
-    wxTRANSPARENT,
-    wxSTIPPLE_MASK_OPAQUE,
-    wxSTIPPLE_MASK,
-    wxSTIPPLE,
-    wxBDIAGONAL_HATCH,
-    wxCROSSDIAG_HATCH,
-    wxFDIAGONAL_HATCH,
-    wxCROSS_HATCH,
-    wxHORIZONTAL_HATCH,
-    wxVERTICAL_HATCH,
+    wxSOLID = 100,
+    wxTRANSPARENT = 106,
+    wxSTIPPLE_MASK_OPAQUE = 107,
+    wxSTIPPLE_MASK = 108,
+    wxSTIPPLE = 109,
+    wxBDIAGONAL_HATCH = 110,
+    wxCROSSDIAG_HATCH = 111,
+    wxFDIAGONAL_HATCH = 112,
+    wxCROSS_HATCH = 113,
+    wxHORIZONTAL_HATCH = 114,
+    wxVERTICAL_HATCH = 115,
     wxFIRST_HATCH = wxBDIAGONAL_HATCH,
     wxLAST_HATCH = wxVERTICAL_HATCH,
     /* end of deprecated values */
 
     wxBRUSHSTYLE_SOLID = wxSOLID,
-    wxBRUSHSTYLE_DOT = wxDOT,
-    wxBRUSHSTYLE_LONG_DASH = wxLONG_DASH,
-    wxBRUSHSTYLE_SHORT_DASH = wxSHORT_DASH,
-    wxBRUSHSTYLE_DOT_DASH = wxDOT_DASH,
-    wxBRUSHSTYLE_USER_DOT = wxUSER_DASH,
-
     wxBRUSHSTYLE_TRANSPARENT = wxTRANSPARENT,
-
-    /*  Brush Stippling. */
     wxBRUSHSTYLE_STIPPLE_MASK_OPAQUE = wxSTIPPLE_MASK_OPAQUE,
-        /* mask is used for blitting monochrome using text fore and back ground colors */
-
     wxBRUSHSTYLE_STIPPLE_MASK = wxSTIPPLE_MASK,
-        /* mask is used for masking areas in the stipple bitmap (TO DO) */
-
     wxBRUSHSTYLE_STIPPLE = wxSTIPPLE,
-        /*  drawn with a Pen, and without any Brush -- and it can be stippled. */
-
-    /* In wxWidgets < 2.6 use WX_HATCH macro  */
-    /* to verify these wx*_HATCH are in style */
-    /* of wxBrush. In wxWidgets >= 2.6 use    */
-    /* wxBrush::IsHatch() instead.            */
     wxBRUSHSTYLE_BDIAGONAL_HATCH = wxBDIAGONAL_HATCH,
     wxBRUSHSTYLE_CROSSDIAG_HATCH = wxCROSSDIAG_HATCH,
     wxBRUSHSTYLE_FDIAGONAL_HATCH = wxFDIAGONAL_HATCH,
     wxBRUSHSTYLE_CROSS_HATCH = wxCROSS_HATCH,
     wxBRUSHSTYLE_HORIZONTAL_HATCH = wxHORIZONTAL_HATCH,
     wxBRUSHSTYLE_VERTICAL_HATCH = wxVERTICAL_HATCH,
-
     wxBRUSHSTYLE_FIRST_HATCH = wxFIRST_HATCH,
     wxBRUSHSTYLE_LAST_HATCH = wxLAST_HATCH,
-
     wxBRUSHSTYLE_MAX
 #else
     wxBRUSHSTYLE_SOLID,
-    wxBRUSHSTYLE_DOT,
-    wxBRUSHSTYLE_LONG_DASH,
-    wxBRUSHSTYLE_SHORT_DASH,
-    wxBRUSHSTYLE_DOT_DASH,
-    wxBRUSHSTYLE_USER_DOT,
-
     wxBRUSHSTYLE_TRANSPARENT,
 
     /*  Brush Stippling. */
+
     wxBRUSHSTYLE_STIPPLE_MASK_OPAQUE,
         /* mask is used for blitting monochrome using text fore and back ground colors */
 
@@ -148,5 +118,17 @@ public:
     #include "wx/os2/brush.h"
 #endif
 
+class WXDLLIMPEXP_CORE wxBrushList: public wxGDIObjListBase
+{
+public:
+    wxBrush *FindOrCreateBrush(const wxColour& colour, wxBrushStyle style = wxBRUSHSTYLE_SOLID);
+#if WXWIN_COMPATIBILITY_2_6
+    wxDEPRECATED( void AddBrush(wxBrush*) );
+    wxDEPRECATED( void RemoveBrush(wxBrush*) );
+#endif
+};
+
+extern WXDLLEXPORT_DATA(wxBrushList*)   wxTheBrushList;
+
 #endif
     // _WX_BRUSH_H_BASE_
index 58f8ab55fe4fb9058e863729558c98149ebf28a4..a88d7176149abaabaf625846866db218d79ee0e9 100644 (file)
 // wxButton specific flags
 // ----------------------------------------------------------------------------
 
+#if WXWIN_COMPATIBILITY_2_8
 // These two flags are obsolete
 #define wxBU_NOAUTODRAW      0x0000
 #define wxBU_AUTODRAW        0x0004
+#endif
 
 // by default, the buttons will be created with some (system dependent)
 // minimal size to make them look nicer, giving this style will make them as
index b6137473ee9d13dc0fca1cc78450a0016cbc7da2..223c2d43cce6f5e0acc88c10b36b88a776b70291 100644 (file)
@@ -25,7 +25,10 @@ class WXDLLEXPORT wxPen: public wxGDIObject
 {
 public:
     wxPen();
-    wxPen(const wxColour& col, int width = 1, int style = wxSOLID);
+    wxPen(const wxColour& col, int width = 1, wxPenStyle style = wxPENSTYLE_SOLID);
+#if WXWIN_COMPATIBILITY_2_8
+    wxDEPRECATED( wxPen(const wxColour& col, int width, wxBrushStyle style) );
+#endif
     wxPen(const wxBitmap& stipple, int width);
     virtual ~wxPen();
 
@@ -37,17 +40,17 @@ public:
     void SetColour(unsigned char r, unsigned char g, unsigned char b)  ;
 
     void SetWidth(int width);
-    void SetStyle(int style);
+    void SetStyle(wxPenStyle style);
     void SetStipple(const wxBitmap& stipple);
     void SetDashes(int nb_dashes, const wxDash *dash);
-    void SetJoin(int join);
-    void SetCap(int cap);
+    void SetJoin(wxPenJoin join);
+    void SetCap(wxPenCap cap);
 
     wxColour& GetColour() const;
     int GetWidth() const;
-    int GetStyle() const;
-    int GetJoin() const;
-    int GetCap() const;
+    wxPenStyle GetStyle() const;
+    wxPenJoin GetJoin() const;
+    wxPenCap GetCap() const;
     int GetDashes(wxDash **ptr) const;
     wxBitmap *GetStipple() const;
 
index 4098c9852569c6671bb1883a5e3a43615e86cd0d..87b0f82d3e287cf23480dddf6297fb3d830779a1 100644 (file)
@@ -2099,14 +2099,6 @@ enum
     /*  Also wxNORMAL for normal (non-italic text) */
     wxITALIC,
     wxSLANT,
-
-    wxJOIN_BEVEL =     120,
-    wxJOIN_MITER,
-    wxJOIN_ROUND,
-
-    wxCAP_ROUND =      130,
-    wxCAP_PROJECTING,
-    wxCAP_BUTT
 };
 
 /*  Logical ops */
index 965b2afcbf3a8e0c27e85f1b49d0d3c7471e8b32..e70107a8b147c69e2db679f506fea8aa03c91058 100644 (file)
@@ -28,11 +28,15 @@ class WXDLLIMPEXP_FWD_CORE wxPen;
 // wxPen
 //-----------------------------------------------------------------------------
 
-class WXDLLIMPEXP_CORE wxPen: public wxGDIObject
+class WXDLLIMPEXP_CORE wxPen: public wxPenBase
 {
 public:
     wxPen() {}
-    wxPen(const wxColour &colour, int width = 1, int style = wxSOLID);
+    wxPen(const wxColour &colour, int width = 1, wxPenStyle style = wxPENSTYLE_SOLID);
+#if WXWIN_COMPATIBILITY_2_8
+    wxDEPRECATED( wxPen(const wxColour& col, int width, wxBrushStyle style) );
+#endif
+
     wxPen(const wxBitmap& stipple, int width);
 
     bool operator==(const wxPen& pen) const;
@@ -40,17 +44,17 @@ public:
 
     void SetColour(const wxColour &colour);
     void SetColour(unsigned char red, unsigned char green, unsigned char blue);
-    void SetCap(int capStyle);
-    void SetJoin(int joinStyle);
-    void SetStyle(int style);
+    void SetCap(wxPenCap capStyle);
+    void SetJoin(wxPenJoin joinStyle);
+    void SetStyle(wxPenStyle style);
     void SetWidth(int width);
     void SetDashes(int number_of_dashes, const wxDash *dash);
     void SetStipple(const wxBitmap& stipple);
 
     wxColour &GetColour() const;
-    int GetCap() const;
-    int GetJoin() const;
-    int GetStyle() const;
+    wxPenCap GetCap() const;
+    wxPenJoin GetJoin() const;
+    wxPenStyle GetStyle() const;
     int GetWidth() const;
     int GetDashes(wxDash **ptr) const;
     int GetDashCount() const;
index 3b808ac2bd2309e6d2b33d498d9c20ab11f47179..e79e04e91c8bebca9f474b9677ae61f010526f30 100644 (file)
@@ -249,5 +249,23 @@ WXDLLIMPEXP_CORE bool wxFromString(const wxString& str, wxFontBase* font);
     #include "wx/os2/font.h"
 #endif
 
+class WXDLLIMPEXP_CORE wxFontList: public wxGDIObjListBase
+{
+public:
+    wxFont *FindOrCreateFont(int pointSize,
+                             wxFontFamily family,
+                             wxFontStyle style,
+                             wxFontWeight weight,
+                             bool underline = false,
+                             const wxString& face = wxEmptyString,
+                             wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
+#if WXWIN_COMPATIBILITY_2_6
+    wxDEPRECATED( void AddFont(wxFont*) );
+    wxDEPRECATED( void RemoveFont(wxFont*) );
+#endif
+};
+
+extern WXDLLEXPORT_DATA(wxFontList*)    wxTheFontList;
+
 #endif
     // _WX_FONT_H_BASE_
index a3904b73d2c0a36be381005d0cad3259338011d2..dfad910181020ca115f9f764ece84ebae5243030 100644 (file)
@@ -22,7 +22,6 @@
 #include "wx/fontenc.h"
 #include "wx/hashmap.h"
 #include "wx/math.h"
-#include "wx/brush.h"
 
 // ---------------------------------------------------------------------------
 // forward declarations
@@ -619,39 +618,6 @@ protected:
     wxList list;
 };
 
-class WXDLLIMPEXP_CORE wxPenList: public wxGDIObjListBase
-{
-public:
-    wxPen *FindOrCreatePen(const wxColour& colour, int width, int style);
-#if WXWIN_COMPATIBILITY_2_6
-    wxDEPRECATED( void AddPen(wxPen*) );
-    wxDEPRECATED( void RemovePen(wxPen*) );
-#endif
-};
-
-class WXDLLIMPEXP_CORE wxBrushList: public wxGDIObjListBase
-{
-public:
-    wxBrush *FindOrCreateBrush(const wxColour& colour, wxBrushStyle style = wxBRUSHSTYLE_SOLID);
-#if WXWIN_COMPATIBILITY_2_6
-    wxDEPRECATED( void AddBrush(wxBrush*) );
-    wxDEPRECATED( void RemoveBrush(wxBrush*) );
-#endif
-};
-
-class WXDLLIMPEXP_CORE wxFontList: public wxGDIObjListBase
-{
-public:
-    wxFont *FindOrCreateFont(int pointSize, int family, int style, int weight,
-                             bool underline = false,
-                             const wxString& face = wxEmptyString,
-                             wxFontEncoding encoding = wxFONTENCODING_DEFAULT);
-#if WXWIN_COMPATIBILITY_2_6
-    wxDEPRECATED( void AddFont(wxFont*) );
-    wxDEPRECATED( void RemoveFont(wxFont*) );
-#endif
-};
-
 WX_DECLARE_STRING_HASH_MAP(wxColour*, wxStringToColourHashMap);
 
 class WXDLLEXPORT wxColourDatabase
@@ -701,10 +667,6 @@ public:
 // global variables
 // ---------------------------------------------------------------------------
 
-// Lists of GDI objects
-extern WXDLLEXPORT_DATA(wxPenList*)   wxThePenList;
-extern WXDLLEXPORT_DATA(wxBrushList*)   wxTheBrushList;
-extern WXDLLEXPORT_DATA(wxFontList*)    wxTheFontList;
 
 /* Stock objects
 
index f4ccb5f9abba71bd999dfafb38750055c6690cdb..2815c444f2127c039cb02d80ed13767a8201a025 100644 (file)
@@ -19,12 +19,16 @@ typedef    gint8 wxGTKDash;
 // wxPen
 //-----------------------------------------------------------------------------
 
-class WXDLLIMPEXP_CORE wxPen: public wxGDIObject
+class WXDLLIMPEXP_CORE wxPen: public wxPenBase
 {
 public:
     wxPen() { }
 
-    wxPen( const wxColour &colour, int width = 1, int style = wxSOLID );
+    wxPen( const wxColour &colour, int width = 1, wxPenStyle style = wxPENSTYLE_SOLID );
+#if WXWIN_COMPATIBILITY_2_8
+    wxDEPRECATED( wxPen(const wxColour& col, int width, wxBrushStyle style) );
+#endif
+
     virtual ~wxPen();
 
     bool operator==(const wxPen& pen) const;
@@ -32,20 +36,22 @@ public:
 
     void SetColour( const wxColour &colour );
     void SetColour( unsigned char red, unsigned char green, unsigned char blue );
-    void SetCap( int capStyle );
-    void SetJoin( int joinStyle );
-    void SetStyle( int style );
+    void SetCap( wxPenCap capStyle );
+    void SetJoin( wxPenJoin joinStyle );
+    void SetStyle( wxPenStyle style );
     void SetWidth( int width );
     void SetDashes( int number_of_dashes, const wxDash *dash );
+    void SetStipple(const wxBitmap& stipple);
 
     wxColour &GetColour() const;
-    int GetCap() const;
-    int GetJoin() const;
-    int GetStyle() const;
+    wxPenCap GetCap() const;
+    wxPenJoin GetJoin() const;
+    wxPenStyle GetStyle() const;
     int GetWidth() const;
     int GetDashes(wxDash **ptr) const;
     int GetDashCount() const;
     wxDash* GetDash() const;
+    wxBitmap *GetStipple() const;
 
 protected:
     virtual wxGDIRefData *CreateGDIRefData() const;
index 877e31f6358ddc8c395787ceb58fdcc403fe897b..7e85235346c5fdc694bd34d78204e182301479f6 100644 (file)
@@ -32,12 +32,16 @@ typedef    gchar wxGTKDash;
 // wxPen
 //-----------------------------------------------------------------------------
 
-class WXDLLIMPEXP_CORE wxPen: public wxGDIObject
+class WXDLLIMPEXP_CORE wxPen: public wxPenBase
 {
 public:
     wxPen() { }
 
-    wxPen( const wxColour &colour, int width = 1, int style = wxSOLID );
+    wxPen( const wxColour &colour, int width = 1, wxPenStyle style = wxPENSTYLE_SOLID );
+#if WXWIN_COMPATIBILITY_2_8
+    wxDEPRECATED( wxPen(const wxColour& col, int width, wxBrushStyle style) );
+#endif
+
     virtual ~wxPen();
 
     bool operator==(const wxPen& pen) const;
@@ -45,16 +49,16 @@ public:
 
     void SetColour( const wxColour &colour );
     void SetColour( unsigned char red, unsigned char green, unsigned char blue );
-    void SetCap( int capStyle );
-    void SetJoin( int joinStyle );
-    void SetStyle( int style );
+    void SetCap( wxPenCap capStyle );
+    void SetJoin( wxPenJoin joinStyle );
+    void SetStyle( wxPenStyle style );
     void SetWidth( int width );
     void SetDashes( int number_of_dashes, const wxDash *dash );
 
     wxColour &GetColour() const;
-    int GetCap() const;
-    int GetJoin() const;
-    int GetStyle() const;
+    wxPenCap GetCap() const;
+    wxPenJoin GetJoin() const;
+    wxPenStyle GetStyle() const;
     int GetWidth() const;
     int GetDashes(wxDash **ptr) const;
     int GetDashCount() const;
index ee28813e408101c4286a81722a1f7b0ffe81dd58..9c3c3655471ee8e290405b42d850f8aa7441bbb6 100644 (file)
 #include "wx/bitmap.h"
 
 // Pen
-class WXDLLEXPORT wxPen : public wxGDIObject
+class WXDLLEXPORT wxPen : public wxPenBase
 {
 public:
     wxPen();
-    wxPen(const wxColour& col, int width = 1, int style = wxSOLID);
+    wxPen(const wxColour& col, int width = 1, wxPenStyle style = wxPENSTYLE_SOLID);
+#if WXWIN_COMPATIBILITY_2_8
+    wxDEPRECATED( wxPen(const wxColour& col, int width, wxBrushStyle style) );
+#endif
+
     wxPen(const wxBitmap& stipple, int width);
     virtual ~wxPen();
 
@@ -33,17 +37,17 @@ public:
     void SetColour(unsigned char r, unsigned char g, unsigned char b) ;
 
     void SetWidth(int width)  ;
-    void SetStyle(int style)  ;
+    void SetStyle(wxPenStyle style)  ;
     void SetStipple(const wxBitmap& stipple)  ;
     void SetDashes(int nb_dashes, const wxDash *dash)  ;
-    void SetJoin(int join)  ;
-    void SetCap(int cap)  ;
+    void SetJoin(wxPenJoin join)  ;
+    void SetCap(wxPenCap cap)  ;
 
     wxColour& GetColour() const ;
     int GetWidth() const;
-    int GetStyle() const;
-    int GetJoin() const;
-    int GetCap() const;
+    wxPenStyle GetStyle() const;
+    wxPenJoin GetJoin() const;
+    wxPenCap GetCap() const;
     int GetDashes(wxDash **ptr) const;
 
     wxBitmap *GetStipple() const ;
index c8dfd2b533b2d4ab996c6da69f27c195ca751d63..880b6cf54c1bc8e70ab9424df51bdd0c4049ae05 100644 (file)
@@ -27,11 +27,15 @@ class WXDLLIMPEXP_FWD_CORE wxPen;
 // wxPen
 //-----------------------------------------------------------------------------
 
-class WXDLLEXPORT wxPen : public wxGDIObject
+class WXDLLEXPORT wxPen : public wxPenBase
 {
 public:
     wxPen() {}
-    wxPen(const wxColour &colour, int width = 1, int style = wxSOLID);
+    wxPen(const wxColour &colour, int width = 1, wxPenStyle style = wxPENSTYLE_SOLID);
+#if WXWIN_COMPATIBILITY_2_8
+    wxDEPRECATED( wxPen(const wxColour& col, int width, wxBrushStyle style) );
+#endif
+
     wxPen(const wxBitmap& stipple, int width);
     virtual ~wxPen() {}
     bool operator == (const wxPen& pen) const;
@@ -39,17 +43,17 @@ public:
 
     void SetColour(const wxColour &colour);
     void SetColour(unsigned char red, unsigned char green, unsigned char blue);
-    void SetCap(int capStyle);
-    void SetJoin(int joinStyle);
-    void SetStyle(int style);
+    void SetCap(wxPenCap capStyle);
+    void SetJoin(wxPenJoin joinStyle);
+    void SetStyle(wxPenStyle style);
     void SetWidth(int width);
     void SetDashes(int number_of_dashes, const wxDash *dash);
     void SetStipple(const wxBitmap& stipple);
 
     wxColour &GetColour() const;
-    int GetCap() const;
-    int GetJoin() const;
-    int GetStyle() const;
+    wxPenCap GetCap() const;
+    wxPenJoin GetJoin() const;
+    wxPenStyle GetStyle() const;
     int GetWidth() const;
     int GetDashes(wxDash **ptr) const;
     int GetDashCount() const;
index 448c58e69e040d34d0a4fd19123e0946749bd9e1..6f311678e5399d2e933a17a4d4aaee9eac07f6a9 100644 (file)
 // Pen
 // ----------------------------------------------------------------------------
 
-class WXDLLEXPORT wxPen : public wxGDIObject
+class WXDLLEXPORT wxPen : public wxPenBase
 {
 public:
     wxPen() { }
-    wxPen(const wxColour& col, int width = 1, int style = wxSOLID);
+    wxPen(const wxColour& col, int width = 1, wxPenStyle style = wxPENSTYLE_SOLID);
+#if WXWIN_COMPATIBILITY_2_8
+    wxDEPRECATED( wxPen(const wxColour& col, int width, wxBrushStyle style) );
+#endif
+
     wxPen(const wxBitmap& stipple, int width);
     virtual ~wxPen() { }
 
@@ -35,17 +39,17 @@ public:
     void SetColour(unsigned char r, unsigned char g, unsigned char b);
 
     void SetWidth(int width);
-    void SetStyle(int style);
+    void SetStyle(wxPenStyle style);
     void SetStipple(const wxBitmap& stipple);
     void SetDashes(int nb_dashes, const wxDash *dash);
-    void SetJoin(int join);
-    void SetCap(int cap);
+    void SetJoin(wxPenJoin join);
+    void SetCap(wxPenCap cap);
 
     wxColour& GetColour() const;
     int GetWidth() const;
-    int GetStyle() const;
-    int GetJoin() const;
-    int GetCap() const;
+    wxPenStyle GetStyle() const;
+    wxPenJoin GetJoin() const;
+    wxPenCap GetCap() const;
     int GetDashes(wxDash** ptr) const;
     wxDash* GetDash() const;
     int GetDashCount() const;
index 30aed3bbe469497301109a6e46b45d15a9467bff..ec0bc733523fee7cd3c62fe9f3398835417d3aab 100644 (file)
@@ -43,9 +43,9 @@ public:
 
 protected:
     int                             m_nWidth;
-    int                             m_nStyle;
-    int                             m_nJoin;
-    int                             m_nCap;
+    wxPenStyle                      m_nStyle;
+    wxPenJoin                       m_nJoin;
+    wxPenCap                        m_nCap;
     wxBitmap                        m_vStipple;
     int                             m_nbDash;
     wxDash *                        m_dash;
@@ -56,14 +56,18 @@ protected:
 #define M_PENDATA ((wxPenRefData *)m_refData)
 
 // Pen
-class WXDLLEXPORT wxPen : public wxGDIObject
+class WXDLLEXPORT wxPen : public wxPenBase
 {
 public:
     wxPen();
     wxPen( const wxColour& rColour
           ,int             nWidth = 1
-          ,int             nStyle = wxSOLID
+          ,wxPenStyle      nStyle = wxPENSTYLE_SOLID
          );
+#if WXWIN_COMPATIBILITY_2_8
+    wxDEPRECATED( wxPen(const wxColour& col, int width, wxBrushStyle style) );
+#endif
+
     wxPen( const wxBitmap& rStipple
           ,int             nWidth
          );
@@ -87,20 +91,20 @@ public:
     void SetColour(unsigned char cRed, unsigned char cGreen, unsigned char cBlue);
 
     void SetWidth(int nWidth);
-    void SetStyle(int nStyle);
+    void SetStyle(wxPenStyle nStyle);
     void SetStipple(const wxBitmap& rStipple);
     void SetDashes( int           nNbDashes
                    ,const wxDash* pDash
                   );
-    void SetJoin(int nJoin);
-    void SetCap(int nCap);
+    void SetJoin(wxPenJoin nJoin);
+    void SetCap(wxPenCap nCap);
     void SetPS(HPS hPS);
 
     inline wxColour& GetColour(void) const { return (M_PENDATA ? M_PENDATA->m_vColour : wxNullColour); };
     inline int       GetWidth(void) const { return (M_PENDATA ? M_PENDATA->m_nWidth : 0); };
-    inline int       GetStyle(void) const { return (M_PENDATA ? M_PENDATA->m_nStyle : 0); };
-    inline int       GetJoin(void) const { return (M_PENDATA ? M_PENDATA->m_nJoin : 0); };
-    inline int       GetCap(void) const { return (M_PENDATA ? M_PENDATA->m_nCap : 0); };
+    inline wxPenStyle GetStyle(void) const { return (M_PENDATA ? M_PENDATA->m_nStyle : 0); };
+    inline wxPenJoin  GetJoin(void) const { return (M_PENDATA ? M_PENDATA->m_nJoin : 0); };
+    inline wxPenCap   GetCap(void) const { return (M_PENDATA ? M_PENDATA->m_nCap : 0); };
     inline int       GetPS(void) const { return (M_PENDATA ? M_PENDATA->m_hPen : 0); };
     inline int       GetDashes(wxDash **ptr) const
     {
@@ -138,7 +142,7 @@ protected:
     DECLARE_DYNAMIC_CLASS(wxPen)
 }; // end of CLASS wxPen
 
-extern int wx2os2PenStyle(int nWxStyle);
+extern int wx2os2PenStyle(wxPenStyle nWxStyle);
 
 #endif
     // _WX_PEN_H_
index 61b1f94dbc5ea70207d57a3e24d53b745215f062..b6d99455bc262e9db82c5d1812319991a5b39dec 100644 (file)
@@ -44,7 +44,7 @@ public:
 
 protected:
     int           m_width;
-    int           m_style;
+    wxPenStyle    m_style;
     int           m_join;
     int           m_cap;
     wxBitmap      m_stipple;
@@ -71,11 +71,15 @@ private:
 // Pen
 // ----------------------------------------------------------------------------
 
-class WXDLLEXPORT wxPen : public wxGDIObject
+class WXDLLEXPORT wxPen : public wxPenBase
 {
 public:
     wxPen();
-    wxPen(const wxColour& col, int width = 1, int style = wxSOLID);
+    wxPen(const wxColour& col, int width = 1, wxPenStyle style = wxPENSTYLE_SOLID);
+#if WXWIN_COMPATIBILITY_2_8
+    wxDEPRECATED( wxPen(const wxColour& col, int width, wxBrushStyle style) );
+#endif
+
     wxPen(const wxBitmap& stipple, int width);
     virtual ~wxPen();
 
@@ -94,17 +98,17 @@ public:
     void SetColour(unsigned char r, unsigned char g, unsigned char b);
 
     void SetWidth(int width);
-    void SetStyle(int style);
+    void SetStyle(wxPenStyle style);
     void SetStipple(const wxBitmap& stipple);
     void SetDashes(int nb_dashes, const wxDash *dash);
-    void SetJoin(int join);
-    void SetCap(int cap);
+    void SetJoin(wxPenJoin join);
+    void SetCap(wxPenCap cap);
 
     wxColour& GetColour() const { return (M_PENDATA ? M_PENDATA->m_colour : wxNullColour); };
     int GetWidth() const { return (M_PENDATA ? M_PENDATA->m_width : 0); };
-    int GetStyle() const { return (M_PENDATA ? M_PENDATA->m_style : 0); };
-    int GetJoin() const { return (M_PENDATA ? M_PENDATA->m_join : 0); };
-    int GetCap() const { return (M_PENDATA ? M_PENDATA->m_cap : 0); };
+    wxPenStyle GetStyle() const { return (M_PENDATA ? M_PENDATA->m_style : 0); };
+    wxPenJoin GetJoin() const { return (M_PENDATA ? M_PENDATA->m_join : 0); };
+    wxPenCap GetCap() const { return (M_PENDATA ? M_PENDATA->m_cap : 0); };
     int GetDashes(wxDash **ptr) const
     {
         *ptr = (M_PENDATA ? (wxDash*)M_PENDATA->m_dash : (wxDash*) NULL);
index f039ae06d4aa036dea5f09987d946c6206d5944a..2582ae406d320b85c75bdfbf1094c9471f79d3c5 100644 (file)
 
 #include "wx/defs.h"
 
+enum wxPenStyle
+{
+#if WXWIN_COMPATIBILITY_2_8
+    /* start of deprecated values */
+    /* wxSOLID, wxTRANSPARENT, wxSTIPPLE are already defined in wxBrushStyle */
+    wxDOT = 101,
+    wxLONG_DASH = 102,
+    wxSHORT_DASH = 103,
+    wxDOT_DASH = 104,
+    wxUSER_DASH = 105,
+    /* end of deprecated values */
+
+    wxPENSTYLE_SOLID = wxSOLID,
+    wxPENSTYLE_DOT = wxDOT,
+    wxPENSTYLE_LONG_DASH = wxLONG_DASH,
+    wxPENSTYLE_SHORT_DASH = wxSHORT_DASH,
+    wxPENSTYLE_DOT_DASH = wxDOT_DASH,
+    wxPENSTYLE_USER_DOT = wxUSER_DASH,
+
+    wxPENSTYLE_TRANSPARENT = wxTRANSPARENT,
+
+    wxPENSTYLE_STIPPLE_MASK_OPAQUE = wxSTIPPLE_MASK_OPAQUE,
+    wxPENSTYLE_STIPPLE_MASK = wxSTIPPLE_MASK,
+    wxPENSTYLE_STIPPLE = wxSTIPPLE,
+
+    wxPENSTYLE_BDIAGONAL_HATCH = wxBDIAGONAL_HATCH,
+    wxPENSTYLE_CROSSDIAG_HATCH = wxCROSSDIAG_HATCH,
+    wxPENSTYLE_FDIAGONAL_HATCH = wxFDIAGONAL_HATCH,
+    wxPENSTYLE_CROSS_HATCH = wxCROSS_HATCH,
+    wxPENSTYLE_HORIZONTAL_HATCH = wxHORIZONTAL_HATCH,
+    wxPENSTYLE_VERTICAL_HATCH = wxVERTICAL_HATCH,
+
+    wxPENSTYLE_FIRST_HATCH = wxFIRST_HATCH,
+    wxPENSTYLE_LAST_HATCH = wxLAST_HATCH,
+
+    wxPENSTYLE_MAX
+#else
+    wxPENSTYLE_SOLID,
+    wxPENSTYLE_DOT,
+    wxPENSTYLE_LONG_DASH,
+    wxPENSTYLE_SHORT_DASH,
+    wxPENSTYLE_DOT_DASH,
+    wxPENSTYLE_USER_DOT,
+
+    wxPENSTYLE_TRANSPARENT,
+
+    /*  Pen Stippling. */
+    wxPENSTYLE_STIPPLE_MASK_OPAQUE,
+        /* mask is used for blitting monochrome using text fore and back ground colors */
+
+    wxPENSTYLE_STIPPLE_MASK,
+        /* mask is used for masking areas in the stipple bitmap (TO DO) */
+
+    wxPENSTYLE_STIPPLE,
+        /*  drawn with a Pen, and without any Brush -- and it can be stippled. */
+
+    /* In wxWidgets < 2.6 use WX_HATCH macro  */
+    /* to verify these wx*_HATCH are in style */
+    /* of wxBrush. In wxWidgets >= 2.6 use    */
+    /* wxBrush::IsHatch() instead.            */
+    wxPENSTYLE_BDIAGONAL_HATCH,
+    wxPENSTYLE_CROSSDIAG_HATCH,
+    wxPENSTYLE_FDIAGONAL_HATCH,
+    wxPENSTYLE_CROSS_HATCH,
+    wxPENSTYLE_HORIZONTAL_HATCH,
+    wxPENSTYLE_VERTICAL_HATCH,
+
+    wxPENSTYLE_FIRST_HATCH = wxPENSTYLE_BDIAGONAL_HATCH,
+    wxPENSTYLE_LAST_HATCH = wxPENSTYLE_VERTICAL_HATCH,
+
+    wxPENSTYLE_MAX
+#endif
+};
+
+enum wxPenJoin
+{
+    wxJOIN_INVALID = -1,
+
+    wxJOIN_BEVEL = 120,
+    wxJOIN_MITER,
+    wxJOIN_ROUND,
+};
+
+enum wxPenCap
+{
+    wxCAP_INVALID = -1,
+
+    wxCAP_ROUND = 130,
+    wxCAP_PROJECTING,
+    wxCAP_BUTT
+};
+
+
+class WXDLLEXPORT wxPenBase : public wxGDIObject
+{
+public:
+    virtual ~wxPenBase() { }
+
+    virtual void SetColour(const wxColour& col) = 0;
+    virtual void SetColour(unsigned char r, unsigned char g, unsigned char b) = 0;
+
+    virtual void SetWidth(int width) = 0;
+    virtual void SetStyle(wxPenStyle style) = 0;
+    virtual void SetStipple(const wxBitmap& stipple) = 0;
+    virtual void SetDashes(int nb_dashes, const wxDash *dash) = 0;
+    virtual void SetJoin(wxPenJoin join) = 0;
+    virtual void SetCap(wxPenCap cap) = 0;
+
+    virtual wxColour& GetColour() const = 0;
+    virtual wxBitmap *GetStipple() const = 0;
+    virtual wxPenStyle GetStyle() const = 0;
+    virtual wxPenJoin GetJoin() const = 0;
+    virtual wxPenCap GetCap() const = 0;
+    virtual int GetWidth() const = 0;
+    virtual int GetDashes(wxDash **ptr) const = 0;
+
+#if WXWIN_COMPATIBILITY_2_8
+    void SetStyle(wxBrushStyle style)
+        { SetStyle((wxPenStyle)style); }
+#endif
+};
+
 #if defined(__WXPALMOS__)
 #include "wx/palmos/pen.h"
 #elif defined(__WXMSW__)
 #include "wx/os2/pen.h"
 #endif
 
+class WXDLLIMPEXP_CORE wxPenList: public wxGDIObjListBase
+{
+public:
+    wxPen *FindOrCreatePen(const wxColour& colour, int width, wxPenStyle style);
+#if WXWIN_COMPATIBILITY_2_6
+    wxDEPRECATED( void AddPen(wxPen*) );
+    wxDEPRECATED( void RemovePen(wxPen*) );
+#endif
+};
+
+extern WXDLLEXPORT_DATA(wxPenList*)   wxThePenList;
+
 #endif
     // _WX_PEN_H_BASE_
index e7d259bc9dab24ba1c9284b1873ecb3abfd65f44..a6b350f21cddd24e36d4bd1487b34ee93fb54e52 100644 (file)
@@ -29,12 +29,16 @@ typedef char wxX11Dash;
 // wxPen
 //-----------------------------------------------------------------------------
 
-class WXDLLIMPEXP_CORE wxPen: public wxGDIObject
+class WXDLLIMPEXP_CORE wxPen: public wxPenBase
 {
 public:
     wxPen() { }
 
-    wxPen( const wxColour &colour, int width = 1, int style = wxSOLID );
+    wxPen( const wxColour &colour, int width = 1, wxPenStyle style = wxPENSTYLE_SOLID );
+#if WXWIN_COMPATIBILITY_2_8
+    wxDEPRECATED( wxPen(const wxColour& col, int width, wxBrushStyle style) );
+#endif
+
     wxPen( const wxBitmap &stipple, int width );
     virtual ~wxPen();
 
@@ -43,17 +47,17 @@ public:
 
     void SetColour( const wxColour &colour );
     void SetColour( unsigned char red, unsigned char green, unsigned char blue );
-    void SetCap( int capStyle );
-    void SetJoin( int joinStyle );
-    void SetStyle( int style );
+    void SetCap( wxPenCap capStyle );
+    void SetJoin( wxPenJoin joinStyle );
+    void SetStyle( wxPenStyle style );
     void SetWidth( int width );
     void SetDashes( int number_of_dashes, const wxDash *dash );
     void SetStipple( wxBitmap *stipple );
 
     wxColour &GetColour() const;
-    int GetCap() const;
-    int GetJoin() const;
-    int GetStyle() const;
+    wxPenCap GetCap() const;
+    wxPenJoin GetJoin() const;
+    wxPenStyle GetStyle() const;
     int GetWidth() const;
     int GetDashes(wxDash **ptr) const;
     int GetDashCount() const;
index eb7c32078f065da2c946371ec5a09d51140977d0..dd5da7034a208fcfb1e59847334af1b7287bd36e 100644 (file)
@@ -665,34 +665,34 @@ const wxPen* wxStockGDI::GetPen(Item item)
         switch (item)
         {
         case PEN_BLACK:
-            pen = new wxPen(*GetColour(COLOUR_BLACK), 1, wxSOLID);
+            pen = new wxPen(*GetColour(COLOUR_BLACK), 1, wxPENSTYLE_SOLID);
             break;
         case PEN_BLACKDASHED:
-            pen = new wxPen(*GetColour(COLOUR_BLACK), 1, wxSHORT_DASH);
+            pen = new wxPen(*GetColour(COLOUR_BLACK), 1, wxPENSTYLE_SHORT_DASH);
             break;
         case PEN_CYAN:
-            pen = new wxPen(*GetColour(COLOUR_CYAN), 1, wxSOLID);
+            pen = new wxPen(*GetColour(COLOUR_CYAN), 1, wxPENSTYLE_SOLID);
             break;
         case PEN_GREEN:
-            pen = new wxPen(*GetColour(COLOUR_GREEN), 1, wxSOLID);
+            pen = new wxPen(*GetColour(COLOUR_GREEN), 1, wxPENSTYLE_SOLID);
             break;
         case PEN_GREY:
-            pen = new wxPen(wxColour(wxT("GREY")), 1, wxSOLID);
+            pen = new wxPen(wxColour(wxT("GREY")), 1, wxPENSTYLE_SOLID);
             break;
         case PEN_LIGHTGREY:
-            pen = new wxPen(*GetColour(COLOUR_LIGHTGREY), 1, wxSOLID);
+            pen = new wxPen(*GetColour(COLOUR_LIGHTGREY), 1, wxPENSTYLE_SOLID);
             break;
         case PEN_MEDIUMGREY:
-            pen = new wxPen(wxColour(wxT("MEDIUM GREY")), 1, wxSOLID);
+            pen = new wxPen(wxColour(wxT("MEDIUM GREY")), 1, wxPENSTYLE_SOLID);
             break;
         case PEN_RED:
-            pen = new wxPen(*GetColour(COLOUR_RED), 1, wxSOLID);
+            pen = new wxPen(*GetColour(COLOUR_RED), 1, wxPENSTYLE_SOLID);
             break;
         case PEN_TRANSPARENT:
-            pen = new wxPen(*GetColour(COLOUR_BLACK), 1, wxTRANSPARENT);
+            pen = new wxPen(*GetColour(COLOUR_BLACK), 1, wxPENSTYLE_TRANSPARENT);
             break;
         case PEN_WHITE:
-            pen = new wxPen(*GetColour(COLOUR_WHITE), 1, wxSOLID);
+            pen = new wxPen(*GetColour(COLOUR_WHITE), 1, wxPENSTYLE_SOLID);
             break;
         default:
             wxFAIL;
@@ -734,7 +734,7 @@ wxGDIObjListBase::~wxGDIObjListBase()
     }
 }
 
-wxPen *wxPenList::FindOrCreatePen (const wxColour& colour, int width, int style)
+wxPen *wxPenList::FindOrCreatePen (const wxColour& colour, int width, wxPenStyle style)
 {
     for ( wxList::compatibility_iterator node = list.GetFirst();
           node;
@@ -781,9 +781,9 @@ wxBrush *wxBrushList::FindOrCreateBrush (const wxColour& colour, wxBrushStyle st
 }
 
 wxFont *wxFontList::FindOrCreateFont(int pointSize,
-                                     int family,
-                                     int style,
-                                     int weight,
+                                     wxFontFamily family,
+                                     wxFontStyle style,
+                                     wxFontWeight weight,
                                      bool underline,
                                      const wxString& facename,
                                      wxFontEncoding encoding)
@@ -799,7 +799,7 @@ wxFont *wxFontList::FindOrCreateFont(int pointSize,
              font->GetWeight () == weight &&
              font->GetUnderlined () == underline )
         {
-            int fontFamily = font->GetFamily();
+            wxFontFamily fontFamily = font->GetFamily();
 
 #if defined(__WXGTK__)
             // under GTK the default family is wxSWISS, so looking for a font
index 21d36f623ea4f78b155ea7e0cec135aed34a0de3..7039406b52f909c9aa2f8cd043f162c3485f9c74 100644 (file)
@@ -29,7 +29,7 @@
 class wxPenRefData : public wxGDIRefData
 {
 public:
-    wxPenRefData(const wxColour& clr = wxNullColour, int style = wxSOLID)
+    wxPenRefData(const wxColour& clr = wxNullColour, wxPenStyle style = wxPENSTYLE_SOLID)
     {
         m_colour = clr;
         SetStyle(style);
@@ -51,7 +51,7 @@ public:
         m_style = style;
     }
 
-    int            m_style;
+    wxPenStyle     m_style;
     wxColour       m_colour;
 };
 
@@ -61,13 +61,18 @@ public:
 
 IMPLEMENT_DYNAMIC_CLASS(wxPen, wxGDIObject)
 
-wxPen::wxPen(const wxColour &colour, int width, int style)
+wxPen::wxPen(const wxColour &colour, int width, wxPenStyle style)
 {
     wxASSERT_MSG( width <= 1, "only width=0,1 are supported" );
 
     m_refData = new wxPenRefData(colour, style);
 }
 
+wxPen::wxPen(const wxColour& col, int width, wxBrushStyle style)
+{
+    m_refData = new wxPenRefData(col, (wxPenStyle)style);
+}
+
 wxPen::wxPen(const wxBitmap& WXUNUSED(stipple), int WXUNUSED(width))
 {
     wxFAIL_MSG( "stipple pens not supported" );
@@ -98,17 +103,17 @@ void wxPen::SetColour(unsigned char red, unsigned char green, unsigned char blue
     M_PENDATA->m_colour.Set(red, green, blue);
 }
 
-void wxPen::SetCap(int WXUNUSED(capStyle))
+void wxPen::SetCap(wxPenCap WXUNUSED(capStyle))
 {
     wxFAIL_MSG( "SetCap not implemented" );
 }
 
-void wxPen::SetJoin(int WXUNUSED(joinStyle))
+void wxPen::SetJoin(wxPenJoin WXUNUSED(joinStyle))
 {
     wxFAIL_MSG( "SetJoin not implemented" );
 }
 
-void wxPen::SetStyle(int style)
+void wxPen::SetStyle(wxPenStyle style)
 {
     AllocExclusive();
     M_PENDATA->SetStyle(style);
@@ -146,23 +151,23 @@ wxDash* wxPen::GetDash() const
     return NULL;
 }
 
-int wxPen::GetCap() const
+wxPenCap wxPen::GetCap() const
 {
-    wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
+    wxCHECK_MSG( Ok(), wxCAP_INVALID, wxT("invalid pen") );
 
     wxFAIL_MSG( "GetCap not implemented" );
-    return -1;
+    return wxCAP_INVALID;
 }
 
-int wxPen::GetJoin() const
+wxPenJoin wxPen::GetJoin() const
 {
-    wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
+    wxCHECK_MSG( Ok(), wxJOIN_INVALID, wxT("invalid pen") );
 
     wxFAIL_MSG( "GetJoin not implemented" );
-    return -1;
+    return wxJOIN_INVALID;
 }
 
-int wxPen::GetStyle() const
+wxPenStyle wxPen::GetStyle() const
 {
     wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
 
index 917abb974c42ce46e5f2c6338408457e1ae1960a..e1c2744d2a08d4450526f0d6335c6230f48b7cd5 100644 (file)
@@ -28,7 +28,7 @@ public:
     wxPenRefData()
     {
         m_width = 1;
-        m_style = wxSOLID;
+        m_style = wxPENSTYLE_SOLID;
         m_joinStyle = wxJOIN_ROUND;
         m_capStyle = wxCAP_ROUND;
         m_dash = (wxGTKDash*) NULL;
@@ -74,9 +74,9 @@ public:
     }
 
     int        m_width;
-    int        m_style;
-    int        m_joinStyle;
-    int        m_capStyle;
+    wxPenStyle m_style;
+    wxPenJoin  m_joinStyle;
+    wxPenCap   m_capStyle;
     wxColour   m_colour;
     int        m_countDashes;
     wxGTKDash *m_dash;
@@ -88,7 +88,7 @@ public:
 
 IMPLEMENT_DYNAMIC_CLASS(wxPen,wxGDIObject)
 
-wxPen::wxPen( const wxColour &colour, int width, int style )
+wxPen::wxPen( const wxColour &colour, int width, wxPenStyle style )
 {
     m_refData = new wxPenRefData();
     M_PENDATA->m_width = width;
@@ -96,6 +96,14 @@ wxPen::wxPen( const wxColour &colour, int width, int style )
     M_PENDATA->m_colour = colour;
 }
 
+wxPen::wxPen(const wxColour& colour, int width, wxBrushStyle style)
+{
+    m_refData = new wxPenRefData();
+    M_PENDATA->m_width = width;
+    M_PENDATA->m_style = (wxPenStyle)style;
+    M_PENDATA->m_colour = colour;
+}
+
 wxPen::~wxPen()
 {
     // m_refData unrefed in ~wxObject
@@ -142,21 +150,21 @@ void wxPen::SetColour( unsigned char red, unsigned char green, unsigned char blu
     M_PENDATA->m_colour.Set( red, green, blue );
 }
 
-void wxPen::SetCap( int capStyle )
+void wxPen::SetCap( wxPenCap capStyle )
 {
     AllocExclusive();
 
     M_PENDATA->m_capStyle = capStyle;
 }
 
-void wxPen::SetJoin( int joinStyle )
+void wxPen::SetJoin( wxPenJoin joinStyle )
 {
     AllocExclusive();
 
     M_PENDATA->m_joinStyle = joinStyle;
 }
 
-void wxPen::SetStyle( int style )
+void wxPen::SetStyle( wxPenStyle style )
 {
     AllocExclusive();
 
@@ -186,23 +194,23 @@ wxDash* wxPen::GetDash() const
     return (wxDash*)M_PENDATA->m_dash;
 }
 
-int wxPen::GetCap() const
+wxPenCap wxPen::GetCap() const
 {
-    wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
+    wxCHECK_MSG( Ok(), wxCAP_INVALID, wxT("invalid pen") );
 
     return M_PENDATA->m_capStyle;
 }
 
-int wxPen::GetJoin() const
+wxPenJoin wxPen::GetJoin() const
 {
-    wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
+    wxCHECK_MSG( Ok(), wxJOIN_INVALID, wxT("invalid pen") );
 
     return M_PENDATA->m_joinStyle;
 }
 
-int wxPen::GetStyle() const
+wxPenStyle wxPen::GetStyle() const
 {
-    wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
+    wxCHECK_MSG( Ok(), wxPENSTYLE_MAX, wxT("invalid pen") );
 
     return M_PENDATA->m_style;
 }
index 008a98cb1a6be6f87c7ada76b5ff36fc0d873875..59c6cfb553ae353602de2509c58fce883fe416fd 100644 (file)
@@ -74,9 +74,9 @@ public:
     }
 
     int        m_width;
-    int        m_style;
-    int        m_joinStyle;
-    int        m_capStyle;
+    wxPenStyle m_style;
+    wxPenJoin  m_joinStyle;
+    wxPenCap   m_capStyle;
     wxColour   m_colour;
     int        m_countDashes;
     wxGTKDash *m_dash;
@@ -88,7 +88,7 @@ public:
 
 IMPLEMENT_DYNAMIC_CLASS(wxPen,wxGDIObject)
 
-wxPen::wxPen( const wxColour &colour, int width, int style )
+wxPen::wxPen( const wxColour &colour, int width, wxPenStyle style )
 {
     m_refData = new wxPenRefData();
     M_PENDATA->m_width = width;
@@ -96,6 +96,14 @@ wxPen::wxPen( const wxColour &colour, int width, int style )
     M_PENDATA->m_colour = colour;
 }
 
+wxPen::wxPen(const wxColour& colour, int width, wxBrushStyle style)
+{
+    m_refData = new wxPenRefData();
+    M_PENDATA->m_width = width;
+    M_PENDATA->m_style = (wxPenStyle)style;
+    M_PENDATA->m_colour = colour;
+}
+
 wxPen::~wxPen()
 {
     // m_refData unrefed in ~wxObject
@@ -142,21 +150,21 @@ void wxPen::SetColour( unsigned char red, unsigned char green, unsigned char blu
     M_PENDATA->m_colour.Set( red, green, blue );
 }
 
-void wxPen::SetCap( int capStyle )
+void wxPen::SetCap( wxPenCap capStyle )
 {
     AllocExclusive();
 
     M_PENDATA->m_capStyle = capStyle;
 }
 
-void wxPen::SetJoin( int joinStyle )
+void wxPen::SetJoin( wxPenJoin joinStyle )
 {
     AllocExclusive();
 
     M_PENDATA->m_joinStyle = joinStyle;
 }
 
-void wxPen::SetStyle( int style )
+void wxPen::SetStyle( wxPenStyle style )
 {
     AllocExclusive();
 
@@ -186,21 +194,21 @@ wxDash* wxPen::GetDash() const
     return (wxDash*)M_PENDATA->m_dash;
 }
 
-int wxPen::GetCap() const
+wxPenCap wxPen::GetCap() const
 {
     wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
 
     return M_PENDATA->m_capStyle;
 }
 
-int wxPen::GetJoin() const
+wxPenJoin wxPen::GetJoin() const
 {
     wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
 
     return M_PENDATA->m_joinStyle;
 }
 
-int wxPen::GetStyle() const
+wxPenStyle wxPen::GetStyle() const
 {
     wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
 
index 5fa47f2a9a1c776435803d7fffc2688e8032312f..fac1abae2711e7477fb241047ecc128bfa9f4888 100644 (file)
@@ -44,9 +44,9 @@ public:
 
 protected:
     int           m_width;
-    int           m_style;
-    int           m_join ;
-    int           m_cap ;
+    wxPenStyle    m_style;
+    wxPenJoin     m_join ;
+    wxPenCap      m_cap ;
     wxBitmap      m_stipple ;
     int           m_nbDash ;
     wxDash *      m_dash ;
@@ -97,7 +97,7 @@ wxPen::~wxPen()
 }
 
 // Should implement Create
-wxPen::wxPen(const wxColour& col, int Width, int Style)
+wxPen::wxPen(const wxColour& col, int Width, wxPenStyle Style)
 {
     m_refData = new wxPenRefData;
 
@@ -112,6 +112,21 @@ wxPen::wxPen(const wxColour& col, int Width, int Style)
     RealizeResource();
 }
 
+wxPen::wxPen(const wxColour& col, int Width, wxBrushStyle Style)
+{
+    m_refData = new wxPenRefData;
+
+    M_PENDATA->m_colour = col;
+    M_PENDATA->m_width = Width;
+    M_PENDATA->m_style = (wxPenStyle)Style;
+    M_PENDATA->m_join = wxJOIN_ROUND ;
+    M_PENDATA->m_cap = wxCAP_ROUND ;
+    M_PENDATA->m_nbDash = 0 ;
+    M_PENDATA->m_dash = 0 ;
+
+    RealizeResource();
+}
+
 wxPen::wxPen(const wxBitmap& stipple, int Width)
 {
     m_refData = new wxPenRefData;
@@ -155,17 +170,17 @@ int wxPen::GetWidth() const
     return (M_PENDATA ? M_PENDATA->m_width : 0);
 }
 
-int wxPen::GetStyle() const
+wxPenStyle wxPen::GetStyle() const
 {
     return (M_PENDATA ? M_PENDATA->m_style : 0);
 }
 
-int wxPen::GetJoin() const
+wxPenJoin wxPen::GetJoin() const
 {
     return (M_PENDATA ? M_PENDATA->m_join : 0);
 }
 
-int wxPen::GetCap() const
+wxPenCap wxPen::GetCap() const
 {
     return (M_PENDATA ? M_PENDATA->m_cap : 0);
 }
@@ -222,7 +237,7 @@ void wxPen::SetWidth(int Width)
     RealizeResource();
 }
 
-void wxPen::SetStyle(int Style)
+void wxPen::SetStyle(wxPenStyle Style)
 {
     Unshare();
 
@@ -251,7 +266,7 @@ void wxPen::SetDashes(int nb_dashes, const wxDash *Dash)
     RealizeResource();
 }
 
-void wxPen::SetJoin(int Join)
+void wxPen::SetJoin(wxPenJoin Join)
 {
     Unshare();
 
@@ -260,7 +275,7 @@ void wxPen::SetJoin(int Join)
     RealizeResource();
 }
 
-void wxPen::SetCap(int Cap)
+void wxPen::SetCap(wxPenCap Cap)
 {
     Unshare();
 
index 203faed261251f011da625cdfc98aad9435c4865..9b8315efcf454d6f62e3f4b3fe8ecadc26e31844 100644 (file)
@@ -50,14 +50,14 @@ public:
     }
 
     int            m_width;
-    int            m_style;
+    wxPenStyle     m_style;
     wxColour       m_colour;
     wxBitmap       m_stipple;
     pixpattern24_t m_pixPattern;
 
     // not used by wxMGL, but we want to preserve values
-    int            m_joinStyle;
-    int            m_capStyle;
+    wxPenJoin      m_joinStyle;
+    wxPenCap       m_capStyle;
     int            m_countDashes;
     wxDash        *m_dash;
 };
@@ -102,7 +102,7 @@ wxPenRefData::wxPenRefData(const wxPenRefData& data)
 
 IMPLEMENT_DYNAMIC_CLASS(wxPen,wxGDIObject)
 
-wxPen::wxPen(const wxColour &colour, int width, int style)
+wxPen::wxPen(const wxColour &colour, int width, wxPenStyle style)
 {
     m_refData = new wxPenRefData();
     M_PENDATA->m_width = width;
@@ -110,6 +110,14 @@ wxPen::wxPen(const wxColour &colour, int width, int style)
     M_PENDATA->m_colour = colour;
 }
 
+wxPen::wxPen(const wxColour& colour, int width, wxBrushStyle style)
+{
+    m_refData = new wxPenRefData();
+    M_PENDATA->m_width = width;
+    M_PENDATA->m_style = (wxPenStyle)style;
+    M_PENDATA->m_colour = colour;
+}
+
 wxPen::wxPen(const wxBitmap& stipple, int width)
 {
     wxCHECK_RET( stipple.Ok(), _T("invalid bitmap") );
@@ -156,19 +164,19 @@ void wxPen::SetColour(unsigned char red, unsigned char green, unsigned char blue
     M_PENDATA->m_colour.Set(red, green, blue);
 }
 
-void wxPen::SetCap(int capStyle)
+void wxPen::SetCap(wxPenCap capStyle)
 {
     AllocExclusive();
     M_PENDATA->m_capStyle = capStyle;
 }
 
-void wxPen::SetJoin(int joinStyle)
+void wxPen::SetJoin(wxPenJoin joinStyle)
 {
     AllocExclusive();
     M_PENDATA->m_joinStyle = joinStyle;
 }
 
-void wxPen::SetStyle(int style)
+void wxPen::SetStyle(wxPenStyle style)
 {
     AllocExclusive();
     M_PENDATA->m_style = style;
@@ -207,21 +215,21 @@ wxDash* wxPen::GetDash() const
     return (wxDash*)M_PENDATA->m_dash;
 }
 
-int wxPen::GetCap() const
+wxPenCap wxPen::GetCap() const
 {
     wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
 
     return M_PENDATA->m_capStyle;
 }
 
-int wxPen::GetJoin() const
+wxPenJoin wxPen::GetJoin() const
 {
     wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
 
     return M_PENDATA->m_joinStyle;
 }
 
-int wxPen::GetStyle() const
+wxPenStyle wxPen::GetStyle() const
 {
     wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
 
index 711ca1b644d10b58f416f8fbfa6566a37923c93e..4eed257800b28a3db285bcf44284c4434bcb6954 100644 (file)
@@ -52,7 +52,7 @@ public:
 
     wxPenRefData();
     wxPenRefData(const wxPenRefData& data);
-    wxPenRefData(const wxColour& col, int width, int style);
+    wxPenRefData(const wxColour& col, int width, wxPenStyle style);
     wxPenRefData(const wxBitmap& stipple, int width);
     virtual ~wxPenRefData();
 
@@ -76,16 +76,16 @@ public:
 
     wxColour& GetColour() const { return wx_const_cast(wxColour&, m_colour); }
     int GetWidth() const { return m_width; }
-    int GetStyle() const { return m_style; }
-    int GetJoin() const { return m_join; }
-    int GetCap() const { return m_cap; }
+    wxPenStyle GetStyle() const { return m_style; }
+    wxPenJoin GetJoin() const { return m_join; }
+    wxPenCap GetCap() const { return m_cap; }
     wxDash* GetDash() const { return m_dash; }
     int GetDashCount() const { return m_nbDash; }
     wxBitmap* GetStipple() const { return wx_const_cast(wxBitmap *, &m_stipple); }
 
     void SetColour(const wxColour& col) { Free(); m_colour = col; }
     void SetWidth(int width) { Free(); m_width = width; }
-    void SetStyle(int style) { Free(); m_style = style; }
+    void SetStyle(wxPenStyle style) { Free(); m_style = style; }
     void SetStipple(const wxBitmap& stipple)
     {
         Free();
@@ -102,8 +102,8 @@ public:
         m_dash = wx_const_cast(wxDash *, dash);
     }
 
-    void SetJoin(int join) { Free(); m_join = join; }
-    void SetCap(int cap) { Free(); m_cap = cap; }
+    void SetJoin(wxPenJoin join) { Free(); m_join = join; }
+    void SetCap(wxPenCap cap) { Free(); m_cap = cap; }
 
 
     // HPEN management
@@ -135,9 +135,9 @@ private:
     }
 
     int           m_width;
-    int           m_style;
-    int           m_join;
-    int           m_cap;
+    wxPenStyle    m_style;
+    wxPenJoin     m_join;
+    wxPenCap      m_cap;
     wxBitmap      m_stipple;
     int           m_nbDash;
     wxDash *      m_dash;
@@ -176,7 +176,7 @@ wxPenRefData::wxPenRefData(const wxPenRefData& data)
     m_hPen = 0;
 }
 
-wxPenRefData::wxPenRefData(const wxColour& col, int width, int style)
+wxPenRefData::wxPenRefData(const wxColour& col, int width, wxPenStyle style)
 {
     Init();
 
@@ -206,7 +206,7 @@ wxPenRefData::~wxPenRefData()
 // wxPenRefData HPEN management
 // ----------------------------------------------------------------------------
 
-static int ConvertPenStyle(int style)
+static int ConvertPenStyle(wxPenStyle style)
 {
     switch ( style )
     {
@@ -247,7 +247,7 @@ static int ConvertPenStyle(int style)
 
 #ifdef wxHAVE_EXT_CREATE_PEN
 
-static int ConvertJoinStyle(int join)
+static int ConvertJoinStyle(wxPenJoin join)
 {
     switch( join )
     {
@@ -266,7 +266,7 @@ static int ConvertJoinStyle(int join)
     }
 }
 
-static int ConvertCapStyle(int cap)
+static int ConvertCapStyle(wxPenCap cap)
 {
     switch ( cap )
     {
@@ -435,6 +435,11 @@ wxPen::wxPen(const wxColour& col, int width, int style)
     m_refData = new wxPenRefData(col, width, style);
 }
 
+wxPen::wxPen(const wxColour& colour, int width, wxBrushStyle style)
+{
+    m_refData = new wxPenRefData(col, width, (wxPenStyle)style);
+}
+
 wxPen::wxPen(const wxBitmap& stipple, int width)
 {
     m_refData = new wxPenRefData(stipple, width);
@@ -498,7 +503,7 @@ void wxPen::SetWidth(int width)
     M_PENDATA->SetWidth(width);
 }
 
-void wxPen::SetStyle(int style)
+void wxPen::SetStyle(wxPenStyle style)
 {
     AllocExclusive();
 
@@ -519,14 +524,14 @@ void wxPen::SetDashes(int nb_dashes, const wxDash *dash)
     M_PENDATA->SetDashes(nb_dashes, dash);
 }
 
-void wxPen::SetJoin(int join)
+void wxPen::SetJoin(wxPenJoin join)
 {
     AllocExclusive();
 
     M_PENDATA->SetJoin(join);
 }
 
-void wxPen::SetCap(int cap)
+void wxPen::SetCap(wxPenCap cap)
 {
     AllocExclusive();
 
@@ -543,17 +548,17 @@ int wxPen::GetWidth() const
     return m_refData ? M_PENDATA->GetWidth() : 0;
 }
 
-int wxPen::GetStyle() const
+wxPenStyle wxPen::GetStyle() const
 {
     return m_refData ? M_PENDATA->GetStyle() : 0;
 }
 
-int wxPen::GetJoin() const
+wxPenJoin wxPen::GetJoin() const
 {
     return m_refData ? M_PENDATA->GetJoin() : 0;
 }
 
-int wxPen::GetCap() const
+wxPenCap wxPen::GetCap() const
 {
     return m_refData ? M_PENDATA->GetCap() : 0;
 }
index 318daf514d718b43a9a8d4605ee87acf4ee1e869..711a62a679fba745badbe59a45119d1aba032d0f 100644 (file)
@@ -71,7 +71,7 @@ wxPen::~wxPen()
 wxPen::wxPen(
   const wxColour&                   rColour
 , int                               nWidth
-, int                               nStyle
+, wxPenStyle                        nStyle
 )
 {
     m_refData = new wxPenRefData;
@@ -86,6 +86,20 @@ wxPen::wxPen(
     RealizeResource();
 } // end of wxPen::wxPen
 
+wxPen::wxPen(const wxColour& colour, int width, wxBrushStyle style)
+{
+    m_refData = new wxPenRefData;
+
+    M_PENDATA->m_vColour = colour;
+    M_PENDATA->m_nWidth  = width;
+    M_PENDATA->m_nStyle  = (wxPenStyle)nStyle;
+    M_PENDATA->m_nJoin   = wxJOIN_ROUND ;
+    M_PENDATA->m_nCap    = wxCAP_ROUND ;
+    M_PENDATA->m_hPen    = 0L;
+
+    RealizeResource();
+}
+
 wxPen::wxPen(
   const wxBitmap&                   rStipple
 , int                               nWidth
@@ -104,7 +118,7 @@ wxPen::wxPen(
 } // end of wxPen::wxPen
 
 int wx2os2PenStyle(
-  int                               nWxStyle
+  wxPenStyle                               nWxStyle
 );
 
 bool wxPen::RealizeResource()
@@ -370,7 +384,7 @@ void wxPen::SetWidth(
 } // end of wxPen::SetWidth
 
 void wxPen::SetStyle(
-  int                               nStyle
+  wxPenStyle                               nStyle
 )
 {
     AllocExclusive();
@@ -397,7 +411,7 @@ void wxPen::SetDashes( int WXUNUSED(nNbDashes),
 } // end of wxPen::SetDashes
 
 void wxPen::SetJoin(
-  int                               nJoin
+  wxPenJoin                               nJoin
 )
 {
     AllocExclusive();
@@ -406,7 +420,7 @@ void wxPen::SetJoin(
 } // end of wxPen::SetJoin
 
 void wxPen::SetCap(
-  int                               nCap
+  wxPenCap                               nCap
 )
 {
     AllocExclusive();
@@ -415,7 +429,7 @@ void wxPen::SetCap(
 } // end of wxPen::SetCap
 
 int wx2os2PenStyle(
-  int                               nWxStyle
+  wxPenStyle                               nWxStyle
 )
 {
     int                             nPMStyle = 0;
index 4ed1a1abd1548e2cc0d1022a9f2623832a66e6fb..65bdffbbae735dcf4b61bc508c4829539b3b15cc 100644 (file)
@@ -52,7 +52,7 @@ wxPen::~wxPen()
 }
 
 // Should implement Create
-wxPen::wxPen(const wxColour& col, int Width, int Style)
+wxPen::wxPen(const wxColour& col, int Width, wxPenStyle Style)
 {
 }
 
@@ -92,7 +92,7 @@ void wxPen::SetWidth(int Width)
 {
 }
 
-void wxPen::SetStyle(int Style)
+void wxPen::SetStyle(wxPenStyle Style)
 {
 }
 
@@ -104,11 +104,11 @@ void wxPen::SetDashes(int nb_dashes, const wxDash *Dash)
 {
 }
 
-void wxPen::SetJoin(int Join)
+void wxPen::SetJoin(wxPenJoin Join)
 {
 }
 
-void wxPen::SetCap(int Cap)
+void wxPen::SetCap(wxPenCap Cap)
 {
 }
 
index 079472dbdf59b1b5cb424667147c880ad4b574b4..3d8efec95473b13a51c790f054598c52b5f502ac 100644 (file)
@@ -63,9 +63,9 @@ public:
     }
 
     int        m_width;
-    int        m_style;
-    int        m_joinStyle;
-    int        m_capStyle;
+    wxPenStyle m_style;
+    wxPenJoin  m_joinStyle;
+    wxPenCap   m_capStyle;
     wxColour   m_colour;
     int        m_countDashes;
     wxBitmap   m_stipple;
@@ -78,7 +78,7 @@ public:
 
 IMPLEMENT_DYNAMIC_CLASS(wxPen,wxGDIObject)
 
-wxPen::wxPen( const wxColour &colour, int width, int style )
+wxPen::wxPen( const wxColour &colour, int width, wxPenStyle style )
 {
     m_refData = new wxPenRefData();
     M_PENDATA->m_width = width;
@@ -86,6 +86,14 @@ wxPen::wxPen( const wxColour &colour, int width, int style )
     M_PENDATA->m_colour = colour;
 }
 
+wxPen::wxPen(const wxColour& colour, int width, wxBrushStyle style)
+{
+    m_refData = new wxPenRefData();
+    M_PENDATA->m_width = width;
+    M_PENDATA->m_style = (wxPenStyle)style;
+    M_PENDATA->m_colour = colour;
+}
+
 wxPen::~wxPen()
 {
     // m_refData unrefed in ~wxObject
@@ -132,14 +140,14 @@ void wxPen::SetColour( unsigned char red, unsigned char green, unsigned char blu
     M_PENDATA->m_colour.Set( red, green, blue );
 }
 
-void wxPen::SetCap( int capStyle )
+void wxPen::SetCap( wxPenCap capStyle )
 {
     AllocExclusive();
 
     M_PENDATA->m_capStyle = capStyle;
 }
 
-void wxPen::SetJoin( int joinStyle )
+void wxPen::SetJoin( wxPenJoin joinStyle )
 {
     AllocExclusive();
 
@@ -153,7 +161,7 @@ void wxPen::SetStipple( wxBitmap *stipple )
     M_PENDATA->m_stipple = *stipple;
 }
 
-void wxPen::SetStyle( int style )
+void wxPen::SetStyle( wxPenStyle style )
 {
     AllocExclusive();
 
@@ -183,21 +191,21 @@ wxDash* wxPen::GetDash() const
     return (wxDash*)M_PENDATA->m_dash;
 }
 
-int wxPen::GetCap() const
+wxPenCap wxPen::GetCap() const
 {
     wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
 
     return M_PENDATA->m_capStyle;
 }
 
-int wxPen::GetJoin() const
+wxPenJoin wxPen::GetJoin() const
 {
     wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );
 
     return M_PENDATA->m_joinStyle;
 }
 
-int wxPen::GetStyle() const
+wxPenStyle wxPen::GetStyle() const
 {
     wxCHECK_MSG( Ok(), -1, wxT("invalid pen") );