]> git.saurik.com Git - wxWidgets.git/commitdiff
renamed wxWindow::Clear() to ClearBackground() (fixes bug 783576)
authorVadim Zeitlin <vadim@wxwidgets.org>
Wed, 13 Aug 2003 14:09:45 +0000 (14:09 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Wed, 13 Aug 2003 14:09:45 +0000 (14:09 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22797 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

19 files changed:
docs/changes.txt
docs/latex/wx/window.tex
include/wx/cocoa/window.h
include/wx/dynarray.h
include/wx/mac/window.h
include/wx/motif/window.h
include/wx/msw/window.h
include/wx/os2/window.h
include/wx/window.h
include/wx/x11/window.h
src/cocoa/window.mm
src/common/wincmn.cpp
src/mac/carbon/window.cpp
src/mac/window.cpp
src/motif/window.cpp
src/msw/timer.cpp
src/msw/window.cpp
src/os2/window.cpp
src/x11/window.cpp

index 9373a54ad26a1ded2a752c980830ee37760c2195..ef06308310e9d93a30a1fed2069638f70e79091e 100644 (file)
@@ -11,6 +11,7 @@ INCOMPATIBLE CHANGES SINCE 2.4.x
 - also, OnExit() is not called if OnInit() fails
 - wxTheApp can't be assigned to any longer, use wxApp::SetInstance() instead
 - wxFileType::GetIcon() returns wxIconLocation, not wxIcon
+- wxWindow::Clear() is now called ClearBackground()
 
 
 DEPRECATED METHODS SINCE 2.4.x
index fa07aa81b99d12592f143db24a076e389511cb2b..1cb313242575b5c868105986537114638d2bd44d 100644 (file)
@@ -245,9 +245,9 @@ or {\tt wxBOTH}.}
 
 \helpref{wxWindow::CentreOnParent}{wxwindowcenteronparent}
 
-\membersection{wxWindow::Clear}\label{wxwindowclear}
+\membersection{wxWindow::ClearBackground}\label{wxwindowclearbackground}
 
-\func{void}{Clear}{\void}
+\func{void}{ClearBackground}{\void}
 
 Clears the window by filling it with the current background colour. Does not
 cause an erase background event to be generated.
index f36f37222e58055cf70629831464cccae4f7750b..ef3dcb47404223bdd4f0f6daa8eccd77fbb488d1 100644 (file)
@@ -98,8 +98,6 @@ public:
     virtual void WarpPointer(int x_pos, int y_pos) ;
     // Send the window a refresh event
     virtual void Refresh(bool eraseBack = TRUE, const wxRect *rect = NULL);
-    // Clear the window
-    virtual void Clear();
     // Set/get the window's font
     virtual bool SetFont(const wxFont& f);
 //    inline virtual wxFont& GetFont() const;
index 26d7e06540873503e5978c762039d2289efc66a4..6c64938d80768a68a07c7cb7200678a3326b341e 100644 (file)
@@ -212,8 +212,6 @@ protected:                                                          \
   void assign(const_iterator first, const_iterator last);           \
   void assign(size_type n, const_reference v);                      \
   size_type capacity() const { return m_nSize; }                    \
-  void clear() { Clear(); }                                         \
-  bool empty() const { return IsEmpty(); }                          \
   iterator erase(iterator first, iterator last)                     \
   {                                                                 \
     size_type idx = first - begin();                                \
@@ -230,17 +228,24 @@ protected:                                                          \
     return begin() + idx;                                           \
   }                                                                 \
   void insert(iterator it, const_iterator first, const_iterator last);\
-  size_type max_size() const { return INT_MAX; }                    \
   void pop_back() { RemoveAt(size() - 1); }                         \
   void push_back(const value_type& v) { Add(v); }                   \
   void reserve(size_type n) { if(n > m_nSize) Realloc(n); }         \
   void resize(size_type n, value_type v = value_type());            \
-  size_type size() const { return GetCount(); }                     \
                                                                     \
   iterator begin() { return m_pItems; }                             \
   iterator end() { return m_pItems + m_nCount; }                    \
   const_iterator begin() const { return m_pItems; }                 \
   const_iterator end() const { return m_pItems + m_nCount; }        \
+                                                                    \
+  /* the following functions may be made directly public because */ \
+  /* they don't use the type of the elements at all */              \
+public:                                                             \
+  void clear() { Clear(); }                                         \
+  bool empty() const { return IsEmpty(); }                          \
+  size_type max_size() const { return INT_MAX; }                    \
+  size_type size() const { return GetCount(); }                     \
+                                                                    \
 private:                                                            \
   void Grow(size_t nIncrement = 0);                                 \
   bool Realloc(size_t nSize);                                       \
@@ -446,8 +451,6 @@ public:                                                               \
   iterator begin() { return (iterator)base::begin(); }                \
   const_iterator begin() const { return (const_iterator)base::begin(); }\
   size_type capacity() const { return base::capacity(); }             \
-  void clear() { base::clear(); }                                     \
-  bool empty() const { return base::empty(); }                        \
   iterator end() { return (iterator)base::end(); }                    \
   const_iterator end() const { return (const_iterator)base::end(); }  \
   iterator erase(iterator first, iterator last)                       \
@@ -463,7 +466,6 @@ public:                                                               \
   void insert(iterator it, const_iterator first, const_iterator last) \
     { base::insert((biterator)it, (bconst_iterator)first,             \
                    (bconst_iterator)last); }                          \
-  size_type max_size() const { return base::max_size(); }             \
   void pop_back() { base::pop_back(); }                               \
   void push_back(const_reference v)                                   \
     { base::push_back((bconst_reference)v); }                         \
@@ -473,7 +475,6 @@ public:                                                               \
   const_reverse_iterator rend() const;                                \
   void reserve(size_type n) { base::reserve(n); };                    \
   void resize(size_type n, value_type v = value_type());              \
-  size_type size() const { return base::size(); }                     \
 }
 
 #define _WX_PTROP pointer operator->() const { return m_ptr; }
