From 8b81a824c48f52bc7d6ede5d6c47f1eef64b77d3 Mon Sep 17 00:00:00 2001 From: =?utf8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Tue, 20 Nov 2001 23:59:46 +0000 Subject: [PATCH] compilation fix for wxUniv git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@12545 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- samples/controls/controls.cpp | 28 ++++++++++++++++++++-------- 1 file changed, 20 insertions(+), 8 deletions(-) diff --git a/samples/controls/controls.cpp b/samples/controls/controls.cpp index 8f984f0bd6..3ccb94120b 100644 --- a/samples/controls/controls.cpp +++ b/samples/controls/controls.cpp @@ -291,8 +291,8 @@ private: // other //---------------------------------------------------------------------- -static void SetControlClientData(const wxChar *name, - wxControlWithItems *control); +static void SetListboxClientData(const wxChar *name, wxListBox *control); +static void SetChoiceClientData(const wxChar *name, wxChoice *control); IMPLEMENT_APP(MyApp) @@ -566,8 +566,8 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) wxPoint(10,90), wxSize(120,70), 5, choices, wxLB_SORT ); - SetControlClientData(wxT("listbox"), m_listbox); - SetControlClientData(wxT("listbox"), m_listboxSorted); + SetListboxClientData(wxT("listbox"), m_listbox); + SetListboxClientData(wxT("listbox"), m_listboxSorted); m_listbox->SetCursor(*wxCROSS_CURSOR); #if wxUSE_TOOLTIPS @@ -605,8 +605,8 @@ MyPanel::MyPanel( wxFrame *frame, int x, int y, int w, int h ) m_choiceSorted = new wxChoice( panel, ID_CHOICE_SORTED, wxPoint(10,70), wxSize(120,-1), 5, choices, wxCB_SORT ); - SetControlClientData(wxT("choice"), m_choice); - SetControlClientData(wxT("choice"), m_choiceSorted); + SetChoiceClientData(wxT("choice"), m_choice); + SetChoiceClientData(wxT("choice"), m_choiceSorted); m_choice->SetSelection(2); m_choice->SetBackgroundColour( "red" ); @@ -1515,8 +1515,20 @@ void MyComboBox::OnKeyUp(wxKeyEvent& event) event.Skip(); } -static void SetControlClientData(const wxChar *name, - wxControlWithItems *control) +static void SetListboxClientData(const wxChar *name, wxListBox *control) +{ + size_t count = control->GetCount(); + for ( size_t n = 0; n < count; n++ ) + { + wxString s; + s.Printf(wxT("%s client data for '%s'"), + name, control->GetString(n).c_str()); + + control->SetClientObject(n, new wxStringClientData(s)); + } +} + +static void SetChoiceClientData(const wxChar *name, wxChoice *control) { size_t count = control->GetCount(); for ( size_t n = 0; n < count; n++ ) -- 2.45.2