From: Gilles Depeyrot Date: Thu, 28 Jun 2001 21:23:41 +0000 (+0000) Subject: corrections after wxUniv merge X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/584bede0618774ad7f62476c9adddeb9776fb737 corrections after wxUniv merge git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10712 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/mac/bitmap.h b/include/wx/mac/bitmap.h index 5e58198e53..9308aca1c3 100644 --- a/include/wx/mac/bitmap.h +++ b/include/wx/mac/bitmap.h @@ -98,7 +98,7 @@ public: #define M_BITMAPDATA ((wxBitmapRefData *)m_refData) -class WXDLLEXPORT wxBitmapHandler: public wxObject +class WXDLLEXPORT wxBitmapHandler: public wxBitmapHandlerBase { DECLARE_DYNAMIC_CLASS(wxBitmapHandler) public: @@ -110,7 +110,7 @@ public: virtual bool Create(wxBitmap *bitmap, void *data, long flags, int width, int height, int depth = 1); virtual bool LoadFile(wxBitmap *bitmap, const wxString& name, long flags, int desiredWidth, int desiredHeight); - virtual bool SaveFile(wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette = NULL); + virtual bool SaveFile(const wxBitmap *bitmap, const wxString& name, int type, const wxPalette *palette = NULL); inline void SetName(const wxString& name) { m_name = name; } inline void SetExtension(const wxString& ext) { m_extension = ext; } @@ -126,7 +126,7 @@ protected: #define M_BITMAPHANDLERDATA ((wxBitmapRefData *)bitmap->GetRefData()) -class WXDLLEXPORT wxBitmap: public wxGDIObject +class WXDLLEXPORT wxBitmap: public wxBitmapBase { DECLARE_DYNAMIC_CLASS(wxBitmap) @@ -148,10 +148,10 @@ public: wxBitmap(char **bits); // Load a file or resource - wxBitmap(const wxString& name, long type = wxBITMAP_TYPE_PICT_RESOURCE); + wxBitmap(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_PICT_RESOURCE); // Constructor for generalised creation from data - wxBitmap(void *data, long type, int width, int height, int depth = 1); + wxBitmap(void *data, wxBitmapType type, int width, int height, int depth = 1); // If depth is omitted, will create a bitmap compatible with the display wxBitmap(int width, int height, int depth = -1); @@ -167,9 +167,12 @@ public: wxBitmap GetSubBitmap( const wxRect& rect ) const; virtual bool Create(int width, int height, int depth = -1); - virtual bool Create(void *data, long type, int width, int height, int depth = 1); - virtual bool LoadFile(const wxString& name, long type = wxBITMAP_TYPE_BMP_RESOURCE); - virtual bool SaveFile(const wxString& name, int type, const wxPalette *cmap = NULL); + virtual bool Create(void *data, wxBitmapType type, int width, int height, int depth = 1); + virtual bool LoadFile(const wxString& name, wxBitmapType type = wxBITMAP_TYPE_BMP_RESOURCE); + virtual bool SaveFile(const wxString& name, wxBitmapType type, const wxPalette *cmap = NULL) const; + + // copies the contents and mask of the given (colour) icon to the bitmap + virtual bool CopyFromIcon(const wxIcon& icon); bool Ok() const; int GetWidth() const; @@ -200,8 +203,8 @@ public: static void InsertHandler(wxBitmapHandler *handler); static bool RemoveHandler(const wxString& name); static wxBitmapHandler *FindHandler(const wxString& name); - static wxBitmapHandler *FindHandler(const wxString& extension, long bitmapType); - static wxBitmapHandler *FindHandler(long bitmapType); + static wxBitmapHandler *FindHandler(const wxString& extension, wxBitmapType type); + static wxBitmapHandler *FindHandler(wxBitmapType type); static void InitStandardHandlers(); static void CleanUpHandlers(); diff --git a/include/wx/mac/radiobox.h b/include/wx/mac/radiobox.h index f46628180e..514ef7f849 100644 --- a/include/wx/mac/radiobox.h +++ b/include/wx/mac/radiobox.h @@ -16,16 +16,12 @@ #pragma interface "radiobox.h" #endif -#include "wx/control.h" - -WXDLLEXPORT_DATA(extern const char*) wxRadioBoxNameStr; - // List box item -class wxBitmap ; +class WXDLLEXPORT wxBitmap ; -class wxRadioButton ; +class WXDLLEXPORT wxRadioButton ; -class wxRadioBox: public wxControl +class WXDLLEXPORT wxRadioBox: public wxControl, public wxRadioBoxBase { DECLARE_DYNAMIC_CLASS(wxRadioBox) public: @@ -55,7 +51,7 @@ public: int GetSelection() const; wxString GetString(int item) const; virtual wxString GetStringSelection() const; - inline virtual int Number() const { return m_noItems; } ; + inline virtual int GetCount() const { return m_noItems; } ; void SetLabel(const wxString& label) ; void SetLabel(int item, const wxString& label) ; void SetSelection(int item); diff --git a/include/wx/mac/statbmp.h b/include/wx/mac/statbmp.h index 62291ce3ce..3ae276eaff 100644 --- a/include/wx/mac/statbmp.h +++ b/include/wx/mac/statbmp.h @@ -16,11 +16,9 @@ #pragma interface "statbmp.h" #endif -#include "wx/control.h" +#include "wx/icon.h" -WXDLLEXPORT_DATA(extern const char*) wxStaticBitmapNameStr; - -class WXDLLEXPORT wxStaticBitmap: public wxControl +class WXDLLEXPORT wxStaticBitmap: public wxStaticBitmapBase { DECLARE_DYNAMIC_CLASS(wxStaticBitmap) public: @@ -50,8 +48,12 @@ class WXDLLEXPORT wxStaticBitmap: public wxControl virtual void OnPaint( wxPaintEvent &event ) ; void SetSize(int x, int y, int width, int height, int sizeFlags = wxSIZE_AUTO); - inline const wxBitmap& GetBitmap() const { return m_messageBitmap; } - const wxIcon& GetIcon() const { return (const wxIcon&) GetBitmap() ; } + wxBitmap GetBitmap() const { return m_bitmap; } + wxIcon GetIcon() const + { + // icons and bitmaps are really the same thing in wxMac + return (const wxIcon &)m_bitmap; + } void SetIcon(const wxIcon& icon) { SetBitmap( (const wxBitmap &)icon ) ; } // overriden base class virtuals @@ -59,7 +61,7 @@ class WXDLLEXPORT wxStaticBitmap: public wxControl wxSize DoGetBestSize() const ; protected: - wxBitmap m_messageBitmap; + wxBitmap m_bitmap; DECLARE_EVENT_TABLE() }; diff --git a/src/mac/carbon/choice.cpp b/src/mac/carbon/choice.cpp index ec6a728102..67aee1e928 100644 --- a/src/mac/carbon/choice.cpp +++ b/src/mac/carbon/choice.cpp @@ -77,7 +77,7 @@ int wxChoice::DoAppend(const wxString& item) m_datas.Add( NULL ) ; int index = m_strings.GetCount() - 1 ; DoSetItemClientData( index , NULL ) ; - SetControlMaximum( m_macControl , Number()) ; + SetControlMaximum( m_macControl , GetCount()) ; return index ; } @@ -93,7 +93,7 @@ void wxChoice::Delete(int n) ::DeleteMenuItem( m_macPopUpMenuHandle , n + 1) ; m_strings.Remove( n ) ; m_datas.Remove( n ) ; - SetControlMaximum( m_macControl , Number()) ; + SetControlMaximum( m_macControl , GetCount()) ; } void wxChoice::Clear() diff --git a/src/mac/carbon/statbmp.cpp b/src/mac/carbon/statbmp.cpp index 007070cb89..03f68a2ea7 100644 --- a/src/mac/carbon/statbmp.cpp +++ b/src/mac/carbon/statbmp.cpp @@ -19,14 +19,14 @@ #include "wx/dcclient.h" #if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap, wxControl) +IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap, wxStaticBitmapBase) #endif /* * wxStaticBitmap */ -BEGIN_EVENT_TABLE(wxStaticBitmap, wxControl) +BEGIN_EVENT_TABLE(wxStaticBitmap, wxStaticBitmapBase) EVT_PAINT(wxStaticBitmap::OnPaint) END_EVENT_TABLE() @@ -43,7 +43,7 @@ bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID id, m_backgroundColour = parent->GetBackgroundColour() ; m_foregroundColour = parent->GetForegroundColour() ; - m_messageBitmap = bitmap; + m_bitmap = bitmap; if ( id == -1 ) m_windowId = (int)NewControlId(); else @@ -52,7 +52,7 @@ bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID id, m_windowStyle = style; bool ret = wxControl::Create( parent, id, pos, size, style , wxDefaultValidator , name ); - SetSizeOrDefault( size ) ; + SetBestSize( size ) ; return ret; } @@ -64,9 +64,9 @@ void wxStaticBitmap::SetSize(int x, int y, int width, int height, int sizeFlags) void wxStaticBitmap::SetBitmap(const wxBitmap& bitmap) { - m_messageBitmap = bitmap; + m_bitmap = bitmap; Refresh() ; - SetSizeOrDefault(); + SetBestSize(wxSize(bitmap.GetWidth(), bitmap.GetHeight())); } void wxStaticBitmap::OnPaint( wxPaintEvent &event ) @@ -74,13 +74,13 @@ void wxStaticBitmap::OnPaint( wxPaintEvent &event ) wxPaintDC dc(this); PrepareDC(dc); - dc.DrawBitmap( m_messageBitmap , 0 , 0 , TRUE ) ; + dc.DrawBitmap( m_bitmap , 0 , 0 , TRUE ) ; } wxSize wxStaticBitmap::DoGetBestSize() const { - if ( m_messageBitmap.Ok() ) - return wxSize(m_messageBitmap.GetWidth(), m_messageBitmap.GetHeight()); + if ( m_bitmap.Ok() ) + return wxSize(m_bitmap.GetWidth(), m_bitmap.GetHeight()); else return wxSize(16, 16); // completely arbitrary } diff --git a/src/mac/carbon/stattext.cpp b/src/mac/carbon/stattext.cpp index 783d231f9b..68e1453ba8 100644 --- a/src/mac/carbon/stattext.cpp +++ b/src/mac/carbon/stattext.cpp @@ -23,12 +23,12 @@ #include #if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxStaticText, wxControl) +IMPLEMENT_DYNAMIC_CLASS(wxStaticText, wxStaticTextBase) #endif #include -BEGIN_EVENT_TABLE(wxStaticText, wxControl) +BEGIN_EVENT_TABLE(wxStaticText, wxStaticTextBase) EVT_PAINT(wxStaticText::OnPaint) END_EVENT_TABLE() @@ -52,7 +52,7 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID id, m_label = label ; bool ret = wxControl::Create( parent, id, pos, size, style , wxDefaultValidator , name ); - SetSizeOrDefault( size ) ; + SetBestSize( size ) ; return ret; } @@ -235,7 +235,7 @@ void wxStaticText::SetLabel(const wxString& st ) SetTitle( st ) ; m_label = st ; if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) ) - SetSizeOrDefault() ; + SetSize( GetBestSize() ) ; Refresh() ; MacUpdateImmediately() ; diff --git a/src/mac/choice.cpp b/src/mac/choice.cpp index ec6a728102..67aee1e928 100644 --- a/src/mac/choice.cpp +++ b/src/mac/choice.cpp @@ -77,7 +77,7 @@ int wxChoice::DoAppend(const wxString& item) m_datas.Add( NULL ) ; int index = m_strings.GetCount() - 1 ; DoSetItemClientData( index , NULL ) ; - SetControlMaximum( m_macControl , Number()) ; + SetControlMaximum( m_macControl , GetCount()) ; return index ; } @@ -93,7 +93,7 @@ void wxChoice::Delete(int n) ::DeleteMenuItem( m_macPopUpMenuHandle , n + 1) ; m_strings.Remove( n ) ; m_datas.Remove( n ) ; - SetControlMaximum( m_macControl , Number()) ; + SetControlMaximum( m_macControl , GetCount()) ; } void wxChoice::Clear() diff --git a/src/mac/statbmp.cpp b/src/mac/statbmp.cpp index 007070cb89..03f68a2ea7 100644 --- a/src/mac/statbmp.cpp +++ b/src/mac/statbmp.cpp @@ -19,14 +19,14 @@ #include "wx/dcclient.h" #if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap, wxControl) +IMPLEMENT_DYNAMIC_CLASS(wxStaticBitmap, wxStaticBitmapBase) #endif /* * wxStaticBitmap */ -BEGIN_EVENT_TABLE(wxStaticBitmap, wxControl) +BEGIN_EVENT_TABLE(wxStaticBitmap, wxStaticBitmapBase) EVT_PAINT(wxStaticBitmap::OnPaint) END_EVENT_TABLE() @@ -43,7 +43,7 @@ bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID id, m_backgroundColour = parent->GetBackgroundColour() ; m_foregroundColour = parent->GetForegroundColour() ; - m_messageBitmap = bitmap; + m_bitmap = bitmap; if ( id == -1 ) m_windowId = (int)NewControlId(); else @@ -52,7 +52,7 @@ bool wxStaticBitmap::Create(wxWindow *parent, wxWindowID id, m_windowStyle = style; bool ret = wxControl::Create( parent, id, pos, size, style , wxDefaultValidator , name ); - SetSizeOrDefault( size ) ; + SetBestSize( size ) ; return ret; } @@ -64,9 +64,9 @@ void wxStaticBitmap::SetSize(int x, int y, int width, int height, int sizeFlags) void wxStaticBitmap::SetBitmap(const wxBitmap& bitmap) { - m_messageBitmap = bitmap; + m_bitmap = bitmap; Refresh() ; - SetSizeOrDefault(); + SetBestSize(wxSize(bitmap.GetWidth(), bitmap.GetHeight())); } void wxStaticBitmap::OnPaint( wxPaintEvent &event ) @@ -74,13 +74,13 @@ void wxStaticBitmap::OnPaint( wxPaintEvent &event ) wxPaintDC dc(this); PrepareDC(dc); - dc.DrawBitmap( m_messageBitmap , 0 , 0 , TRUE ) ; + dc.DrawBitmap( m_bitmap , 0 , 0 , TRUE ) ; } wxSize wxStaticBitmap::DoGetBestSize() const { - if ( m_messageBitmap.Ok() ) - return wxSize(m_messageBitmap.GetWidth(), m_messageBitmap.GetHeight()); + if ( m_bitmap.Ok() ) + return wxSize(m_bitmap.GetWidth(), m_bitmap.GetHeight()); else return wxSize(16, 16); // completely arbitrary } diff --git a/src/mac/stattext.cpp b/src/mac/stattext.cpp index 783d231f9b..68e1453ba8 100644 --- a/src/mac/stattext.cpp +++ b/src/mac/stattext.cpp @@ -23,12 +23,12 @@ #include #if !USE_SHARED_LIBRARY -IMPLEMENT_DYNAMIC_CLASS(wxStaticText, wxControl) +IMPLEMENT_DYNAMIC_CLASS(wxStaticText, wxStaticTextBase) #endif #include -BEGIN_EVENT_TABLE(wxStaticText, wxControl) +BEGIN_EVENT_TABLE(wxStaticText, wxStaticTextBase) EVT_PAINT(wxStaticText::OnPaint) END_EVENT_TABLE() @@ -52,7 +52,7 @@ bool wxStaticText::Create(wxWindow *parent, wxWindowID id, m_label = label ; bool ret = wxControl::Create( parent, id, pos, size, style , wxDefaultValidator , name ); - SetSizeOrDefault( size ) ; + SetBestSize( size ) ; return ret; } @@ -235,7 +235,7 @@ void wxStaticText::SetLabel(const wxString& st ) SetTitle( st ) ; m_label = st ; if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) ) - SetSizeOrDefault() ; + SetSize( GetBestSize() ) ; Refresh() ; MacUpdateImmediately() ;