index 92f5bbb7b1b37c74c99d36e83f8eea94ea3e3879..08442d3ee4c2beeba0f91afa07cf7b6ef879d37c 100644 (file)
@@ -84,7 +84,6 @@ public:
 
     virtual void Refresh( bool eraseBackground = TRUE,
                           const wxRect *rect = (const wxRect *) NULL );
-    virtual void Clear();
 
     virtual bool SetCursor( const wxCursor &cursor );
     virtual bool SetFont(const wxFont& font)
index 500cbfe9d4bf7ee62e002097ad78eb072ecc705f..c85264e4f39185ccda0581a911efbc775bb168e4 100644 (file)
@@ -66,7 +66,6 @@ public:
     
     virtual void Refresh( bool eraseBackground = TRUE,
         const wxRect *rect = (const wxRect *) NULL );
-    virtual void Clear();
     
     virtual bool SetBackgroundColour( const wxColour &colour );
     virtual bool SetForegroundColour( const wxColour &colour );
index b6a76b45440460b6daaf5b98d172d9fb27dfe518..45372805e6b9752fff5f5d16b2778ca6635ca423 100644 (file)
@@ -95,7 +95,6 @@ public:
     virtual void Refresh( bool eraseBackground = TRUE,
                           const wxRect *rect = (const wxRect *) NULL );
     virtual void Update();
-    virtual void Clear();
     virtual void Freeze();
     virtual void Thaw();
 
index 261d6562d8516d1ab28d1762d0979ab7af981783..8c5626dcc59e874bc777e7d1d5e4253e404c5908 100644 (file)
@@ -103,7 +103,6 @@ public:
     virtual void     Refresh( bool          bEraseBackground = TRUE
                              ,const wxRect* pRect = (const wxRect *)NULL
                             );
-    virtual void     Clear(void);
     virtual void     Freeze(void);
     virtual void     Update(void);
     virtual void     Thaw(void);
