]> git.saurik.com Git - wxWidgets.git/commitdiff
Miscellaneous, mostly cosmetic changes. wxPen/wxFont/wxBrush altered so Set...
authorJulian Smart <julian@anthemion.co.uk>
Sun, 9 Aug 1998 16:46:37 +0000 (16:46 +0000)
committerJulian Smart <julian@anthemion.co.uk>
Sun, 9 Aug 1998 16:46:37 +0000 (16:46 +0000)
functions don't change shared objects.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@489 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

17 files changed:
include/wx/msw/brush.h
include/wx/msw/clipbrd.h
include/wx/msw/dc.h
include/wx/msw/font.h
include/wx/msw/pen.h
include/wx/msw/textctrl.h
include/wx/msw/window.h
include/wx/toolbar.h
src/msw/bitmap.cpp
src/msw/brush.cpp
src/msw/font.cpp
src/msw/menu.cpp
src/msw/pen.cpp
src/msw/region.cpp
src/msw/textctrl.cpp
src/msw/treectrl.cpp
src/msw/window.cpp

index 71367662a470a6e79849ed2f3e545e524e9cba3f..e68db683b576352552d8aa2eae6073c4ef99be99 100644 (file)
@@ -27,6 +27,7 @@ class WXDLLEXPORT wxBrushRefData: public wxGDIRefData
     friend class WXDLLEXPORT wxBrush;
 public:
     wxBrushRefData(void);
+    wxBrushRefData(const wxBrushRefData& data);
     ~wxBrushRefData(void);
 
 protected:
@@ -49,7 +50,7 @@ public:
   wxBrush(const wxString& col, int style);
   wxBrush(const wxBitmap& stipple);
   inline wxBrush(const wxBrush& brush) { Ref(brush); }
-  inline wxBrush(const wxBrush* brush) { /* UnRef(); */ if (brush) Ref(*brush); }
+  inline wxBrush(const wxBrush* brush) { if (brush) Ref(*brush); }
   ~wxBrush(void);
 
   virtual void SetColour(const wxColour& col)  ;
@@ -72,12 +73,8 @@ public:
   bool RealizeResource(void);
   WXHANDLE GetResourceHandle(void) ;
   bool FreeResource(bool force = FALSE);
-/*
-  bool UseResource(void);
-  bool ReleaseResource(void);
-*/
-
   bool IsFree(void);
+  void Unshare();
 };
 
 #endif
index 8d4d4edfb23af8ea1d0b38d9ca0eb28b4d89f37f..6e816fab561a2f671913e5405abf0c901defd092 100644 (file)
@@ -104,7 +104,7 @@ class WXDLLEXPORT wxClipboard : public wxObject
 void WXDLLEXPORT wxInitClipboard(void);
 
 /* The clipboard */
-extern wxClipboard* WXDLLEXPORT wxTheClipboard;
+WXDLLEXPORT_DATA(extern wxClipboard*) wxTheClipboard;
 
 #endif // USE_CLIPBOARD
 #endif
index 8d90a1797ba9b44dfda8e799981e5b1348be870d..c7ca3e05ba02ab01213a25318e818bd986d78a7e 100644 (file)
@@ -52,7 +52,7 @@ public:
   }
 
   virtual void CrossHair(long x, long y) ;
-  virtual void CrossHair(const wxPoint& pt)
+  inline void CrossHair(const wxPoint& pt)
   {
     CrossHair(pt.x, pt.y);
   }
index 2ce96b9bd903d5a488e7b665da4a3b0e57f90306..83079df94d8d51d6f64547c6d36cf05cadb307f5 100644 (file)
@@ -25,6 +25,7 @@ class WXDLLEXPORT wxFontRefData: public wxGDIRefData
     friend class WXDLLEXPORT wxFont;
 public:
     wxFontRefData(void);
+    wxFontRefData(const wxFontRefData& data);
     ~wxFontRefData(void);
 protected:
   bool          m_temporary;   // If TRUE, the pointer to the actual font
