+
+ panel = new wxPanel(m_notebook);
+
+#if !defined(__WXMOTIF__) && !defined(__WIN16__) // wxStaticBitmap not working under Motif yet; and icons not allowed under WIN16.
+ wxIcon icon = wxTheApp->GetStdIcon(wxICON_INFORMATION);
+ wxStaticBitmap *bmpStatic = new wxStaticBitmap(panel, -1, icon,
+ wxPoint(10, 10));
+
+ bmpStatic = new wxStaticBitmap(panel, -1, wxNullIcon, wxPoint(50, 10));
+ bmpStatic->SetIcon(wxTheApp->GetStdIcon(wxICON_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(wxTheApp->GetStdIcon(wxICON_INFORMATION)),
+ bmp2(wxTheApp->GetStdIcon(wxICON_WARNING)),
+ bmp3(wxTheApp->GetStdIcon(wxICON_QUESTION));
+ wxBitmapButton *bmpBtn = new wxBitmapButton
+ (
+ panel, -1,
+ bmp1,
+ wxPoint(30, 70)
+ );
+ bmpBtn->SetBitmapSelected(bmp2);
+ bmpBtn->SetBitmapFocus(bmp3);
+
+ (void)new wxToggleButton(panel, ID_BUTTON_LABEL,
+ "&Toggle label", wxPoint(250, 20));
+ 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
+
+ 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");
+
+ // 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, "Test Button &2" ), 3, wxGROW|wxALL, 10 );
+
+ panel->SetSizer( sizer );
+
+ m_notebook->AddPage(panel, "wxSizer");