From 0de9b5b23f70465393526546cd1a69fcfcd26e9c Mon Sep 17 00:00:00 2001 From: Robert Roebling Date: Wed, 12 May 1999 20:26:54 +0000 Subject: [PATCH] Fixes a few SGI compiler warnings.. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@2436 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/gtk/choice.h | 5 +++++ include/wx/gtk/combobox.h | 5 +++++ include/wx/gtk/dc.h | 2 +- include/wx/gtk/dcclient.h | 2 +- include/wx/gtk/listbox.h | 5 +++++ include/wx/gtk/mdi.h | 10 ++++------ include/wx/gtk/menu.h | 3 ++- include/wx/gtk/radiobox.h | 27 ++++++++++++++++++--------- include/wx/gtk1/choice.h | 5 +++++ include/wx/gtk1/combobox.h | 5 +++++ include/wx/gtk1/dc.h | 2 +- include/wx/gtk1/dcclient.h | 2 +- include/wx/gtk1/listbox.h | 5 +++++ include/wx/gtk1/mdi.h | 10 ++++------ include/wx/gtk1/menu.h | 3 ++- include/wx/gtk1/radiobox.h | 27 ++++++++++++++++++--------- include/wx/window.h | 2 +- src/gtk/dc.cpp | 2 +- src/gtk/dcclient.cpp | 6 +++--- src/gtk1/dc.cpp | 2 +- src/gtk1/dcclient.cpp | 6 +++--- 21 files changed, 91 insertions(+), 45 deletions(-) diff --git a/include/wx/gtk/choice.h b/include/wx/gtk/choice.h index 0a7eeca3d8..da0b83c288 100644 --- a/include/wx/gtk/choice.h +++ b/include/wx/gtk/choice.h @@ -69,6 +69,11 @@ public: void SetClientObject( int n, wxClientData* clientData ); wxClientData* GetClientObject( int n ); + void SetClientObject( wxClientData *data ) { wxControl::SetClientObject( data ); } + wxClientData *GetClientObject() const { return wxControl::GetClientObject(); } + void SetClientData( void *data ) { wxControl::SetClientData( data ); } + void *GetClientData() const { return wxControl::GetClientData(); } + void Clear(); void Delete(int n); diff --git a/include/wx/gtk/combobox.h b/include/wx/gtk/combobox.h index 78c1425e66..a9910b78a3 100644 --- a/include/wx/gtk/combobox.h +++ b/include/wx/gtk/combobox.h @@ -75,6 +75,11 @@ public: void SetClientObject( int n, wxClientData* clientData ); wxClientData* GetClientObject( int n ); + void SetClientObject( wxClientData *data ) { wxControl::SetClientObject( data ); } + wxClientData *GetClientObject() const { return wxControl::GetClientObject(); } + void SetClientData( void *data ) { wxControl::SetClientData( data ); } + void *GetClientData() const { return wxControl::GetClientData(); } + void Clear(); void Delete( int n ); diff --git a/include/wx/gtk/dc.h b/include/wx/gtk/dc.h index 581fc16482..f7875edf7a 100644 --- a/include/wx/gtk/dc.h +++ b/include/wx/gtk/dc.h @@ -88,7 +88,7 @@ public: { CrossHair(pt.x, pt.y); } - virtual void DrawArc( long x1, long y1, long x2, long y2, double xc, double yc ); + virtual void DrawArc( long x1, long y1, long x2, long y2, long xc, long yc ); inline void DrawArc(const wxPoint& pt1, const wxPoint& pt2, const wxPoint& centre) { DrawArc(pt1.x, pt1.y, pt2.x, pt2.y, centre.x, centre.y); diff --git a/include/wx/gtk/dcclient.h b/include/wx/gtk/dcclient.h index ae99362c13..516971fd98 100644 --- a/include/wx/gtk/dcclient.h +++ b/include/wx/gtk/dcclient.h @@ -45,7 +45,7 @@ public: virtual void DrawLine( long x1, long y1, long x2, long y2 ); virtual void CrossHair( long x, long y ); - virtual void DrawArc( long x1, long y1, long x2, long y2, double xc, double yc ); + virtual void DrawArc( long x1, long y1, long x2, long y2, long xc, long yc ); virtual void DrawEllipticArc( long x, long y, long width, long height, double sa, double ea ); virtual void DrawPoint( long x, long y ); diff --git a/include/wx/gtk/listbox.h b/include/wx/gtk/listbox.h index f1627cf454..a20c32802a 100644 --- a/include/wx/gtk/listbox.h +++ b/include/wx/gtk/listbox.h @@ -75,6 +75,11 @@ public: void SetClientObject( int n, wxClientData* clientData ); wxClientData* GetClientObject( int n ); + void SetClientObject( wxClientData *data ) { wxControl::SetClientObject( data ); } + wxClientData *GetClientObject() const { return wxControl::GetClientObject(); } + void SetClientData( void *data ) { wxControl::SetClientData( data ); } + void *GetClientData() const { return wxControl::GetClientData(); } + void Clear(); void Delete( int n ); diff --git a/include/wx/gtk/mdi.h b/include/wx/gtk/mdi.h index 2f30d72b4f..ff370ad38c 100644 --- a/include/wx/gtk/mdi.h +++ b/include/wx/gtk/mdi.h @@ -122,16 +122,14 @@ class wxMDIChildFrame: public wxFrame // no status bars virtual wxStatusBar* CreateStatusBar( int WXUNUSED(number)=1, long WXUNUSED(style)=1, wxWindowID WXUNUSED(id)=1, const wxString& WXUNUSED(name)=WXSTRINGCAST NULL ) {return (wxStatusBar*)NULL; } - virtual wxStatusBar *GetStatusBar() { return (wxStatusBar*)NULL; } + virtual wxStatusBar *GetStatusBar() const { return (wxStatusBar*)NULL; } virtual void SetStatusText( const wxString &WXUNUSED(text), int WXUNUSED(number) ) {} - virtual void SetStatusWidths( int WXUNUSED(n), int *WXUNUSED(width) ) {} + virtual void SetStatusWidths( int WXUNUSED(n), const int WXUNUSED(widths_field)[] ) {} // no size hints virtual void SetSizeHints( int WXUNUSED(minW), int WXUNUSED(minH), - int WXUNUSED(maxW), int WXUNUSED(maxH), - int WXUNUSED(incW) ) - { - } + int WXUNUSED(maxW), int WXUNUSED(maxH), + int WXUNUSED(incW), int WXUNUSED(incH) ) {} // no toolbar bars virtual wxToolBar* CreateToolBar( long WXUNUSED(style), wxWindowID WXUNUSED(id), diff --git a/include/wx/gtk/menu.h b/include/wx/gtk/menu.h index e747a14d87..1e1d52349a 100644 --- a/include/wx/gtk/menu.h +++ b/include/wx/gtk/menu.h @@ -68,8 +68,9 @@ public: void Enable( int id, bool enable ); bool IsEnabled( int id ) const; - wxString GetLabel( int id ) const; void SetLabel( int id, const wxString &label ); + wxString GetLabel( int id ) const; + wxString GetLabel() const { return wxWindow::GetLabel(); } void EnableTop( int pos, bool flag ); void SetLabelTop( int pos, const wxString& label ); diff --git a/include/wx/gtk/radiobox.h b/include/wx/gtk/radiobox.h index 2c2e72ec8b..a73c1a608e 100644 --- a/include/wx/gtk/radiobox.h +++ b/include/wx/gtk/radiobox.h @@ -42,9 +42,8 @@ class wxRadioBox: public wxControl DECLARE_DYNAMIC_CLASS(wxRadioBox) - public: - - wxRadioBox(void); +public: + wxRadioBox(); inline wxRadioBox( wxWindow *parent, wxWindowID id, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, int n = 0, const wxString choices[] = (const wxString *) NULL, @@ -61,22 +60,32 @@ class wxRadioBox: public wxControl int majorDim = 0, long style = wxRA_HORIZONTAL, const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr ); + int FindString( const wxString& s) const; void SetSelection( int n ); - int GetSelection(void) const; + int GetSelection() const; + wxString GetString( int n ) const; + + wxString GetLabel( int item ) const; + wxString GetLabel() const { return wxControl::GetLabel(); } void SetLabel( const wxString& label ); void SetLabel( int item, const wxString& label ); + + /* doesn't work */ void SetLabel( int item, wxBitmap *bitmap ); - wxString GetLabel( int item ) const; + bool Show( bool show ); + void Show( int item, bool show ); + bool Enable( bool enable ); void Enable( int item, bool enable ); - void Show( int item, bool show ); - virtual wxString GetStringSelection(void) const; + + virtual wxString GetStringSelection() const; virtual bool SetStringSelection( const wxString& s ); - virtual int Number(void) const; - int GetNumberOfRowsOrCols(void) const; + + virtual int Number() const; + int GetNumberOfRowsOrCols() const; void SetNumberOfRowsOrCols( int n ); void OnSize( wxSizeEvent &event ); diff --git a/include/wx/gtk1/choice.h b/include/wx/gtk1/choice.h index 0a7eeca3d8..da0b83c288 100644 --- a/include/wx/gtk1/choice.h +++ b/include/wx/gtk1/choice.h @@ -69,6 +69,11 @@ public: void SetClientObject( int n, wxClientData* clientData ); wxClientData* GetClientObject( int n ); + void SetClientObject( wxClientData *data ) { wxControl::SetClientObject( data ); } + wxClientData *GetClientObject() const { return wxControl::GetClientObject(); } + void SetClientData( void *data ) { wxControl::SetClientData( data ); } + void *GetClientData() const { return wxControl::GetClientData(); } + void Clear(); void Delete(int n); diff --git a/include/wx/gtk1/combobox.h b/include/wx/gtk1/combobox.h index 78c1425e66..a9910b78a3 100644 --- a/include/wx/gtk1/combobox.h +++ b/include/wx/gtk1/combobox.h @@ -75,6 +75,11 @@ public: void SetClientObject( int n, wxClientData* clientData ); wxClientData* GetClientObject( int n ); + void SetClientObject( wxClientData *data ) { wxControl::SetClientObject( data ); } + wxClientData *GetClientObject() const { return wxControl::GetClientObject(); } + void SetClientData( void *data ) { wxControl::SetClientData( data ); } + void *GetClientData() const { return wxControl::GetClientData(); } + void Clear(); void Delete( int n ); diff --git a/include/wx/gtk1/dc.h b/include/wx/gtk1/dc.h index 581fc16482..f7875edf7a 100644 --- a/include/wx/gtk1/dc.h +++ b/include/wx/gtk1/dc.h @@ -88,7 +88,7 @@ public: { CrossHair(pt.x, pt.y); } - virtual void DrawArc( long x1, long y1, long x2, long y2, double xc, double yc ); + virtual void DrawArc( long x1, long y1, long x2, long y2, long xc, long yc ); inline void DrawArc(const wxPoint& pt1, const wxPoint& pt2, const wxPoint& centre) { DrawArc(pt1.x, pt1.y, pt2.x, pt2.y, centre.x, centre.y); diff --git a/include/wx/gtk1/dcclient.h b/include/wx/gtk1/dcclient.h index ae99362c13..516971fd98 100644 --- a/include/wx/gtk1/dcclient.h +++ b/include/wx/gtk1/dcclient.h @@ -45,7 +45,7 @@ public: virtual void DrawLine( long x1, long y1, long x2, long y2 ); virtual void CrossHair( long x, long y ); - virtual void DrawArc( long x1, long y1, long x2, long y2, double xc, double yc ); + virtual void DrawArc( long x1, long y1, long x2, long y2, long xc, long yc ); virtual void DrawEllipticArc( long x, long y, long width, long height, double sa, double ea ); virtual void DrawPoint( long x, long y ); diff --git a/include/wx/gtk1/listbox.h b/include/wx/gtk1/listbox.h index f1627cf454..a20c32802a 100644 --- a/include/wx/gtk1/listbox.h +++ b/include/wx/gtk1/listbox.h @@ -75,6 +75,11 @@ public: void SetClientObject( int n, wxClientData* clientData ); wxClientData* GetClientObject( int n ); + void SetClientObject( wxClientData *data ) { wxControl::SetClientObject( data ); } + wxClientData *GetClientObject() const { return wxControl::GetClientObject(); } + void SetClientData( void *data ) { wxControl::SetClientData( data ); } + void *GetClientData() const { return wxControl::GetClientData(); } + void Clear(); void Delete( int n ); diff --git a/include/wx/gtk1/mdi.h b/include/wx/gtk1/mdi.h index 2f30d72b4f..ff370ad38c 100644 --- a/include/wx/gtk1/mdi.h +++ b/include/wx/gtk1/mdi.h @@ -122,16 +122,14 @@ class wxMDIChildFrame: public wxFrame // no status bars virtual wxStatusBar* CreateStatusBar( int WXUNUSED(number)=1, long WXUNUSED(style)=1, wxWindowID WXUNUSED(id)=1, const wxString& WXUNUSED(name)=WXSTRINGCAST NULL ) {return (wxStatusBar*)NULL; } - virtual wxStatusBar *GetStatusBar() { return (wxStatusBar*)NULL; } + virtual wxStatusBar *GetStatusBar() const { return (wxStatusBar*)NULL; } virtual void SetStatusText( const wxString &WXUNUSED(text), int WXUNUSED(number) ) {} - virtual void SetStatusWidths( int WXUNUSED(n), int *WXUNUSED(width) ) {} + virtual void SetStatusWidths( int WXUNUSED(n), const int WXUNUSED(widths_field)[] ) {} // no size hints virtual void SetSizeHints( int WXUNUSED(minW), int WXUNUSED(minH), - int WXUNUSED(maxW), int WXUNUSED(maxH), - int WXUNUSED(incW) ) - { - } + int WXUNUSED(maxW), int WXUNUSED(maxH), + int WXUNUSED(incW), int WXUNUSED(incH) ) {} // no toolbar bars virtual wxToolBar* CreateToolBar( long WXUNUSED(style), wxWindowID WXUNUSED(id), diff --git a/include/wx/gtk1/menu.h b/include/wx/gtk1/menu.h index e747a14d87..1e1d52349a 100644 --- a/include/wx/gtk1/menu.h +++ b/include/wx/gtk1/menu.h @@ -68,8 +68,9 @@ public: void Enable( int id, bool enable ); bool IsEnabled( int id ) const; - wxString GetLabel( int id ) const; void SetLabel( int id, const wxString &label ); + wxString GetLabel( int id ) const; + wxString GetLabel() const { return wxWindow::GetLabel(); } void EnableTop( int pos, bool flag ); void SetLabelTop( int pos, const wxString& label ); diff --git a/include/wx/gtk1/radiobox.h b/include/wx/gtk1/radiobox.h index 2c2e72ec8b..a73c1a608e 100644 --- a/include/wx/gtk1/radiobox.h +++ b/include/wx/gtk1/radiobox.h @@ -42,9 +42,8 @@ class wxRadioBox: public wxControl DECLARE_DYNAMIC_CLASS(wxRadioBox) - public: - - wxRadioBox(void); +public: + wxRadioBox(); inline wxRadioBox( wxWindow *parent, wxWindowID id, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, int n = 0, const wxString choices[] = (const wxString *) NULL, @@ -61,22 +60,32 @@ class wxRadioBox: public wxControl int majorDim = 0, long style = wxRA_HORIZONTAL, const wxValidator& val = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr ); + int FindString( const wxString& s) const; void SetSelection( int n ); - int GetSelection(void) const; + int GetSelection() const; + wxString GetString( int n ) const; + + wxString GetLabel( int item ) const; + wxString GetLabel() const { return wxControl::GetLabel(); } void SetLabel( const wxString& label ); void SetLabel( int item, const wxString& label ); + + /* doesn't work */ void SetLabel( int item, wxBitmap *bitmap ); - wxString GetLabel( int item ) const; + bool Show( bool show ); + void Show( int item, bool show ); + bool Enable( bool enable ); void Enable( int item, bool enable ); - void Show( int item, bool show ); - virtual wxString GetStringSelection(void) const; + + virtual wxString GetStringSelection() const; virtual bool SetStringSelection( const wxString& s ); - virtual int Number(void) const; - int GetNumberOfRowsOrCols(void) const; + + virtual int Number() const; + int GetNumberOfRowsOrCols() const; void SetNumberOfRowsOrCols( int n ); void OnSize( wxSizeEvent &event ); diff --git a/include/wx/window.h b/include/wx/window.h index b84b81fb49..6062504215 100644 --- a/include/wx/window.h +++ b/include/wx/window.h @@ -156,7 +156,7 @@ public: // label is just the same as the title (but for, e.g., buttons it // makes more sense to speak about labels) - wxString GetLabel() const { return GetTitle(); } + virtual wxString GetLabel() const { return GetTitle(); } // the window name is used for ressource setting in X, it is not the // same as the window title/label diff --git a/src/gtk/dc.cpp b/src/gtk/dc.cpp index f101829e97..d4e7c7b3ba 100644 --- a/src/gtk/dc.cpp +++ b/src/gtk/dc.cpp @@ -93,7 +93,7 @@ bool wxDC::Ok() const } void wxDC::DrawArc( long WXUNUSED(x1), long WXUNUSED(y1), long WXUNUSED(x2), long WXUNUSED(y2), - double WXUNUSED(xc), double WXUNUSED(yc) ) + long WXUNUSED(xc), long WXUNUSED(yc) ) { } diff --git a/src/gtk/dcclient.cpp b/src/gtk/dcclient.cpp index a5ee2b008c..cbac084f38 100644 --- a/src/gtk/dcclient.cpp +++ b/src/gtk/dcclient.cpp @@ -193,7 +193,7 @@ void wxWindowDC::CrossHair( long x, long y ) } } -void wxWindowDC::DrawArc( long x1, long y1, long x2, long y2, double xc, double yc ) +void wxWindowDC::DrawArc( long x1, long y1, long x2, long y2, long xc, long yc ) { wxCHECK_RET( Ok(), _T("invalid window dc") ); @@ -201,8 +201,8 @@ void wxWindowDC::DrawArc( long x1, long y1, long x2, long y2, double xc, double long yy1 = YLOG2DEV(y1); long xx2 = XLOG2DEV(x2); long yy2 = YLOG2DEV(y2); - long xxc = XLOG2DEV((long)xc); - long yyc = YLOG2DEV((long)yc); + long xxc = XLOG2DEV(xc); + long yyc = YLOG2DEV(yc); double dx = xx1 - xxc; double dy = yy1 - yyc; double radius = sqrt(dx*dx+dy*dy); diff --git a/src/gtk1/dc.cpp b/src/gtk1/dc.cpp index f101829e97..d4e7c7b3ba 100644 --- a/src/gtk1/dc.cpp +++ b/src/gtk1/dc.cpp @@ -93,7 +93,7 @@ bool wxDC::Ok() const } void wxDC::DrawArc( long WXUNUSED(x1), long WXUNUSED(y1), long WXUNUSED(x2), long WXUNUSED(y2), - double WXUNUSED(xc), double WXUNUSED(yc) ) + long WXUNUSED(xc), long WXUNUSED(yc) ) { } diff --git a/src/gtk1/dcclient.cpp b/src/gtk1/dcclient.cpp index a5ee2b008c..cbac084f38 100644 --- a/src/gtk1/dcclient.cpp +++ b/src/gtk1/dcclient.cpp @@ -193,7 +193,7 @@ void wxWindowDC::CrossHair( long x, long y ) } } -void wxWindowDC::DrawArc( long x1, long y1, long x2, long y2, double xc, double yc ) +void wxWindowDC::DrawArc( long x1, long y1, long x2, long y2, long xc, long yc ) { wxCHECK_RET( Ok(), _T("invalid window dc") ); @@ -201,8 +201,8 @@ void wxWindowDC::DrawArc( long x1, long y1, long x2, long y2, double xc, double long yy1 = YLOG2DEV(y1); long xx2 = XLOG2DEV(x2); long yy2 = YLOG2DEV(y2); - long xxc = XLOG2DEV((long)xc); - long yyc = YLOG2DEV((long)yc); + long xxc = XLOG2DEV(xc); + long yyc = YLOG2DEV(yc); double dx = xx1 - xxc; double dy = yy1 - yyc; double radius = sqrt(dx*dx+dy*dy); -- 2.45.2