+ int initialSpinValue = -5;
+ wxString s;
+ s << initialSpinValue;
+ m_spintext = new wxTextCtrl( panel, -1, s, wxPoint(20,160), wxSize(80,-1) );
+#if wxUSE_SPINBTN
+ m_spinbutton = new wxSpinButton( panel, ID_SPIN, wxPoint(103,160), wxSize(80, -1) );
+ m_spinbutton->SetRange(-40,30);
+ m_spinbutton->SetValue(initialSpinValue);
+
+ m_btnProgress = new wxButton( panel, ID_BTNPROGRESS, _T("&Show progress dialog"),
+ wxPoint(300, 160) );
+#endif // wxUSE_SPINBTN
+
+#if wxUSE_SPINCTRL
+ m_spinctrl = new wxSpinCtrl( panel, ID_SPINCTRL, _T(""), wxPoint(200, 160), wxSize(80, -1) );
+ m_spinctrl->SetRange(10,30);
+ m_spinctrl->SetValue(15);
+#endif // wxUSE_SPINCTRL
+
+ m_notebook->AddPage(panel, _T("wxGauge"), FALSE, Image_Gauge);
+
+ panel = new wxPanel(m_notebook);
+
+#if !defined(__WXMOTIF__) && !defined(__WIN16__) // wxStaticBitmap not working under Motif yet; and icons not allowed under WIN16.
+ wxIcon icon = wxArtProvider::GetIcon(wxART_INFORMATION);
+ (void) new wxStaticBitmap( panel, -1, icon, wxPoint(10, 10) );
+
+ // VZ: don't leak memory
+ // bmpStatic = new wxStaticBitmap(panel, -1, wxNullIcon, wxPoint(50, 10));
+ // bmpStatic->SetIcon(wxArtProvider::GetIcon(wxART_QUESTION));
+#endif // !Motif
+
+ wxBitmap bitmap( 100, 100 );
+ wxMemoryDC dc;
+ dc.SelectObject( bitmap );
+ dc.SetPen(*wxGREEN_PEN);
+ dc.Clear();
+ dc.DrawEllipse(5, 5, 90, 90);
+ dc.DrawText(_T("Bitmap"), 30, 40);
+ dc.SelectObject( wxNullBitmap );
+
+ (void)new wxBitmapButton(panel, ID_BITMAP_BTN, bitmap, wxPoint(100, 20));
+
+#ifdef __WXMSW__
+ // test for masked bitmap display
+ bitmap = wxBitmap(_T("test2.bmp"), wxBITMAP_TYPE_BMP);
+ if (bitmap.Ok())
+ {
+ bitmap.SetMask(new wxMask(bitmap, *wxBLUE));
+
+ (void)new wxStaticBitmap /* wxBitmapButton */ (panel, -1, bitmap, wxPoint(300, 120));
+ }
+#endif
+
+ wxBitmap bmp1(wxArtProvider::GetBitmap(wxART_INFORMATION)),
+ bmp2(wxArtProvider::GetBitmap(wxART_WARNING)),
+ bmp3(wxArtProvider::GetBitmap(wxART_QUESTION));
+ wxBitmapButton *bmpBtn = new wxBitmapButton
+ (
+ panel, -1,
+ bmp1,
+ wxPoint(30, 70)
+ );
+
+ bmpBtn->SetBitmapSelected(bmp2);
+ bmpBtn->SetBitmapFocus(bmp3);
+
+#if wxUSE_TOGGLEBTN
+ (void)new wxToggleButton(panel, ID_BUTTON_LABEL,
+ _T("&Toggle label"), wxPoint(250, 20));
+#else
+ (void)new wxCheckBox(panel, ID_BUTTON_LABEL,
+ _T("&Toggle label"), wxPoint(250, 20));
+#endif // wxUSE_TOGGLEBTN
+
+ m_label = new wxStaticText(panel, -1, _T("Label with some long text"),
+ wxPoint(250, 60), wxDefaultSize,
+ wxALIGN_RIGHT /*| wxST_NO_AUTORESIZE*/);
+ m_label->SetForegroundColour( *wxBLUE );
+
+ m_notebook->AddPage(panel, _T("wxBitmapXXX"));
+
+ // layout constraints
+#if wxUSE_CONSTRAINTS
+ wxLayoutConstraints *c;
+
+ panel = new wxPanel(m_notebook);
+ panel->SetAutoLayout( TRUE );
+
+ c = new wxLayoutConstraints;
+ c->top.SameAs( panel, wxTop, 10 );
+ c->height.AsIs( );
+ c->left.SameAs( panel, wxLeft, 10 );
+ c->width.PercentOf( panel, wxWidth, 40 );
+
+ wxButton *pMyButton = new wxButton(panel, ID_BUTTON_TEST1, _T("Test Button &1") );
+ pMyButton->SetConstraints( c );
+
+ c = new wxLayoutConstraints;
+ c->top.SameAs( panel, wxTop, 10 );
+ c->bottom.SameAs( panel, wxBottom, 10 );
+ c->right.SameAs( panel, wxRight, 10 );
+ c->width.PercentOf( panel, wxWidth, 40 );
+
+ wxButton *pMyButton2 = new wxButton(panel, ID_BUTTON_TEST2, _T("Test Button &2") );
+ pMyButton2->SetConstraints( c );
+
+ m_notebook->AddPage(panel, _T("wxLayoutConstraint"));