git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@22797
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
19 files changed:
- 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
- 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
DEPRECATED METHODS SINCE 2.4.x
\helpref{wxWindow::CentreOnParent}{wxwindowcenteronparent}
\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.
Clears the window by filling it with the current background colour. Does not
cause an erase background event to be generated.
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);
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;
// Set/get the window's font
virtual bool SetFont(const wxFont& f);
// inline virtual wxFont& GetFont() const;
void assign(const_iterator first, const_iterator last); \
void assign(size_type n, const_reference v); \
size_type capacity() const { return m_nSize; } \
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(); \
iterator erase(iterator first, iterator last) \
{ \
size_type idx = first - begin(); \
return begin() + idx; \
} \
void insert(iterator it, const_iterator first, const_iterator last);\
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()); \
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; } \
\
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); \
private: \
void Grow(size_t nIncrement = 0); \
bool Realloc(size_t nSize); \
iterator begin() { return (iterator)base::begin(); } \
const_iterator begin() const { return (const_iterator)base::begin(); }\
size_type capacity() const { return base::capacity(); } \
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) \
iterator end() { return (iterator)base::end(); } \
const_iterator end() const { return (const_iterator)base::end(); } \
iterator erase(iterator first, iterator last) \
void insert(iterator it, const_iterator first, const_iterator last) \
{ base::insert((biterator)it, (bconst_iterator)first, \
(bconst_iterator)last); } \
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); } \
void pop_back() { base::pop_back(); } \
void push_back(const_reference v) \
{ base::push_back((bconst_reference)v); } \
const_reverse_iterator rend() const; \
void reserve(size_type n) { base::reserve(n); }; \
void resize(size_type n, value_type v = value_type()); \
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; }
}
#define _WX_PTROP pointer operator->() const { return m_ptr; }
virtual void Refresh( bool eraseBackground = TRUE,
const wxRect *rect = (const wxRect *) NULL );
virtual void Refresh( bool eraseBackground = TRUE,
const wxRect *rect = (const wxRect *) NULL );
virtual bool SetCursor( const wxCursor &cursor );
virtual bool SetFont(const wxFont& font)
virtual bool SetCursor( const wxCursor &cursor );
virtual bool SetFont(const wxFont& font)
virtual void Refresh( bool eraseBackground = TRUE,
const wxRect *rect = (const wxRect *) NULL );
virtual void Refresh( bool eraseBackground = TRUE,
const wxRect *rect = (const wxRect *) NULL );
virtual bool SetBackgroundColour( const wxColour &colour );
virtual bool SetForegroundColour( const wxColour &colour );
virtual bool SetBackgroundColour( const wxColour &colour );
virtual bool SetForegroundColour( const wxColour &colour );
virtual void Refresh( bool eraseBackground = TRUE,
const wxRect *rect = (const wxRect *) NULL );
virtual void Update();
virtual void Refresh( bool eraseBackground = TRUE,
const wxRect *rect = (const wxRect *) NULL );
virtual void Update();
virtual void Freeze();
virtual void Thaw();
virtual void Freeze();
virtual void Thaw();
virtual void Refresh( bool bEraseBackground = TRUE
,const wxRect* pRect = (const wxRect *)NULL
);
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);
virtual void Freeze(void);
virtual void Update(void);
virtual void Thaw(void);
// repaint all invalid areas of the window immediately
virtual void Update() { }
// 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() { }
// freeze the window: don't redraw it until it is thawed
virtual void Freeze() { }
const wxRect *rect = (const wxRect *) NULL );
virtual void Update();
const wxRect *rect = (const wxRect *) NULL );
virtual void Update();
- virtual void Clear();
-
virtual bool SetBackgroundColour( const wxColour &colour );
virtual bool SetForegroundColour( const wxColour &colour );
virtual bool SetBackgroundColour( const wxColour &colour );
virtual bool SetForegroundColour( const wxColour &colour );
-void wxWindow::Clear()
-{
- // TODO
-}
-
static int CocoaRaiseWindowCompareFunction(id first, id second, void *target)
{
// first should be ordered higher
static int CocoaRaiseWindowCompareFunction(id first, id second, void *target)
{
// first should be ordered higher
return m_updateRegion.Contains(x, y, w, h) != wxOutRegion;
}
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
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// find child window by id or name
// ----------------------------------------------------------------------------
-void wxWindowMac::Clear()
-{
- wxClientDC dc(this);
- wxBrush brush(GetBackgroundColour(), wxSOLID);
- dc.SetBackground(brush);
- dc.Clear();
-}
-
// Setup background and foreground colours correctly
void wxWindowMac::SetupColours()
{
// Setup background and foreground colours correctly
void wxWindowMac::SetupColours()
{
-void wxWindowMac::Clear()
-{
- wxClientDC dc(this);
- wxBrush brush(GetBackgroundColour(), wxSOLID);
- dc.SetBackground(brush);
- dc.Clear();
-}
-
// Setup background and foreground colours correctly
void wxWindowMac::SetupColours()
{
// Setup background and foreground colours correctly
void wxWindowMac::SetupColours()
{
XSendEvent(display, thisWindow, False, ExposureMask, (XEvent *)&dummyEvent);
}
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
void wxWindow::DoPaint()
{
//TODO : make a temporary gc so we can do the XCopyArea below
-void WINAPI _EXPORT wxTimerProc(HWND hwnd, WORD, int idTimer, DWORD);
+void WINAPI wxTimerProc(HWND hwnd, WORD, int idTimer, DWORD);
// ----------------------------------------------------------------------------
// macros
// ----------------------------------------------------------------------------
// ----------------------------------------------------------------------------
// 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
#ifdef __WXMICROWIN__
#define MakeProcInstance(proc, hinst) proc
#endif
-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);
{
wxTimerMap::iterator node = wxTimerList.find((long)idTimer);
wxASSERT_MSG( node != wxTimerList.end(), wxT("bogus timer id in wxTimerProc") );
wxProcessTimer(*(node->second));
wxASSERT_MSG( node != wxTimerList.end(), wxT("bogus timer id in wxTimerProc") );
wxProcessTimer(*(node->second));
-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__
static inline void SendSetRedraw(HWND hwnd, bool on)
{
#ifndef __WXMICROWIN__
return TRUE;
} // end of 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());
void wxWindowOS2::Update()
{
::WinUpdateWindow(GetHwnd());
-void wxWindowX11::Clear()
-{
-// wxClientDC dc((wxWindow*) this);
-// wxBrush brush(GetBackgroundColour(), wxSOLID);
-// dc.SetBackground(brush);
-// dc.Clear();
-}
-
void wxWindowX11::SendEraseEvents()
{
if (m_clearRegion.IsEmpty()) return;
void wxWindowX11::SendEraseEvents()
{
if (m_clearRegion.IsEmpty()) return;