+
+ 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);
+ wxStaticBitmap *bmpStatic = 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("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("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,
+ "&Toggle label", wxPoint(250, 20));
+#endif // wxUSE_TOGGLEBTN
+
+ m_label = new wxStaticText(panel, -1, "Label with some long text",
+ wxPoint(250, 60), wxDefaultSize,
+ wxALIGN_RIGHT /*| wxST_NO_AUTORESIZE*/);
+ m_label->SetForegroundColour( *wxBLUE );
+
+ m_notebook->AddPage(panel, "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, "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, "Test Button &2" );
+ pMyButton2->SetConstraints( c );
+
+ m_notebook->AddPage(panel, "wxLayoutConstraint");
+#endif
+
+ // sizer
+
+ panel = new wxPanel(m_notebook);
+ panel->SetAutoLayout( TRUE );
+
+ wxBoxSizer *sizer = new wxBoxSizer( wxHORIZONTAL );
+
+ sizer->Add( new wxButton(panel, -1, "Test Button &1" ), 3, wxALL, 10 );
+ sizer->Add( 20,20, 1 );
+ sizer->Add( new wxButton(panel, -1, "Multiline\nbutton" ), 3, wxGROW|wxALL, 10 );
+
+ panel->SetSizer( sizer );
+
+ m_notebook->AddPage(panel, "wxSizer");