corrected warnings when compiling with -Wall -W

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@15412 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Gilles Depeyrot
2002-05-07 21:58:27 +00:00
parent 54380f29f0
commit d84afea9d1
87 changed files with 333 additions and 245 deletions

View File

@@ -27,14 +27,20 @@ public:
wxAcceleratorTable(int n, wxAcceleratorEntry entries[]); // Load from array
// Copy constructors
inline wxAcceleratorTable(const wxAcceleratorTable& accel) { Ref(accel); }
inline wxAcceleratorTable(const wxAcceleratorTable* accel) { if (accel) Ref(*accel); }
wxAcceleratorTable(const wxAcceleratorTable& accel)
: wxObject()
{ Ref(accel); }
wxAcceleratorTable(const wxAcceleratorTable* accel)
{ if (accel) Ref(*accel); }
~wxAcceleratorTable();
inline wxAcceleratorTable& operator = (const wxAcceleratorTable& accel) { if (*this == accel) return (*this); Ref(accel); return *this; }
inline bool operator == (const wxAcceleratorTable& accel) { return m_refData == accel.m_refData; }
inline bool operator != (const wxAcceleratorTable& accel) { return m_refData != accel.m_refData; }
wxAcceleratorTable& operator = (const wxAcceleratorTable& accel)
{ if (*this == accel) return (*this); Ref(accel); return *this; }
bool operator == (const wxAcceleratorTable& accel)
{ return m_refData == accel.m_refData; }
bool operator != (const wxAcceleratorTable& accel)
{ return m_refData != accel.m_refData; }
bool Ok() const;

View File

@@ -39,7 +39,9 @@ public:
wxBrush(short macThemeBrush ) ;
wxBrush(const wxColour& col, int style);
wxBrush(const wxBitmap& stipple);
inline wxBrush(const wxBrush& brush) { Ref(brush); }
wxBrush(const wxBrush& brush)
: wxGDIObject()
{ Ref(brush); }
~wxBrush();
virtual void SetColour(const wxColour& col) ;
@@ -49,9 +51,12 @@ public:
virtual void SetMacTheme(short macThemeBrush) ;
virtual void SetMacThemeBackground(unsigned long macThemeBackground , WXRECTPTR extent) ;
inline wxBrush& operator = (const wxBrush& brush) { if (*this == brush) return (*this); Ref(brush); return *this; }
inline bool operator == (const wxBrush& brush) { return m_refData == brush.m_refData; }
inline bool operator != (const wxBrush& brush) { return m_refData != brush.m_refData; }
wxBrush& operator = (const wxBrush& brush)
{ if (*this == brush) return (*this); Ref(brush); return *this; }
bool operator == (const wxBrush& brush)
{ return m_refData == brush.m_refData; }
bool operator != (const wxBrush& brush)
{ return m_refData != brush.m_refData; }
wxMacBrushKind MacGetBrushKind() const ;

View File