index e8767aae8cf2b5eef70b86f87e0c3a52bccd4c08..c506460376086556647e90e782033fd5cd3d1478 100644 (file)
@@ -583,8 +583,8 @@ public:
         // repaint all invalid areas of the window immediately
     virtual void Update() { }
 
-        // clear the window entirely
-    virtual void Clear() = 0;
+        // clear the window background
+    virtual void ClearBackground();
 
         // freeze the window: don't redraw it until it is thawed
     virtual void Freeze() { }
index df8d37553f8a7872d9275f0686c6261708ff6d5b..ce7fe96831affec86db0e454682dbb80761bdacc 100644 (file)
@@ -64,8 +64,6 @@ public:
         const wxRect *rect = (const wxRect *) NULL );
     virtual void Update();
     
-    virtual void Clear();
-    
     virtual bool SetBackgroundColour( const wxColour &colour );
     virtual bool SetForegroundColour( const wxColour &colour );
     
index c73a1fa0ca9ac8ecf30f3e338bba91a87ef88b7b..b255cb12123716157cbb52c73e8c7b8c923b0b50 100644 (file)
@@ -531,11 +531,6 @@ bool wxWindow::SetFont(const wxFont& font)
     return TRUE;
 }
 
-void wxWindow::Clear()
-{
-    // TODO
-}
-
 static int CocoaRaiseWindowCompareFunction(id first, id second, void *target)
 {
     // first should be ordered higher
index f044c553cd09dfa311df0ce664c054443fd476ed..9a1a983162f8922f7580fe9508b4ddd674c3aa88 100644 (file)
@@ -977,6 +977,17 @@ bool wxWindowBase::IsExposed(int x, int y, int w, int h) const
     return m_updateRegion.Contains(x, y, w, h) != wxOutRegion;
 }
 
+void wxWindowBase::ClearBackground()
+{
+    // wxGTK uses its own version, no need to add never used code
+#ifndef __WXGTK__
+    wxClientDC dc((wxWindow *)this);
+    wxBrush brush(GetBackgroundColour(), wxSOLID);
+    dc.SetBackground(brush);
+    dc.Clear();
+#endif // __WXGTK__
+}
+
 // ----------------------------------------------------------------------------
 // find child window by id or name
 // ----------------------------------------------------------------------------
index ddb8eebf2b898759b80ea6be4385d41cb2652eb2..74d6c9730d0a18c8d2c21cfe4f6298a516cc67ca 100644 (file)
@@ -1351,14 +1351,6 @@ void wxWindowMac::OnSetFocus(wxFocusEvent& event)
     event.Skip();
 }
 
-void wxWindowMac::Clear()
-{
-    wxClientDC dc(this);
-    wxBrush brush(GetBackgroundColour(), wxSOLID);
-    dc.SetBackground(brush);
-    dc.Clear();
-}
-
 // Setup background and foreground colours correctly
 void wxWindowMac::SetupColours()
 {
index ddb8eebf2b898759b80ea6be4385d41cb2652eb2..74d6c9730d0a18c8d2c21cfe4f6298a516cc67ca 100644 (file)
@@ -1351,14 +1351,6 @@ void wxWindowMac::OnSetFocus(wxFocusEvent& event)
     event.Skip();
 }
 
-void wxWindowMac::Clear()
-{
-    wxClientDC dc(this);
-    wxBrush brush(GetBackgroundColour(), wxSOLID);
-    dc.SetBackground(brush);
-    dc.Clear();
-}
-
 // Setup background and foreground colours correctly
 void wxWindowMac::SetupColours()
 {
index 0a70d435a5c8b6ec70e46790a66bf758bbd7b0a3..fcb9aa4b493155713407d98e4f4684dfd66eb608 100644 (file)
@@ -1577,14 +1577,6 @@ void wxWindow::Refresh(bool eraseBack, const wxRect *rect)
     XSendEvent(display, thisWindow, False, ExposureMask, (XEvent *)&dummyEvent);
 }
 
