file_menu->Append(MINIMAL_ABOUT, "&About");
file_menu->Append(MINIMAL_QUIT, "E&xit");
- wxMenuBar *menu_bar = new wxMenuBar;
+ wxMenuBar *menu_bar = new wxMenuBar( wxMB_DOCKABLE );
menu_bar->Append(file_menu, "&File");
#if wxUSE_TOOLTIPS
s_repeatCount = 1;
}
- wxLogStatus("Key event: %d (x%u), at position %ld",
+ wxLogStatus( _T("Key event: %d (x%u), at position %ld"),
s_keycode, s_repeatCount, GetInsertionPoint());
event.Skip();
long line, column, pos = GetInsertionPoint();
PositionToXY(pos, &column, &line);
- wxLogMessage("Current position: %ld\n"
+ wxLogMessage( _T("Current position: %ld\n"
"Current line, column: (%ld, %ld)\n"
"Number of lines: %ld\n"
"Current line length: %ld\n"
- "Total text length: %ld",
+ "Total text length: %ld"),
pos,
line, column,
GetNumberOfLines(),
panel = new wxPanel(m_notebook);
m_choice = new wxChoice( panel, ID_CHOICE, wxPoint(10,10), wxSize(120,-1), 5, choices );
+ m_choice->SetBackgroundColour( "red" );
(void)new wxButton( panel, ID_CHOICE_SEL_NUM, "Select #2", wxPoint(180,30), wxSize(140,30) );
(void)new wxButton( panel, ID_CHOICE_SEL_STR, "Select 'This'", wxPoint(340,30), wxSize(140,30) );
(void)new wxButton( panel, ID_CHOICE_CLEAR, "Clear", wxPoint(180,80), wxSize(140,30) );
m_notebook->AddPage(panel, "wxChoice", FALSE, Image_Choice);
panel = new wxPanel(m_notebook);
- m_combo = new wxComboBox( panel, ID_COMBO, "This", wxPoint(10,10), wxSize(120,-1), 5, choices );
+ m_combo = new wxComboBox( panel, ID_COMBO, "This", wxPoint(10,10), wxSize(120,-1), 5, choices, wxCB_READONLY );
(void)new wxButton( panel, ID_COMBO_SEL_NUM, "Select #2", wxPoint(180,30), wxSize(140,30) );
(void)new wxButton( panel, ID_COMBO_SEL_STR, "Select 'This'", wxPoint(340,30), wxSize(140,30) );
(void)new wxButton( panel, ID_COMBO_CLEAR, "Clear", wxPoint(180,80), wxSize(140,30) );
(*m_multitext) << " Appended.";
m_multitext->SetInsertionPoint(0);
m_multitext->WriteText( "Prepended. " );
- m_multitext->AppendText( "\nPress function keys to test different wxTextCtrl functions." );
+ m_multitext->AppendText( "\nPress function keys for test different tests." );
(*m_multitext) << "\nDoes it have cross cursor?";
m_multitext->SetCursor(*wxCROSS_CURSOR);
panel = new wxPanel(m_notebook);
(void)new wxStaticBox( panel, -1, "wxGauge and wxSlider", wxPoint(10,10), wxSize(180,130) );
m_gauge = new wxGauge( panel, -1, 200, wxPoint(18,50), wxSize(155, 30) );
- m_slider = new wxSlider( panel, ID_SLIDER, 0, 0, 200, wxPoint(18,90), wxSize(155,-1) );
+ m_slider = new wxSlider( panel, ID_SLIDER, 0, 0, 200, wxPoint(18,90), wxSize(155,-1), wxSL_LABELS );
(void)new wxStaticBox( panel, -1, "Explanation", wxPoint(200,10), wxSize(290,130) );
#ifdef __WXMOTIF__
// No wrapping text in wxStaticText yet :-(
void MyPanel::OnListBox( wxCommandEvent &event )
{
- m_text->AppendText( "ListBox selection string is: " );
+ m_text->AppendText( "ListBox event selection string is: " );
m_text->AppendText( event.GetString() );
m_text->AppendText( "\n" );
+ m_text->AppendText( "ListBox control selection string is: " );
+ m_text->AppendText( m_listbox->GetStringSelection() );
+ m_text->AppendText( "\n" );
}
void MyPanel::OnListBoxDoubleClick( wxCommandEvent &event )
void MyPanel::OnChoice( wxCommandEvent &event )
{
- m_text->AppendText( "Choice selection string is: " );
+ m_text->AppendText( "Choice event selection string is: " );
m_text->AppendText( event.GetString() );
m_text->AppendText( "\n" );
+ m_text->AppendText( "Choice control selection string is: " );
+ m_text->AppendText( m_choice->GetStringSelection() );
+ m_text->AppendText( "\n" );
}
void MyPanel::OnChoiceButtons( wxCommandEvent &event )
void MyPanel::OnCombo( wxCommandEvent &event )
{
- m_text->AppendText( "ComboBox selection string is: " );
+ m_text->AppendText( "ComboBox event selection string is: " );
m_text->AppendText( event.GetString() );
m_text->AppendText( "\n" );
+ m_text->AppendText( "ComboBox control selection string is: " );
+ m_text->AppendText( m_combo->GetStringSelection() );
+ m_text->AppendText( "\n" );
}
void MyPanel::OnComboButtons( wxCommandEvent &event )
void MyPanel::OnSpinUpdate( wxSpinEvent &event )
{
wxString value;
- value.Printf( "%d", event.GetPosition() );
+ value.Printf( _T("%d"), event.GetPosition() );
m_spintext->SetValue( value );
- value.Printf("Spin control range: (%d, %d), current = %d\n",
+ value.Printf( _T("Spin control range: (%d, %d), current = %d\n"),
m_spinbutton->GetMin(), m_spinbutton->GetMax(),
m_spinbutton->GetValue());
static long s_delay = 5000;
wxString delay;
- delay.Printf("%ld", s_delay);
+ delay.Printf( _T("%ld"), s_delay);
delay = wxGetTextFromUser("Enter delay (in milliseconds)",
"Set tooltip delay",
if ( !delay )
return; // cancelled
- sscanf(delay, "%ld", &s_delay);
+ wxSscanf(delay, _T("%ld"), &s_delay);
wxToolTip::SetDelay(s_delay);
- wxLogStatus(this, "Tooltip delay set to %ld milliseconds", s_delay);
+ wxLogStatus(this, _T("Tooltip delay set to %ld milliseconds"), s_delay);
}
void MyFrame::OnToggleTooltips(wxCommandEvent& event)
wxToolTip::Enable(s_enabled);
- wxLogStatus(this, "Tooltips %sabled", s_enabled ? "en" : "dis");
+ wxLogStatus(this, _T("Tooltips %sabled"), s_enabled ? _T("en") : _T("dis") );
}
#endif // tooltips
void MyFrame::OnSize( wxSizeEvent& event )
{
wxString msg;
- msg.Printf("%dx%d", event.GetSize().x, event.GetSize().y);
+ msg.Printf( _("%dx%d"), event.GetSize().x, event.GetSize().y);
SetStatusText(msg, 1);
event.Skip();
s_windowFocus = focus;
wxString msg;
- msg.Printf("Focus: wxWindow = %p"
+ msg.Printf(
#ifdef __WXMSW__
- ", HWND = %08x"
-#endif // wxMSW
- , s_windowFocus
+ _T("Focus: wxWindow = %p, HWND = %08x"),
+#else
+ _T("Focus: wxWindow = %p"),
+#endif
+ s_windowFocus
#ifdef __WXMSW__
, s_windowFocus->GetHWND()
-#endif // wxMSW
+#endif
);
SetStatusText(msg);