) : wxPanel( parent, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL),
box(bx)
{
-
+ this->title = title;
wxPanel* panel = this;
sizer = new wxBoxSizer(wxHORIZONTAL);
if(bitmap != NULL)
{
button = new wxBitmapButton(panel, -1, *bitmap, wxDefaultPosition, wxSize(bitmap->GetWidth(),bitmap->GetHeight()));
- std::cout << "Size: " << bitmap->GetWidth() << " " << bitmap->GetHeight() << std::endl;
+
+ sizer -> Add(button, 0, wxALL | wxALIGN_CENTER, 3);
+ sizer -> Add(new wxStaticText(panel,-1,title), 0, wxALL | wxALIGN_CENTER, 3);
}
else
{
button = new wxButton( panel, -1, title);
+ sizer -> Add(button,1,wxEXPAND | wxALL | wxALIGN_CENTER, 5);
}
Connect( button->GetId(), wxEVT_COMMAND_BUTTON_CLICKED ,
(wxObjectEventFunction)
(void (wxPanel::*)(wxEvent&))
&BitmapButtonWidget::OnClick );
- sizer -> Add(button,1,wxEXPAND | wxALL, 5);
+
panel -> SetSizer(sizer);
sizer->Fit(panel);
if(bitmap != NULL)
{
wxPanel* panel = this;
- sizer->Remove(0);
+ sizer->Clear();
button->Destroy();
button = new wxBitmapButton(panel, -1, *bitmap, wxDefaultPosition, wxSize(bitmap->GetWidth(),bitmap->GetHeight()));
(void (wxPanel::*)(wxEvent&))
&BitmapButtonWidget::OnClick );
- sizer->Add(button, 0, wxALL, 5);
+ sizer->Add(button, 0, wxALL | wxALIGN_CENTER, 3);
+ sizer -> Add(new wxStaticText(panel,-1,title), 0, wxALL | wxALIGN_CENTER, 3);
sizer->RecalcSizes();
}
}