@@ -53,7 +54,7 @@ public:
   wxFont(void);
   wxFont(int PointSize, int Family, int Style, int Weight, bool underlined = FALSE, const wxString& Face = wxEmptyString);
   inline wxFont(const wxFont& font) { Ref(font); }
-  inline wxFont(const wxFont* font) { /* UnRef(); */ if (font) Ref(*font); }
+  inline wxFont(const wxFont* font) { if (font) Ref(*font); }
 
   ~wxFont(void);
 
@@ -92,6 +93,9 @@ public:
   inline wxFont& operator = (const wxFont& font) { if (*this == font) return (*this); Ref(font); return *this; }
   inline bool operator == (const wxFont& font) { return m_refData == font.m_refData; }
   inline bool operator != (const wxFont& font) { return m_refData != font.m_refData; }
+
+protected:
+  void Unshare();
 };
 
 #endif
index 5bf73b0205ae2284c94337fbbb65a95de3e05023..7635328dbdbe4b409652a147643b6339d04e4ac4 100644 (file)
@@ -27,6 +27,7 @@ class WXDLLEXPORT wxPenRefData: public wxGDIRefData
     friend class WXDLLEXPORT wxPen;
 public:
     wxPenRefData(void);
+    wxPenRefData(const wxPenRefData& data);
     ~wxPenRefData(void);
 
 protected:
@@ -53,7 +54,7 @@ public:
   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) { /* UnRef(); */ if (pen) Ref(*pen); }
+  inline wxPen(const wxPen* pen) { if (pen) Ref(*pen); }
   ~wxPen(void);
 
   inline wxPen& operator = (const wxPen& pen) { if (*this == pen) return (*this); Ref(pen); return *this; }
@@ -90,6 +91,7 @@ public:
   bool FreeResource(bool force = FALSE);
   WXHANDLE GetResourceHandle(void) ;
   bool IsFree(void);
+  void Unshare();
 };
 
 int wx2msPenStyle(int wx_style);
index 1e8e351f0249863720b8abf01e6d4ed954e48689..44928ded075fd21a6d45108de03da19e9e5c0546 100644 (file)
@@ -147,7 +147,7 @@ public:
   
 protected:
   bool      m_isRich; // Are we using rich text edit to implement this?
-  wxString  fileName;
+  wxString  m_fileName;
   
   DECLARE_EVENT_TABLE()
 };
index 1ab4f69b508cc2dca8dc583f023c592c76c21f8a..75d17676f09028a4ec74ca1c636296b50aecf974 100644 (file)
@@ -67,7 +67,7 @@ class WXDLLEXPORT wxDC;
 class WXDLLEXPORT wxValidator;
 
 #if USE_DRAG_AND_DROP
-class wxDropTarget;
+class WXDLLEXPORT wxDropTarget;
 #endif
 
 #if USE_WX_RESOURCES
index 3f7abdfdea1999c46512f3e15d1fd1cdbb39b2e8..4b5c73acfbab9ddad3f6b356637a11db24e4d80f 100644 (file)
@@ -14,7 +14,7 @@
 #elif defined(__WXGTK__)
 #   include "wx/gtk/tbargtk.h"
 #elif defined(__WXQT__)
-#   include "wx/qt/tbargtk.h"
+#   include "wx/qt/tbarqt.h"
 #endif
 
 #endif
index aa0f6ed6996d696b18c6bb19500869bcc0f3f714..fe0edb9f120c092aaf4d7fbc9c37c5bd2ba3a52a 100644 (file)
@@ -256,7 +256,7 @@ bool wxBitmap::SaveFile(const wxString& filename, int type, const wxPalette *pal
 void wxBitmap::SetWidth(int w)
 {
   if (!M_BITMAPDATA)
-    m_refData = new wxBitmapRefData;
+  m_refData = new wxBitmapRefData;
 
   M_BITMAPDATA->m_width = w;
 }
index f9043c2e1d9ffee2d86d92815f09298f9391de27..3f31a36166b2f300b837cb5e4d8ce5c3f1af6cae 100644 (file)
@@ -40,7 +40,14 @@ IMPLEMENT_DYNAMIC_CLASS(wxBrush, wxGDIObject)
 wxBrushRefData::wxBrushRefData(void)
 {
   m_style = wxSOLID;
-//  m_stipple = NULL ;
+  m_hBrush = 0;
+}
+
+wxBrushRefData::wxBrushRefData(const wxBrushRefData& data)
+{
+  m_style = data.m_style;
+  m_stipple = data.m_stipple;
+  m_colour = data.m_colour;
   m_hBrush = 0;
 }
 
@@ -186,77 +193,69 @@ bool wxBrush::FreeResource(bool force)
   else return FALSE;
 }
 
