// Created: 27.03.01
// Id: $Id$
// Copyright: (c) 2001 Vadim Zeitlin
-// License: wxWindows license
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
// ============================================================================
ComboPage_InsertText,
ComboPage_Add,
ComboPage_AddText,
+ ComboPage_SetFirst,
+ ComboPage_SetFirstText,
ComboPage_AddSeveral,
ComboPage_AddMany,
ComboPage_Clear,
void OnButtonClear(wxCommandEvent& event);
void OnButtonInsert(wxCommandEvent &event);
void OnButtonAdd(wxCommandEvent& event);
+ void OnButtonSetFirst(wxCommandEvent& event);
void OnButtonAddSeveral(wxCommandEvent& event);
void OnButtonAddMany(wxCommandEvent& event);
void OnButtonSetValue(wxCommandEvent& event);
// the text entries for "Add/change string" and "Delete" buttons
wxTextCtrl *m_textInsert,
*m_textAdd,
+ *m_textSetFirst,
*m_textChange,
*m_textSetValue,
*m_textDelete,
EVT_BUTTON(ComboPage_Clear, ComboboxWidgetsPage::OnButtonClear)
EVT_BUTTON(ComboPage_Insert, ComboboxWidgetsPage::OnButtonInsert)
EVT_BUTTON(ComboPage_Add, ComboboxWidgetsPage::OnButtonAdd)
+ EVT_BUTTON(ComboPage_SetFirst, ComboboxWidgetsPage::OnButtonSetFirst)
EVT_BUTTON(ComboPage_AddSeveral, ComboboxWidgetsPage::OnButtonAddSeveral)
EVT_BUTTON(ComboPage_AddMany, ComboboxWidgetsPage::OnButtonAddMany)
EVT_BUTTON(ComboPage_SetValue, ComboboxWidgetsPage::OnButtonSetValue)
&m_textAdd);
sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
+ sizerRow = CreateSizerWithTextAndButton(ComboPage_SetFirst,
+ wxT("Change &1st string"),
+ ComboPage_SetFirstText,
+ &m_textSetFirst);
+ sizerMiddle->Add(sizerRow, 0, wxALL | wxGROW, 5);
+
btn = new wxButton(this, ComboPage_AddSeveral, wxT("&Append a few strings"));
sizerMiddle->Add(btn, 0, wxALL | wxGROW, 5);
int sel = m_combobox->GetSelection();
if ( sel != wxNOT_FOUND )
{
-#ifndef __WXGTK__
m_combobox->SetString(sel, m_textChange->GetValue());
-#else
- wxLogMessage(wxT("Not implemented in wxGTK"));
-#endif
}
}
m_combobox->Append(s);
}
+void ComboboxWidgetsPage::OnButtonSetFirst(wxCommandEvent& WXUNUSED(event))
+{
+ if ( m_combobox->IsListEmpty() )
+ {
+ wxLogWarning("No string to change.");
+ return;
+ }
+
+ m_combobox->SetString(0, m_textSetFirst->GetValue());
+}
+
void ComboboxWidgetsPage::OnButtonAddMany(wxCommandEvent& WXUNUSED(event))
{
// "many" means 1000 here