From d015713e787da8241e92ff86ee2e911868b8024c Mon Sep 17 00:00:00 2001 From: Stefan Csomor Date: Sun, 10 Dec 2000 10:17:00 +0000 Subject: [PATCH] added cw6 fixes and patrick's patches git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@8888 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/gdicmn.h | 2 +- include/wx/mac/timer.h | 6 +++++- include/wx/wx_cw.h | 4 ++++ include/wx/wx_cw_cm.h | 4 ++++ include/wx/wx_cw_d.h | 4 ++++ include/wx/wx_cwc.h | 4 ++++ include/wx/wx_cwc_d.h | 4 ++++ src/mac/carbon/stattext.cpp | 3 +++ src/mac/carbon/timer.cpp | 6 +++--- src/mac/stattext.cpp | 3 +++ src/mac/timer.cpp | 6 +++--- 11 files changed, 38 insertions(+), 8 deletions(-) diff --git a/include/wx/gdicmn.h b/include/wx/gdicmn.h index 7518f8aaf0..0f98d1ffa4 100644 --- a/include/wx/gdicmn.h +++ b/include/wx/gdicmn.h @@ -167,7 +167,7 @@ enum wxStockCursor #if defined(__WXMSW__) || defined(__WXPM__) #define wxBITMAP(name) wxBitmap(#name, wxBITMAP_TYPE_RESOURCE) -#elif defined(__WXGTK__) || defined(__WXMOTIF__) +#elif defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__) // Initialize from an included XPM #define wxBITMAP(name) wxBitmap( (const char**) name##_xpm ) #else // other platforms diff --git a/include/wx/mac/timer.h b/include/wx/mac/timer.h index 1554893d8e..1c4469e9a5 100644 --- a/include/wx/mac/timer.h +++ b/include/wx/mac/timer.h @@ -31,7 +31,8 @@ typedef struct MacTimerInfo class WXDLLEXPORT wxTimer: public wxTimerBase { public: - wxTimer(); + wxTimer() { Init(); } + wxTimer(wxEvtHandler *owner, int id = -1) : wxTimerBase(owner, id) { Init(); } ~wxTimer(); virtual bool Start(int milliseconds = -1, @@ -41,7 +42,10 @@ public: virtual bool IsRunning() const ; MacTimerInfo m_info; +protected : + void Init(); private: + DECLARE_ABSTRACT_CLASS(wxTimer) }; diff --git a/include/wx/wx_cw.h b/include/wx/wx_cw.h index 5480949118..7b1e20dc9e 100644 --- a/include/wx/wx_cw.h +++ b/include/wx/wx_cw.h @@ -12,6 +12,10 @@ #ifndef _WX_CW__ #define _WX_CW__ +#if __MWERKS__ >= 0x2400 +#pragma old_argmatch on +#endif + #if __option(profile) #ifdef __cplusplus #if __POWERPC__ diff --git a/include/wx/wx_cw_cm.h b/include/wx/wx_cw_cm.h index 3e25d4e8ce..a565d4a3f6 100644 --- a/include/wx/wx_cw_cm.h +++ b/include/wx/wx_cw_cm.h @@ -6,6 +6,10 @@ #define WX_COMP_INLINE_NO_CLASS // defined if the compiler does not want the classname repeated for inlines within a class definition +#if __MWERKS__ >= 0x2400 +#pragma old_argmatch on +#endif + #if (__MWERKS__ < 0x0900) || macintosh #define __MAC__ #define __WXMAC__ diff --git a/include/wx/wx_cw_d.h b/include/wx/wx_cw_d.h index 75a2a5ed2e..94d5dd1741 100644 --- a/include/wx/wx_cw_d.h +++ b/include/wx/wx_cw_d.h @@ -12,6 +12,10 @@ #ifndef _WX_CW__ #define _WX_CW__ +#if __MWERKS__ >= 0x2400 +#pragma old_argmatch on +#endif + #if __option(profile) #error "profiling is not supported in debug versions" #else diff --git a/include/wx/wx_cwc.h b/include/wx/wx_cwc.h index 830a0ca271..ea8911edf0 100644 --- a/include/wx/wx_cwc.h +++ b/include/wx/wx_cwc.h @@ -12,6 +12,10 @@ #ifndef _WX_CW__ #define _WX_CW__ +#if __MWERKS__ >= 0x2400 +#pragma old_argmatch on +#endif + #if __option(profile) #ifdef __cplusplus #if __POWERPC__ diff --git a/include/wx/wx_cwc_d.h b/include/wx/wx_cwc_d.h index b5649cd4a0..46a17bc2dc 100644 --- a/include/wx/wx_cwc_d.h +++ b/include/wx/wx_cwc_d.h @@ -12,6 +12,10 @@ #ifndef _WX_CW__ #define _WX_CW__ +#if __MWERKS__ >= 0x2400 +#pragma old_argmatch on +#endif + #if __option(profile) #error "profiling is not supported in debug versions" #else diff --git a/src/mac/carbon/stattext.cpp b/src/mac/carbon/stattext.cpp index 22653f651e..06d6fe9c3c 100644 --- a/src/mac/carbon/stattext.cpp +++ b/src/mac/carbon/stattext.cpp @@ -55,6 +55,9 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID id, void wxStaticText::OnDraw( wxDC &dc ) { + if (m_width <= 0 || m_height <= 0) + return; + PrepareDC(dc); dc.Clear() ; diff --git a/src/mac/carbon/timer.cpp b/src/mac/carbon/timer.cpp index 3d0bb31c08..4135235791 100644 --- a/src/mac/carbon/timer.cpp +++ b/src/mac/carbon/timer.cpp @@ -21,13 +21,13 @@ IMPLEMENT_ABSTRACT_CLASS(wxTimer, wxObject) static void wxProcessTimer( unsigned long event , void *data ) ; -pascal void MacTimerProc( TMTask * t ) +static pascal void MacTimerProc( TMTask * t ) { MacTimerInfo * tm = (MacTimerInfo*) t ; wxMacAddEvent( tm->m_table , wxProcessTimer, 0 , (void*) tm->m_timer , TRUE ) ; } -void wxProcessTimer( unsigned long event , void *data ) +static void wxProcessTimer( unsigned long event , void *data ) { if ( !data ) return ; @@ -44,7 +44,7 @@ void wxProcessTimer( unsigned long event , void *data ) } } -wxTimer::wxTimer() +void wxTimer::Init() { m_info.m_task.tmAddr = NULL ; m_info.m_task.tmWakeUp = 0 ; diff --git a/src/mac/stattext.cpp b/src/mac/stattext.cpp index 22653f651e..06d6fe9c3c 100644 --- a/src/mac/stattext.cpp +++ b/src/mac/stattext.cpp @@ -55,6 +55,9 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID id, void wxStaticText::OnDraw( wxDC &dc ) { + if (m_width <= 0 || m_height <= 0) + return; + PrepareDC(dc); dc.Clear() ; diff --git a/src/mac/timer.cpp b/src/mac/timer.cpp index 3d0bb31c08..4135235791 100644 --- a/src/mac/timer.cpp +++ b/src/mac/timer.cpp @@ -21,13 +21,13 @@ IMPLEMENT_ABSTRACT_CLASS(wxTimer, wxObject) static void wxProcessTimer( unsigned long event , void *data ) ; -pascal void MacTimerProc( TMTask * t ) +static pascal void MacTimerProc( TMTask * t ) { MacTimerInfo * tm = (MacTimerInfo*) t ; wxMacAddEvent( tm->m_table , wxProcessTimer, 0 , (void*) tm->m_timer , TRUE ) ; } -void wxProcessTimer( unsigned long event , void *data ) +static void wxProcessTimer( unsigned long event , void *data ) { if ( !data ) return ; @@ -44,7 +44,7 @@ void wxProcessTimer( unsigned long event , void *data ) } } -wxTimer::wxTimer() +void wxTimer::Init() { m_info.m_task.tmAddr = NULL ; m_info.m_task.tmWakeUp = 0 ; -- 2.45.2