From 8b1d8f3611c9a00d6936e617725416339681a23f Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 22 Aug 2002 19:22:52 +0000 Subject: [PATCH] gcc 3.1 warning fixes (patch 598343) git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16687 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/controls/controls.cpp | 9 +++++++-- samples/text/text.cpp | 6 +++--- samples/widgets/slider.cpp | 2 +- samples/widgets/textctrl.cpp | 3 ++- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/samples/controls/controls.cpp b/samples/controls/controls.cpp index 3093e61f2f..a7dc649c7c 100644 --- a/samples/controls/controls.cpp +++ b/samples/controls/controls.cpp @@ -272,7 +272,7 @@ public: const wxValidator& validator = wxDefaultValidator, const wxString& name = wxRadioBoxNameStr) : wxRadioBox(parent, id, title, pos, size, n, choices, majorDim, - style, validator, name) { } + style, validator, name) { SetForegroundColour(*wxRED); } protected: void OnFocusGot(wxFocusEvent& event) @@ -682,6 +682,7 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) panel = new wxPanel(m_notebook); (void)new MyRadioBox( panel, ID_RADIOBOX, "&That", wxPoint(10,160), wxSize(-1,-1), WXSIZEOF(choices2), choices2, 1, wxRA_SPECIFY_ROWS ); m_radio = new wxRadioBox( panel, ID_RADIOBOX, "T&his", wxPoint(10,10), wxSize(-1,-1), WXSIZEOF(choices), choices, 1, wxRA_SPECIFY_COLS ); + m_radio->SetForegroundColour(*wxRED); #if wxUSE_TOOLTIPS m_combo->SetToolTip("This is a natural\ncombobox - can you believe me?"); @@ -709,6 +710,8 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) m_slider = new wxSlider( panel, ID_SLIDER, 0, 0, 200, wxPoint(18,90), wxSize(155,-1), wxSL_AUTOTICKS | wxSL_LABELS ); m_slider->SetTickFreq(40, 0); + m_slider->SetToolTip(_T("This is a sliding slider")); + (void)new wxStaticBox( panel, -1, "&Explanation", wxPoint(230,10), wxSize(270,130), wxALIGN_CENTER ); @@ -1224,6 +1227,8 @@ void MyPanel::OnRadioButtons( wxCommandEvent &event ) } case ID_RADIOBOX_FONT: { + m_radio->SetForegroundColour(*wxGREEN); + m_radio->SetFont( *wxITALIC_FONT ); break; } @@ -1562,7 +1567,7 @@ void MyFrame::OnIdle( wxIdleEvent& WXUNUSED(event) ) #endif s_windowFocus->GetClassInfo()->GetClassName() #ifdef __WXMSW__ - , s_windowFocus->GetHWND() + , (unsigned int) s_windowFocus->GetHWND() #endif ); diff --git a/samples/text/text.cpp b/samples/text/text.cpp index ff0226a293..50e24835aa 100644 --- a/samples/text/text.cpp +++ b/samples/text/text.cpp @@ -707,8 +707,8 @@ void MyTextCtrl::OnKeyDown(wxKeyEvent& event) wxLogMessage( _T("Current position: %ld\nCurrent line, column: (%ld, %ld)\nNumber of lines: %ld\nCurrent line length: %ld\nTotal text length: %u (%ld)"), pos, line, column, - GetNumberOfLines(), - GetLineLength(line), + (long) GetNumberOfLines(), + (long) GetLineLength(line), GetValue().length(), GetLastPosition()); } @@ -1204,7 +1204,7 @@ void MyFrame::OnIdle( wxIdleEvent& event ) #endif s_windowFocus #ifdef __WXMSW__ - , s_windowFocus->GetHWND() + , (unsigned int) s_windowFocus->GetHWND() #endif ); diff --git a/samples/widgets/slider.cpp b/samples/widgets/slider.cpp index fc512cd966..ec1d8f5a76 100644 --- a/samples/widgets/slider.cpp +++ b/samples/widgets/slider.cpp @@ -490,7 +490,7 @@ void SliderWidgetsPage::OnSlider(wxScrollEvent& event) If this assert is triggered, there is an unknown slider event which should be added to the above eventNames array. */ - wxASSERT_MSG(index >= 0 && index < WXSIZEOF(eventNames), + wxASSERT_MSG(index >= 0 && (size_t)index < WXSIZEOF(eventNames), wxT("Unknown slider event") ); diff --git a/samples/widgets/textctrl.cpp b/samples/widgets/textctrl.cpp index a32a3e51c2..85b49793ed 100644 --- a/samples/widgets/textctrl.cpp +++ b/samples/widgets/textctrl.cpp @@ -700,7 +700,8 @@ void TextWidgetsPage::OnButtonLoad(wxCommandEvent& WXUNUSED(event)) { long elapsed = sw.Time(); wxLogMessage(_T("Loaded file '%s' in %lu.%us"), - filename.c_str(), elapsed / 1000, elapsed % 1000); + filename.c_str(), elapsed / 1000, + (unsigned int) elapsed % 1000); } } } -- 2.45.2