void OnChar(wxKeyEvent& event);
private:
- static inline char GetChar(bool on, char c) { return on ? c : '-'; }
- void LogEvent(const char *name, wxKeyEvent& event) const;
+ static inline wxChar GetChar(bool on, wxChar c) { return on ? c : _T('-'); }
+ void LogEvent(const wxChar *name, wxKeyEvent& event) const;
DECLARE_EVENT_TABLE()
};
wxGauge *m_gauge;
wxSlider *m_slider;
wxButton *m_fontButton;
+ wxButton *m_lbSelectNum;
+ wxButton *m_lbSelectThis;
#ifndef wxUSE_SPINBUTTON
wxSpinButton *m_spinbutton;
wxButton *m_btnProgress;
EVT_CHAR(MyTextCtrl::OnChar)
END_EVENT_TABLE()
-void MyTextCtrl::LogEvent(const char *name, wxKeyEvent& event) const
+void MyTextCtrl::LogEvent(const wxChar *name, wxKeyEvent& event) const
{
wxString key;
long keycode = event.KeyCode();
- if ( isprint((int)keycode) )
- key.Printf("'%c'", (char)keycode);
+ if ( wxIsprint((int)keycode) )
+ key.Printf( _T("'%c'") , (char)keycode);
else
{
switch ( keycode )
case WXK_MBUTTON: key = "MBUTTON"; break;
case WXK_CLEAR: key = "CLEAR"; break;
case WXK_SHIFT: key = "SHIFT"; break;
+ case WXK_ALT: key = "ALT"; break;
case WXK_CONTROL: key = "CONTROL"; break;
case WXK_MENU: key = "MENU"; break;
case WXK_PAUSE: key = "PAUSE"; break;
case WXK_NUMPAD_DECIMAL: key = "NUMPAD_DECIMAL"; break;
default:
- key.Printf("unknown (%ld)", keycode);
+ key.Printf( _T("unknown (%ld)"), keycode);
}
}
wxLogMessage( _T("%s event: %s (flags = %c%c%c%c)"),
name,
key.c_str(),
- GetChar(event.ControlDown(), 'C'),
- GetChar(event.AltDown(), 'A'),
- GetChar(event.ShiftDown(), 'S'),
- GetChar(event.MetaDown(), 'M'));
+ GetChar( event.ControlDown(), _T('C') ),
+ GetChar( event.AltDown(), _T('A') ),
+ GetChar( event.ShiftDown(), _T('S') ),
+ GetChar( event.MetaDown(), _T('M') ) );
}
void MyTextCtrl::OnChar(wxKeyEvent& event)
{
- LogEvent("Char", event);
+ LogEvent( _T("Char"), event);
event.Skip();
}
void MyTextCtrl::OnKeyUp(wxKeyEvent& event)
{
- LogEvent("Key up", event);
+ LogEvent( _("Key up"), event);
event.Skip();
}
break;
}
- LogEvent("Key down", event);
+ LogEvent( _("Key down"), event);
event.Skip();
}
m_listbox->SetToolTip( "This is a list box" );
#endif // wxUSE_TOOLTIPS
- (void)new wxButton( panel, ID_LISTBOX_SEL_NUM, "Select #2", wxPoint(180,30), wxSize(140,30) );
- (void)new wxButton( panel, ID_LISTBOX_SEL_STR, "Select 'This'", wxPoint(340,30), wxSize(140,30) );
+ m_lbSelectNum = new wxButton( panel, ID_LISTBOX_SEL_NUM, "Select #2", wxPoint(180,30), wxSize(140,30) );
+ m_lbSelectThis = new wxButton( panel, ID_LISTBOX_SEL_STR, "Select 'This'", wxPoint(340,30), wxSize(140,30) );
(void)new wxButton( panel, ID_LISTBOX_CLEAR, "Clear", wxPoint(180,80), wxSize(140,30) );
(void)new wxButton( panel, ID_LISTBOX_APPEND, "Append 'Hi!'", wxPoint(340,80), wxSize(140,30) );
(void)new wxButton( panel, ID_LISTBOX_DELETE, "Delete selected item", wxPoint(180,130), wxSize(140,30) );
case ID_LISTBOX_SEL_NUM:
{
m_listbox->SetSelection( 2 );
+ m_lbSelectThis->WarpPointer( 40, 14 );
break;
}
case ID_LISTBOX_SEL_STR:
{
m_listbox->SetStringSelection( "This" );
+ m_lbSelectNum->WarpPointer( 40, 14 );
break;
}
case ID_LISTBOX_CLEAR: