]> git.saurik.com Git - wxWidgets.git/commitdiff
wxColour(const char *) ctor related modifications
authorVadim Zeitlin <vadim@wxwidgets.org>
Tue, 20 Oct 1998 14:35:22 +0000 (14:35 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Tue, 20 Oct 1998 14:35:22 +0000 (14:35 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@886 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

35 files changed:
include/wx/colour.h
include/wx/gdicmn.h
include/wx/gtk/brush.h
include/wx/gtk/colour.h
include/wx/gtk/pen.h
include/wx/gtk1/brush.h
include/wx/gtk1/colour.h
include/wx/gtk1/pen.h
include/wx/motif/brush.h
include/wx/motif/colour.h
include/wx/motif/pen.h
include/wx/msw/colour.h
include/wx/msw/pen.h
include/wx/stubs/brush.h
include/wx/stubs/colour.h
include/wx/stubs/pen.h
samples/controls/controls.cpp
src/common/gdicmn.cpp
src/gtk/brush.cpp
src/gtk/colour.cpp
src/gtk/notebook.cpp
src/gtk/pen.cpp
src/gtk1/brush.cpp
src/gtk1/colour.cpp
src/gtk1/notebook.cpp
src/gtk1/pen.cpp
src/motif/brush.cpp
src/motif/colour.cpp
src/motif/pen.cpp
src/msw/brush.cpp
src/msw/colour.cpp
src/msw/pen.cpp
src/stubs/brush.cpp
src/stubs/colour.cpp
src/stubs/pen.cpp

index 88b50afca501364b9b73079502aa3dd1e6190140..3fff20043186499810cfe7193e0407ba206c987c 100644 (file)
@@ -15,5 +15,7 @@
 #include "wx/stubs/colour.h"
 #endif
 
+#define wxColor wxColour
+
 #endif
     // _WX_COLOUR_H_BASE_
index 49cbec544808b40c919201e07325c03767311973..f0719dbe004db92cc0fd155863782305d77fc571 100644 (file)
@@ -199,7 +199,6 @@ class WXDLLEXPORT wxPenList: public wxList
   void AddPen(wxPen *pen);
   void RemovePen(wxPen *pen);
   wxPen *FindOrCreatePen(const wxColour& colour, int width, int style);
-  wxPen *FindOrCreatePen(const wxString& colour, int width, int style);
 };
 
 class WXDLLEXPORT wxBrushList: public wxList
@@ -212,7 +211,6 @@ class WXDLLEXPORT wxBrushList: public wxList
   void AddBrush(wxBrush *brush);
   void RemoveBrush(wxBrush *brush);
   wxBrush *FindOrCreateBrush(const wxColour& colour, int style);
-  wxBrush *FindOrCreateBrush(const wxString& colour, int style);
 };
 
 WXDLLEXPORT_DATA(extern const char*) wxEmptyString;
index 94c65f760f13033663065605e9e8095dd17db3ff..66a3d451d5c35e22c5624ef93ebbea4c1e082c13 100644 (file)
@@ -40,7 +40,6 @@ class wxBrush: public wxGDIObject
 
     wxBrush(void);
     wxBrush( const wxColour &colour, int style );
-    wxBrush( const wxString &colourName, int style );
     wxBrush( const wxBitmap &stippleBitmap );
     wxBrush( const wxBrush &brush );
     wxBrush( const wxBrush *brush );
@@ -56,7 +55,6 @@ class wxBrush: public wxGDIObject
     
     
     void SetColour( const wxColour& col );
-    void SetColour( const wxString& col );
     void SetColour( unsigned char r, unsigned char g, unsigned char b );
     void SetStyle( int style );
     void SetStipple( const wxBitmap& stipple );
index 43f9d528399f808cf3cd47e899866d6f0de509c1..da8e9ee208090053d3560ed86886821bfa269b9e 100644 (file)
@@ -39,43 +39,46 @@ class wxColour;
 
 class wxColour: public wxGDIObject
 {
-  public:
-
-    wxColour();
-    wxColour( char red, char green, char blue );
-    wxColour( const wxString &colourName ) { InitFromName(colourName); }
-//    wxColour( const char *colourName ) { InitFromName(colourName); }
-    wxColour( const wxColour& col );
-    wxColour( const wxColour* col );
-    ~wxColour();
-    wxColour& operator = ( const wxColour& col );
-    wxColour& operator = ( const wxString& colourName );
-    bool operator == ( const wxColour& col );
-    bool operator != ( const wxColour& col );
-    void Set( const unsigned char red, const unsigned char green, const unsigned char blue );
-    unsigned char Red() const;
-    unsigned char Green() const;
-    unsigned char Blue() const;
-    bool Ok() const;
-
-  private:
-  public:
-
-    friend wxDC;
-    friend wxPaintDC;
-    friend wxBitmap;
-    friend wxWindow;
-
-    void CalcPixel( GdkColormap *cmap );
-    int GetPixel() const;
-    GdkColor *GetColor() const;
+public:
+  // ctors
+    // default
+  wxColour();
+    // from RGB
+  wxColour( char red, char green, char blue );
+    // implicit conversion from the colour name
+  wxColour( const wxString &colourName ) { InitFromName(colourName); }
+  wxColour( const char *colourName ) { InitFromName(colourName); }
+
+    // copy ctors and assignment operators
+  wxColour( const wxColour& col );
+  wxColour( const wxColour* col );
+  wxColour& operator = ( const wxColour& col );
+
+    // dtor
+  ~wxColour();
+
+  // comparison
+  bool operator == ( const wxColour& col );
+  bool operator != ( const wxColour& col );
+  
+  // accessors
+  void Set( unsigned char red, unsigned char green, unsigned char blue );
+  unsigned char Red() const;
+  unsigned char Green() const;
+  unsigned char Blue() const;
+  bool Ok() const;
+
+  // implementation
+  void CalcPixel( GdkColormap *cmap );
+  int GetPixel() const;
+  GdkColor *GetColor() const;
 
 protected:
-    // helper functions
-    void InitFromName(const wxString& colourName);
+  // helper functions
+  void InitFromName(const wxString& colourName);
 
 private:
-    DECLARE_DYNAMIC_CLASS(wxColour)
+  DECLARE_DYNAMIC_CLASS(wxColour)
 };
 
 #endif // __GTKCOLOURH__
index d6c4d632b8d4a39941f2f22f410c5ba10f4bee60..0649fe2473107641e54cfbcf811dc1f5a5e4a58b 100644 (file)
@@ -40,7 +40,6 @@ class wxPen: public wxGDIObject
   
     wxPen(void);
     wxPen( const wxColour &colour, int width, int style );
-    wxPen( const wxString &colourName, int width, int style );
     wxPen( const wxPen& pen );
     wxPen( const wxPen* pen );
     ~wxPen(void);
@@ -49,7 +48,6 @@ class wxPen: public wxGDIObject
     bool operator != ( const wxPen& pen );
     
     void SetColour( const wxColour &colour );
-    void SetColour( const wxString &colourName );
     void SetColour( int red, int green, int blue );
     void SetCap( int capStyle );
     void SetJoin( int joinStyle );
index 94c65f760f13033663065605e9e8095dd17db3ff..66a3d451d5c35e22c5624ef93ebbea4c1e082c13 100644 (file)
@@ -40,7 +40,6 @@ class wxBrush: public wxGDIObject
 
     wxBrush(void);
     wxBrush( const wxColour &colour, int style );
-    wxBrush( const wxString &colourName, int style );
     wxBrush( const wxBitmap &stippleBitmap );
     wxBrush( const wxBrush &brush );
     wxBrush( const wxBrush *brush );
@@ -56,7 +55,6 @@ class wxBrush: public wxGDIObject
     
     
     void SetColour( const wxColour& col );
-    void SetColour( const wxString& col );
     void SetColour( unsigned char r, unsigned char g, unsigned char b );
     void SetStyle( int style );
     void SetStipple( const wxBitmap& stipple );
index 43f9d528399f808cf3cd47e899866d6f0de509c1..da8e9ee208090053d3560ed86886821bfa269b9e 100644 (file)
@@ -39,43 +39,46 @@ class wxColour;
 
 class wxColour: public wxGDIObject
 {
-  public:
-
-    wxColour();
-    wxColour( char red, char green, char blue );
-    wxColour( const wxString &colourName ) { InitFromName(colourName); }
-//    wxColour( const char *colourName ) { InitFromName(colourName); }
-    wxColour( const wxColour& col );
-    wxColour( const wxColour* col );
-    ~wxColour();
-    wxColour& operator = ( const wxColour& col );
-    wxColour& operator = ( const wxString& colourName );
-    bool operator == ( const wxColour& col );
-    bool operator != ( const wxColour& col );
-    void Set( const unsigned char red, const unsigned char green, const unsigned char blue );
-    unsigned char Red() const;
-    unsigned char Green() const;
-    unsigned char Blue() const;
-    bool Ok() const;
-
-  private:
-  public:
-
-    friend wxDC;
-    friend wxPaintDC;
-    friend wxBitmap;
-    friend wxWindow;
-
-    void CalcPixel( GdkColormap *cmap );
-    int GetPixel() const;
-    GdkColor *GetColor() const;
+public:
+  // ctors
+    // default
+  wxColour();
+    // from RGB
+  wxColour( char red, char green, char blue );
+    // implicit conversion from the colour name
+  wxColour( const wxString &colourName ) { InitFromName(colourName); }
+  wxColour( const char *colourName ) { InitFromName(colourName); }
+
+    // copy ctors and assignment operators
+  wxColour( const wxColour& col );
+  wxColour( const wxColour* col );
+  wxColour& operator = ( const wxColour& col );
+
+    // dtor
+  ~wxColour();
+
+  // comparison
+  bool operator == ( const wxColour& col );
+  bool operator != ( const wxColour& col );
+  
+  // accessors
+  void Set( unsigned char red, unsigned char green, unsigned char blue );
+  unsigned char Red() const;
+  unsigned char Green() const;
+  unsigned char Blue() const;
+  bool Ok() const;
+
+  // implementation
+  void CalcPixel( GdkColormap *cmap );
+  int GetPixel() const;
+  GdkColor *GetColor() const;
 
 protected:
-    // helper functions
-    void InitFromName(const wxString& colourName);
+  // helper functions
+  void InitFromName(const wxString& colourName);
 
 private:
-    DECLARE_DYNAMIC_CLASS(wxColour)
+  DECLARE_DYNAMIC_CLASS(wxColour)
 };
 
 #endif // __GTKCOLOURH__
index d6c4d632b8d4a39941f2f22f410c5ba10f4bee60..0649fe2473107641e54cfbcf811dc1f5a5e4a58b 100644 (file)
@@ -40,7 +40,6 @@ class wxPen: public wxGDIObject
   
     wxPen(void);
     wxPen( const wxColour &colour, int width, int style );
-    wxPen( const wxString &colourName, int width, int style );
     wxPen( const wxPen& pen );
     wxPen( const wxPen* pen );
     ~wxPen(void);
@@ -49,7 +48,6 @@ class wxPen: public wxGDIObject
     bool operator != ( const wxPen& pen );
     
     void SetColour( const wxColour &colour );
-    void SetColour( const wxString &colourName );
     void SetColour( int red, int green, int blue );
     void SetCap( int capStyle );
     void SetJoin( int joinStyle );
index 79a45146368de2b89cea4a1f981b1414c958e88c..8f2764962b43d01a8926bc797d9c57fdb3d800db 100644 (file)
@@ -46,14 +46,12 @@ class WXDLLEXPORT wxBrush: public wxGDIObject
 public:
   wxBrush();
   wxBrush(const wxColour& col, int style);
-  wxBrush(const wxString& col, int style);
   wxBrush(const wxBitmap& stipple);
   inline wxBrush(const wxBrush& brush) { Ref(brush); }
   inline wxBrush(const wxBrush* brush) { if (brush) Ref(*brush); }
   ~wxBrush();
 
   virtual void SetColour(const wxColour& col)  ;
-  virtual void SetColour(const wxString& col)  ;
   virtual void SetColour(unsigned char r, unsigned char g, unsigned char b)  ;
   virtual void SetStyle(int style)  ;
   virtual void SetStipple(const wxBitmap& stipple)  ;
index 9ce941f2a8833f3ea8fa027fa5bede32da775465..a255c645589cfbbe9394320c5c8a12851730ad81 100644 (file)
 #include "wx/string.h"
 
 // Colour