-/*
-bool wxBrush::UseResource(void)
+bool wxBrush::IsFree(void)
 {
-  IncrementResourceUsage();
-  return TRUE;
+  return (M_BRUSHDATA && (M_BRUSHDATA->m_hBrush == 0));
 }
 
-bool wxBrush::ReleaseResource(void)
+void wxBrush::Unshare()
 {
-  DecrementResourceUsage();
-  return TRUE;
+       // Don't change shared data
+       if (!m_refData)
+    {
+               m_refData = new wxBrushRefData();
+       }
+    else
+    {
+               wxBrushRefData* ref = new wxBrushRefData(*(wxBrushRefData*)m_refData);
+               UnRef();
+               m_refData = ref;
+       }
 }
-*/
 
-bool wxBrush::IsFree(void)
-{
-  return (M_BRUSHDATA && (M_BRUSHDATA->m_hBrush == 0));
-}
 
 void wxBrush::SetColour(const wxColour& col)
 {
-  if ( !M_BRUSHDATA )
-       m_refData = new wxBrushRefData;
+    Unshare();
 
-  M_BRUSHDATA->m_colour = col;
+    M_BRUSHDATA->m_colour = col;
 
-  if (FreeResource())
     RealizeResource();
 }
 
 void wxBrush::SetColour(const wxString& col)
 {
-  if ( !M_BRUSHDATA )
-       m_refData = new wxBrushRefData;
+    Unshare();
 
-  M_BRUSHDATA->m_colour = col;
+    M_BRUSHDATA->m_colour = col;
 
-  if (FreeResource())
     RealizeResource();
 }
 
 void wxBrush::SetColour(const unsigned char r, const unsigned char g, const unsigned char b)
 {
-  if ( !M_BRUSHDATA )
-       m_refData = new wxBrushRefData;
+    Unshare();
 
-  M_BRUSHDATA->m_colour.Set(r, g, b);
+    M_BRUSHDATA->m_colour.Set(r, g, b);
 
-  if (FreeResource())
     RealizeResource();
 }
 
 void wxBrush::SetStyle(int Style)
 {
-  if ( !M_BRUSHDATA )
-       m_refData = new wxBrushRefData;
+    Unshare();
 
-  M_BRUSHDATA->m_style = Style;
+    M_BRUSHDATA->m_style = Style;
 
-  if (FreeResource())
     RealizeResource();
 }
 
 void wxBrush::SetStipple(const wxBitmap& Stipple)
 {
-  if ( !M_BRUSHDATA )
-       m_refData = new wxBrushRefData;
+    Unshare();
 
-  M_BRUSHDATA->m_stipple = Stipple;
+    M_BRUSHDATA->m_stipple = Stipple;
 
-  if (FreeResource())
     RealizeResource();
 }
 
index 66a9fdbb79547daa0bdf991fa96b2d293ad2bd0b..8fd41f1b384ef4d6fd77bd293ad5c0317466b441 100644 (file)
@@ -55,6 +55,20 @@ wxFontRefData::wxFontRefData(void)
        m_hFont = 0;
 }
 
