m_combo = new MyComboBox( panel, ID_COMBO, _T("This"),
wxPoint(20,25), wxSize(120, wxDefaultCoord),
5, choices,
- wxPROCESS_ENTER);
+ wxTE_PROCESS_ENTER);
(void)new wxButton( panel, ID_COMBO_SEL_NUM, _T("Select #&2"), wxPoint(180,30), wxSize(140,30) );
(void)new wxButton( panel, ID_COMBO_SEL_STR, _T("&Select 'This'"), wxPoint(340,30), wxSize(140,30) );
};
panel = new wxPanel(m_book);
- (void)new MyRadioBox( panel, ID_RADIOBOX, _T("&That"), wxPoint(10,160), wxDefaultSize, WXSIZEOF(choices2), choices2, 1, wxRA_SPECIFY_ROWS );
+ wxRadioBox *radio2 = new MyRadioBox( panel, ID_RADIOBOX, _T("&That"), wxPoint(10,160), wxDefaultSize, WXSIZEOF(choices2), choices2, 1, wxRA_SPECIFY_ROWS );
m_radio = new wxRadioBox( panel, ID_RADIOBOX, _T("T&his"), wxPoint(10,10), wxDefaultSize, WXSIZEOF(choices), choices, 1, wxRA_SPECIFY_COLS );
#if wxUSE_TOOLTIPS
m_combo->SetToolTip(_T("This is a natural\ncombobox - can you believe me?"));
- m_radio->SetToolTip(_T("Ever seen a radiobox?"));
+ radio2->SetToolTip(_T("Ever seen a radiobox?"));
+
+ //m_radio->SetToolTip(_T("Tooltip for the entire radiobox"));
+ for ( unsigned int nb = 0; nb < WXSIZEOF(choices); nb++ )
+ {
+ m_radio->SetItemToolTip(nb, _T("tooltip for\n") + choices[nb]);
+ }
+
+ // remove the tooltip for one of the items
+ m_radio->SetItemToolTip(2, _T(""));
#endif // wxUSE_TOOLTIPS
(void)new wxButton( panel, ID_RADIOBOX_SEL_NUM, _T("Select #&2"), wxPoint(180,30), wxSize(140,30) );
static const int INVALID_SELECTION = -2;
static int s_selCombo = INVALID_SELECTION;
+
+ if (!m_combo || !m_choice)
+ {
+ event.Skip();
+ return;
+ }
+
int sel = m_combo->GetSelection();
if ( sel != s_selCombo )
{
void MyPanel::OnCombo( wxCommandEvent &event )
{
+ if (!m_combo)
+ return;
+
wxLogMessage(_T("EVT_COMBOBOX: item %d/%d (event/control), string \"%s\"/\"%s\""),
(int)event.GetInt(),
m_combo->GetSelection(),
if ( m_spinctrl )
{
wxString s;
- s.Printf( _T("Spin ctrl changed: now %d (from event: %ld)\n"),
+ s.Printf( _T("Spin ctrl changed: now %d (from event: %d)\n"),
m_spinctrl->GetValue(), event.GetInt() );
m_text->AppendText(s);
}
if ( m_spinctrl )
{
m_text->AppendText( wxString::Format(
- _T("Spin up: %d (from event: %ld)\n"),
+ _T("Spin up: %d (from event: %d)\n"),
m_spinctrl->GetValue(), event.GetInt() ) );
}
}
if ( m_spinctrl )
{
m_text->AppendText( wxString::Format(
- _T("Spin down: %d (from event: %ld)\n"),
+ _T("Spin down: %d (from event: %d)\n"),
m_spinctrl->GetValue(), event.GetInt() ) );
}
}