-class WXDLLEXPORT wxColour: public wxObject
+class WXDLLEXPORT wxColour : public wxObject
 {
-  DECLARE_DYNAMIC_CLASS(wxColour)
 public:
+  // ctors
+    // default
   wxColour();
-  wxColour(unsigned char r, unsigned char g, unsigned char b);
-  wxColour(unsigned long colRGB) { Set(colRGB); }
-  wxColour(const wxColour& col);
-  wxColour(const wxString& col);
-  ~wxColour() ;
-  wxColour& operator =(const wxColour& src) ;
-  wxColour& operator =(const wxString& src) ;
-  inline int Ok() const { return (m_isInit) ; }
-
-  void Set(unsigned char r, unsigned char g, unsigned char b);
-  void Set(unsigned long colRGB) 
-  { 
+    // from RGB
+  wxColour( char red, char green, char blue );
+    // implicit conversion from the colour name
+  wxColour( const wxString &colourName ) { InitFromName(colourName); }
+  wxColour( const char *colourName ) { InitFromName(colourName); }
+
+    // copy ctors and assignment operators
+  wxColour( const wxColour& col );
+  wxColour( const wxColour* col );
+  wxColour& operator = ( const wxColour& col );
+
+    // dtor
+  ~wxColour();
+
+  // Set() functions
+  void Set( unsigned char red, unsigned char green, unsigned char blue );
+  void Set( unsigned long colRGB )
+  {
     // we don't need to know sizeof(long) here because we assume that the three
     // least significant bytes contain the R, G and B values
-    Set((unsigned char)colRGB, 
+    Set((unsigned char)colRGB,
         (unsigned char)(colRGB >> 8),
-        (unsigned char)(colRGB >> 16)); 
+        (unsigned char)(colRGB >> 16));
   }
 
-  inline unsigned char Red() const { return m_red; }
-  inline unsigned char Green() const { return m_green; }
-  inline unsigned char Blue() const { return m_blue; }
-
-  inline bool operator == (const wxColour& colour) { return (m_red == colour.m_red && m_green == colour.m_green && m_blue == colour.m_blue); }
+  // accessors
+  bool Ok() const {return m_isInit; }
 
-  inline bool operator != (const wxColour& colour) { return (!(m_red == colour.m_red && m_green == colour.m_green && m_blue == colour.m_blue)); }
-
-  inline int GetPixel() const { return m_pixel; };
-  inline void SetPixel(int pixel) { m_pixel = pixel; m_isInit = TRUE; };
+  int GetPixel() const { return m_pixel; };
+  void SetPixel(int pixel) { m_pixel = pixel; m_isInit = TRUE; };
 
   // Allocate a colour, or nearest colour, using the given display.
   // If realloc is TRUE, ignore the existing pixel, otherwise just return
@@ -65,17 +67,15 @@ public:
 
   int AllocColour(WXDisplay* display, bool realloc = FALSE);
 
- private:
+private:
   bool          m_isInit;
   unsigned char m_red;
   unsigned char m_blue;
   unsigned char m_green;
- public:
-  int           m_pixel;
 
+public:
+  int           m_pixel;
 };
 
-#define wxColor wxColour
-
 #endif
        // _WX_COLOUR_H_
index e8ac082a8096bd26f33fd59a02922372557c0390..8a69853d11f347eed81d9793b368eef01dce6015 100644 (file)
@@ -52,7 +52,6 @@ class WXDLLEXPORT wxPen: public wxGDIObject
 public:
   wxPen();
   wxPen(const wxColour& col, int width, int style);
-  wxPen(const wxString& col, int width, int style);
   wxPen(const wxBitmap& stipple, int width);
   inline wxPen(const wxPen& pen) { Ref(pen); }
   inline wxPen(const wxPen* pen) { if (pen) Ref(*pen); }
@@ -66,8 +65,7 @@ public:
 
   // Override in order to recreate the pen
   void SetColour(const wxColour& col) ;
-  void SetColour(const wxString& col)  ;
-  void SetColour(const unsigned char r, const unsigned char g, const unsigned char b)  ;
+  void SetColour(unsigned char r, unsigned char g, unsigned char b)  ;
 
   void SetWidth(int width)  ;
   void SetStyle(int style)  ;
index b8f2270a4d2eb2116d8d12738f363bd5e6e43f15..fabd5ad99c26e650518faf784cf7aabc9b90bbaf 100644 (file)
 class WXDLLEXPORT wxColour: public wxObject
 {
 public:
+  // ctors
+    // default
   wxColour();
-  wxColour(const unsigned char r, const unsigned char g, const unsigned char b);
-  wxColour(unsigned long colRGB) { Set(colRGB); }
-  wxColour(const wxColour& col);
-  wxColour(const wxString& col) { InitFromName(col); }
-//  wxColour(const char *col) { InitFromName(col); }
+    // from RGB
+  wxColour( char red, char green, char blue );
+    // implicit conversion from the colour name
+  wxColour( const wxString &colourName ) { InitFromName(colourName); }
+  wxColour( const char *colourName ) { InitFromName(colourName); }
+
+    // copy ctors and assignment operators
+  wxColour( const wxColour& col );
+  wxColour( const wxColour* col );
+  wxColour& operator = ( const wxColour& col );
+
+    // dtor
   ~wxColour();
 
-  wxColour& operator =(const wxColour& src) ;
-  wxColour& operator =(const wxString& src) ;
-  inline int Ok() const { return (m_isInit) ; }
-
-  void Set(unsigned char r, unsigned char g, unsigned char b);
+  // Set() functions
+  void Set( unsigned char red, unsigned char green, unsigned char blue );
   void Set(unsigned long colRGB)
   {
     // we don't need to know sizeof(long) here because we assume that the three
@@ -42,23 +48,31 @@ public:
         (unsigned char)(colRGB >> 16));
   }
 
+  // accessors
+  bool Ok() const {return m_isInit; }
+
   // Let's remove this inelegant function
 #if WXWIN_COMPATIBILITY
   void Get(unsigned char *r, unsigned char *g, unsigned char *b) const;
 #endif
 
-  inline unsigned char Red() const { return m_red; }
-  inline unsigned char Green() const { return m_green; }
-  inline unsigned char Blue() const { return m_blue; }
-
-  inline bool operator == (const wxColour& colour) { return (m_red == colour.m_red && m_green == colour.m_green && m_blue == colour.m_blue); }
+  unsigned char Red() const { return m_red; }
+  unsigned char Green() const { return m_green; }
+  unsigned char Blue() const { return m_blue; }
 
-  inline bool operator != (const wxColour& colour) { return (!(m_red == colour.m_red && m_green == colour.m_green && m_blue == colour.m_blue)); }
+  // comparison
+  bool operator == (const wxColour& colour)
+  {
+    return (m_red == colour.m_red && 
+            m_green == colour.m_green && 
+            m_blue == colour.m_blue);
+  }
+  bool operator != (const wxColour& colour) { return !(*this == colour); }
 
   WXCOLORREF GetPixel() const { return m_pixel; };
 
 private:
-  bool                         m_isInit;
+  bool                             m_isInit;
   unsigned char m_red;
   unsigned char m_blue;
   unsigned char m_green;
@@ -73,7 +87,5 @@ private:
   DECLARE_DYNAMIC_CLASS(wxColour)
 };
 
-#define wxColor wxColour
-
 #endif
        // _WX_COLOUR_H_