+wxFontRefData::wxFontRefData(const wxFontRefData& data)
+{
+       m_style = data.m_style;
+       m_temporary = FALSE;
+       m_pointSize = data.m_pointSize;
+       m_family = data.m_family;
+       m_fontId = data.m_fontId;
+       m_style = data.m_style;
+       m_weight = data.m_weight;
+       m_underlined = data.m_underlined;
+       m_faceName = data.m_faceName;
+       m_hFont = 0;
+}
+
 wxFontRefData::~wxFontRefData(void)
 {
        if ( m_hFont )
@@ -70,27 +84,25 @@ wxFont::wxFont(void)
 /* Constructor for a font. Note that the real construction is done
  * in wxDC::SetFont, when information is available about scaling etc.
  */
-wxFont::wxFont(int PointSize, int Family, int Style, int Weight, bool Underlined, const wxString& Face)
+wxFont::wxFont(int pointSize, int family, int style, int weight, bool underlined, const wxString& faceName)
 {
-  Create(PointSize, Family, Style, Weight, Underlined, Face);
+    Create(pointSize, family, style, weight, underlined, faceName);
 
     if ( wxTheFontList )
         wxTheFontList->Append(this);
 }
 
-bool wxFont::Create(int PointSize, int Family, int Style, int Weight, bool Underlined, const wxString& Face)
+bool wxFont::Create(int pointSize, int family, int style, int weight, bool underlined, const wxString& faceName)
 {
   UnRef();
   m_refData = new wxFontRefData;
 
-  M_FONTDATA->m_family = Family;
-  M_FONTDATA->m_style = Style;
-  M_FONTDATA->m_weight = Weight;
-  M_FONTDATA->m_pointSize = PointSize;
-  M_FONTDATA->m_underlined = Underlined;
-  M_FONTDATA->m_faceName = Face;
-  M_FONTDATA->m_temporary = FALSE;
-  M_FONTDATA->m_hFont = 0;
+  M_FONTDATA->m_family = family;
+  M_FONTDATA->m_style = style;
+  M_FONTDATA->m_weight = weight;
+  M_FONTDATA->m_pointSize = pointSize;
+  M_FONTDATA->m_underlined = underlined;
+  M_FONTDATA->m_faceName = faceName;
 
   RealizeResource();
 
@@ -216,21 +228,7 @@ bool wxFont::FreeResource(bool force)
   return FALSE;
 }
 
-/*
-bool wxFont::UseResource(void)
-{
-  IncrementResourceUsage();
-  return TRUE;
-}
-
-bool wxFont::ReleaseResource(void)
-{
-  DecrementResourceUsage();
-  return TRUE;
-}
-*/
-  
-WXHANDLE wxFont::GetResourceHandle(void)
+WXHANDLE wxFont::GetResourceHandle()
 {
   if ( !M_FONTDATA )
        return 0;
@@ -238,51 +236,78 @@ WXHANDLE wxFont::GetResourceHandle(void)
     return (WXHANDLE)M_FONTDATA->m_hFont ;
 }
 
-bool wxFont::IsFree(void)
+bool wxFont::IsFree()
 {
   return (M_FONTDATA && (M_FONTDATA->m_hFont == 0));
 }
 
+void wxFont::Unshare()
+{
+       // Don't change shared data
+       if (!m_refData)
+    {
+               m_refData = new wxFontRefData();
+       }
+    else
+    {
+               wxFontRefData* ref = new wxFontRefData(*(wxFontRefData*)m_refData);
+               UnRef();
+               m_refData = ref;
+       }
+}
+
 void wxFont::SetPointSize(int pointSize)
 {
-    if ( !m_refData )
-        m_refData = new wxFontRefData;
+    Unshare();
+
     M_FONTDATA->m_pointSize = pointSize;
+
+    RealizeResource();
 }
 
 void wxFont::SetFamily(int family)
 {
-    if ( !m_refData )
-        m_refData = new wxFontRefData;
+    Unshare();
+
     M_FONTDATA->m_family = family;
+
+    RealizeResource();
 }
 
 void wxFont::SetStyle(int style)
 {
-    if ( !m_refData )
-        m_refData = new wxFontRefData;
+    Unshare();
+
     M_FONTDATA->m_style = style;
+
+    RealizeResource();
 }
 
 void wxFont::SetWeight(int weight)
 {
-    if ( !m_refData )
-        m_refData = new wxFontRefData;
+    Unshare();
+
     M_FONTDATA->m_weight = weight;
+
+    RealizeResource();
 }
 
 void wxFont::SetFaceName(const wxString& faceName)
 {
-    if ( !m_refData )
-        m_refData = new wxFontRefData;
+    Unshare();
+
     M_FONTDATA->m_faceName = faceName;
+
+    RealizeResource();
 }
 
 void wxFont::SetUnderlined(bool underlined)
 {
-    if ( !m_refData )
-        m_refData = new wxFontRefData;
+    Unshare();
+
     M_FONTDATA->m_underlined = underlined;
+
+    RealizeResource();
 }
 
 wxString wxFont::GetFamilyString(void) const
@@ -315,7 +340,6 @@ wxString wxFont::GetFamilyString(void) const
   return fam;
 }
 