@@ -27,11 +27,14 @@ WX_DEFINE_ARRAY( char * , wxChoiceDataArray ) ;
// Choice item
class WXDLLEXPORT wxChoice: public wxChoiceBase
{
DECLARE_DYNAMIC_CLASS(wxChoice)
DECLARE_DYNAMIC_CLASS(wxChoice)
public:
wxChoice() {}
virtual ~wxChoice() ;
public:
wxChoice()
: m_strings(), m_datas(), m_macPopUpMenuHandle(NULL)
{}
virtual ~wxChoice() ;
wxChoice(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition,

View File

@@ -28,11 +28,17 @@ public:
wxColour();
// from RGB
wxColour( unsigned char red, unsigned char green, unsigned char blue );
wxColour( unsigned long colRGB ) { Set(colRGB); }
wxColour( unsigned long colRGB )
: m_isInit(FALSE), m_red(0), m_blue(0), m_green(0)
{ Set(colRGB); }
// implicit conversion from the colour name
wxColour( const wxString &colourName ) { InitFromName(colourName); }
wxColour( const char *colourName ) { InitFromName(colourName); }
wxColour( const wxString &colourName )
: m_isInit(FALSE), m_red(0), m_blue(0), m_green(0)
{ InitFromName(colourName); }
wxColour( const char *colourName )
: m_isInit(FALSE), m_red(0), m_blue(0), m_green(0)
{ InitFromName(colourName); }
// copy ctors and assignment operators
wxColour( const wxColour& col );

View File

@@ -102,11 +102,11 @@ protected:
protected:
// For controls like radiobuttons which are really composite
WXWidget m_macControl ;
bool m_macControlIsShown ;
wxList m_subControls;
int m_macHorizontalBorder ;
int m_macVerticalBorder ;
WXWidget m_macControl ;
bool m_macControlIsShown ;
wxList m_subControls;
int m_macHorizontalBorder ;
int m_macVerticalBorder ;
virtual wxSize DoGetBestSize() const;

View File

@@ -65,9 +65,9 @@ public:
int ShowModal();
// not supported for file dialog, RR
virtual void DoSetSize(int x, int y,
int width, int height,
int sizeFlags = wxSIZE_AUTO) {}
virtual void DoSetSize(int WXUNUSED(x), int WXUNUSED(y),
int WXUNUSED(width), int WXUNUSED(height),
int WXUNUSED(sizeFlags) = wxSIZE_AUTO) {}
};

View File

@@ -92,7 +92,7 @@ public:
virtual void* DoGetItemClientData(int n) const;
virtual void DoSetItemClientObject(int n, wxClientData* clientData);
virtual wxClientData* DoGetItemClientObject(int n) const;
virtual void DoSetSize(int x, int y,int width, int height,int sizeFlags = wxSIZE_AUTO ) ;
virtual void DoSetSize(int x, int y,int width, int height,int sizeFlags = wxSIZE_AUTO ) ;
// wxCheckListBox support
#if wxUSE_OWNER_DRAWN
@@ -108,29 +108,29 @@ public:
// Windows callbacks
virtual void SetupColours();
virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart ) ;
virtual void SetupColours();
virtual void MacHandleControlClick( WXWidget control , wxInt16 controlpart ) ;
void* m_macList ;
wxArrayString m_stringArray ;
wxListDataArray m_dataArray ;
wxArrayInt m_selectionPreImage ;
void MacSetRedraw( bool doDraw ) ;
void* m_macList ;
wxArrayString m_stringArray ;
wxListDataArray m_dataArray ;
wxArrayInt m_selectionPreImage ;
void MacSetRedraw( bool doDraw ) ;
protected:
void MacDestroy() ;
void MacDelete( int n ) ;
void MacInsert( int n , const char * text) ;
void MacAppend( const char * text) ;
void MacSet( int n , const char *text ) ;
void MacClear() ;
void MacSetSelection( int n , bool select ) ;
int MacGetSelection() const ;
int MacGetSelections(wxArrayInt& aSelections) const ;
bool MacIsSelected( int n ) const ;
void MacScrollTo( int n ) ;
void OnSize( const wxSizeEvent &size ) ;
void MacDoClick() ;
void MacDoDoubleClick() ;
void MacDestroy() ;
void MacDelete( int n ) ;
void MacInsert( int n , const char * text) ;
void MacAppend( const char * text) ;
void MacSet( int n , const char *text ) ;
void MacClear() ;
void MacSetSelection( int n , bool select ) ;
int MacGetSelection() const ;
int MacGetSelections(wxArrayInt& aSelections) const ;
bool MacIsSelected( int n ) const ;
void MacScrollTo( int n ) ;
void OnSize( const wxSizeEvent &size ) ;
void MacDoClick() ;
void MacDoDoubleClick() ;
// do we have multiple selections?
bool HasMultipleSelection() const;
@@ -150,7 +150,7 @@ protected:
private:
DECLARE_DYNAMIC_CLASS(wxListBox)
DECLARE_EVENT_TABLE()
DECLARE_EVENT_TABLE()
};
#endif

View File