index 7635328dbdbe4b409652a147643b6339d04e4ac4..9915f97622044b10e91e26b15930020b49136956 100644 (file)
@@ -26,9 +26,9 @@ class WXDLLEXPORT wxPenRefData: public wxGDIRefData
 {
     friend class WXDLLEXPORT wxPen;
 public:
-    wxPenRefData(void);
+    wxPenRefData();
     wxPenRefData(const wxPenRefData& data);
-    ~wxPenRefData(void);
+    ~wxPenRefData();
 
 protected:
   int           m_width;
@@ -49,19 +49,19 @@ class WXDLLEXPORT wxPen: public wxGDIObject
 {
   DECLARE_DYNAMIC_CLASS(wxPen)
 public:
-  wxPen(void);
+  wxPen();
   wxPen(const wxColour& col, int width, int style);
   wxPen(const wxString& col, int width, int style);
   wxPen(const wxBitmap& stipple, int width);
   inline wxPen(const wxPen& pen) { Ref(pen); }
   inline wxPen(const wxPen* pen) { if (pen) Ref(*pen); }
-  ~wxPen(void);
+  ~wxPen();
 
   inline wxPen& operator = (const wxPen& pen) { if (*this == pen) return (*this); Ref(pen); return *this; }
   inline bool operator == (const wxPen& pen) { return m_refData == pen.m_refData; }
   inline bool operator != (const wxPen& pen) { return m_refData != pen.m_refData; }
 
-  virtual bool Ok(void) const { return (m_refData != NULL) ; }
+  virtual bool Ok() const { return (m_refData != NULL) ; }
 
   // Override in order to recreate the pen
   void SetColour(const wxColour& col) ;
@@ -75,22 +75,22 @@ public:
   void SetJoin(int join)  ;
   void SetCap(int cap)  ;
 
-  inline wxColour& GetColour(void) const { return (M_PENDATA ? M_PENDATA->m_colour : wxNullColour); };
-  inline int GetWidth(void) const { return (M_PENDATA ? M_PENDATA->m_width : 0); };
-  inline int GetStyle(void) const { return (M_PENDATA ? M_PENDATA->m_style : 0); };
-  inline int GetJoin(void) const { return (M_PENDATA ? M_PENDATA->m_join : 0); };
-  inline int GetCap(void) const { return (M_PENDATA ? M_PENDATA->m_cap : 0); };
+  inline wxColour& GetColour() const { return (M_PENDATA ? M_PENDATA->m_colour : wxNullColour); };
+  inline int GetWidth() const { return (M_PENDATA ? M_PENDATA->m_width : 0); };
+  inline int GetStyle() const { return (M_PENDATA ? M_PENDATA->m_style : 0); };
+  inline int GetJoin() const { return (M_PENDATA ? M_PENDATA->m_join : 0); };
+  inline int GetCap() const { return (M_PENDATA ? M_PENDATA->m_cap : 0); };
   inline int GetDashes(wxDash **ptr) const {
      *ptr = (M_PENDATA ? M_PENDATA->m_dash : NULL); return (M_PENDATA ? M_PENDATA->m_nbDash : 0);
   }
 
-  inline wxBitmap *GetStipple(void) const { return (M_PENDATA ? (& M_PENDATA->m_stipple) : NULL); };
+  inline wxBitmap *GetStipple() const { return (M_PENDATA ? (& M_PENDATA->m_stipple) : NULL); };
 
   // Internal
-  bool RealizeResource(void);
+  bool RealizeResource();
   bool FreeResource(bool force = FALSE);
-  WXHANDLE GetResourceHandle(void) ;
-  bool IsFree(void);
+  WXHANDLE GetResourceHandle() ;
+  bool IsFree() const;
   void Unshare();
 };
 
index cd525bf950570d1159567de5eaa4f99b61c11c9b..6bff2018f72aa9977a59b95383a02c30566107c5 100644 (file)
@@ -50,14 +50,12 @@ class WXDLLEXPORT wxBrush: public wxGDIObject
 public:
   wxBrush();
   wxBrush(const wxColour& col, int style);
-  wxBrush(const wxString& col, int style);
   wxBrush(const wxBitmap& stipple);
   inline wxBrush(const wxBrush& brush) { Ref(brush); }
   inline wxBrush(const wxBrush* brush) { if (brush) Ref(*brush); }
   ~wxBrush();
 
   virtual void SetColour(const wxColour& col)  ;
-  virtual void SetColour(const wxString& col)  ;
   virtual void SetColour(unsigned char r, unsigned char g, unsigned char b)  ;
   virtual void SetStyle(int style)  ;
   virtual void SetStipple(const wxBitmap& stipple)  ;
index 452d946cdca9377a672c963a33daac7933761abe..0f592f578990e41e3435cedab7b67b52b4c0a845 100644 (file)
 // Colour
 class WXDLLEXPORT wxColour: public wxObject
 {
-  DECLARE_DYNAMIC_CLASS(wxColour)
 public:
+  // ctors
+    // default
   wxColour();
-  wxColour(unsigned char r, unsigned char g, unsigned char b);
-  wxColour(unsigned long colRGB) { Set(colRGB); }
-  wxColour(const wxColour& col);
-  wxColour(const wxString& col);
-  ~wxColour() ;
-  wxColour& operator =(const wxColour& src) ;
-  wxColour& operator =(const wxString& src) ;
-  inline int Ok() const { return (m_isInit) ; }
-
-  void Set(unsigned char r, unsigned char g, unsigned char b);
-  void Set(unsigned long colRGB) 
-  { 
+    // from RGB
+  wxColour( char red, char green, char blue );
+    // implicit conversion from the colour name
+  wxColour( const wxString &colourName ) { InitFromName(colourName); }
+  wxColour( const char *colourName ) { InitFromName(colourName); }
+
+    // copy ctors and assignment operators
+  wxColour( const wxColour& col );
+  wxColour( const wxColour* col );
+  wxColour& operator = ( const wxColour& col );
+
+    // dtor
+  ~wxColour();
+
+  // Set() functions
+  void Set( unsigned char red, unsigned char green, unsigned char blue );
+  void Set( unsigned long colRGB )
+  {
     // we don't need to know sizeof(long) here because we assume that the three
     // least significant bytes contain the R, G and B values
-    Set((unsigned char)colRGB, 
+    Set((unsigned char)colRGB,
         (unsigned char)(colRGB >> 8),
-        (unsigned char)(colRGB >> 16)); 
+        (unsigned char)(colRGB >> 16));
   }
 
-  inline unsigned char Red() const { return m_red; }
-  inline unsigned char Green() const { return m_green; }
-  inline unsigned char Blue() const { return m_blue; }
+  // accessors
+  bool Ok() const {return m_isInit; }
 
-  inline bool operator == (const wxColour& colour) { return (m_red == colour.m_red && m_green == colour.m_green && m_blue == colour.m_blue); }
+  // Let's remove this inelegant function
+#if WXWIN_COMPATIBILITY
+  void Get(unsigned char *r, unsigned char *g, unsigned char *b) const;
+#endif
+
+  unsigned char Red() const { return m_red; }
+  unsigned char Green() const { return m_green; }
+  unsigned char Blue() const { return m_blue; }
 
-  inline bool operator != (const wxColour& colour) { return (!(m_red == colour.m_red && m_green == colour.m_green && m_blue == colour.m_blue)); }
+  // comparison
+  bool operator == (const wxColour& colour)
+  {
+    return (m_red == colour.m_red && 
+            m_green == colour.m_green && 
+            m_blue == colour.m_blue);
+  }
+  bool operator != (const wxColour& colour) { return !(*this == colour); }
 
 /* TODO
   WXCOLORREF GetPixel() const { return m_pixel; };
 */
 
- private:
-  bool                         m_isInit;
+private:
+  bool                             m_isInit;
   unsigned char m_red;
   unsigned char m_blue;
   unsigned char m_green;
- public:
-/* TODO: implementation
-  WXCOLORREF m_pixel ;
-*/
-};
 
-#define wxColor wxColour
+public:
+  /* TODO: implementation
+     WXCOLORREF m_pixel ;
+   */
+
+private:
+  DECLARE_DYNAMIC_CLASS(wxColour)
+};
 
 #endif
        // _WX_COLOUR_H_
index 2d0aa7b84657ddce2597e9ff1f2da17fb890457a..5097841e3471107ad07bc0324e7bce44756370c6 100644 (file)
@@ -55,7 +55,6 @@ class WXDLLEXPORT wxPen: public wxGDIObject
 public:
   wxPen();
   wxPen(const wxColour& col, int width, int style);
-  wxPen(const wxString& col, int width, int style);
   wxPen(const wxBitmap& stipple, int width);
   inline wxPen(const wxPen& pen) { Ref(pen); }
   inline wxPen(const wxPen* pen) { if (pen) Ref(*pen); }
@@ -69,8 +68,7 @@ public:
 
   // Override in order to recreate the pen
   void SetColour(const wxColour& col) ;
-  void SetColour(const wxString& col)  ;
-  void SetColour(const unsigned char r, const unsigned char g, const unsigned char b)  ;
+  void SetColour(unsigned char r, unsigned char g, unsigned char b)  ;
 
   void SetWidth(int width)  ;
   void SetStyle(int style)  ;
index 180ffe799ac2055353d61d714b09b5a9c025ec24..c08ec582d9d71a04d4257238bc722eb13edf5e89 100644 (file)
@@ -9,7 +9,7 @@
 /////////////////////////////////////////////////////////////////////////////
 
 #ifdef __GNUG__
-#pragma interface "controls.h"
+#pragma implementation "controls.h"
 #endif
 
 // For compilers that support precompilation, includes "wx/wx.h".
@@ -209,7 +209,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) :
   wxPanel( frame, -1, wxPoint(x, y), wxSize(w, h) )
 {
   m_text = new wxTextCtrl( this, -1, "This is the log window.\n", wxPoint(0,50), wxSize(100,50), wxTE_MULTILINE );
-  m_text->SetBackgroundColour(wxColor("yellow"));
+  m_text->SetBackgroundColour("yellow");
   
   m_notebook = new wxNotebook( this, ID_NOTEBOOK, wxPoint(0,0), wxSize(200,150) );
   
@@ -248,11 +248,11 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) :
 
   wxPanel *panel = new wxPanel(m_notebook);
   m_listbox = new wxListBox( panel, ID_LISTBOX, wxPoint(10,10), wxSize(120,70), 4, choices );
