corrections after wxUniv merge

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@10712 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Gilles Depeyrot 2001-06-28 21:23:41 +00:00
parent 7ef4c90b0a
commit 584bede061
9 changed files with 56 additions and 55 deletions

View File

@ -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();

View File

@ -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);

View File

@ -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()
};

View File

@ -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()

View File

@ -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
}

View File

@ -23,12 +23,12 @@
#include <stdio.h>
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxStaticText, wxControl)
IMPLEMENT_DYNAMIC_CLASS(wxStaticText, wxStaticTextBase)
#endif
#include <wx/mac/uma.h>
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() ;

View File

@ -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()

View File

@ -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
}

View File

@ -23,12 +23,12 @@
#include <stdio.h>
#if !USE_SHARED_LIBRARY
IMPLEMENT_DYNAMIC_CLASS(wxStaticText, wxControl)
IMPLEMENT_DYNAMIC_CLASS(wxStaticText, wxStaticTextBase)
#endif
#include <wx/mac/uma.h>
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() ;