@@ -37,53 +37,59 @@
class wxMacPortStateHelper
{
public :
wxMacPortStateHelper( GrafPtr newport) ;
wxMacPortStateHelper() ;
~wxMacPortStateHelper() ;
DECLARE_NO_COPY_CLASS(wxMacPortStateHelper)
public:
wxMacPortStateHelper( GrafPtr newport) ;
wxMacPortStateHelper() ;
~wxMacPortStateHelper() ;
void Setup( GrafPtr newport ) ;
void Clear() ;
bool IsCleared() { return m_clip == NULL ; }
GrafPtr GetCurrentPort() { return m_currentPort ; }
void Setup( GrafPtr newport ) ;
void Clear() ;
bool IsCleared() { return m_clip == NULL ; }
GrafPtr GetCurrentPort() { return m_currentPort ; }
private :
GrafPtr m_currentPort ;
GrafPtr m_oldPort ;
RgnHandle m_clip ;
ThemeDrawingState m_drawingState ;
short m_textFont ;
short m_textSize ;
short m_textStyle ;
short m_textMode ;
private:
GrafPtr m_currentPort ;
GrafPtr m_oldPort ;
RgnHandle m_clip ;
ThemeDrawingState m_drawingState ;
short m_textFont ;
short m_textSize ;
short m_textStyle ;
short m_textMode ;
} ;
class WXDLLEXPORT wxMacPortSetter
{
public :
wxMacPortSetter( const wxDC* dc ) ;
~wxMacPortSetter() ;
private :
wxMacPortStateHelper m_ph ;
const wxDC* m_dc ;
DECLARE_NO_COPY_CLASS(wxMacPortSetter)
public:
wxMacPortSetter( const wxDC* dc ) ;
~wxMacPortSetter() ;
private:
wxMacPortStateHelper m_ph ;
const wxDC* m_dc ;
} ;
class wxMacDrawingHelper
{
public :
wxMacDrawingHelper( wxWindowMac * theWindow , bool clientArea = false ) ;
~wxMacDrawingHelper() ;
bool Ok() { return m_ok ; }
void LocalToWindow( Rect *rect) { OffsetRect( rect , m_origin.h , m_origin.v ) ; }
void LocalToWindow( Point *pt ) { AddPt( m_origin , pt ) ; }
void LocalToWindow( RgnHandle rgn ) { OffsetRgn( rgn , m_origin.h , m_origin.v ) ; }
const Point& GetOrigin() { return m_origin ; }
private :
Point m_origin ;
GrafPtr m_formerPort ;
GrafPtr m_currentPort ;
PenState m_savedPenState ;
bool m_ok ;
DECLARE_NO_COPY_CLASS(wxMacDrawingHelper)
public:
wxMacDrawingHelper( wxWindowMac * theWindow , bool clientArea = false ) ;
~wxMacDrawingHelper() ;
bool Ok() { return m_ok ; }
void LocalToWindow( Rect *rect) { OffsetRect( rect , m_origin.h , m_origin.v ) ; }
void LocalToWindow( Point *pt ) { AddPt( m_origin , pt ) ; }
void LocalToWindow( RgnHandle rgn ) { OffsetRgn( rgn , m_origin.h , m_origin.v ) ; }
const Point& GetOrigin() { return m_origin ; }
private:
Point m_origin ;
GrafPtr m_formerPort ;
GrafPtr m_currentPort ;
PenState m_savedPenState ;
bool m_ok ;
} ;

View File

@@ -27,7 +27,7 @@ class WXDLLEXPORT wxStaticLine : public wxStaticLineBase
public:
// constructors and pseudo-constructors
wxStaticLine() { }
wxStaticLine() : m_statbox(NULL) { }
wxStaticLine( wxWindow *parent,
wxWindowID id,
@@ -35,6 +35,7 @@ public:
const wxSize &size = wxDefaultSize,
long style = wxLI_HORIZONTAL,
const wxString &name = wxStaticTextNameStr )
: m_statbox(NULL)
{
Create(parent, id, pos, size, style, name);
}

View File