-  m_listbox->SetBackgroundColour(wxColour("red"));
+  m_listbox->SetBackgroundColour("red");
   (void)new wxButton( panel, ID_LISTBOX_SEL_NUM, "Select #2", wxPoint(180,30), wxSize(140,30) );
   (void)new wxButton( panel, ID_LISTBOX_SEL_STR, "Select 'This'", wxPoint(340,30), wxSize(140,30) );
   wxButton *btn = new wxButton( panel, ID_LISTBOX_CLEAR, "Clear", wxPoint(180,80), wxSize(140,30) );
-  btn->SetBackgroundColour(wxColour("green"));
+  btn->SetBackgroundColour("green");
   (void)new wxButton( panel, ID_LISTBOX_APPEND, "Append 'Hi!'", wxPoint(340,80), wxSize(140,30) );
   (void)new wxButton( panel, ID_LISTBOX_DELETE, "Delete selected item", wxPoint(180,130), wxSize(140,30) );
   (void)new wxButton( panel, ID_LISTBOX_FONT, "Set Italic font", wxPoint(340,130), wxSize(140,30) );
index d97f067d226425b4efc09eb88d2e9205173a2b98..a6c575f1c1aeb7331f329cbaa2a4607765512d53 100644 (file)
@@ -512,15 +512,6 @@ wxPen *wxPenList::FindOrCreatePen (const wxColour& colour, int width, int style)
   return pen;
 }
 
-wxPen *wxPenList::FindOrCreatePen (const wxString& colour, int width, int style)
-{
-  wxColour *the_colour = wxTheColourDatabase->FindColour (colour);
-  if (the_colour)
-    return FindOrCreatePen (*the_colour, width, style);
-  else
-    return (wxPen *) NULL;
-}
-
 wxBrushList::~wxBrushList ()
 {
 #ifdef __WXMSW__
@@ -562,15 +553,6 @@ wxBrush *wxBrushList::FindOrCreateBrush (const wxColour& colour, int style)
   return brush;
 }
 
-wxBrush *wxBrushList::FindOrCreateBrush (const wxString& colour, int style)
-{
-  wxColour *the_colour = wxTheColourDatabase->FindColour (colour);
-  if (the_colour)
-    return FindOrCreateBrush (*the_colour, style);
-  else
-    return (wxBrush *) NULL;
-}
-
 void wxBrushList::RemoveBrush (wxBrush * brush)
 {
   DeleteObject (brush);
index 9b36dfce3d3571f4cab95c728264b3b3893a3d20..ae90ec472d5236f012aea3fa36e0b1f7f09a9b33 100644 (file)
@@ -62,15 +62,6 @@ wxBrush::wxBrush( const wxColour &colour, int style )
   if (wxTheBrushList) wxTheBrushList->AddBrush( this );
 }
 
-wxBrush::wxBrush( const wxString &colourName, int style )
-{
-  m_refData = new wxBrushRefData();
-  M_BRUSHDATA->m_style = style;
-  M_BRUSHDATA->m_colour = colourName;
-  
-  if (wxTheBrushList) wxTheBrushList->AddBrush( this );
-}
-
 wxBrush::wxBrush( const wxBitmap &stippleBitmap )
 {
   m_refData = new wxBrushRefData();
@@ -161,12 +152,6 @@ void wxBrush::SetColour( const wxColour& col )
   M_BRUSHDATA->m_colour = col;
 }
 
-void wxBrush::SetColour( const wxString& col )
-{
-  Unshare();
-  M_BRUSHDATA->m_colour = col;
-}
-
 void wxBrush::SetColour( unsigned char r, unsigned char g, unsigned char b )
 {
   Unshare();
index 0f9cb80716764e44273339fe9d433382048e8bad..b7c2dc11769cb2ecbe33d9cc1c42db048b32200b 100644 (file)
@@ -121,28 +121,6 @@ wxColour& wxColour::operator = ( const wxColour& col )
   return *this; 
 }
 