-void wxWindow::Clear()
-{
-    wxClientDC dc(this);
-    wxBrush brush(GetBackgroundColour(), wxSOLID);
-    dc.SetBackground(brush);
-    dc.Clear();
-}
-
 void wxWindow::DoPaint()
 {
     //TODO : make a temporary gc so we can do the XCopyArea below
index 64096f7d77b45182bf85fda45640aaba51d2f1b7..cccb8ed09fc7634b5468a4eb6706ca60e85ef3f5 100644 (file)
@@ -49,19 +49,13 @@ WX_DECLARE_HASH_MAP( long,
 
 wxTimerMap wxTimerList;
 
-void WINAPI _EXPORT wxTimerProc(HWND hwnd, WORD, int idTimer, DWORD);
+void WINAPI wxTimerProc(HWND hwnd, WORD, int idTimer, DWORD);
 
 // ----------------------------------------------------------------------------
 // macros
 // ----------------------------------------------------------------------------
 
-#ifdef __WIN32__
-    #define _EXPORT
-#else
-    #define _EXPORT _export
-#endif
-
-// should probably be in wx/msw/private.h
+// should probably be in wx/msw/missing.h
 #ifdef __WXMICROWIN__
     #define MakeProcInstance(proc, hinst) proc
 #endif
@@ -149,7 +143,7 @@ void wxProcessTimer(wxTimer& timer)
     timer.Notify();
 }
 
-void WINAPI _EXPORT wxTimerProc(HWND WXUNUSED(hwnd), WORD, int idTimer, DWORD)
+void WINAPI wxTimerProc(HWND WXUNUSED(hwnd), WORD, int idTimer, DWORD)
 {
     
     wxTimerMap::iterator node = wxTimerList.find((long)idTimer);
@@ -157,8 +151,7 @@ void WINAPI _EXPORT wxTimerProc(HWND WXUNUSED(hwnd), WORD, int idTimer, DWORD)
     wxASSERT_MSG( node != wxTimerList.end(), wxT("bogus timer id in wxTimerProc") );
 
     wxProcessTimer(*(node->second));
-
-    // return 0;
 }
 
 #endif // wxUSE_TIMER
+
index a957b5e8c02dbe7810a99c9ac3c305c223455ec4..91c35788a7d6c9e991e42666334f12fc953f26dd 100644 (file)
@@ -1297,14 +1297,6 @@ bool wxWindowMSW::Reparent(wxWindowBase *parent)
     return TRUE;
 }
 
-void wxWindowMSW::Clear()
-{
-    wxClientDC dc((wxWindow *)this);
-    wxBrush brush(GetBackgroundColour(), wxSOLID);
-    dc.SetBackground(brush);
-    dc.Clear();
-}
-
 static inline void SendSetRedraw(HWND hwnd, bool on)
 {
 #ifndef __WXMICROWIN__
index affeabe47e5588111935250d5a1448f18901c9d7..70d2e322aafb1ab66b230253383024e8008ea6bc 100644 (file)
@@ -1385,17 +1385,6 @@ bool wxWindowOS2::Reparent(
     return TRUE;
 } // end of wxWindowOS2::Reparent
 
-void wxWindowOS2::Clear()
-{
-    wxClientDC                      vDc((wxWindow*)this);
-    wxBrush                         vBrush( GetBackgroundColour()
-                                           ,wxSOLID
-                                          );
-
-    vDc.SetBackground(vBrush);
-    vDc.Clear();
-} // end of wxWindowOS2::Clear
-
 void wxWindowOS2::Update()
 {
     ::WinUpdateWindow(GetHwnd());
index 4c8a3ce35b4d4e96fd7cbbcf1e2531d672b5a8e4..5fc23f7e6b9b2eb50b67f437556e93cbcfb71133 100644 (file)
@@ -1163,14 +1163,6 @@ void wxWindowX11::Update()
     }
 }
 
-void wxWindowX11::Clear()
-{
-//    wxClientDC dc((wxWindow*) this);
-//    wxBrush brush(GetBackgroundColour(), wxSOLID);
-//    dc.SetBackground(brush);
-//    dc.Clear();
-}
-
 void wxWindowX11::SendEraseEvents()
 {
     if (m_clearRegion.IsEmpty()) return;