#include "wx/tooltip.h"
#endif
-#if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__)
+#if defined(__WXGTK__) || defined(__WXMOTIF__) || defined(__WXMAC__) || defined(__WXMGL__)
#define USE_XPM
#endif
y = 50;
if ( argc == 3 )
{
- wxSscanf(argv[1], "%d", &x);
- wxSscanf(argv[2], "%d", &y);
+ wxSscanf(wxString(argv[1]), wxT("%d"), &x);
+ wxSscanf(wxString(argv[2]), wxT("%d"), &y);
}
// Create the main frame window
: wxPanel( frame, -1, wxPoint(x, y), wxSize(w, h) ),
m_text(NULL), m_notebook(NULL)
{
- wxLayoutConstraints *c;
-
m_text = new wxTextCtrl(this, -1, "This is the log window.\n",
wxPoint(0, 250), wxSize(100, 50), wxTE_MULTILINE);
- m_text->SetBackgroundColour("wheat");
+ m_text->SetBackgroundColour(wxT("wheat"));
if ( 0 )
wxLog::AddTraceMask(_T("focus"));
SetChoiceClientData(wxT("choice"), m_choiceSorted);
m_choice->SetSelection(2);
- m_choice->SetBackgroundColour( "red" );
+ m_choice->SetBackgroundColour( wxT("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_slider = new wxSlider( panel, ID_SLIDER, 0, 0, 200, wxPoint(18,90), wxSize(155,-1),
wxSL_AUTOTICKS | wxSL_LABELS );
m_slider->SetTickFreq(40, 0);
- (void)new wxStaticBox( panel, -1, "&Explanation", wxPoint(230,10), wxSize(270,130) );
+ (void)new wxStaticBox( panel, -1, "&Explanation",
+ wxPoint(230,10), wxSize(270,130),
+ wxALIGN_CENTER );
+
#ifdef __WXMOTIF__
// No wrapping text in wxStaticText yet :-(
(void)new wxStaticText( panel, -1,
m_notebook->AddPage(panel, "wxBitmapXXX");
// layout constraints
+#if wxUSE_CONSTRAINTS
+ wxLayoutConstraints *c;
panel = new wxPanel(m_notebook);
panel->SetAutoLayout( TRUE );
pMyButton2->SetConstraints( c );
m_notebook->AddPage(panel, "wxLayoutConstraint");
-
+#endif
+
// sizer
panel = new wxPanel(m_notebook);
SetBackgroundColour(s_colOld);
s_colOld = wxNullColour;
- m_lbSelectThis->SetForegroundColour("red");
- m_lbSelectThis->SetBackgroundColour("white");
+ m_lbSelectThis->SetForegroundColour(wxT("red"));
+ m_lbSelectThis->SetBackgroundColour(wxT("white"));
}
else
{
- s_colOld = wxColour("red");
- SetBackgroundColour("white");
+ s_colOld = wxColour(wxT("red"));
+ SetBackgroundColour(wxT("white"));
- m_lbSelectThis->SetForegroundColour("white");
- m_lbSelectThis->SetBackgroundColour("red");
+ m_lbSelectThis->SetForegroundColour(wxT("white"));
+ m_lbSelectThis->SetBackgroundColour(wxT("red"));
}
m_lbSelectThis->Refresh();
case ID_LISTBOX_ENABLE:
{
m_text->AppendText("Checkbox clicked.\n");
- wxCheckBox *cb = (wxCheckBox*)event.GetEventObject();
#if wxUSE_TOOLTIPS
+ wxCheckBox *cb = (wxCheckBox*)event.GetEventObject();
if (event.GetInt())
cb->SetToolTip( "Click to enable listbox" );
else
void MyPanel::OnShowProgress( wxCommandEvent& WXUNUSED(event) )
{
int max = m_spinbutton->GetValue();
+
+ if ( max <= 0 )
+ {
+ wxLogError(_T("You must set positive range!"));
+ return;
+ }
+
wxProgressDialog dialog("Progress dialog example",
"An informative message",
max, // range