-wxColour& wxColour::operator = ( const wxString& colourName ) 
-{ 
-  UnRef();
-  wxNode *node = (wxNode *) NULL;
-  if ((wxTheColourDatabase) && (node = wxTheColourDatabase->Find(colourName)) ) 
-  {
-    wxColour *col = (wxColour*)node->Data();
-    if (col) Ref( *col );
-  } 
-  else 
-  {
-    m_refData = new wxColourRefData();
-    if (!gdk_color_parse( colourName, &M_COLDATA->m_color ))
-    {
-      wxFAIL_MSG( "wxColour: couldn't find colour" );
-      delete m_refData;
-      m_refData = (wxObjectRefData *) NULL;
-    }
-  }
-  return *this; 
-}
-
 bool wxColour::operator == ( const wxColour& col ) 
 { 
   return m_refData == col.m_refData; 
index d9b2bbc0909d8283521b689269e8d5b6132a5f5e..0a3b30089d1cdf6f8ed11a5b29dcbc5bda5c23b0 100644 (file)
@@ -351,10 +351,14 @@ bool wxNotebook::AddPage(wxWindow* win, const wxString& text,
   {
     wxASSERT( m_imageList != NULL );
 
-    wxBitmap *bmp = m_imageList->GetBitmap(imageId);
+    const wxBitmap *bmp = m_imageList->GetBitmap(imageId);
     GdkPixmap *pixmap = bmp->GetPixmap();
     GdkBitmap *mask = (GdkBitmap*) NULL;
-    if (bmp->GetMask()) mask = bmp->GetMask()->GetBitmap();
+    if ( bmp->GetMask() )
+    {
+      mask = bmp->GetMask()->GetBitmap();
+    }
+
     GtkWidget *pixmapwid = gtk_pixmap_new (pixmap, mask );
 
     gtk_box_pack_start(GTK_BOX(page->m_box), pixmapwid, FALSE, FALSE, 3);
index a0fd6d563bdcd9a555531816b81531fb0a551e49..f897cb2d95c90fe3796858d15ea423836b9acedf 100644 (file)
@@ -71,16 +71,6 @@ wxPen::wxPen( const wxColour &colour, int width, int style )
   if (wxThePenList) wxThePenList->AddPen( this );
 }
 
-wxPen::wxPen( const wxString &colourName, int width, int style )
-{
-  m_refData = new wxPenRefData();
-  M_PENDATA->m_width = width;
-  M_PENDATA->m_style = style;
-  M_PENDATA->m_colour = colourName;
-  
-  if (wxThePenList) wxThePenList->AddPen( this );
-}
-
 wxPen::wxPen( const wxPen& pen )
 {
   Ref( pen );
@@ -123,12 +113,6 @@ void wxPen::SetColour( const wxColour &colour )
   M_PENDATA->m_colour = colour;
 }
 
-void wxPen::SetColour( const wxString &colourName )
-{
-  Unshare();
-  M_PENDATA->m_colour = colourName;
-}
-
 void wxPen::SetColour( int red, int green, int blue )
 {
   Unshare();
index 9b36dfce3d3571f4cab95c728264b3b3893a3d20..ae90ec472d5236f012aea3fa36e0b1f7f09a9b33 100644 (file)
@@ -62,15 +62,6 @@ wxBrush::wxBrush( const wxColour &colour, int style )
   if (wxTheBrushList) wxTheBrushList->AddBrush( this );
 }
 
-wxBrush::wxBrush( const wxString &colourName, int style )
-{
-  m_refData = new wxBrushRefData();
-  M_BRUSHDATA->m_style = style;
-  M_BRUSHDATA->m_colour = colourName;
-  
-  if (wxTheBrushList) wxTheBrushList->AddBrush( this );
-}
-
 wxBrush::wxBrush( const wxBitmap &stippleBitmap )
 {
   m_refData = new wxBrushRefData();
@@ -161,12 +152,6 @@ void wxBrush::SetColour( const wxColour& col )
   M_BRUSHDATA->m_colour = col;
 }
 
-void wxBrush::SetColour( const wxString& col )
-{
-  Unshare();
-  M_BRUSHDATA->m_colour = col;
-}
-
 void wxBrush::SetColour( unsigned char r, unsigned char g, unsigned char b )
 {
   Unshare();
index 0f9cb80716764e44273339fe9d433382048e8bad..b7c2dc11769cb2ecbe33d9cc1c42db048b32200b 100644 (file)
@@ -121,28 +121,6 @@ wxColour& wxColour::operator = ( const wxColour& col )
   return *this; 
 }
 
-wxColour& wxColour::operator = ( const wxString& colourName ) 
-{ 
-  UnRef();
-  wxNode *node = (wxNode *) NULL;
-  if ((wxTheColourDatabase) && (node = wxTheColourDatabase->Find(colourName)) ) 
-  {
-    wxColour *col = (wxColour*)node->Data();
-    if (col) Ref( *col );
-  } 
-  else 
-  {
-    m_refData = new wxColourRefData();
-    if (!gdk_color_parse( colourName, &M_COLDATA->m_color ))
-    {
-      wxFAIL_MSG( "wxColour: couldn't find colour" );
-      delete m_refData;
-      m_refData = (wxObjectRefData *) NULL;
-    }
-  }
-  return *this; 
-}
-
 bool wxColour::operator == ( const wxColour& col ) 
 { 
   return m_refData == col.m_refData; 
index d9b2bbc0909d8283521b689269e8d5b6132a5f5e..0a3b30089d1cdf6f8ed11a5b29dcbc5bda5c23b0 100644 (file)
@@ -351,10 +351,14 @@ bool wxNotebook::AddPage(wxWindow* win, const wxString& text,
   {
     wxASSERT( m_imageList != NULL );
 
-    wxBitmap *bmp = m_imageList->GetBitmap(imageId);
+    const wxBitmap *bmp = m_imageList->GetBitmap(imageId);
     GdkPixmap *pixmap = bmp->GetPixmap();
     GdkBitmap *mask = (GdkBitmap*) NULL;
-    if (bmp->GetMask()) mask = bmp->GetMask()->GetBitmap();
+    if ( bmp->GetMask() )
+    {
+      mask = bmp->GetMask()->GetBitmap();
+    }
+
     GtkWidget *pixmapwid = gtk_pixmap_new (pixmap, mask );
 
     gtk_box_pack_start(GTK_BOX(page->m_box), pixmapwid, FALSE, FALSE, 3);
index a0fd6d563bdcd9a555531816b81531fb0a551e49..f897cb2d95c90fe3796858d15ea423836b9acedf 100644 (file)
@@ -71,16 +71,6 @@ wxPen::wxPen( const wxColour &colour, int width, int style )
   if (wxThePenList) wxThePenList->AddPen( this );
 }
 
-wxPen::wxPen( const wxString &colourName, int width, int style )
-{
-  m_refData = new wxPenRefData();
-  M_PENDATA->m_width = width;
-  M_PENDATA->m_style = style;
-  M_PENDATA->m_colour = colourName;
-  
-  if (wxThePenList) wxThePenList->AddPen( this );
-}
-
 wxPen::wxPen( const wxPen& pen )
 {
   Ref( pen );
@@ -123,12 +113,6 @@ void wxPen::SetColour( const wxColour &colour )
   M_PENDATA->m_colour = colour;
 }
 
-void wxPen::SetColour( const wxString &colourName )
-{
-  Unshare();
-  M_PENDATA->m_colour = colourName;
-}
-
 void wxPen::SetColour( int red, int green, int blue )
 {
   Unshare();
index 4c719acade0b39798ce0aa13c400f68e440b84b4..804bcaaa3e9bf30ca75aea6bc9271e0dad5fd48f 100644 (file)
@@ -63,20 +63,6 @@ wxBrush::wxBrush(const wxColour& col, int Style)
         wxTheBrushList->AddBrush(this);
 }
 
-wxBrush::wxBrush(const wxString& col, int Style)
-{
-    m_refData = new wxBrushRefData;
-
-    // Implicit conversion from string to wxColour via colour database
-    M_BRUSHDATA->m_colour = col;
-    M_BRUSHDATA->m_style = Style;
-
-    RealizeResource();
-
-    if ( wxTheBrushList )
-        wxTheBrushList->AddBrush(this);
-}
-
 wxBrush::wxBrush(const wxBitmap& stipple)
 {
     m_refData = new wxBrushRefData;
@@ -114,16 +100,7 @@ void wxBrush::SetColour(const wxColour& col)
     RealizeResource();
 }
 
-void wxBrush::SetColour(const wxString& col)
-{
-    Unshare();
-
-    M_BRUSHDATA->m_colour = col;
-
-    RealizeResource();
-}
-
-void wxBrush::SetColour(const unsigned char r, const unsigned char g, const unsigned char b)
+void wxBrush::SetColour(unsigned char r, unsigned char g, unsigned char b)
 {
     Unshare();
 
index a6a1287ff6471440fc67cef6b940dee1bec34cd9..9963f79b6b7b9444ad632eeeab872d63fbfcf4ef 100644 (file)
@@ -65,7 +65,7 @@ wxColour& wxColour::operator =(const wxColour& col)
   return *this;
 }
 
-wxColour::wxColour (const wxString& col)
+void wxColour::InitFromName(const wxString& col)
 {
     wxColour *the_colour = wxTheColourDatabase->FindColour (col);
     if (the_colour)
@@ -89,28 +89,6 @@ wxColour::~wxColour ()
 {
 }
 
-wxColour& wxColour::operator = (const wxString& col)
-{
-    wxColour *the_colour = wxTheColourDatabase->FindColour (col);
-    if (the_colour)
-    {
-        m_red = the_colour->Red ();
-        m_green = the_colour->Green ();
-        m_blue = the_colour->Blue ();
-        m_pixel = the_colour->m_pixel;
-        m_isInit = TRUE;
-    }
-    else
-    {
-        m_red = 0;
-        m_green = 0;
-        m_blue = 0;
-        m_isInit = FALSE;
-    }
-
-    return (*this);
-}
-
 void wxColour::Set (unsigned char r, unsigned char g, unsigned char b)
 {
     m_red = r;
index 076335cccf8321573f31399a420c36e84029fe1f..6bbfcd7a0cb67ebf5012482d6dc8125fb0b91d6e 100644 (file)
@@ -97,24 +97,6 @@ wxPen::wxPen(const wxBitmap& stipple, int Width)
         wxThePenList->AddPen(this);
 }
 
-wxPen::wxPen(const wxString& col, int Width, int Style)
-{
-    m_refData = new wxPenRefData;
-
-    M_PENDATA->m_colour = col;
-    M_PENDATA->m_width = Width;
-    M_PENDATA->m_style = Style;
-    M_PENDATA->m_join = wxJOIN_ROUND ;
-    M_PENDATA->m_cap = wxCAP_ROUND ;
-    M_PENDATA->m_nbDash = 0 ;
-    M_PENDATA->m_dash = 0 ;
-
-    RealizeResource();
-
-    if ( wxThePenList )
-        wxThePenList->AddPen(this);
-}
-
 void wxPen::Unshare()
 {
        // Don't change shared data
@@ -139,16 +121,7 @@ void wxPen::SetColour(const wxColour& col)
     RealizeResource();
 }
 
-void wxPen::SetColour(const wxString& col)
-{
-    Unshare();
-
-    M_PENDATA->m_colour = col;
-  
-    RealizeResource();
-}
-
-void wxPen::SetColour(const unsigned char r, const unsigned char g, const unsigned char b)
+void wxPen::SetColour(unsigned char r, unsigned char g, unsigned char b)
 {
     Unshare();
 
@@ -219,4 +192,3 @@ bool wxPen::RealizeResource()
     return TRUE;
 }
 
-
index 3f31a36166b2f300b837cb5e4d8ce5c3f1af6cae..4a46f5c0b43c2331757f417bb268b65ed9d60748 100644 (file)
@@ -84,20 +84,6 @@ wxBrush::wxBrush(const wxColour& col, int Style)
     wxTheBrushList->AddBrush(this);
 }
 
-wxBrush::wxBrush(const wxString& col, int Style)
-{
-  m_refData = new wxBrushRefData;
-
-  M_BRUSHDATA->m_colour = col;
-  M_BRUSHDATA->m_style = Style;
-  M_BRUSHDATA->m_hBrush = 0;
-
-  RealizeResource();
-
-  if ( wxTheBrushList )
-    wxTheBrushList->AddBrush(this);
-}
-
 wxBrush::wxBrush(const wxBitmap& stipple)
 {
   m_refData = new wxBrushRefData;
@@ -223,16 +209,7 @@ void wxBrush::SetColour(const wxColour& col)
     RealizeResource();
 }
 
-void wxBrush::SetColour(const wxString& col)
-{
-    Unshare();
-
-    M_BRUSHDATA->m_colour = col;
-
-    RealizeResource();
-}
-
-void wxBrush::SetColour(const unsigned char r, const unsigned char g, const unsigned char b)
+void wxBrush::SetColour(unsigned char r, unsigned char g, unsigned char b)
 {
     Unshare();
 
index 3c3fe85864ce75f1ce02e3432502ae2c5721da76..ed446cbaba77bd46d38e92cdba409aa8d4112da3 100644 (file)
@@ -38,7 +38,7 @@ wxColour::wxColour ()
   m_red = m_blue = m_green = 0;
 }
 
-wxColour::wxColour (const unsigned char r, const unsigned char g, const unsigned char b)
+wxColour::wxColour (unsigned char r, unsigned char g, unsigned char b)
 {
   m_red = r;
   m_green = g;
@@ -90,27 +90,6 @@ wxColour::~wxColour()
 {
 }
 
-wxColour& wxColour::operator = (const wxString& col)
-{
-  wxColour *the_colour = wxTheColourDatabase->FindColour (col);
-  if (the_colour)
-    {
-      m_red = the_colour->Red ();
-      m_green = the_colour->Green ();
-      m_blue = the_colour->Blue ();
-      m_isInit = TRUE;
-    }
-  else
-    {
-      m_red = 0;
-      m_green = 0;
-      m_blue = 0;
-      m_isInit = FALSE;
-    }
-  m_pixel = PALETTERGB (m_red, m_green, m_blue);
-  return (*this);
-}
-
 void wxColour::Set (unsigned char r, unsigned char g, unsigned char b)
 {
   m_red = r;
index ea9b92d66719ded593d344f724ac41f81c5089ed..50f821006a8042c5f1fc6e6838a4cb7de46e02f1 100644 (file)
@@ -36,7 +36,7 @@
 IMPLEMENT_DYNAMIC_CLASS(wxPen, wxGDIObject)
 #endif
 
-wxPenRefData::wxPenRefData(void)
+wxPenRefData::wxPenRefData()
 {
   m_style = wxSOLID;
   m_width = 1;
@@ -59,7 +59,7 @@ wxPenRefData::wxPenRefData(const wxPenRefData& data)
     m_hPen = 0;
 }
 
-wxPenRefData::~wxPenRefData(void)
+wxPenRefData::~wxPenRefData()
 {
        if ( m_hPen )
                ::DeleteObject((HPEN) m_hPen);
@@ -67,7 +67,7 @@ wxPenRefData::~wxPenRefData(void)
 
 // Pens
 
-wxPen::wxPen(void)
+wxPen::wxPen()
 {
   if ( wxThePenList )
     wxThePenList->AddPen(this);
@@ -143,27 +143,7 @@ wxPen::wxPen(const wxBitmap& stipple, int Width)
     wxThePenList->AddPen(this);
 }
 
-wxPen::wxPen(const wxString& col, int Width, int Style)
-{
-  m_refData = new wxPenRefData;
-
-  M_PENDATA->m_colour = col;
-//  M_PENDATA->m_stipple = NULL ;
-  M_PENDATA->m_width = Width;
-  M_PENDATA->m_style = Style;
-  M_PENDATA->m_join = wxJOIN_ROUND ;
-  M_PENDATA->m_cap = wxCAP_ROUND ;
-  M_PENDATA->m_nbDash = 0 ;
-  M_PENDATA->m_dash = 0 ;
-  M_PENDATA->m_hPen = 0 ;
-
-  RealizeResource();
-
-  if ( wxThePenList )
-    wxThePenList->AddPen(this);
-}
-
-bool wxPen::RealizeResource(void)
+bool wxPen::RealizeResource()
 {
   if (M_PENDATA && (M_PENDATA->m_hPen == 0))
   {
@@ -280,7 +260,7 @@ bool wxPen::RealizeResource(void)
   return FALSE;
 }
 
-WXHANDLE wxPen::GetResourceHandle(void)
+WXHANDLE wxPen::GetResourceHandle()
 {
        if ( !M_PENDATA )
                return 0;
@@ -299,7 +279,7 @@ bool wxPen::FreeResource(bool force)
   else return FALSE;
 }
 
-bool wxPen::IsFree(void)
+bool wxPen::IsFree() const
 {
   return (M_PENDATA && M_PENDATA->m_hPen == 0);
 }
@@ -328,16 +308,7 @@ void wxPen::SetColour(const wxColour& col)
     RealizeResource();
 }
 
-void wxPen::SetColour(const wxString& col)
-{
-    Unshare();
-
-    M_PENDATA->m_colour = col;
-  
-    RealizeResource();
-}
-
-void wxPen::SetColour(const unsigned char r, const unsigned char g, const unsigned char b)
+void wxPen::SetColour(unsigned char r, unsigned char g, unsigned char b)
 {
     Unshare();
 
index 0aa8fd927c3d90c7591c0ef70eaf3d83d11a19ec..4f28e92f53475598e8fb475fd7b1a0d387d7e90d 100644 (file)
@@ -68,20 +68,6 @@ wxBrush::wxBrush(const wxColour& col, int Style)
         wxTheBrushList->AddBrush(this);
 }
 
-wxBrush::wxBrush(const wxString& col, int Style)
-{
-    m_refData = new wxBrushRefData;
-
-    // Implicit conversion from string to wxColour via colour database
-    M_BRUSHDATA->m_colour = col;
-    M_BRUSHDATA->m_style = Style;
-
-    RealizeResource();
-
-    if ( wxTheBrushList )
-        wxTheBrushList->AddBrush(this);
-}
-
 wxBrush::wxBrush(const wxBitmap& stipple)
 {
     m_refData = new wxBrushRefData;
@@ -119,16 +105,7 @@ void wxBrush::SetColour(const wxColour& col)
     RealizeResource();
 }
 
-void wxBrush::SetColour(const wxString& col)
-{
-    Unshare();
-
-    M_BRUSHDATA->m_colour = col;
-
-    RealizeResource();
-}
-
-void wxBrush::SetColour(const unsigned char r, const unsigned char g, const unsigned char b)
+void wxBrush::SetColour(unsigned char r, unsigned char g, unsigned char b)
 {
     Unshare();
 
index d342d516de631ee3b2844d89fadbfbfc1bae0b42..8d0827ef1d7f1536832bf8c34eb3feb2e154cecb 100644 (file)
@@ -65,7 +65,7 @@ wxColour& wxColour::operator =(const wxColour& col)
   return *this;
 }
 
-wxColour::wxColour (const wxString& col)
+void wxColour::InitFromName(const wxString& col)
 {
     wxColour *the_colour = wxTheColourDatabase->FindColour (col);
     if (the_colour)
@@ -91,29 +91,6 @@ wxColour::~wxColour ()
 {
 }
 
-wxColour& wxColour::operator = (const wxString& col)
-{
-    wxColour *the_colour = wxTheColourDatabase->FindColour (col);
-    if (the_colour)
-    {
-        m_red = the_colour->Red ();
-        m_green = the_colour->Green ();
-        m_blue = the_colour->Blue ();
-        m_isInit = TRUE;
-    }
-    else
-    {
-        m_red = 0;
-        m_green = 0;
-        m_blue = 0;
-        m_isInit = FALSE;
-    }
-/* TODO
-    m_pixel = PALETTERGB (m_red, m_green, m_blue);
-*/
-    return (*this);
-}
-
 void wxColour::Set (unsigned char r, unsigned char g, unsigned char b)
 {
     m_red = r;
index d7b2ce264cb548485b611004010fb563ccf718c9..1e3ced2a3a484c777157da7da10c70737831a760 100644 (file)
@@ -104,24 +104,6 @@ wxPen::wxPen(const wxBitmap& stipple, int Width)
         wxThePenList->AddPen(this);
 }
 
-wxPen::wxPen(const wxString& col, int Width, int Style)
-{
-    m_refData = new wxPenRefData;
-
-    M_PENDATA->m_colour = col;
-    M_PENDATA->m_width = Width;
-    M_PENDATA->m_style = Style;
-    M_PENDATA->m_join = wxJOIN_ROUND ;
-    M_PENDATA->m_cap = wxCAP_ROUND ;
-    M_PENDATA->m_nbDash = 0 ;
-    M_PENDATA->m_dash = 0 ;
-
-    RealizeResource();
-
-    if ( wxThePenList )
-        wxThePenList->AddPen(this);
-}
-
 void wxPen::Unshare()
 {
        // Don't change shared data
@@ -146,16 +128,7 @@ void wxPen::SetColour(const wxColour& col)
     RealizeResource();
 }
 
-void wxPen::SetColour(const wxString& col)
-{
-    Unshare();
-
-    M_PENDATA->m_colour = col;
-  
-    RealizeResource();
-}
-
-void wxPen::SetColour(const unsigned char r, const unsigned char g, const unsigned char b)
+void wxPen::SetColour(unsigned char r, unsigned char g, unsigned char b)
 {
     Unshare();