+ win->UnsetToolTip();
+ win->SetToolTip(tip);
+}
+
+}
+
+void MyPanel::SetAllToolTips()
+{
+ ResetToolTip(FindWindow(ID_LISTBOX_FONT), "Press here to set italic font");
+ ResetToolTip(m_checkbox, "Click here to disable the listbox");
+ ResetToolTip(m_listbox, "This is a list box");
+ ResetToolTip(m_combo, "This is a natural\ncombobox - can you believe me?");
+ ResetToolTip(m_slider, "This is a sliding slider");
+ ResetToolTip(FindWindow(ID_RADIOBOX2), "Ever seen a radiobox?");
+
+ //ResetToolTip(m_radio, "Tooltip for the entire radiobox");
+ for ( unsigned int nb = 0; nb < m_radio->GetCount(); nb++ )
+ {
+ m_radio->SetItemToolTip(nb, "");
+ m_radio->SetItemToolTip(nb, "tooltip for\n" + m_radio->GetString(nb));
+ }
+
+ // remove the tooltip for one of the items
+ m_radio->SetItemToolTip(2, "");
+}
+#endif // wxUSE_TOOLTIPS
+
+void MyPanel::OnIdle(wxIdleEvent& event)
+{
+ 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 )
+ {
+ if ( s_selCombo != INVALID_SELECTION )
+ {
+ wxLogMessage(_T("EVT_IDLE: combobox selection changed from %d to %d"),
+ s_selCombo, sel);
+ }
+
+ s_selCombo = sel;
+ }
+
+ static int s_selChoice = INVALID_SELECTION;
+ sel = m_choice->GetSelection();
+ if ( sel != s_selChoice )
+ {
+ if ( s_selChoice != INVALID_SELECTION )
+ {
+ wxLogMessage(_T("EVT_IDLE: choice selection changed from %d to %d"),
+ s_selChoice, sel);
+ }
+
+ s_selChoice = sel;
+ }
+
+ event.Skip();