From 899544330f37440c140b72a014c518a911b5b7a4 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 5 Nov 2007 22:29:16 +0000 Subject: [PATCH] fix a few hundreds of harmless unused parameters warnings and a couple of real bugs discovered thanks to them git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@49659 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/mac/carbon/private.h | 2 +- include/wx/mac/carbon/private/mactext.h | 10 +- include/wx/x11/app.h | 2 +- src/gtk1/bitmap.cpp | 2 +- src/gtk1/checkbox.cpp | 3 +- src/gtk1/dnd.cpp | 2 +- src/gtk1/gsockgtk.cpp | 2 +- src/gtk1/listbox.cpp | 34 ++--- src/gtk1/menu.cpp | 4 +- src/gtk1/radiobox.cpp | 4 +- src/gtk1/renderer.cpp | 4 +- src/gtk1/settings.cpp | 3 +- src/gtk1/tbargtk.cpp | 2 +- src/gtk1/textctrl.cpp | 10 +- src/gtk1/toplevel.cpp | 6 +- src/gtk1/window.cpp | 14 +- src/mac/carbon/app.cpp | 41 +++--- src/mac/carbon/bitmap.cpp | 13 +- src/mac/carbon/checkbox.cpp | 10 +- src/mac/carbon/colordlgosx.mm | 28 ++-- src/mac/carbon/combobox.cpp | 9 +- src/mac/carbon/control.cpp | 2 +- src/mac/carbon/dataobj.cpp | 5 +- src/mac/carbon/dirdlg.cpp | 2 +- src/mac/carbon/fontdlg.cpp | 7 +- src/mac/carbon/fontdlgosx.mm | 4 +- src/mac/carbon/fontenum.cpp | 8 +- src/mac/carbon/fontutil.cpp | 2 +- src/mac/carbon/graphics.cpp | 2 +- src/mac/carbon/icon.cpp | 8 +- src/mac/carbon/listbox.cpp | 2 +- src/mac/carbon/listctrl_mac.cpp | 28 ++-- src/mac/carbon/mdi.cpp | 2 +- src/mac/carbon/metafile.cpp | 2 +- src/mac/carbon/msgdlg.cpp | 2 +- src/mac/carbon/notebmac.cpp | 6 +- src/mac/carbon/overlay.cpp | 2 +- src/mac/carbon/printmac.cpp | 4 +- src/mac/carbon/region.cpp | 6 +- src/mac/carbon/scrolbar.cpp | 10 +- src/mac/carbon/slider.cpp | 17 ++- src/mac/carbon/spinbutt.cpp | 7 +- src/mac/carbon/spinctrl.cpp | 16 +-- src/mac/carbon/srchctrl.cpp | 8 +- src/mac/carbon/taskbar.cpp | 8 +- src/mac/carbon/textctrl.cpp | 27 ++-- src/mac/carbon/timer.cpp | 2 +- src/mac/carbon/toolbar.cpp | 8 +- src/mac/carbon/toplevel.cpp | 36 +++--- src/mac/carbon/uma.cpp | 3 +- src/mac/carbon/utils.cpp | 20 +-- src/mac/carbon/window.cpp | 52 +++++--- src/mac/corefoundation/gsockosx.cpp | 4 +- src/mac/corefoundation/hidjoystick.cpp | 8 +- src/mac/corefoundation/utilsexc_cf.cpp | 8 +- src/motif/combobox_native.cpp | 72 +---------- src/motif/textctrl.cpp | 162 +----------------------- src/x11/app.cpp | 4 +- src/x11/cursor.cpp | 10 +- src/x11/dcclient.cpp | 11 +- src/x11/dcscreen.cpp | 17 +-- src/x11/evtloop.cpp | 25 +--- src/x11/palette.cpp | 4 +- src/x11/reparent.cpp | 2 +- src/x11/toplevel.cpp | 8 +- src/x11/utils.cpp | 2 +- src/x11/window.cpp | 8 +- 67 files changed, 344 insertions(+), 514 deletions(-) diff --git a/include/wx/mac/carbon/private.h b/include/wx/mac/carbon/private.h index 7e0736ac85..65216bbcfb 100644 --- a/include/wx/mac/carbon/private.h +++ b/include/wx/mac/carbon/private.h @@ -370,7 +370,7 @@ protected : template class wxMacUPP { public : - wxMacUPP( procType proc ) + wxMacUPP( procType WXUNUSED(proc) ) { m_upp = NULL; m_upp = (*newUPP)( NULL ); diff --git a/include/wx/mac/carbon/private/mactext.h b/include/wx/mac/carbon/private/mactext.h index c61119e3d4..84959fde2d 100644 --- a/include/wx/mac/carbon/private/mactext.h +++ b/include/wx/mac/carbon/private/mactext.h @@ -39,10 +39,10 @@ public : virtual bool HasOwnContextMenu() const - { return false ; } + { return false ; } - virtual bool SetupCursor( const wxPoint& pt ) - { return false ; } + virtual bool SetupCursor( const wxPoint& WXUNUSED(pt) ) + { return false ; } virtual void Clear() ; virtual bool CanUndo() const; @@ -55,7 +55,7 @@ public : virtual void ShowPosition(long WXUNUSED(pos)) ; virtual int GetLineLength(long lineNo) const ; virtual wxString GetLineText(long lineNo) const ; - virtual void CheckSpelling(bool check) { } + virtual void CheckSpelling(bool WXUNUSED(check)) { } #ifndef __WXMAC_OSX__ virtual void MacControlUserPaneDrawProc(wxInt16 part) = 0 ; @@ -112,4 +112,4 @@ public : #endif // TARGET_API_MAC_OSX -#endif // _WX_MAC_PRIVATE_MACTEXT_H_ \ No newline at end of file +#endif // _WX_MAC_PRIVATE_MACTEXT_H_ diff --git a/include/wx/x11/app.h b/include/wx/x11/app.h index ac5f86fdce..a32699073a 100644 --- a/include/wx/x11/app.h +++ b/include/wx/x11/app.h @@ -84,7 +84,7 @@ public: PangoContext* GetPangoContext(); #endif - wxXVisualInfo* GetVisualInfo(WXDisplay* display) + wxXVisualInfo* GetVisualInfo(WXDisplay* WXUNUSED(display)) { // this should be implemented correctly for wxBitmap to work // with multiple display diff --git a/src/gtk1/bitmap.cpp b/src/gtk1/bitmap.cpp index 5948f4dfdf..e0ceb53c45 100644 --- a/src/gtk1/bitmap.cpp +++ b/src/gtk1/bitmap.cpp @@ -1363,7 +1363,7 @@ GdkBitmap *wxBitmap::GetBitmap() const return M_BMPDATA->m_bitmap; } -void *wxBitmap::GetRawData(wxPixelDataBase& data, int bpp) +void *wxBitmap::GetRawData(wxPixelDataBase& WXUNUSED(data), int WXUNUSED(bpp)) { return NULL; } diff --git a/src/gtk1/checkbox.cpp b/src/gtk1/checkbox.cpp index a85a9b4acf..c61796d946 100644 --- a/src/gtk1/checkbox.cpp +++ b/src/gtk1/checkbox.cpp @@ -36,7 +36,8 @@ extern wxWindowGTK *g_delayedFocus; //----------------------------------------------------------------------------- extern "C" { -static void gtk_checkbox_toggled_callback(GtkWidget *widget, wxCheckBox *cb) +static void gtk_checkbox_toggled_callback(GtkWidget *WXUNUSED(widget), + wxCheckBox *cb) { if (g_isIdle) wxapp_install_idle_handler(); diff --git a/src/gtk1/dnd.cpp b/src/gtk1/dnd.cpp index e90fecfe8c..47ce58b017 100644 --- a/src/gtk1/dnd.cpp +++ b/src/gtk1/dnd.cpp @@ -677,7 +677,7 @@ source_drag_data_get (GtkWidget *WXUNUSED(widget), extern "C" { static void source_drag_data_delete( GtkWidget *WXUNUSED(widget), - GdkDragContext *context, + GdkDragContext *WXUNUSED(context), wxDropSource *WXUNUSED(drop_source) ) { if (g_isIdle) diff --git a/src/gtk1/gsockgtk.cpp b/src/gtk1/gsockgtk.cpp index a3656b7284..6609441ee3 100644 --- a/src/gtk1/gsockgtk.cpp +++ b/src/gtk1/gsockgtk.cpp @@ -25,7 +25,7 @@ extern "C" { static void _GSocket_GDK_Input(gpointer data, - gint source, + gint WXUNUSED(source), GdkInputCondition condition) { GSocket *socket = (GSocket *)data; diff --git a/src/gtk1/listbox.cpp b/src/gtk1/listbox.cpp index 8828edc2a3..2af807102d 100644 --- a/src/gtk1/listbox.cpp +++ b/src/gtk1/listbox.cpp @@ -93,9 +93,9 @@ static gint wxlistbox_idle_callback( gpointer gdata ) //----------------------------------------------------------------------------- extern "C" { -static gint gtk_listitem_focus_in_callback( GtkWidget *widget, - GdkEvent *WXUNUSED(event), - wxWindow *win ) +static gint gtk_listitem_focus_in_callback( GtkWidget *WXUNUSED(widget), + GdkEvent *WXUNUSED(event), + wxWindow *win ) { if (g_isIdle) wxapp_install_idle_handler(); @@ -127,7 +127,9 @@ static gint gtk_listitem_focus_in_callback( GtkWidget *widget, //----------------------------------------------------------------------------- extern "C" { -static gint gtk_listitem_focus_out_callback( GtkWidget *widget, GdkEventFocus *gdk_event, wxWindowGTK *win ) +static gint gtk_listitem_focus_out_callback( GtkWidget *WXUNUSED(widget), + GdkEventFocus *WXUNUSED(gdk_event), + wxWindowGTK *win ) { if (g_isIdle) wxapp_install_idle_handler(); @@ -433,7 +435,7 @@ static void gtk_listitem_deselect_callback( GtkWidget *widget, wxListBox *listbo extern "C" { static gint -gtk_listbox_realized_callback( GtkWidget *m_widget, wxListBox *win ) +gtk_listbox_realized_callback( GtkWidget *WXUNUSED(widget), wxListBox *win ) { if (g_isIdle) wxapp_install_idle_handler(); @@ -565,8 +567,7 @@ wxListBox::~wxListBox() Clear(); - if (m_strings) - delete m_strings; + delete m_strings; } // ---------------------------------------------------------------------------- @@ -1007,23 +1008,8 @@ GtkWidget *wxListBox::GetConnectWidget() bool wxListBox::IsOwnGtkWindow( GdkWindow *window ) { - return true; - -#if 0 - if (m_widget->window == window) return true; - - if (GTK_WIDGET(m_list)->window == window) return true; - - GList *child = m_list->children; - while (child) - { - GtkWidget *bin = GTK_WIDGET( child->data ); - if (bin->window == window) return true; - child = child->next; - } - - return false; -#endif + return m_widget->window == window || + GTK_WIDGET(m_list)->window == window; } void wxListBox::DoApplyWidgetStyle(GtkRcStyle *style) diff --git a/src/gtk1/menu.cpp b/src/gtk1/menu.cpp index 03d490065e..7fbcb2cfb5 100644 --- a/src/gtk1/menu.cpp +++ b/src/gtk1/menu.cpp @@ -148,14 +148,14 @@ static void DoCommonMenuCallbackCode(wxMenu *menu, wxMenuEvent& event) extern "C" { -static void gtk_menu_open_callback( GtkWidget *widget, wxMenu *menu ) +static void gtk_menu_open_callback( GtkWidget *WXUNUSED(widget), wxMenu *menu ) { wxMenuEvent event(wxEVT_MENU_OPEN, -1, menu); DoCommonMenuCallbackCode(menu, event); } -static void gtk_menu_close_callback( GtkWidget *widget, wxMenuBar *menubar ) +static void gtk_menu_close_callback( GtkWidget *WXUNUSED(widget), wxMenuBar *menubar ) { if ( !menubar->GetMenuCount() ) { diff --git a/src/gtk1/radiobox.cpp b/src/gtk1/radiobox.cpp index 2f760c38cf..7d906ebce7 100644 --- a/src/gtk1/radiobox.cpp +++ b/src/gtk1/radiobox.cpp @@ -115,7 +115,7 @@ static gint gtk_radiobox_keypress_callback( GtkWidget *widget, GdkEventKey *gdk_ } extern "C" { -static gint gtk_radiobutton_focus_in( GtkWidget *widget, +static gint gtk_radiobutton_focus_in( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED(event), wxRadioBox *win ) { @@ -141,7 +141,7 @@ static gint gtk_radiobutton_focus_in( GtkWidget *widget, } extern "C" { -static gint gtk_radiobutton_focus_out( GtkWidget *widget, +static gint gtk_radiobutton_focus_out( GtkWidget *WXUNUSED(widget), GdkEvent *WXUNUSED(event), wxRadioBox *win ) { diff --git a/src/gtk1/renderer.cpp b/src/gtk1/renderer.cpp index 04d03ae16d..27ec163a20 100644 --- a/src/gtk1/renderer.cpp +++ b/src/gtk1/renderer.cpp @@ -183,7 +183,7 @@ wxRendererGTK::DrawSplitterBorder(wxWindow * WXUNUSED(win), void wxRendererGTK::DrawSplitterSash(wxWindow *win, - wxDC& dc, + wxDC& WXUNUSED(dc), const wxSize& size, wxCoord position, wxOrientation orient, @@ -297,7 +297,7 @@ wxRendererGTK::DrawSplitterSash(wxWindow *win, } void -wxRendererGTK::DrawDropArrow(wxWindow *win, +wxRendererGTK::DrawDropArrow(wxWindow *WXUNUSED(win), wxDC& dc, const wxRect& rect, int flags) diff --git a/src/gtk1/settings.cpp b/src/gtk1/settings.cpp index b7b1283e83..a428fd858f 100644 --- a/src/gtk1/settings.cpp +++ b/src/gtk1/settings.cpp @@ -357,7 +357,8 @@ wxFont wxSystemSettingsNative::GetFont( wxSystemFont index ) } } -int wxSystemSettingsNative::GetMetric( wxSystemMetric index, wxWindow* win ) +int +wxSystemSettingsNative::GetMetric(wxSystemMetric index, wxWindow* WXUNUSED(win)) { switch (index) { diff --git a/src/gtk1/tbargtk.cpp b/src/gtk1/tbargtk.cpp index 462561c522..6b5a785f2c 100644 --- a/src/gtk1/tbargtk.cpp +++ b/src/gtk1/tbargtk.cpp @@ -482,7 +482,7 @@ bool wxToolBar::DoInsertTool(size_t pos, wxToolBarToolBase *toolBase) return true; } -bool wxToolBar::DoDeleteTool(size_t pos, wxToolBarToolBase *toolBase) +bool wxToolBar::DoDeleteTool(size_t WXUNUSED(pos), wxToolBarToolBase *toolBase) { wxToolBarTool *tool = (wxToolBarTool *)toolBase; diff --git a/src/gtk1/textctrl.cpp b/src/gtk1/textctrl.cpp index 9dfc2f1857..06460bd944 100644 --- a/src/gtk1/textctrl.cpp +++ b/src/gtk1/textctrl.cpp @@ -89,9 +89,9 @@ static void wxGtkTextInsert(GtkWidget *text, extern "C" { static void gtk_insert_text_callback(GtkEditable *editable, - const gchar *new_text, - gint new_text_length, - gint *position, + const gchar *WXUNUSED(new_text), + gint WXUNUSED(new_text_length), + gint *WXUNUSED(position), wxTextCtrl *win) { if (g_isIdle) @@ -130,7 +130,7 @@ gtk_insert_text_callback(GtkEditable *editable, extern "C" { static void -gtk_text_changed_callback( GtkWidget *widget, wxTextCtrl *win ) +gtk_text_changed_callback( GtkWidget *WXUNUSED(widget), wxTextCtrl *win ) { if ( win->IgnoreTextUpdate() ) return; @@ -718,7 +718,7 @@ void wxTextCtrl::DoEnable( bool enable ) // wxGTK-specific: called recursively by Enable, // to give widgets an oppprtunity to correct their colours after they // have been changed by Enable -void wxTextCtrl::OnEnabled( bool enable ) +void wxTextCtrl::OnEnabled( bool WXUNUSED(enable) ) { if ( IsSingleLine() ) return; diff --git a/src/gtk1/toplevel.cpp b/src/gtk1/toplevel.cpp index ba996a4a9d..a6f76dadc7 100644 --- a/src/gtk1/toplevel.cpp +++ b/src/gtk1/toplevel.cpp @@ -170,9 +170,9 @@ static gint gtk_frame_focus_in_callback( GtkWidget *widget, //----------------------------------------------------------------------------- extern "C" { -static gint gtk_frame_focus_out_callback( GtkWidget *widget, +static gint gtk_frame_focus_out_callback( GtkWidget *WXUNUSED(widget), GdkEventFocus *WXUNUSED(gdk_event), - wxTopLevelWindowGTK *win ) + wxTopLevelWindowGTK *WXUNUSED(win) ) { if (g_isIdle) wxapp_install_idle_handler(); @@ -1117,7 +1117,7 @@ void wxTopLevelWindowGTK::SetIcons( const wxIconBundle &icons ) // frame state: maximized/iconized/normal // ---------------------------------------------------------------------------- -void wxTopLevelWindowGTK::Maximize(bool maximize) +void wxTopLevelWindowGTK::Maximize(bool WXUNUSED(maximize)) { wxFAIL_MSG( _T("not implemented") ); } diff --git a/src/gtk1/window.cpp b/src/gtk1/window.cpp index 71bf6d41d7..d2ad366660 100644 --- a/src/gtk1/window.cpp +++ b/src/gtk1/window.cpp @@ -428,7 +428,7 @@ static void gtk_window_own_draw_callback( GtkWidget *widget, GdkRectangle *WXUNU // make it extern because wxStaticText needs to disconnect this one extern "C" { -void wxgtk_window_size_request_callback(GtkWidget *widget, +void wxgtk_window_size_request_callback(GtkWidget *WXUNUSED(widget), GtkRequisition *requisition, wxWindow *win) { @@ -446,7 +446,7 @@ void wxgtk_window_size_request_callback(GtkWidget *widget, extern "C" { static -void wxgtk_combo_size_request_callback(GtkWidget *widget, +void wxgtk_combo_size_request_callback(GtkWidget *WXUNUSED(widget), GtkRequisition *requisition, wxComboBox *win) { @@ -478,7 +478,7 @@ void wxgtk_combo_size_request_callback(GtkWidget *widget, //----------------------------------------------------------------------------- extern "C" { -static int gtk_window_expose_callback( GtkWidget *widget, +static int gtk_window_expose_callback( GtkWidget *WXUNUSED(widget), GdkEventExpose *gdk_event, wxWindow *win ) { @@ -1862,7 +1862,9 @@ static gint gtk_window_focus_in_callback( GtkWidget *widget, //----------------------------------------------------------------------------- extern "C" { -static gint gtk_window_focus_out_callback( GtkWidget *widget, GdkEventFocus *gdk_event, wxWindowGTK *win ) +static gint gtk_window_focus_out_callback( GtkWidget *WXUNUSED(widget), + GdkEventFocus *WXUNUSED(gdk_event), + wxWindowGTK *win ) { DEBUG_MAIN_THREAD @@ -2168,7 +2170,7 @@ wxWindow *wxWindowBase::DoFindFocus() extern "C" { static gint -gtk_window_realized_callback( GtkWidget *m_widget, wxWindow *win ) +gtk_window_realized_callback( GtkWidget *WXUNUSED(widget), wxWindow *win ) { DEBUG_MAIN_THREAD @@ -2228,7 +2230,7 @@ void gtk_window_size_callback( GtkWidget *WXUNUSED(widget), extern "C" { static void gtk_wxwindow_size_callback( GtkWidget* WXUNUSED_UNLESS_XIM(widget), - GtkAllocation* WXUNUSED_UNLESS_XIM(alloc), + GtkAllocation* WXUNUSED(alloc), wxWindowGTK* WXUNUSED_UNLESS_XIM(win) ) { if (g_isIdle) diff --git a/src/mac/carbon/app.cpp b/src/mac/carbon/app.cpp index 8f8c8f9129..4b45779556 100644 --- a/src/mac/carbon/app.cpp +++ b/src/mac/carbon/app.cpp @@ -295,7 +295,7 @@ void wxApp::MacOpenFile(const wxString & fileName ) #endif } -void wxApp::MacOpenURL(const wxString & url ) +void wxApp::MacOpenURL(const wxString & WXUNUSED(url) ) { } @@ -543,7 +543,9 @@ static const EventTypeSpec eventList[] = } ; static pascal OSStatus -wxMacAppMenuEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) +wxMacAppMenuEventHandler( EventHandlerCallRef WXUNUSED(handler), + EventRef event, + void *WXUNUSED(data) ) { wxMacCarbonEvent cEvent( event ) ; MenuRef menuRef = cEvent.GetParameter(kEventParamDirectObject) ; @@ -596,7 +598,10 @@ wxMacAppMenuEventHandler( EventHandlerCallRef handler , EventRef event , void *d return eventNotHandledErr; } -static pascal OSStatus wxMacAppCommandEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) +static pascal OSStatus +wxMacAppCommandEventHandler( EventHandlerCallRef WXUNUSED(handler) , + EventRef event , + void *WXUNUSED(data) ) { OSStatus result = eventNotHandledErr ; @@ -679,7 +684,10 @@ static pascal OSStatus wxMacAppCommandEventHandler( EventHandlerCallRef handler return result ; } -static pascal OSStatus wxMacAppApplicationEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) +static pascal OSStatus +wxMacAppApplicationEventHandler( EventHandlerCallRef WXUNUSED(handler) , + EventRef event , + void *WXUNUSED(data) ) { OSStatus result = eventNotHandledErr ; switch ( GetEventKind( event ) ) @@ -760,9 +768,16 @@ DEFINE_ONE_SHOT_HANDLER_GETTER( wxMacAppEventHandler ) #ifdef __WXDEBUG__ -pascal static void wxMacAssertOutputHandler(OSType componentSignature, UInt32 options, - const char *assertionString, const char *exceptionLabelString, - const char *errorString, const char *fileName, long lineNumber, void *value, ConstStr255Param outputMsg) +pascal static void +wxMacAssertOutputHandler(OSType WXUNUSED(componentSignature), + UInt32 WXUNUSED(options), + const char *assertionString, + const char *exceptionLabelString, + const char *errorString, + const char *fileName, + long lineNumber, + void *value, + ConstStr255Param WXUNUSED(outputMsg)) { // flow into assert handling wxString fileNameStr ; @@ -800,13 +815,7 @@ pascal static void wxMacAssertOutputHandler(OSType componentSignature, UInt32 op #endif //__WXDEBUG__ #ifdef __WXMAC_OSX__ -extern "C" -{ - // m_macEventPosted run loop source callback: - void macPostedEventCallback(void *unused); -} - -void macPostedEventCallback(void *unused) +extern "C" void macPostedEventCallback(void *WXUNUSED(unused)) { wxTheApp->ProcessPendingEvents(); } @@ -1134,7 +1143,7 @@ wxApp::wxApp() #endif } -void wxApp::OnIdle(wxIdleEvent& event) +void wxApp::OnIdle(wxIdleEvent& WXUNUSED(event)) { wxMacProcessNotifierEvents(); @@ -1272,7 +1281,7 @@ void wxApp::MacDoOneEvent() } // virtual -void wxApp::MacHandleUnhandledEvent( WXEVENTREF evr ) +void wxApp::MacHandleUnhandledEvent( WXEVENTREF WXUNUSED(evr) ) { // Override to process unhandled events as you please } diff --git a/src/mac/carbon/bitmap.cpp b/src/mac/carbon/bitmap.cpp index c1106bdfb0..8f5c67a4c6 100644 --- a/src/mac/carbon/bitmap.cpp +++ b/src/mac/carbon/bitmap.cpp @@ -529,7 +529,7 @@ PicHandle wxBitmapRefData::GetPictHandle() } #ifdef __WXMAC_OSX__ -void wxMacMemoryBufferReleaseProc(void *info, const void *data, size_t size) +void wxMacMemoryBufferReleaseProc(void *info, const void *data, size_t WXUNUSED(size)) { wxMemoryBuffer* membuf = (wxMemoryBuffer*) info ; @@ -1597,8 +1597,11 @@ public: IMPLEMENT_DYNAMIC_CLASS(wxPICTResourceHandler, wxBitmapHandler) -bool wxPICTResourceHandler::LoadFile(wxBitmap *bitmap, const wxString& name, long flags, - int desiredWidth, int desiredHeight) +bool wxPICTResourceHandler::LoadFile(wxBitmap *bitmap, + const wxString& name, + long WXUNUSED(flags), + int WXUNUSED(desiredWidth), + int WXUNUSED(desiredHeight)) { #if wxUSE_METAFILE Str255 theName ; @@ -1633,7 +1636,7 @@ void wxBitmap::InitStandardHandlers() // raw bitmap access support // ---------------------------------------------------------------------------- -void *wxBitmap::GetRawData(wxPixelDataBase& data, int bpp) +void *wxBitmap::GetRawData(wxPixelDataBase& data, int WXUNUSED(bpp)) { if ( !Ok() ) // no bitmap, no data (raw or otherwise) @@ -1646,7 +1649,7 @@ void *wxBitmap::GetRawData(wxPixelDataBase& data, int bpp) return BeginRawAccess() ; } -void wxBitmap::UngetRawData(wxPixelDataBase& dataBase) +void wxBitmap::UngetRawData(wxPixelDataBase& WXUNUSED(dataBase)) { EndRawAccess() ; } diff --git a/src/mac/carbon/checkbox.cpp b/src/mac/carbon/checkbox.cpp index b1c9af8e45..982869b0aa 100644 --- a/src/mac/carbon/checkbox.cpp +++ b/src/mac/carbon/checkbox.cpp @@ -132,9 +132,9 @@ wxInt32 wxCheckBox::MacControlHit( WXEVENTHANDLERREF WXUNUSED(handler) , WXEVENT // Bitmap checkbox bool wxBitmapCheckBox::Create(wxWindow *parent, wxWindowID id, - const wxBitmap *label, - const wxPoint& pos, - const wxSize& size, + const wxBitmap *WXUNUSED(label), + const wxPoint& WXUNUSED(pos), + const wxSize& WXUNUSED(size), long style, const wxValidator& wxVALIDATOR_PARAM(validator), const wxString& name) @@ -158,7 +158,7 @@ bool wxBitmapCheckBox::Create(wxWindow *parent, return false; } -void wxBitmapCheckBox::SetLabel(const wxBitmap *bitmap) +void wxBitmapCheckBox::SetLabel(const wxBitmap *WXUNUSED(bitmap)) { // TODO wxFAIL_MSG(wxT("wxBitmapCheckBox::SetLabel() not yet implemented")); @@ -169,7 +169,7 @@ void wxBitmapCheckBox::SetSize(int x, int y, int width, int height, int sizeFlag wxControl::SetSize( x , y , width , height , sizeFlags ) ; } -void wxBitmapCheckBox::SetValue(bool val) +void wxBitmapCheckBox::SetValue(bool WXUNUSED(val)) { // TODO wxFAIL_MSG(wxT("wxBitmapCheckBox::SetValue() not yet implemented")); diff --git a/src/mac/carbon/colordlgosx.mm b/src/mac/carbon/colordlgosx.mm index b40911c3a0..ea058c24f7 100644 --- a/src/mac/carbon/colordlgosx.mm +++ b/src/mac/carbon/colordlgosx.mm @@ -69,8 +69,10 @@ IMPLEMENT_DYNAMIC_CLASS(wxColourDialog, wxDialog) - (BOOL)windowShouldClose:(id)sender { + wxUnusedVar(sender); + m_bIsClosed = true; - + [NSApp abortModal]; [NSApp stopModal]; return YES; @@ -100,7 +102,7 @@ wxColourDialog::wxColourDialog(wxWindow *parent, wxColourData *data) bool wxColourDialog::Create(wxWindow *parent, wxColourData *data) { m_dialogParent = parent; - + if (data) m_colourData = *data; @@ -109,7 +111,7 @@ bool wxColourDialog::Create(wxWindow *parent, wxColourData *data) // events and window stuff for cocoa for carbon // applications. // - // This is also the only call here that is + // This is also the only call here that is // 10.2+ specific (the rest is OSX only), // which, ironically, the carbon font // panel requires. @@ -128,16 +130,16 @@ bool wxColourDialog::Create(wxWindow *parent, wxColourData *data) alpha:1.0] ]; else - [[NSColorPanel sharedColorPanel] setColor:[NSColor blackColor]]; - + [[NSColorPanel sharedColorPanel] setColor:[NSColor blackColor]]; + //We're done - free up the pool [thePool release]; - + return bOK; } int wxColourDialog::ShowModal() { - //Start the pool. Required for carbon interaction + //Start the pool. Required for carbon interaction //(For those curious, the only thing that happens //if you don't do this is a bunch of error //messages about leaks on the console, @@ -152,27 +154,27 @@ int wxColourDialog::ShowModal() //we can tell if a window has closed/open or not wxCPWCDelegate* theCPDelegate = [[wxCPWCDelegate alloc] init]; [theColorPanel setDelegate:theCPDelegate]; - + // // Start the color panel modal loop // NSModalSession session = [NSApp beginModalSessionForWindow:theColorPanel]; - for (;;) + for (;;) { [NSApp runModalSession:session]; - + //If the color panel is closed, return the font panel modal loop if ([theCPDelegate isClosed]) break; } [NSApp endModalSession:session]; - + //free up the memory for the delegates - we don't need them anymore [theCPDelegate release]; - + //Get the shared color panel along with the chosen color and set the chosen color NSColor* theColor = [[theColorPanel color] colorUsingColorSpaceName:NSCalibratedRGBColorSpace]; - + m_colourData.m_dataColour.Set( (unsigned char) ([theColor redComponent] * 255.0), (unsigned char) ([theColor greenComponent] * 255.0), diff --git a/src/mac/carbon/combobox.cpp b/src/mac/carbon/combobox.cpp index 63c256d52d..dddce8211e 100644 --- a/src/mac/carbon/combobox.cpp +++ b/src/mac/carbon/combobox.cpp @@ -345,8 +345,13 @@ bool wxComboBox::Create(wxWindow *parent, const wxValidator& validator, const wxString& name) { - return Create( parent, id, value, pos, size, 0, NULL, - style, validator, name ); + if ( !Create( parent, id, value, pos, size, 0, NULL, + style, validator, name ) ) + return false; + + Append(choices); + + return true; } bool wxComboBox::Create(wxWindow *parent, diff --git a/src/mac/carbon/control.cpp b/src/mac/carbon/control.cpp index f062739923..5b004c794a 100644 --- a/src/mac/carbon/control.cpp +++ b/src/mac/carbon/control.cpp @@ -81,7 +81,7 @@ bool wxControl::ProcessCommand( wxCommandEvent &event ) return GetEventHandler()->ProcessEvent( event ); } -void wxControl::OnKeyDown( wxKeyEvent &event ) +void wxControl::OnKeyDown( wxKeyEvent &WXUNUSED(event) ) { if ( m_peer == NULL || !m_peer->Ok() ) return; diff --git a/src/mac/carbon/dataobj.cpp b/src/mac/carbon/dataobj.cpp index 748c387ad6..b3b42de40a 100644 --- a/src/mac/carbon/dataobj.cpp +++ b/src/mac/carbon/dataobj.cpp @@ -189,7 +189,8 @@ bool wxDataObject::IsSupportedFormat( const wxDataFormat& rFormat, Direction vDi // ---------------------------------------------------------------------------- #if wxUSE_UNICODE -void wxTextDataObject::GetAllFormats( wxDataFormat *formats, wxDataObjectBase::Direction dir ) const +void wxTextDataObject::GetAllFormats(wxDataFormat *formats, + wxDataObjectBase::Direction WXUNUSED(dir)) const { *formats++ = wxDataFormat( wxDF_TEXT ); *formats = wxDataFormat( wxDF_UNICODETEXT ); @@ -239,7 +240,7 @@ size_t wxFileDataObject::GetDataSize() const return buffLength + 1; } -bool wxFileDataObject::SetData( size_t nSize, const void *pBuf ) +bool wxFileDataObject::SetData( size_t WXUNUSED(nSize), const void *pBuf ) { wxString filenames; diff --git a/src/mac/carbon/dirdlg.cpp b/src/mac/carbon/dirdlg.cpp index 49ae77655e..f63080f4e1 100644 --- a/src/mac/carbon/dirdlg.cpp +++ b/src/mac/carbon/dirdlg.cpp @@ -64,7 +64,7 @@ static pascal void NavEventProc( wxDirDialog::wxDirDialog(wxWindow *parent, const wxString& message, const wxString& defaultPath, - long style, + long WXUNUSED(style), const wxPoint& WXUNUSED(pos), const wxSize& WXUNUSED(size), const wxString& WXUNUSED(name)) diff --git a/src/mac/carbon/fontdlg.cpp b/src/mac/carbon/fontdlg.cpp index e155dd7bd5..c0a58e2c56 100644 --- a/src/mac/carbon/fontdlg.cpp +++ b/src/mac/carbon/fontdlg.cpp @@ -58,7 +58,10 @@ static const EventTypeSpec eventList[] = } ; -pascal OSStatus wxMacCarbonFontPanelHandler(EventHandlerCallRef nextHandler, EventRef event, void *userData) +pascal OSStatus +wxMacCarbonFontPanelHandler(EventHandlerCallRef WXUNUSED(nextHandler), + EventRef event, + void *userData) { OSStatus result = eventNotHandledErr ; wxFontDialog *fontdialog = (wxFontDialog*) userData ; @@ -183,7 +186,7 @@ wxFontDialog::~wxFontDialog() { } -bool wxFontDialog::Create(wxWindow *parent, const wxFontData& data) +bool wxFontDialog::Create(wxWindow *WXUNUSED(parent), const wxFontData& data) { m_fontData = data; return true ; diff --git a/src/mac/carbon/fontdlgosx.mm b/src/mac/carbon/fontdlgosx.mm index d863f75689..a0e78b064d 100644 --- a/src/mac/carbon/fontdlgosx.mm +++ b/src/mac/carbon/fontdlgosx.mm @@ -105,12 +105,14 @@ - (IBAction)cancelPressed:(id)sender { + wxUnusedVar(sender); m_shouldClose = YES ; [NSApp stopModal]; } - (IBAction)okPressed:(id)sender { + wxUnusedVar(sender); m_okPressed = YES ; m_shouldClose = YES ; [NSApp stopModal]; @@ -135,7 +137,7 @@ extern "C" int RunMixedFontDialog(wxFontDialog* dialog) ; -int RunMixedFontDialog(wxFontDialog* dialog) +int RunMixedFontDialog(wxFontDialog* WXUNUSED(dialog)) { int retval = wxID_CANCEL ; diff --git a/src/mac/carbon/fontenum.cpp b/src/mac/carbon/fontenum.cpp index 6db95ec845..f74bbb43fc 100644 --- a/src/mac/carbon/fontenum.cpp +++ b/src/mac/carbon/fontenum.cpp @@ -34,6 +34,12 @@ bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding, bool fixedWidthOnly) { + if ( fixedWidthOnly ) + { + wxFAIL_MSG( "enumerating only fixed width fonts not supported" ); + return false; + } + // // From Apple's QA 1471 http://developer.apple.com/qa/qa2006/qa1471.html // @@ -104,7 +110,7 @@ bool wxFontEnumerator::EnumerateFacenames(wxFontEncoding encoding, return true; } -bool wxFontEnumerator::EnumerateEncodings(const wxString& family) +bool wxFontEnumerator::EnumerateEncodings(const wxString& WXUNUSED(family)) { wxFAIL_MSG(wxT("wxFontEnumerator::EnumerateEncodings() not yet implemented")); diff --git a/src/mac/carbon/fontutil.cpp b/src/mac/carbon/fontutil.cpp index 0cc43c8953..5fc4804433 100644 --- a/src/mac/carbon/fontutil.cpp +++ b/src/mac/carbon/fontutil.cpp @@ -81,7 +81,7 @@ bool wxGetNativeFontEncoding( wxFontEncoding encoding, wxNativeEncodingInfo *inf return true; } -bool wxTestFontEncoding( const wxNativeEncodingInfo& info ) +bool wxTestFontEncoding( const wxNativeEncodingInfo& WXUNUSED(info) ) { // basically we should be able to support every encoding via the OS return true; diff --git a/src/mac/carbon/graphics.cpp b/src/mac/carbon/graphics.cpp index b2bcb0788a..6e0196b7fb 100644 --- a/src/mac/carbon/graphics.cpp +++ b/src/mac/carbon/graphics.cpp @@ -985,7 +985,7 @@ public : virtual void * GetNativePath() const { return m_path; } // give the native path returned by GetNativePath() back (there might be some deallocations necessary) - virtual void UnGetNativePath(void *p) const {} + virtual void UnGetNativePath(void *WXUNUSED(p)) const {} // transforms each point of this path by the matrix virtual void Transform( const wxGraphicsMatrixData* matrix ); diff --git a/src/mac/carbon/icon.cpp b/src/mac/carbon/icon.cpp index 68e908bf25..e774075ae3 100644 --- a/src/mac/carbon/icon.cpp +++ b/src/mac/carbon/icon.cpp @@ -95,15 +95,15 @@ int wxIcon::GetDepth() const return 32; } -void wxIcon::SetDepth( int depth ) +void wxIcon::SetDepth( int WXUNUSED(depth) ) { } -void wxIcon::SetWidth( int width ) +void wxIcon::SetWidth( int WXUNUSED(width) ) { } -void wxIcon::SetHeight( int height ) +void wxIcon::SetHeight( int WXUNUSED(height) ) { } @@ -259,7 +259,7 @@ void wxIconRefData::Free() IMPLEMENT_DYNAMIC_CLASS(wxICONResourceHandler, wxBitmapHandler) bool wxICONResourceHandler::LoadFile( - wxBitmap *bitmap, const wxString& name, long flags, + wxBitmap *bitmap, const wxString& name, long WXUNUSED(flags), int desiredWidth, int desiredHeight ) { wxIcon icon ; diff --git a/src/mac/carbon/listbox.cpp b/src/mac/carbon/listbox.cpp index fb80168fcc..b43aaba328 100644 --- a/src/mac/carbon/listbox.cpp +++ b/src/mac/carbon/listbox.cpp @@ -435,7 +435,7 @@ wxMacListBoxItem::~wxMacListBoxItem() void wxMacListBoxItem::Notification(wxMacDataItemBrowserControl *owner , DataBrowserItemNotification message, - DataBrowserItemDataRef itemData ) const + DataBrowserItemDataRef WXUNUSED(itemData) ) const { wxMacDataBrowserListControl *lb = wxDynamicCast(owner,wxMacDataBrowserListControl); diff --git a/src/mac/carbon/listctrl_mac.cpp b/src/mac/carbon/listctrl_mac.cpp index 01045405ec..52c83c10a7 100644 --- a/src/mac/carbon/listctrl_mac.cpp +++ b/src/mac/carbon/listctrl_mac.cpp @@ -259,11 +259,11 @@ protected: Rect *maxEditTextRect, Boolean *shrinkToFit); - static pascal Boolean DataBrowserHitTestProc(ControlRef browser, - DataBrowserItemID itemID, - DataBrowserPropertyID property, - const Rect *theRect, - const Rect *mouseRect) { return true; } + static pascal Boolean DataBrowserHitTestProc(ControlRef WXUNUSED(browser), + DataBrowserItemID WXUNUSED(itemID), + DataBrowserPropertyID WXUNUSED(property), + const Rect *WXUNUSED(theRect), + const Rect *WXUNUSED(mouseRect)) { return true; } virtual bool ConfirmEditText(DataBrowserItemID item, DataBrowserPropertyID property, @@ -1848,7 +1848,7 @@ wxTextCtrl* wxListCtrl::EditLabel(long item, wxClassInfo* textControlClass) } // End label editing, optionally cancelling the edit -bool wxListCtrl::EndEditLabel(bool cancel) +bool wxListCtrl::EndEditLabel(bool WXUNUSED(cancel)) { // TODO: generic impl. doesn't have this method - is it needed for us? if (m_genericImpl) @@ -2364,7 +2364,7 @@ wxMacListCtrlItem::~wxMacListCtrlItem() void wxMacListCtrlItem::Notification(wxMacDataItemBrowserControl *owner , DataBrowserItemNotification message, - DataBrowserItemDataRef itemData ) const + DataBrowserItemDataRef WXUNUSED(itemData) ) const { wxMacDataBrowserListCtrlControl *lb = wxDynamicCast(owner, wxMacDataBrowserListCtrlControl); @@ -2538,11 +2538,11 @@ pascal Boolean wxMacDataBrowserListCtrlControl::DataBrowserEditTextProc( } bool wxMacDataBrowserListCtrlControl::ConfirmEditText( - DataBrowserItemID itemID, - DataBrowserPropertyID property, - CFStringRef theString, - Rect *maxEditTextRect, - Boolean *shrinkToFit) + DataBrowserItemID WXUNUSED(itemID), + DataBrowserPropertyID WXUNUSED(property), + CFStringRef WXUNUSED(theString), + Rect *WXUNUSED(maxEditTextRect), + Boolean *WXUNUSED(shrinkToFit)) { return false; } @@ -2601,7 +2601,7 @@ void wxMacDataBrowserListCtrlControl::DrawItem( DataBrowserItemID itemID, DataBrowserPropertyID property, DataBrowserItemState itemState, - const Rect *itemRect, + const Rect *WXUNUSED(itemRect), SInt16 gdDepth, Boolean colorDevice) { @@ -2923,7 +2923,7 @@ OSStatus wxMacDataBrowserListCtrlControl::GetSetItemData(DataBrowserItemID itemI void wxMacDataBrowserListCtrlControl::ItemNotification(DataBrowserItemID itemID, DataBrowserItemNotification message, - DataBrowserItemDataRef itemData ) + DataBrowserItemDataRef WXUNUSED(itemData) ) { // we want to depend on as little as possible to make sure tear-down of controls is safe if ( message == kDataBrowserItemRemoved) diff --git a/src/mac/carbon/mdi.cpp b/src/mac/carbon/mdi.cpp index ef630d2fc8..324c8b22bb 100644 --- a/src/mac/carbon/mdi.cpp +++ b/src/mac/carbon/mdi.cpp @@ -480,7 +480,7 @@ void wxMDIClientWindow::DoGetClientSize(int *x, int *y) const } // Explicitly call default scroll behaviour -void wxMDIClientWindow::OnScroll(wxScrollEvent& event) +void wxMDIClientWindow::OnScroll(wxScrollEvent& WXUNUSED(event)) { } diff --git a/src/mac/carbon/metafile.cpp b/src/mac/carbon/metafile.cpp index 3c211cad89..aebbf38e04 100644 --- a/src/mac/carbon/metafile.cpp +++ b/src/mac/carbon/metafile.cpp @@ -101,7 +101,7 @@ WXHMETAFILE wxMetaFile::GetHMETAFILE() const return (WXHMETAFILE) M_METAFILEDATA->m_metafile; } -bool wxMetaFile::SetClipboard(int width, int height) +bool wxMetaFile::SetClipboard(int WXUNUSED(width), int WXUNUSED(height)) { bool success = true; diff --git a/src/mac/carbon/msgdlg.cpp b/src/mac/carbon/msgdlg.cpp index ade6197a84..0b4f029de2 100644 --- a/src/mac/carbon/msgdlg.cpp +++ b/src/mac/carbon/msgdlg.cpp @@ -28,7 +28,7 @@ wxMessageDialog::wxMessageDialog(wxWindow *parent, const wxString& message, const wxString& caption, long style, - const wxPoint& pos) + const wxPoint& WXUNUSED(pos)) : wxMessageDialogBase(parent, message, caption, style) { m_yes = _("Yes"); diff --git a/src/mac/carbon/notebmac.cpp b/src/mac/carbon/notebmac.cpp index 2aff7f536b..6d3562e882 100644 --- a/src/mac/carbon/notebmac.cpp +++ b/src/mac/carbon/notebmac.cpp @@ -140,12 +140,12 @@ wxNotebook::~wxNotebook() // wxNotebook accessors // ---------------------------------------------------------------------------- -void wxNotebook::SetPadding(const wxSize& padding) +void wxNotebook::SetPadding(const wxSize& WXUNUSED(padding)) { // unsupported by OS } -void wxNotebook::SetTabSize(const wxSize& sz) +void wxNotebook::SetTabSize(const wxSize& WXUNUSED(sz)) { // unsupported by OS } @@ -565,7 +565,7 @@ bool wxNotebook::DoPhase(int WXUNUSED(nPhase)) #endif // wxUSE_CONSTRAINTS -void wxNotebook::Command(wxCommandEvent& event) +void wxNotebook::Command(wxCommandEvent& WXUNUSED(event)) { wxFAIL_MSG(wxT("wxNotebook::Command not implemented")); } diff --git a/src/mac/carbon/overlay.cpp b/src/mac/carbon/overlay.cpp index 0a1fb54073..ec49a7fc9e 100644 --- a/src/mac/carbon/overlay.cpp +++ b/src/mac/carbon/overlay.cpp @@ -145,7 +145,7 @@ void wxOverlayImpl::EndDrawing( wxWindowDC* dc) CGContextSynchronize( m_overlayContext ); } -void wxOverlayImpl::Clear(wxWindowDC* dc) +void wxOverlayImpl::Clear(wxWindowDC* WXUNUSED(dc)) { wxASSERT_MSG( IsOk() , _("You cannot Clear an overlay that is not inited") ); CGRect box = CGRectMake( m_x - 1, m_y - 1 , m_width + 2 , m_height + 2 ); diff --git a/src/mac/carbon/printmac.cpp b/src/mac/carbon/printmac.cpp index fbcae56a55..9e45b9e38b 100644 --- a/src/mac/carbon/printmac.cpp +++ b/src/mac/carbon/printmac.cpp @@ -281,7 +281,7 @@ bool wxMacCarbonPrintData::TransferTo( wxPrintData &data ) return true ; } -void wxMacCarbonPrintData::TransferFrom( wxPageSetupData *data ) +void wxMacCarbonPrintData::TransferFrom( wxPageSetupData *WXUNUSED(data) ) { // should we setup the page rect here ? // since MacOS sometimes has two same paper rects with different @@ -562,7 +562,7 @@ wxDC* wxMacPrinter::PrintDialog(wxWindow *parent) return dc; } -bool wxMacPrinter::Setup(wxWindow *parent) +bool wxMacPrinter::Setup(wxWindow *WXUNUSED(parent)) { #if 0 wxPrintDialog dialog(parent, & m_printDialogData); diff --git a/src/mac/carbon/region.cpp b/src/mac/carbon/region.cpp index b8147e5db8..5c8f05e7ad 100644 --- a/src/mac/carbon/region.cpp +++ b/src/mac/carbon/region.cpp @@ -207,7 +207,7 @@ bool wxRegion::DoCombine(const wxRegion& region, wxRegionOp op) //# Information on region //----------------------------------------------------------------------------- -bool wxRegion::DoIsEqual(const wxRegion& region) const +bool wxRegion::DoIsEqual(const wxRegion& WXUNUSED(region)) const { wxFAIL_MSG( _T("not implemented") ); @@ -358,7 +358,7 @@ wxRegionIterator::wxRegionIterator(const wxRegion& region) */ OSStatus wxMacRegionToRectsCounterCallback( - UInt16 message, RgnHandle region, const Rect *rect, void *data ) + UInt16 message, RgnHandle WXUNUSED(region), const Rect *WXUNUSED(rect), void *data ) { long *m_numRects = (long*) data ; if ( message == kQDRegionToRectsMsgInit ) @@ -381,7 +381,7 @@ public : }; OSStatus wxMacRegionToRectsSetterCallback( - UInt16 message, RgnHandle region, const Rect *rect, void *data ) + UInt16 message, RgnHandle WXUNUSED(region), const Rect *rect, void *data ) { if (message == kQDRegionToRectsMsgParse) { diff --git a/src/mac/carbon/scrolbar.cpp b/src/mac/carbon/scrolbar.cpp index 5f268188b9..e26fa27eef 100644 --- a/src/mac/carbon/scrolbar.cpp +++ b/src/mac/carbon/scrolbar.cpp @@ -69,7 +69,11 @@ int wxScrollBar::GetThumbPosition() const return m_peer->GetValue(); } -void wxScrollBar::SetScrollbar( int position, int thumbSize, int range, int pageSize, bool refresh ) +void wxScrollBar::SetScrollbar( int position, + int thumbSize, + int range, + int pageSize, + bool WXUNUSED(refresh) ) { m_pageSize = pageSize; m_viewSize = thumbSize; @@ -89,7 +93,7 @@ void wxScrollBar::Command( wxCommandEvent& event ) ProcessCommand( event ); } -void wxScrollBar::MacHandleControlClick( WXWidget control, wxInt16 controlpart, bool mouseStillDown ) +void wxScrollBar::MacHandleControlClick( WXWidget WXUNUSED(control), wxInt16 controlpart, bool mouseStillDown ) { int position = m_peer->GetValue(); int minPos = m_peer->GetMinimum(); @@ -164,7 +168,7 @@ void wxScrollBar::MacHandleControlClick( WXWidget control, wxInt16 controlpart, GetEventHandler()->ProcessEvent( event ); } -wxInt32 wxScrollBar::MacControlHit( WXEVENTHANDLERREF handler, WXEVENTREF mevent ) +wxInt32 wxScrollBar::MacControlHit( WXEVENTHANDLERREF WXUNUSED(handler), WXEVENTREF mevent ) { int position = m_peer->GetValue(); int minPos = m_peer->GetMinimum(); diff --git a/src/mac/carbon/slider.cpp b/src/mac/carbon/slider.cpp index 287bfe78ab..7c87118ba6 100644 --- a/src/mac/carbon/slider.cpp +++ b/src/mac/carbon/slider.cpp @@ -216,7 +216,7 @@ void wxSlider::SetRange(int minValue, int maxValue) } // For trackbars only -void wxSlider::SetTickFreq(int n, int pos) +void wxSlider::SetTickFreq(int n, int WXUNUSED(pos)) { // TODO m_tickFreq = n; @@ -267,12 +267,12 @@ int wxSlider::GetSelStart() const return 0; } -void wxSlider::SetSelection(int minPos, int maxPos) +void wxSlider::SetSelection(int WXUNUSED(minPos), int WXUNUSED(maxPos)) { // TODO } -void wxSlider::SetThumbLength(int len) +void wxSlider::SetThumbLength(int WXUNUSED(len)) { // TODO } @@ -283,7 +283,7 @@ int wxSlider::GetThumbLength() const return 0; } -void wxSlider::SetTick(int tickPos) +void wxSlider::SetTick(int WXUNUSED(tickPos)) { // TODO } @@ -294,7 +294,9 @@ void wxSlider::Command(wxCommandEvent &event) ProcessCommand(event); } -void wxSlider::MacHandleControlClick( WXWidget control, wxInt16 controlpart, bool mouseStillDown ) +void wxSlider::MacHandleControlClick(WXWidget WXUNUSED(control), + wxInt16 WXUNUSED(controlpart), + bool WXUNUSED(mouseStillDown)) { // Whatever the native value is, we may need to invert it for calling // SetValue and putting the possibly inverted value in the event @@ -313,7 +315,8 @@ void wxSlider::MacHandleControlClick( WXWidget control, wxInt16 controlpart, boo GetEventHandler()->ProcessEvent( cevent ); } -wxInt32 wxSlider::MacControlHit( WXEVENTHANDLERREF handler , WXEVENTREF mevent ) +wxInt32 wxSlider::MacControlHit(WXEVENTHANDLERREF WXUNUSED(handler), + WXEVENTREF WXUNUSED(mevent)) { // Whatever the native value is, we may need to invert it for calling // SetValue and putting the possibly inverted value in the event @@ -340,7 +343,7 @@ wxInt32 wxSlider::MacControlHit( WXEVENTHANDLERREF handler , WXEVENTREF mevent ) // void wxSlider::DoSetSizeHints( int minW, int minH, int maxW, int maxH, - int incW, int incH ) + int WXUNUSED(incW), int WXUNUSED(incH) ) { wxSize size = GetBestSize(); diff --git a/src/mac/carbon/spinbutt.cpp b/src/mac/carbon/spinbutt.cpp index 55de645d54..850e708252 100644 --- a/src/mac/carbon/spinbutt.cpp +++ b/src/mac/carbon/spinbutt.cpp @@ -149,7 +149,9 @@ void wxSpinButton::MacHandleValueChanged( int inc ) } } -void wxSpinButton::MacHandleControlClick( WXWidget control, wxInt16 controlpart, bool mouseStillDown ) +void wxSpinButton::MacHandleControlClick(WXWidget WXUNUSED(control), + wxInt16 controlpart, + bool WXUNUSED(mouseStillDown)) { int nScrollInc = 0; @@ -170,7 +172,8 @@ void wxSpinButton::MacHandleControlClick( WXWidget control, wxInt16 controlpart, MacHandleValueChanged( nScrollInc ) ; } -wxInt32 wxSpinButton::MacControlHit(WXEVENTHANDLERREF WXUNUSED(handler) , WXEVENTREF event ) +wxInt32 wxSpinButton::MacControlHit(WXEVENTHANDLERREF WXUNUSED(handler), + WXEVENTREF WXUNUSED(event)) { #if 0 // these have been handled by the live action proc already diff --git a/src/mac/carbon/spinctrl.cpp b/src/mac/carbon/spinctrl.cpp index e0e3bcb597..478fdfc1e0 100644 --- a/src/mac/carbon/spinctrl.cpp +++ b/src/mac/carbon/spinctrl.cpp @@ -57,7 +57,7 @@ public: } protected: - void OnKillFocus(wxFocusEvent &event) + void OnKillFocus(wxFocusEvent& WXUNUSED(event)) { long l; if ( !GetValue().ToLong(&l) ) @@ -65,35 +65,35 @@ protected: // not a number at all return; } - + // is within range if (l < m_spin->GetMin()) l = m_spin->GetMin(); if (l > m_spin->GetMax()) l = m_spin->GetMax(); - + // Update text control wxString str; str.Printf( wxT("%d"), (int)l ); if (str != GetValue()) SetValue( str ); - + if (l != m_spin->m_oldValue) { // set value in spin button // does that trigger an event? m_spin->m_btn->SetValue( l ); - + // if not wxCommandEvent event(wxEVT_COMMAND_SPINCTRL_UPDATED, m_spin->GetId()); event.SetEventObject(m_spin); event.SetInt(l); m_spin->GetEventHandler()->ProcessEvent(event); - + m_spin->m_oldValue = l; - } + } } - + void OnTextChange(wxCommandEvent& event) { int val; diff --git a/src/mac/carbon/srchctrl.cpp b/src/mac/carbon/srchctrl.cpp index 3fcb8d7d66..fb9ec1f67b 100644 --- a/src/mac/carbon/srchctrl.cpp +++ b/src/mac/carbon/srchctrl.cpp @@ -71,7 +71,7 @@ public : virtual void SetDescriptiveText(const wxString& text); virtual wxString GetDescriptiveText() const; - + protected : virtual void CreateControl( wxTextCtrl* peer, const Rect* bounds, CFStringRef crf ); @@ -79,7 +79,9 @@ private: wxMenu* m_menu; } ; -void wxMacSearchFieldControl::CreateControl( wxTextCtrl* /*peer*/, const Rect* bounds, CFStringRef crf ) +void wxMacSearchFieldControl::CreateControl(wxTextCtrl* WXUNUSED(peer), + const Rect* bounds, + CFStringRef WXUNUSED(crf)) { OptionBits attributes = 0; #if MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_4 @@ -275,6 +277,8 @@ bool wxSearchCtrl::Create(wxWindow *parent, wxWindowID id, GetEventTypeCount(eventList), eventList, this, (EventHandlerRef *)&searchEventHandler); + SetValue(value); + return true; } diff --git a/src/mac/carbon/taskbar.cpp b/src/mac/carbon/taskbar.cpp index e263984d0a..5479c2ade1 100644 --- a/src/mac/carbon/taskbar.cpp +++ b/src/mac/carbon/taskbar.cpp @@ -132,8 +132,10 @@ wxTaskBarIconImpl::~wxTaskBarIconImpl() // 1) To handle wxTaskBarIcon menu events (see below for why) // 2) To handle events from the dock when it requests a menu //----------------------------------------------------------------------------- -pascal OSStatus wxDockEventHandler( EventHandlerCallRef inHandlerCallRef, - EventRef inEvent, void *pData ) +pascal OSStatus +wxDockEventHandler(EventHandlerCallRef WXUNUSED(inHandlerCallRef), + EventRef inEvent, + void *pData) { // Get the parameters we want from the event wxDockTaskBarIcon* pTB = (wxDockTaskBarIcon*) pData; @@ -388,7 +390,7 @@ bool wxDockTaskBarIcon::IsIconInstalled() const // // Sets the icon for the dock CGImage functions and SetApplicationDockTileImage //----------------------------------------------------------------------------- -bool wxDockTaskBarIcon::SetIcon(const wxIcon& icon, const wxString& tooltip) +bool wxDockTaskBarIcon::SetIcon(const wxIcon& icon, const wxString& WXUNUSED(tooltip)) { // convert the wxIcon into a wxBitmap so we can perform some // wxBitmap operations with it diff --git a/src/mac/carbon/textctrl.cpp b/src/mac/carbon/textctrl.cpp index dd9601d7c0..5c885f6fb0 100644 --- a/src/mac/carbon/textctrl.cpp +++ b/src/mac/carbon/textctrl.cpp @@ -1128,7 +1128,9 @@ wxMacTextControl::~wxMacTextControl() { } -void wxMacTextControl::SetStyle(long start, long end, const wxTextAttr& style) +void wxMacTextControl::SetStyle(long WXUNUSED(start), + long WXUNUSED(end), + const wxTextAttr& WXUNUSED(style)) { } @@ -1149,7 +1151,7 @@ bool wxMacTextControl::CanPaste() const return false ; } -void wxMacTextControl::SetEditable(bool editable) +void wxMacTextControl::SetEditable(bool WXUNUSED(editable)) { } @@ -1193,12 +1195,14 @@ void wxMacTextControl::Redo() { } -long wxMacTextControl::XYToPosition(long x, long y) const +long wxMacTextControl::XYToPosition(long WXUNUSED(x), long WXUNUSED(y)) const { return 0 ; } -bool wxMacTextControl::PositionToXY(long pos, long *x, long *y) const +bool wxMacTextControl::PositionToXY(long WXUNUSED(pos), + long *WXUNUSED(x), + long *WXUNUSED(y)) const { return false ; } @@ -1471,7 +1475,7 @@ bool wxMacUnicodeTextControl::CanPaste() const return true ; } -void wxMacUnicodeTextControl::SetEditable(bool editable) +void wxMacUnicodeTextControl::SetEditable(bool WXUNUSED(editable)) { #if 0 // leads to problem because text cannot be selected anymore SetData( kControlEditTextPart , kControlEditTextLockedTag , (Boolean) !editable ) ; @@ -1729,7 +1733,8 @@ TXNFrameOptions wxMacMLTEControl::FrameOptionsFromWXStyle( long wxStyle ) return frameOptions ; } -void wxMacMLTEControl::AdjustCreationAttributes( const wxColour &background, bool visible ) +void wxMacMLTEControl::AdjustCreationAttributes(const wxColour &background, + bool WXUNUSED(visible)) { TXNControlTag iControlTags[] = { @@ -1884,7 +1889,9 @@ void wxMacMLTEControl::TXNSetAttribute( const wxTextAttr& style , long from , lo } } -void wxMacMLTEControl::SetFont( const wxFont & font , const wxColour& foreground , long windowStyle ) +void wxMacMLTEControl::SetFont(const wxFont & font, + const wxColour& foreground, + long WXUNUSED(windowStyle)) { wxMacEditHelper help( m_txn ) ; TXNSetAttribute( wxTextAttr( foreground, wxNullColour, font ), kTXNStartOffset, kTXNEndOffset ) ; @@ -2531,7 +2538,7 @@ void wxMacMLTEClassicControl::SetRect( Rect *r ) MacUpdatePosition() ; } -void wxMacMLTEClassicControl::MacControlUserPaneDrawProc(wxInt16 thePart) +void wxMacMLTEClassicControl::MacControlUserPaneDrawProc(wxInt16 WXUNUSED(thePart)) { wxTextCtrl* textctrl = (wxTextCtrl*)GetControlReference( m_controlRef ); if ( textctrl == NULL ) @@ -2572,7 +2579,7 @@ wxInt16 wxMacMLTEClassicControl::MacControlUserPaneHitTestProc(wxInt16 x, wxInt1 return result; } -wxInt16 wxMacMLTEClassicControl::MacControlUserPaneTrackingProc( wxInt16 x, wxInt16 y, void* actionProc ) +wxInt16 wxMacMLTEClassicControl::MacControlUserPaneTrackingProc( wxInt16 x, wxInt16 y, void* WXUNUSED(actionProc) ) { ControlPartCode result = kControlNoPart; @@ -2690,7 +2697,7 @@ wxInt16 wxMacMLTEClassicControl::MacControlUserPaneFocusProc(wxInt16 action) return focusResult; } -void wxMacMLTEClassicControl::MacControlUserPaneBackgroundProc( void *info ) +void wxMacMLTEClassicControl::MacControlUserPaneBackgroundProc( void *WXUNUSED(info) ) { } diff --git a/src/mac/carbon/timer.cpp b/src/mac/carbon/timer.cpp index 28179a84f4..9346bf18c5 100644 --- a/src/mac/carbon/timer.cpp +++ b/src/mac/carbon/timer.cpp @@ -38,7 +38,7 @@ struct MacTimerInfo EventLoopTimerRef m_timerRef; }; -static pascal void wxProcessTimer( EventLoopTimerRef theTimer, void *data ) +static pascal void wxProcessTimer( EventLoopTimerRef WXUNUSED(theTimer), void *data ) { if ( data == NULL ) return; diff --git a/src/mac/carbon/toolbar.cpp b/src/mac/carbon/toolbar.cpp index 1b7cef3e5f..f65f88223e 100644 --- a/src/mac/carbon/toolbar.cpp +++ b/src/mac/carbon/toolbar.cpp @@ -244,7 +244,7 @@ static const EventTypeSpec eventList[] = #endif }; -static pascal OSStatus wxMacToolBarToolControlEventHandler( EventHandlerCallRef handler, EventRef event, void *data ) +static pascal OSStatus wxMacToolBarToolControlEventHandler( EventHandlerCallRef WXUNUSED(handler), EventRef event, void *data ) { OSStatus result = eventNotHandledErr; ControlRef controlRef; @@ -326,7 +326,7 @@ static const EventTypeSpec toolBarEventList[] = { kEventClassToolbarItem, kEventToolbarItemPerformAction }, }; -static pascal OSStatus wxMacToolBarCommandEventHandler( EventHandlerCallRef handler, EventRef event, void *data ) +static pascal OSStatus wxMacToolBarCommandEventHandler( EventHandlerCallRef WXUNUSED(handler), EventRef event, void *data ) { OSStatus result = eventNotHandledErr; @@ -769,7 +769,9 @@ static const EventTypeSpec kToolbarEvents[] = { kEventClassToolbar, kEventToolbarCreateItemWithIdentifier }, }; -static OSStatus ToolbarDelegateHandler( EventHandlerCallRef inCallRef, EventRef inEvent, void* inUserData ) +static OSStatus ToolbarDelegateHandler(EventHandlerCallRef WXUNUSED(inCallRef), + EventRef inEvent, + void* WXUNUSED(inUserData)) { OSStatus result = eventNotHandledErr; // Not yet needed diff --git a/src/mac/carbon/toplevel.cpp b/src/mac/carbon/toplevel.cpp index 48ffe45bb3..cc7fde5a17 100644 --- a/src/mac/carbon/toplevel.cpp +++ b/src/mac/carbon/toplevel.cpp @@ -457,7 +457,10 @@ ControlRef wxMacFindControlUnderMouse( wxTopLevelWindowMac* toplevelWindow , con #define NEW_CAPTURE_HANDLING 1 -pascal OSStatus wxMacTopLevelMouseEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) +pascal OSStatus +wxMacTopLevelMouseEventHandler(EventHandlerCallRef WXUNUSED(handler), + EventRef event, + void *data) { wxTopLevelWindowMac* toplevelWindow = (wxTopLevelWindowMac*) data ; @@ -688,7 +691,10 @@ pascal OSStatus wxMacTopLevelMouseEventHandler( EventHandlerCallRef handler , Ev return result ; } -static pascal OSStatus wxMacTopLevelWindowEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) +static pascal OSStatus +wxMacTopLevelWindowEventHandler(EventHandlerCallRef WXUNUSED(handler), + EventRef event, + void *data) { OSStatus result = eventNotHandledErr ; @@ -1166,7 +1172,7 @@ void wxTopLevelWindowMac::MacCreateRealWindow( else wclass = kPlainWindowClass ; // has a single line border, it will have to do for now //attr |= kWindowNoShadowAttribute; // turn off the shadow Should we?? - group = GetWindowGroupOfClass( // float above other windows + group = GetWindowGroupOfClass( // float above other windows kFloatingWindowClass) ; } else if ( HasFlag( wxCAPTION ) ) @@ -1217,7 +1223,7 @@ void wxTopLevelWindowMac::MacCreateRealWindow( if ( HasFlag( wxFRAME_FLOAT_ON_PARENT ) ) group = GetWindowGroupOfClass(kFloatingWindowClass) ; - + attr |= kWindowCompositingAttribute; #if 0 // wxMAC_USE_CORE_GRAPHICS ; TODO : decide on overall handling of high dpi screens (pixel vs userscale) attr |= kWindowFrameworkScaledAttribute; @@ -1227,7 +1233,7 @@ void wxTopLevelWindowMac::MacCreateRealWindow( { WindowDefSpec customWindowDefSpec; customWindowDefSpec.defType = kWindowDefProcPtr; - customWindowDefSpec.u.defProc = + customWindowDefSpec.u.defProc = #ifdef __LP64__ (WindowDefUPP) wxShapedMacWindowDef; #else @@ -1251,7 +1257,7 @@ void wxTopLevelWindowMac::MacCreateRealWindow( verify_noerr( CreateWindowGroup( kWindowGroupAttrMoveTogether | kWindowGroupAttrLayerTogether | kWindowGroupAttrHideOnCollapse, &group )); verify_noerr( SetWindowGroupParent( group, GetWindowGroup( (WindowRef) m_macWindow ))); verify_noerr( SetWindowGroup( (WindowRef) m_macWindow , group )); - + // the create commands are only for content rect, // so we have to set the size again as structure bounds SetWindowBounds( (WindowRef) m_macWindow , kWindowStructureRgn , &theBoundsRect ) ; @@ -1338,7 +1344,7 @@ void wxTopLevelWindowMac::MacDelayedDeactivation(long timestamp) } } -void wxTopLevelWindowMac::MacActivate( long timestamp , bool inIsActivating ) +void wxTopLevelWindowMac::MacActivate( long timestamp , bool WXUNUSED(inIsActivating) ) { wxLogTrace(TRACE_ACTIVATE, wxT("TopLevel=%p::MacActivate"), this); @@ -1507,7 +1513,7 @@ void wxTopLevelWindowMac::SetExtraStyle(long exStyle) { if ( MacGetUnifiedAppearance() ) MacSetUnifiedAppearance( !metal ) ; - + MacSetMetalAppearance( metal ) ; } } @@ -1597,7 +1603,7 @@ void wxTopLevelWindowMac::MacSetMetalAppearance( bool set ) #if TARGET_API_MAC_OSX if ( MacGetUnifiedAppearance() ) MacSetUnifiedAppearance( false ) ; - + MacChangeWindowAttributes( set ? kWindowMetalAttribute : kWindowNoAttributes , set ? kWindowNoAttributes : kWindowMetalAttribute ) ; #endif @@ -1619,13 +1625,13 @@ void wxTopLevelWindowMac::MacSetUnifiedAppearance( bool set ) { if ( MacGetMetalAppearance() ) MacSetMetalAppearance( false ) ; - + MacChangeWindowAttributes( set ? kWindowUnifiedTitleAndToolbarAttribute : kWindowNoAttributes , set ? kWindowNoAttributes : kWindowUnifiedTitleAndToolbarAttribute) ; - + // For some reason, Tiger uses white as the background color for this appearance, // while most apps using it use the typical striped background. Restore that behavior - // for wx. + // for wx. // TODO: Determine if we need this on Leopard as well. (should be harmless either way, // though) SetBackgroundColour( wxSYS_COLOUR_WINDOW ) ; @@ -1695,7 +1701,7 @@ static pascal void wxMacNMResponse( NMRecPtr ptr ) DisposePtr( (Ptr)ptr ) ; } -void wxTopLevelWindowMac::RequestUserAttention(int flags ) +void wxTopLevelWindowMac::RequestUserAttention(int WXUNUSED(flags)) { NMRecPtr notificationRequest = (NMRecPtr) NewPtr( sizeof( NMRec) ) ; static wxMacNMUPP nmupp( wxMacNMResponse ); @@ -1767,7 +1773,7 @@ static void wxShapedMacWindowGetPos(WindowRef window, Rect* inRect) inRect->left = pt.h; } -static SInt32 wxShapedMacWindowGetFeatures(WindowRef window, SInt32 param) +static SInt32 wxShapedMacWindowGetFeatures(WindowRef WXUNUSED(window), SInt32 param) { /*------------------------------------------------------ Define which options your custom window supports. @@ -1867,7 +1873,7 @@ static SInt32 wxShapedMacWindowHitTest(WindowRef window, SInt32 param) return wNoHit; } -static pascal long wxShapedMacWindowDef(short varCode, WindowRef window, SInt16 message, SInt32 param) +static pascal long wxShapedMacWindowDef(short WXUNUSED(varCode), WindowRef window, SInt16 message, SInt32 param) { switch (message) { diff --git a/src/mac/carbon/uma.cpp b/src/mac/carbon/uma.cpp index 88b5771bdd..b8f477e055 100644 --- a/src/mac/carbon/uma.cpp +++ b/src/mac/carbon/uma.cpp @@ -49,7 +49,8 @@ void UMACleanupToolbox() { } -void UMAInitToolbox( UInt16 inMoreMastersCalls, bool isEmbedded ) +void UMAInitToolbox( UInt16 WXUNUSED(inMoreMastersCalls), + bool WXUNUSED(isEmbedded) ) { ::InitCursor(); diff --git a/src/mac/carbon/utils.cpp b/src/mac/carbon/utils.cpp index 71acf7553d..202080f5df 100644 --- a/src/mac/carbon/utils.cpp +++ b/src/mac/carbon/utils.cpp @@ -463,7 +463,7 @@ wxString wxMacFindFolder( short vol, // Check whether this window wants to process messages, e.g. Stop button // in long calculations. -bool wxCheckForInterrupt(wxWindow *wnd) +bool wxCheckForInterrupt(wxWindow *WXUNUSED(wnd)) { // TODO return false; @@ -932,7 +932,7 @@ bool wxMacControl::NeedsFocusRect() const return m_needsFocusRect; } -void wxMacControl::VisibilityChanged(bool shown) +void wxMacControl::VisibilityChanged(bool WXUNUSED(shown)) { } @@ -1286,7 +1286,11 @@ DataBrowserItemDataUPP gDataBrowserItemDataUPP = NULL; DataBrowserItemNotificationUPP gDataBrowserItemNotificationUPP = NULL; DataBrowserItemCompareUPP gDataBrowserItemCompareUPP = NULL; -wxMacDataBrowserControl::wxMacDataBrowserControl( wxWindow* peer, const wxPoint& pos, const wxSize& size, long style) : wxMacControl( peer ) +wxMacDataBrowserControl::wxMacDataBrowserControl( wxWindow* peer, + const wxPoint& pos, + const wxSize& size, + long WXUNUSED(style)) + : wxMacControl( peer ) { Rect bounds = wxMacGetBoundsForControl( peer, pos, size ); OSStatus err = ::CreateDataBrowserControl( @@ -1626,7 +1630,7 @@ const wxString& wxMacDataItem::GetLabel() const return m_label; } -bool wxMacDataItem::IsLessThan(wxMacDataItemBrowserControl *owner , +bool wxMacDataItem::IsLessThan(wxMacDataItemBrowserControl *WXUNUSED(owner) , const wxMacDataItem* rhs, DataBrowserPropertyID sortProperty) const { @@ -1643,7 +1647,7 @@ bool wxMacDataItem::IsLessThan(wxMacDataItemBrowserControl *owner , return retval; } -OSStatus wxMacDataItem::GetSetData( wxMacDataItemBrowserControl *owner , +OSStatus wxMacDataItem::GetSetData( wxMacDataItemBrowserControl *WXUNUSED(owner) , DataBrowserPropertyID property, DataBrowserItemDataRef itemData, bool changeValue ) @@ -1675,9 +1679,9 @@ OSStatus wxMacDataItem::GetSetData( wxMacDataItemBrowserControl *owner , return err; } -void wxMacDataItem::Notification(wxMacDataItemBrowserControl *owner , - DataBrowserItemNotification message, - DataBrowserItemDataRef itemData ) const +void wxMacDataItem::Notification(wxMacDataItemBrowserControl *WXUNUSED(owner) , + DataBrowserItemNotification WXUNUSED(message), + DataBrowserItemDataRef WXUNUSED(itemData) ) const { } diff --git a/src/mac/carbon/window.cpp b/src/mac/carbon/window.cpp index 87a9efbcc7..b13a595ec9 100644 --- a/src/mac/carbon/window.cpp +++ b/src/mac/carbon/window.cpp @@ -268,7 +268,7 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl float alpha = 1.0 ; { wxWindow* iter = thisWindow ; - while ( iter ) + while ( iter ) { alpha *= (float) iter->GetTransparent()/255.0 ; if ( iter->IsTopLevel() ) @@ -316,7 +316,7 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl case kEventControlHiliteChanged : thisWindow->MacHiliteChanged() ; break ; - + case kEventControlActivate : case kEventControlDeactivate : // FIXME: we should have a virtual function for this! @@ -405,7 +405,10 @@ static pascal OSStatus wxMacWindowControlEventHandler( EventHandlerCallRef handl return result ; } -static pascal OSStatus wxMacWindowServiceEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) +static pascal OSStatus +wxMacWindowServiceEventHandler(EventHandlerCallRef WXUNUSED(handler), + EventRef event, + void *data) { OSStatus result = eventNotHandledErr ; @@ -549,7 +552,7 @@ pascal OSStatus wxMacUnicodeTextEventHandler( EventHandlerCallRef handler , Even On the other hand, it can be useful for some applications to react to uncommitted text (for example, to update a status display), as long as it does not disrupt the inline input session. Ideally, wx should add new event types to support advanced text input. For now, I would keep things as they are. - + However, the code that was being used caused additional problems: UInt32 message = (0 << 8) + ((char)uniChars[pos] ); Since it simply truncated the unichar to the last byte, it ended up causing weird bugs with inline @@ -620,7 +623,10 @@ pascal OSStatus wxMacUnicodeTextEventHandler( EventHandlerCallRef handler , Even return result ; } -static pascal OSStatus wxMacWindowCommandEventHandler( EventHandlerCallRef handler , EventRef event , void *data ) +static pascal OSStatus +wxMacWindowCommandEventHandler(EventHandlerCallRef WXUNUSED(handler), + EventRef event, + void *data) { OSStatus result = eventNotHandledErr ; wxWindowMac* focus = (wxWindowMac*) data ; @@ -1147,7 +1153,7 @@ void wxWindowMac::MacChildAdded() m_hScrollBar->Raise() ; } -void wxWindowMac::MacPostControlCreate(const wxPoint& pos, const wxSize& size) +void wxWindowMac::MacPostControlCreate(const wxPoint& WXUNUSED(pos), const wxSize& size) { wxASSERT_MSG( m_peer != NULL && m_peer->Ok() , wxT("No valid mac control") ) ; @@ -1394,7 +1400,7 @@ void wxWindowMac::SetDropTarget(wxDropTarget *pDropTarget) #endif // Old-style File Manager Drag & Drop -void wxWindowMac::DragAcceptFiles(bool accept) +void wxWindowMac::DragAcceptFiles(bool WXUNUSED(accept)) { // TODO: } @@ -1402,8 +1408,10 @@ void wxWindowMac::DragAcceptFiles(bool accept) // Returns the size of the native control. In the case of the toplevel window // this is the content area root control -void wxWindowMac::MacGetPositionAndSizeFromControl(int& x, int& y, - int& w, int& h) const +void wxWindowMac::MacGetPositionAndSizeFromControl(int& WXUNUSED(x), + int& WXUNUSED(y), + int& WXUNUSED(w), + int& WXUNUSED(h)) const { wxFAIL_MSG( wxT("Not currently supported") ) ; } @@ -1763,7 +1771,7 @@ bool wxWindowMac::SetCursor(const wxCursor& cursor) HIGetMousePosition(kHICoordSpaceWindow, window, &hiPoint); pt.h = hiPoint.x; pt.v = hiPoint.y; - #else + #else CGrafPtr savePort ; Boolean swapped = QDSwapPort( GetWindowPort( window ) , &savePort ) ; @@ -2178,7 +2186,7 @@ void wxWindowMac::MacPropagateVisibilityChanged() #endif } -void wxWindowMac::OnEnabled(bool enabled) +void wxWindowMac::OnEnabled(bool WXUNUSED(enabled)) { #if !TARGET_API_MAC_OSX MacEnabledStateChanged() ; @@ -2304,7 +2312,7 @@ void wxWindowMac::GetTextExtent(const wxString& string, int *x, int *y, * we always intersect with the entire window, not only with the client area */ -void wxWindowMac::Refresh(bool eraseBack, const wxRect *rect) +void wxWindowMac::Refresh(bool WXUNUSED(eraseBack), const wxRect *rect) { if ( m_peer == NULL ) return ; @@ -2364,7 +2372,7 @@ wxWindowMac *wxGetActiveWindow() } // Coordinates relative to the window -void wxWindowMac::WarpPointer(int x_pos, int y_pos) +void wxWindowMac::WarpPointer(int WXUNUSED(x_pos), int WXUNUSED(y_pos)) { // We really don't move the mouse programmatically under Mac. } @@ -2442,7 +2450,7 @@ int wxWindowMac::GetScrollThumb(int orient) const return 0; } -void wxWindowMac::SetScrollPos(int orient, int pos, bool refresh) +void wxWindowMac::SetScrollPos(int orient, int pos, bool WXUNUSED(refresh)) { if ( orient == wxHORIZONTAL ) { @@ -2481,7 +2489,7 @@ wxWindowMac::AlwaysShowScrollbars(bool hflag, bool vflag) // our own window origin is at leftOrigin/rightOrigin // -void wxWindowMac::MacPaintBorders( int leftOrigin , int rightOrigin ) +void wxWindowMac::MacPaintBorders( int WXUNUSED(leftOrigin) , int WXUNUSED(rightOrigin) ) { if ( IsTopLevel() ) return ; @@ -2494,7 +2502,7 @@ void wxWindowMac::MacPaintBorders( int leftOrigin , int rightOrigin ) m_peer->GetRect( &rect ) ; InsetRect( &rect, -1 , -1 ) ; -#if wxMAC_USE_CORE_GRAPHICS +#if wxMAC_USE_CORE_GRAPHICS { CGRect cgrect = CGRectMake( rect.left , rect.top , rect.right - rect.left , rect.bottom - rect.top ) ; @@ -2848,7 +2856,7 @@ bool wxWindowMac::MacSetupCursor( const wxPoint& pt ) return cursor.Ok() ; } -wxString wxWindowMac::MacGetToolTipString( wxPoint &pt ) +wxString wxWindowMac::MacGetToolTipString( wxPoint &WXUNUSED(pt) ) { #if wxUSE_TOOLTIPS if ( m_tooltip ) @@ -3102,7 +3110,7 @@ bool wxWindowMac::MacDoRedraw( WXHRGN updatergnr , long time ) eventNc.SetEventObject( child ); if ( !child->GetEventHandler()->ProcessEvent( eventNc ) ) { -#if wxMAC_USE_CORE_GRAPHICS +#if wxMAC_USE_CORE_GRAPHICS child->MacPaintBorders(0, 0) ; #else { @@ -3376,7 +3384,7 @@ void wxWindowMac::OnMouseEvent( wxMouseEvent &event ) } } -void wxWindowMac::OnPaint( wxPaintEvent & event ) +void wxWindowMac::OnPaint( wxPaintEvent & WXUNUSED(event) ) { if ( wxTheApp->MacGetCurrentEvent() != NULL && wxTheApp->MacGetCurrentEventHandlerCallRef() != NULL && GetBackgroundStyle() != wxBG_STYLE_TRANSPARENT ) @@ -3385,7 +3393,9 @@ void wxWindowMac::OnPaint( wxPaintEvent & event ) (EventRef) wxTheApp->MacGetCurrentEvent() ) ; } -void wxWindowMac::MacHandleControlClick( WXWidget control , wxInt16 controlpart , bool WXUNUSED( mouseStillDown ) ) +void wxWindowMac::MacHandleControlClick(WXWidget WXUNUSED(control), + wxInt16 WXUNUSED(controlpart), + bool WXUNUSED(mouseStillDown)) { } @@ -3446,7 +3456,7 @@ bool wxWindowMac::CanSetTransparent() #endif } -wxByte wxWindowMac::GetTransparent() const +wxByte wxWindowMac::GetTransparent() const { return m_macAlpha ; } diff --git a/src/mac/corefoundation/gsockosx.cpp b/src/mac/corefoundation/gsockosx.cpp index a433d71c0c..afbf551477 100644 --- a/src/mac/corefoundation/gsockosx.cpp +++ b/src/mac/corefoundation/gsockosx.cpp @@ -28,8 +28,8 @@ struct MacGSocketData // We will store the main loop's reference when Initialize is called static CFRunLoopRef s_mainRunLoop = NULL; -void Mac_Socket_Callback(CFSocketRef s, CFSocketCallBackType callbackType, - CFDataRef address, const void* data, void* info) +void Mac_Socket_Callback(CFSocketRef WXUNUSED(s), CFSocketCallBackType callbackType, + CFDataRef WXUNUSED(address), const void* data, void* info) { GSocket* socket = (GSocket*)info; struct MacGSocketData* macdata; diff --git a/src/mac/corefoundation/hidjoystick.cpp b/src/mac/corefoundation/hidjoystick.cpp index 12d5b86ba9..a14444989e 100644 --- a/src/mac/corefoundation/hidjoystick.cpp +++ b/src/mac/corefoundation/hidjoystick.cpp @@ -480,7 +480,7 @@ int wxJoystick::GetMovementThreshold() const return 0; } -void wxJoystick::SetMovementThreshold(int threshold) +void wxJoystick::SetMovementThreshold(int WXUNUSED(threshold)) { } @@ -795,8 +795,10 @@ void* wxJoystickThread::Entry() // 5) Sends the event to the polling window (if any) // 6) Gets the next event and goes back to (1) //--------------------------------------------------------------------------- -/*static*/ void wxJoystickThread::HIDCallback(void* target, IOReturn res, - void* context, void* sender) +/*static*/ void wxJoystickThread::HIDCallback(void* WXUNUSED(target), + IOReturn WXUNUSED(res), + void* context, + void* WXUNUSED(sender)) { IOHIDEventStruct hidevent; AbsoluteTime bogustime = {0,0}; diff --git a/src/mac/corefoundation/utilsexc_cf.cpp b/src/mac/corefoundation/utilsexc_cf.cpp index c4684fb25f..93dc45dd5d 100644 --- a/src/mac/corefoundation/utilsexc_cf.cpp +++ b/src/mac/corefoundation/utilsexc_cf.cpp @@ -143,7 +143,7 @@ extern "C" { #include } -void wxMAC_MachPortEndProcessDetect(CFMachPortRef port, void *data) +void wxMAC_MachPortEndProcessDetect(CFMachPortRef WXUNUSED(port), void *data) { wxEndProcessData *proc_data = (wxEndProcessData*)data; wxLogDebug(wxT("Process ended")); @@ -240,7 +240,11 @@ int wxAddProcessCallbackForPid(wxEndProcessData *proc_data, int pid) Called due to source signal detected by the CFRunLoop. This is nearly identical to the wxGTK equivalent. */ -extern "C" void WXCF_EndProcessDetector(CFSocketRef s, CFSocketCallBackType callbackType, CFDataRef address, void const *data, void *info) +extern "C" void WXCF_EndProcessDetector(CFSocketRef s, + CFSocketCallBackType WXUNUSED(callbackType), + CFDataRef WXUNUSED(address), + void const *WXUNUSED(data), + void *info) { wxEndProcessData * const proc_data = static_cast(info); diff --git a/src/motif/combobox_native.cpp b/src/motif/combobox_native.cpp index 959b1581ae..4bb234346a 100644 --- a/src/motif/combobox_native.cpp +++ b/src/motif/combobox_native.cpp @@ -169,15 +169,6 @@ void wxComboBox::DoSetSize(int x, int y, int width, int WXUNUSED(height), int si wxWindow::DoSetSize(x, y, width, DoGetBestSize().y, sizeFlags); } -wxString wxComboBox::GetValue() const -{ - char* s = XmTextGetString (GetXmText (this)); - wxString str(s); - if (s) - XtFree (s); - return str; -} - void wxComboBox::SetString(unsigned int n, const wxString& s) { wxXmString text(s); @@ -288,69 +279,11 @@ int wxComboBox::FindString(const wxString& s, bool WXUNUSED(bCase)) const return wxDoFindStringInList( GetXmList( this ), s ); } -// Clipboard operations -void wxComboBox::Copy() -{ - XmTextCopy( GetXmText(this), CurrentTime ); -} - -void wxComboBox::Cut() -{ - XmTextCut( GetXmText(this), CurrentTime ); -} - -void wxComboBox::Paste() -{ - XmTextPaste( GetXmText(this) ); -} - void wxComboBox::SetEditable(bool WXUNUSED(editable)) { // TODO } -void wxComboBox::SetInsertionPoint(long pos) -{ - XmTextSetInsertionPosition( GetXmText(this), (XmTextPosition)pos ); -} - -void wxComboBox::SetInsertionPointEnd() -{ - SetInsertionPoint( GetLastPosition() ); -} - -long wxComboBox::GetInsertionPoint() const -{ - return (long)XmTextGetInsertionPosition( GetXmText(this) ); -} - -wxTextPos wxComboBox::GetLastPosition() const -{ - XmTextPosition pos = XmTextGetLastPosition( GetXmText(this) ); - return (long)pos; -} - -void wxComboBox::Replace(long from, long to, const wxString& value) -{ - XmTextReplace( GetXmText(this), (XmTextPosition)from, (XmTextPosition)to, - value.char_str() ); -} - -void wxComboBox::Remove(long from, long to) -{ - SetSelection( from, to ); - XmTextRemove( GetXmText(this) ); -} - -void wxComboBox::SetSelection(long from, long to) -{ - if( to == -1 ) - to = GetLastPosition(); - - XmTextSetSelection( GetXmText(this), (XmTextPosition)from, - (XmTextPosition)to, (Time)0 ); -} - void wxComboBoxCallback (Widget WXUNUSED(w), XtPointer clientData, XmComboBoxCallbackStruct * cbs) { @@ -446,6 +379,11 @@ wxSize wxComboBox::DoGetBestSize() const return wxWindow::DoGetBestSize(); } +WXWidget wxComboBox::GetTextWidget() const +{ + return (WXWidget)GetXmText(this); +} + #endif // XmVersion >= 2000 #endif // wxUSE_COMBOBOX diff --git a/src/motif/textctrl.cpp b/src/motif/textctrl.cpp index 82624d53e8..aeafee2200 100644 --- a/src/motif/textctrl.cpp +++ b/src/motif/textctrl.cpp @@ -219,14 +219,7 @@ wxString wxTextCtrl::GetValue() const } else { - // just get the string from Motif - char *s = XmTextGetString ((Widget) m_mainWidget); - if ( s ) - { - str = s; - XtFree (s); - } - //else: return empty string + str = wxTextEntry::GetValue(); if ( m_tempCallbackStruct ) { @@ -258,159 +251,6 @@ void wxTextCtrl::DoSetValue(const wxString& text, int flags) SendTextUpdatedEvent(); } -// Clipboard operations -void wxTextCtrl::Copy() -{ - XmTextCopy((Widget) m_mainWidget, CurrentTime); -} - -void wxTextCtrl::Cut() -{ - XmTextCut((Widget) m_mainWidget, CurrentTime); -} - -void wxTextCtrl::Paste() -{ - XmTextPaste((Widget) m_mainWidget); -} - -bool wxTextCtrl::CanCopy() const -{ - // Can copy if there's a selection - long from, to; - GetSelection(& from, & to); - return (from != to) ; -} - -bool wxTextCtrl::CanCut() const -{ - // Can cut if there's a selection - long from, to; - GetSelection(& from, & to); - return (from != to) && (IsEditable()); -} - -bool wxTextCtrl::CanPaste() const -{ - return IsEditable() ; -} - -// Undo/redo -void wxTextCtrl::Undo() -{ - // Not possible in Motif -} - -void wxTextCtrl::Redo() -{ - // Not possible in Motif -} - -bool wxTextCtrl::CanUndo() const -{ - // No Undo in Motif - return false; -} - -bool wxTextCtrl::CanRedo() const -{ - // No Redo in Motif - return false; -} - -// If the return values from and to are the same, there is no -// selection. -void wxTextCtrl::GetSelection(long* from, long* to) const -{ - XmTextPosition left, right; - - XmTextGetSelectionPosition((Widget) m_mainWidget, & left, & right); - - *from = (long) left; - *to = (long) right; -} - -bool wxTextCtrl::IsEditable() const -{ - return (XmTextGetEditable((Widget) m_mainWidget) != 0); -} - -void wxTextCtrl::SetEditable(bool editable) -{ - XmTextSetEditable((Widget) m_mainWidget, (Boolean) editable); -} - -void wxTextCtrl::SetInsertionPoint(long pos) -{ - XmTextSetInsertionPosition ((Widget) m_mainWidget, (XmTextPosition) pos); -} - -void wxTextCtrl::SetInsertionPointEnd() -{ - wxTextPos pos = GetLastPosition(); - SetInsertionPoint(pos); -} - -long wxTextCtrl::GetInsertionPoint() const -{ - return (long) XmTextGetInsertionPosition ((Widget) m_mainWidget); -} - -wxTextPos wxTextCtrl::GetLastPosition() const -{ - return (long) XmTextGetLastPosition ((Widget) m_mainWidget); -} - -void wxTextCtrl::Replace(long from, long to, const wxString& value) -{ - XmTextReplace ((Widget) m_mainWidget, (XmTextPosition) from, (XmTextPosition) to, - value.char_str()); -} - -void wxTextCtrl::Remove(long from, long to) -{ - XmTextSetSelection ((Widget) m_mainWidget, (XmTextPosition) from, (XmTextPosition) to, - (Time) 0); - XmTextRemove ((Widget) m_mainWidget); -} - -void wxTextCtrl::SetSelection(long from, long to) -{ - if( to == -1 ) - to = GetLastPosition(); - - XmTextSetSelection ((Widget) m_mainWidget, (XmTextPosition) from, (XmTextPosition) to, - (Time) 0); -} - -void wxTextCtrl::WriteText(const wxString& text) -{ - long textPosition = GetInsertionPoint() + text.length(); - XmTextInsert ((Widget) m_mainWidget, GetInsertionPoint(), - text.char_str()); - XtVaSetValues ((Widget) m_mainWidget, XmNcursorPosition, textPosition, NULL); - SetInsertionPoint(textPosition); - XmTextShowPosition ((Widget) m_mainWidget, textPosition); - m_modified = true; -} - -void wxTextCtrl::AppendText(const wxString& text) -{ - wxTextPos textPosition = GetLastPosition() + text.length(); - XmTextInsert ((Widget) m_mainWidget, GetLastPosition(), - text.char_str()); - XtVaSetValues ((Widget) m_mainWidget, XmNcursorPosition, textPosition, NULL); - SetInsertionPoint(textPosition); - XmTextShowPosition ((Widget) m_mainWidget, textPosition); - m_modified = true; -} - -void wxTextCtrl::Clear() -{ - XmTextSetString ((Widget) m_mainWidget, wxMOTIF_STR("")); - m_modified = false; -} - bool wxTextCtrl::IsModified() const { return m_modified; diff --git a/src/x11/app.cpp b/src/x11/app.cpp index 17a553ffe9..c7ec2a5de7 100644 --- a/src/x11/app.cpp +++ b/src/x11/app.cpp @@ -237,7 +237,7 @@ struct wxExposeInfo }; extern "C" -Bool wxX11ExposePredicate (Display *display, XEvent *xevent, XPointer arg) +Bool wxX11ExposePredicate (Display *WXUNUSED(display), XEvent *xevent, XPointer arg) { wxExposeInfo *info = (wxExposeInfo*) arg; @@ -630,7 +630,7 @@ bool wxApp::ProcessXEvent(WXEvent* _event) // This should be redefined in a derived class for // handling property change events for XAtom IPC. -bool wxApp::HandlePropertyChange(WXEvent *event) +bool wxApp::HandlePropertyChange(WXEvent *WXUNUSED(event)) { // by default do nothing special // TODO: what to do for X11 diff --git a/src/x11/cursor.cpp b/src/x11/cursor.cpp index fb29364b43..1e1efbc681 100644 --- a/src/x11/cursor.cpp +++ b/src/x11/cursor.cpp @@ -123,15 +123,17 @@ wxCursor::wxCursor( int cursorId ) #endif } -wxCursor::wxCursor(const char bits[], int width, int height, - int hotSpotX, int hotSpotY, - const char maskBits[], wxColour *fg, wxColour *bg) +wxCursor::wxCursor(const char WXUNUSED(bits)[], + int WXUNUSED(width), int WXUNUSED(height), + int WXUNUSED(hotSpotX), int WXUNUSED(hotSpotY), + const char WXUNUSED(maskBits)[], + wxColour *WXUNUSED(fg), wxColour *WXUNUSED(bg)) { wxFAIL_MSG( wxT("wxCursor creation from bits not yet implemented") ); } #if wxUSE_IMAGE -wxCursor::wxCursor( const wxImage & image ) +wxCursor::wxCursor( const wxImage & WXUNUSED(image) ) { wxFAIL_MSG( wxT("wxCursor creation from wxImage not yet implemented") ); } diff --git a/src/x11/dcclient.cpp b/src/x11/dcclient.cpp index 63932ca5b9..5e19609f43 100644 --- a/src/x11/dcclient.cpp +++ b/src/x11/dcclient.cpp @@ -625,7 +625,8 @@ void wxWindowDC::DoDrawLines( int n, wxPoint points[], wxCoord xoffset, wxCoord } void wxWindowDC::DoDrawPolygon( int n, wxPoint points[], - wxCoord xoffset, wxCoord yoffset, int fillStyle ) + wxCoord xoffset, wxCoord yoffset, + int WXUNUSED(fillStyle) ) { wxCHECK_RET( Ok(), wxT("invalid window dc") ); @@ -1606,9 +1607,11 @@ void wxWindowDC::DoDrawText( const wxString &text, wxCoord x, wxCoord y ) #endif } -void wxWindowDC::DoDrawRotatedText( const wxString &text, wxCoord x, wxCoord y, double angle ) +void wxWindowDC::DoDrawRotatedText(const wxString& WXUNUSED(text), + wxCoord WXUNUSED(x), wxCoord WXUNUSED(y), + double WXUNUSED(angle)) { - // later + wxFAIL_MSG( "not implemented" ); } void wxWindowDC::DoGetTextExtent( const wxString &string, wxCoord *width, wxCoord *height, @@ -2137,7 +2140,7 @@ void wxWindowDC::SetBackgroundMode( int mode ) } } -void wxWindowDC::SetPalette( const wxPalette& palette ) +void wxWindowDC::SetPalette( const wxPalette& WXUNUSED(palette) ) { #if 0 if (m_window) diff --git a/src/x11/dcscreen.cpp b/src/x11/dcscreen.cpp index 8bcb5f410b..58ac7e3a18 100644 --- a/src/x11/dcscreen.cpp +++ b/src/x11/dcscreen.cpp @@ -96,24 +96,9 @@ bool wxScreenDC::StartDrawingOnTop( wxWindow *window ) return StartDrawingOnTop( &rect ); } -bool wxScreenDC::StartDrawingOnTop( wxRect *rectIn ) +bool wxScreenDC::StartDrawingOnTop( wxRect *WXUNUSED(rectIn) ) { // VZ: should we do the same thing that wxMotif wxScreenDC does here? -#if 0 - wxRect rect; - if ( rectIn ) - { - rect = *rectIn; - } - else - { - rect.x = - rect.y = 0; - - DoGetSize(&rect.width, &rect.height); - } -#endif // 0 - return true; } diff --git a/src/x11/evtloop.cpp b/src/x11/evtloop.cpp index 3e1e5213ef..4540e888da 100644 --- a/src/x11/evtloop.cpp +++ b/src/x11/evtloop.cpp @@ -98,31 +98,8 @@ bool wxEventLoopImpl::ProcessEvent(XEvent *event) return false; } -bool wxEventLoopImpl::PreProcessEvent(XEvent *event) +bool wxEventLoopImpl::PreProcessEvent(XEvent *WXUNUSED(event)) { - // TODO -#if 0 - HWND hWnd = msg->hwnd; - wxWindow *wndThis = wxGetWindowFromHWND((WXHWND)hWnd); - - - // try translations first; find the youngest window with a translation - // table. - wxWindow *wnd; - for ( wnd = wndThis; wnd; wnd = wnd->GetParent() ) - { - if ( wnd->MSWTranslateMessage((WXMSG *)msg) ) - return true; - } - - // Anyone for a non-translation message? Try youngest descendants first. - for ( wnd = wndThis; wnd; wnd = wnd->GetParent() ) - { - if ( wnd->MSWProcessMessage((WXMSG *)msg) ) - return true; - } -#endif - return false; } diff --git a/src/x11/palette.cpp b/src/x11/palette.cpp index 61a885cbdd..8d7852654f 100644 --- a/src/x11/palette.cpp +++ b/src/x11/palette.cpp @@ -170,7 +170,9 @@ bool wxPalette::Create(int n, const unsigned char *red, const unsigned char *gre return true; } -int wxPalette::GetPixel(unsigned char red, unsigned char green, unsigned char blue) const +int wxPalette::GetPixel(unsigned char WXUNUSED(red), + unsigned char WXUNUSED(green), + unsigned char WXUNUSED(blue)) const { if ( !m_refData ) return wxNOT_FOUND; diff --git a/src/x11/reparent.cpp b/src/x11/reparent.cpp index ac394ccf1a..d6ece8ddce 100644 --- a/src/x11/reparent.cpp +++ b/src/x11/reparent.cpp @@ -70,7 +70,7 @@ wxWindow* wxReparenter::sm_newParent = NULL; wxString wxReparenter::sm_name; bool wxReparenter::sm_exactMatch = false; -static int ErrorHandler(Display* dpy, XErrorEvent* event) +static int ErrorHandler(Display* WXUNUSED(dpy), XErrorEvent* WXUNUSED(event)) { Xerror = True; return False; diff --git a/src/x11/toplevel.cpp b/src/x11/toplevel.cpp index 0f7e4a9b4d..384b7ae317 100644 --- a/src/x11/toplevel.cpp +++ b/src/x11/toplevel.cpp @@ -299,7 +299,7 @@ bool wxTopLevelWindowX11::Show(bool show) // wxTopLevelWindowX11 maximize/minimize // ---------------------------------------------------------------------------- -void wxTopLevelWindowX11::Maximize(bool maximize) +void wxTopLevelWindowX11::Maximize(bool WXUNUSED(maximize)) { // TODO } @@ -312,6 +312,12 @@ bool wxTopLevelWindowX11::IsMaximized() const void wxTopLevelWindowX11::Iconize(bool iconize) { + if ( !iconize ) + { + Restore(); + return; + } + if (!m_iconized && GetMainWindow()) { if (XIconifyWindow(wxGlobalDisplay(), diff --git a/src/x11/utils.cpp b/src/x11/utils.cpp index 2f06547b2d..117e7274b2 100644 --- a/src/x11/utils.cpp +++ b/src/x11/utils.cpp @@ -83,7 +83,7 @@ void wxFlushEvents() // ?? } -bool wxCheckForInterrupt(wxWindow *wnd) +bool wxCheckForInterrupt(wxWindow *WXUNUSED(wnd)) { wxFAIL_MSG(wxT("wxCheckForInterrupt not yet implemented.")); return false; diff --git a/src/x11/window.cpp b/src/x11/window.cpp index dbd6b97cff..7026b5aa65 100644 --- a/src/x11/window.cpp +++ b/src/x11/window.cpp @@ -1416,7 +1416,10 @@ WXWindow wxWindowX11::GetClientAreaWindow() const // TranslateXXXEvent() functions // ---------------------------------------------------------------------------- -bool wxTranslateMouseEvent(wxMouseEvent& wxevent, wxWindow *win, Window window, XEvent *xevent) +bool wxTranslateMouseEvent(wxMouseEvent& wxevent, + wxWindow *win, + Window WXUNUSED(window), + XEvent *xevent) { switch (XEventGetType(xevent)) { @@ -1648,7 +1651,8 @@ wxWindow *wxWindowBase::GetCapture() // position. wxWindow* wxFindWindowAtPointer(wxPoint& pt) { - return wxFindWindowAtPoint(wxGetMousePosition()); + pt = wxGetMousePosition(); + return wxFindWindowAtPoint(pt); } void wxGetMouseState(int& rootX, int& rootY, unsigned& maskReturn) -- 2.45.2