-/* New font system */
 wxString wxFont::GetFaceName(void) const
 {
   wxString str("");
index 8a5350df2a17bd2fd6aa29c950f2355b8f468503..4a1f194854d01955038de5b947348b1d492e8080 100644 (file)
@@ -49,8 +49,8 @@
 #include <string.h>
 
 #if !USE_SHARED_LIBRARY
-IMPLEMENT_DYNAMIC_CLASS(wxMenu, wxWindow)
-IMPLEMENT_DYNAMIC_CLASS(wxMenuBar, wxWindow)
+IMPLEMENT_DYNAMIC_CLASS(wxMenu, wxEvtHandler)
+IMPLEMENT_DYNAMIC_CLASS(wxMenuBar, wxEvtHandler)
 #endif
 
 // ============================================================================
index 2818565949a09f013c83bbae49570bedec5c9fef..ea9b92d66719ded593d344f724ac41f81c5089ed 100644 (file)
@@ -38,7 +38,6 @@ IMPLEMENT_DYNAMIC_CLASS(wxPen, wxGDIObject)
 
 wxPenRefData::wxPenRefData(void)
 {
-//  m_stipple = NULL ;
   m_style = wxSOLID;
   m_width = 1;
   m_join = wxJOIN_ROUND ;
@@ -48,6 +47,18 @@ wxPenRefData::wxPenRefData(void)
   m_hPen = 0;
 }
 
+wxPenRefData::wxPenRefData(const wxPenRefData& data)
+{
+    m_style = data.m_style;
+    m_width = data.m_width;
+    m_join = data.m_join;
+    m_cap = data.m_cap;
+    m_nbDash = data.m_nbDash;
+    m_dash = data.m_dash;
+    m_colour = data.m_colour;
+    m_hPen = 0;
+}
+
 wxPenRefData::~wxPenRefData(void)
 {
        if ( m_hPen )
@@ -288,123 +299,106 @@ bool wxPen::FreeResource(bool force)
   else return FALSE;
 }
 
-/*
-bool wxPen::UseResource(void)
-{
-  IncrementResourceUsage();
-  return TRUE;
-}
-
-bool wxPen::ReleaseResource(void)
+bool wxPen::IsFree(void)
 {
-  DecrementResourceUsage();
-  return TRUE;
+  return (M_PENDATA && M_PENDATA->m_hPen == 0);
 }
-*/
 
-bool wxPen::IsFree(void)
+void wxPen::Unshare()
 {
-  return (M_PENDATA && M_PENDATA->m_hPen == 0);
+       // Don't change shared data
+       if (!m_refData)
+    {
+               m_refData = new wxPenRefData();
+       }
+    else
+    {
+               wxPenRefData* ref = new wxPenRefData(*(wxPenRefData*)m_refData);
+               UnRef();
+               m_refData = ref;
+       }
 }
 
 void wxPen::SetColour(const wxColour& col)
 {
-  if ( !M_PENDATA )
-       m_refData = new wxPenRefData;
+    Unshare();
 
-  M_PENDATA->m_colour = col;
+    M_PENDATA->m_colour = col;
   
-  if (FreeResource())
     RealizeResource();
 }
 
 void wxPen::SetColour(const wxString& col)
 {
-  if ( !M_PENDATA )
-       m_refData = new wxPenRefData;
+    Unshare();
 
-  M_PENDATA->m_colour = col;
+    M_PENDATA->m_colour = col;
   
-  if (FreeResource())
     RealizeResource();
 }
 
 void wxPen::SetColour(const unsigned char r, const unsigned char g, const unsigned char b)
 {
-  if ( !M_PENDATA )
-       m_refData = new wxPenRefData;
+    Unshare();
 
-  M_PENDATA->m_colour.Set(r, g, b);
+    M_PENDATA->m_colour.Set(r, g, b);
   
-  if (FreeResource())
     RealizeResource();
 }
 
 void wxPen::SetWidth(int Width)
 {
-  if ( !M_PENDATA )
-       m_refData = new wxPenRefData;
+    Unshare();
 
-  M_PENDATA->m_width = Width;
+    M_PENDATA->m_width = Width;
 
-  if (FreeResource())
     RealizeResource();
 }
 
 void wxPen::SetStyle(int Style)
 {
-  if ( !M_PENDATA )
-       m_refData = new wxPenRefData;
+    Unshare();
 
-  M_PENDATA->m_style = Style;
+    M_PENDATA->m_style = Style;
 
-  if (FreeResource())
     RealizeResource();
 }
 
 void wxPen::SetStipple(const wxBitmap& Stipple)
 {
-  if ( !M_PENDATA )
-       m_refData = new wxPenRefData;
+    Unshare();
 
-  M_PENDATA->m_stipple = Stipple;
-  M_PENDATA->m_style = wxSTIPPLE;
+    M_PENDATA->m_stipple = Stipple;
+    M_PENDATA->m_style = wxSTIPPLE;
   
-  if (FreeResource())
     RealizeResource();
 }
 
 void wxPen::SetDashes(int nb_dashes, const wxDash *Dash)
 {
-  if ( !M_PENDATA )
-       m_refData = new wxPenRefData;
+    Unshare();
 
-  M_PENDATA->m_nbDash = nb_dashes;
-  M_PENDATA->m_dash = (wxDash *)Dash;
+    M_PENDATA->m_nbDash = nb_dashes;
+    M_PENDATA->m_dash = (wxDash *)Dash;
   
-  if (FreeResource())
     RealizeResource();
 }
 
 void wxPen::SetJoin(int Join)
 {
-  if ( !M_PENDATA )
-       m_refData = new wxPenRefData;
+    Unshare();
 
-  M_PENDATA->m_join = Join;
+    M_PENDATA->m_join = Join;
 
-  if (FreeResource())
     RealizeResource();
 }
 
 void wxPen::SetCap(int Cap)
 {
-  if ( !M_PENDATA )
-       m_refData = new wxPenRefData;
+    Unshare();
 
-  M_PENDATA->m_cap = Cap;
+    M_PENDATA->m_cap = Cap;
 
-  if (FreeResource())
     RealizeResource();
 }
 
index 1e59e6b0b9d55393d92cd81e14901b8d9faf8f4a..a65999c240960adcb9fa3c58e008ec679ced167c 100644 (file)
@@ -36,6 +36,7 @@ class WXDLLEXPORT wxRegionRefData : public wxGDIRefData {
 public:
        wxRegionRefData(void)
        {
+        m_region = 0;
        }
 
        wxRegionRefData(const wxRegionRefData& data)
index 5fc6c3e2ad85657d256f6af2f035d6ae6c83e952..3def23203d57672f8715cd4dc3ab2e5303d82180 100644 (file)
@@ -72,7 +72,7 @@ wxTextCtrl::wxTextCtrl(void)
  :streambuf()
 #endif
 {
-  fileName = "";
+  m_fileName = "";
   m_isRich = FALSE;
 }
 
@@ -83,7 +83,7 @@ bool wxTextCtrl::Create(wxWindow *parent, wxWindowID id,
            const wxValidator& validator,
            const wxString& name)
 {
-  fileName = "";
+  m_fileName = "";
   SetName(name);
   SetValidator(validator);
   if (parent) parent->AddChild(this);
@@ -504,7 +504,7 @@ bool wxTextCtrl::LoadFile(const wxString& file)
   if (!FileExists(WXSTRINGCAST file))
     return FALSE;
 
-  fileName = file;
+  m_fileName = file;
 
   Clear();
 
@@ -553,14 +553,14 @@ bool wxTextCtrl::LoadFile(const wxString& file)
 // Returns TRUE if succeeds.
 bool wxTextCtrl::SaveFile(const wxString& file)
 {
-  wxString theFile;
-  if (file == "")
-    theFile = fileName;
-  if (file == "")
+  wxString theFile(file);
+  if (theFile == "")
+    theFile = m_fileName;
+  if (theFile == "")
     return FALSE;
-  fileName = theFile;
+  m_fileName = theFile;
 
-  ofstream output(WXSTRINGCAST file);
+  ofstream output((char*) (const char*) theFile);
   if (output.bad())
        return FALSE;
 
@@ -848,47 +848,46 @@ wxTextCtrl& wxTextCtrl::operator<<(const wxString& s)
 
 wxTextCtrl& wxTextCtrl::operator<<(float f)
 {
-  static char buf[100];
-  sprintf(buf, "%.2f", f);
-  WriteText(buf);
-  return *this;
+    wxString str;
+    str.Printf("%.2f", f);
+    WriteText(str);
+    return *this;
 }
 
 wxTextCtrl& wxTextCtrl::operator<<(double d)
 {
-  static char buf[100];
-  sprintf(buf, "%.2f", d);
-  WriteText(buf);
-  return *this;
+    wxString str;
+    str.Printf("%.2f", d);
+    WriteText(str);
+    return *this;
 }
 
 wxTextCtrl& wxTextCtrl::operator<<(int i)
 {
-  static char buf[100];
-  sprintf(buf, "%i", i);
-  WriteText(buf);
-  return *this;
+    wxString str;
+    str.Printf("%d", i);
+    WriteText(str);
+    return *this;
 }
 
 wxTextCtrl& wxTextCtrl::operator<<(long i)
 {
-  static char buf[100];
-  sprintf(buf, "%ld", i);
-  WriteText(buf);
-  return *this;
+    wxString str;
+    str.Printf("%ld", i);
+    WriteText(str);
+    return *this;
 }
 
 wxTextCtrl& wxTextCtrl::operator<<(const char c)
 {
-  char buf[2];
+    char buf[2];
 
-  buf[0] = c;
-  buf[1] = 0;
-  WriteText(buf);
-  return *this;
+    buf[0] = c;
+    buf[1] = 0;
+    WriteText(buf);
+    return *this;
 }
 
-
 WXHBRUSH wxTextCtrl::OnCtlColor(WXHDC pDC, WXHWND pWnd, WXUINT nCtlColor,
                        WXUINT message, WXWPARAM wParam, WXLPARAM lParam)
 {
index ef1417069f02cbb6fb0237ebeb7d871ad877652a..549b53236f1cfcdb1cffd4b1f68696b6162b3703 100644 (file)
@@ -1,13 +1,13 @@
-/*
- * File:  TreeCtrl.cpp
- * Purpose: Tree control
- * Author:  Julian Smart
- * Created: 1997
- * Updated: 
- * Copyright:
- */
-
-/* static const char sccsid[] = "%W% %G%"; */
+/////////////////////////////////////////////////////////////////////////////
+// Name:        treectrl.cpp
+// Purpose:     wxTreeCtrl
+// Author:      Julian Smart
+// Modified by:
+// Created:     1997
+// RCS-ID:      $Id$
+// Copyright:   (c) Julian Smart
+// Licence:    wxWindows licence
+/////////////////////////////////////////////////////////////////////////////
 
 #ifdef __GNUG__
 #pragma implementation "treectrl.h"
index 48495e2e697a6befea8d7912ddcf8cd877788929..d1ed6fbf04cbde0e4c04989f1800ed541daab64a 100644 (file)
@@ -4362,7 +4362,6 @@ void wxWindow::SetupColours(void)
 
 void wxWindow::OnIdle(wxIdleEvent& event)
 {
-#if 0
     // Check if we need to send a LEAVE event
     if (m_mouseInWindow)
     {
@@ -4376,7 +4375,6 @@ void wxWindow::OnIdle(wxIdleEvent& event)
         }
     }
        UpdateWindowUI();
-#endif
 }
 
 // Raise the window to the top of the Z order