@@ -20,7 +20,7 @@ class WXDLLEXPORT wxStaticText: public wxStaticTextBase
{
DECLARE_DYNAMIC_CLASS(wxStaticText)
public:
inline wxStaticText() { }
inline wxStaticText() : m_label() { }
inline wxStaticText(wxWindow *parent, wxWindowID id,
const wxString& label,

View File

@@ -31,12 +31,14 @@ class WXDLLEXPORT wxToolBar: public wxToolBarBase
* Public interface
*/
wxToolBar() { Init(); }
wxToolBar() : m_macToolHandles() { Init(); }
inline wxToolBar(wxWindow *parent, wxWindowID id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = wxNO_BORDER|wxTB_HORIZONTAL,
const wxString& name = wxToolBarNameStr)
inline wxToolBar(wxWindow *parent, wxWindowID id,
const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize,
long style = wxNO_BORDER|wxTB_HORIZONTAL,
const wxString& name = wxToolBarNameStr)
: m_macToolHandles()
{
Init();
Create(parent, id, pos, size, style, name);

View File

@@ -58,35 +58,36 @@ public:
virtual void SetIcons(const wxIconBundle& icons) { SetIcon( icons.GetIcon( -1 ) ); }
virtual void Restore();
virtual bool ShowFullScreen(bool show, long style = wxFULLSCREEN_ALL) { return FALSE; }
virtual bool ShowFullScreen(bool WXUNUSED(show), long WXUNUSED(style) = wxFULLSCREEN_ALL)
{ return FALSE; }
virtual bool IsFullScreen() const { return FALSE; }
// implementation from now on
// --------------------------
virtual void MacCreateRealWindow( const wxString& title,
const wxPoint& pos,
const wxSize& size,
long style,
const wxString& name ) ;
static WXWindow MacGetWindowInUpdate() { return s_macWindowInUpdate ; }
virtual void MacGetPortParams(WXPOINTPTR localOrigin, WXRECTPTR clipRect, WXWindow *window , wxWindowMac** rootwin ) ;
virtual void Clear() ;
virtual WXWidget MacGetContainerForEmbedding() ;
WXWindow MacGetWindowRef() { return m_macWindow ; }
virtual void MacActivate( WXEVENTREF ev , bool inIsActivating ) ;
virtual void MacUpdate( long timestamp ) ;
virtual void MacMouseDown( WXEVENTREF ev , short windowPart ) ;
virtual void MacMouseUp( WXEVENTREF ev , short windowPart ) ;
virtual void MacMouseMoved( WXEVENTREF ev , short windowPart ) ;
virtual void MacKeyDown( WXEVENTREF ev ) ;
virtual void MacFireMouseEvent( WXEVENTREF ev ) ;
virtual void Raise();
virtual void Lower();
virtual void SetTitle( const wxString& title);
virtual bool Show( bool show = TRUE );
virtual void DoMoveWindow(int x, int y, int width, int height);
void MacInvalidate( const WXRECTPTR rect, bool eraseBackground ) ;
virtual void MacCreateRealWindow( const wxString& title,
const wxPoint& pos,
const wxSize& size,
long style,
const wxString& name ) ;
static WXWindow MacGetWindowInUpdate() { return s_macWindowInUpdate ; }
virtual void MacGetPortParams(WXPOINTPTR localOrigin, WXRECTPTR clipRect, WXWindow *window , wxWindowMac** rootwin ) ;
virtual void Clear() ;
virtual WXWidget MacGetContainerForEmbedding() ;
WXWindow MacGetWindowRef() { return m_macWindow ; }
virtual void MacActivate( WXEVENTREF ev , bool inIsActivating ) ;
virtual void MacUpdate( long timestamp ) ;
virtual void MacMouseDown( WXEVENTREF ev , short windowPart ) ;
virtual void MacMouseUp( WXEVENTREF ev , short windowPart ) ;
virtual void MacMouseMoved( WXEVENTREF ev , short windowPart ) ;
virtual void MacKeyDown( WXEVENTREF ev ) ;
virtual void MacFireMouseEvent( WXEVENTREF ev ) ;
virtual void Raise();
virtual void Lower();
virtual void SetTitle( const wxString& title);
virtual bool Show( bool show = TRUE );
virtual void DoMoveWindow(int x, int y, int width, int height);
void MacInvalidate( const WXRECTPTR rect, bool eraseBackground ) ;
protected:
// common part of all ctors
void Init();
@@ -105,7 +106,7 @@ protected:
WXHRGN m_macNoEraseUpdateRgn ;
bool m_macNeedsErasing ;
static WXWindow s_macWindowInUpdate ;
static WXWindow s_macWindowInUpdate ;
};
// list of all frames and modeless dialogs