Code: Select all
int button_id = 10000 + Durchlauf_fortlaufend;
wxBitmapButton *button = new wxBitmapButton(Panel1, button_id, wxBitmap(_T("C:\\Users\\Thomas\\Documents\\Programmprojekte\\Wall-Mat\\warenkorb.png")), wxDefaultPosition, wxDefaultSize, wxNO_BORDER, wxDefaultValidator, _T("this string doesn't matter"));
BitmapButton[Durchlauf_fortlaufend] = button;
FlexGridSizer2->Add(button, 1, wxALL|wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL, 5);
Connect(button_id, wxEVT_COMMAND_BUTTON_CLICKED,(wxObjectEventFunction)&Geometrie::OnBitmapButtonClick);
Code: Select all
void Geometrie::OnBitmapButtonClick(wxCommandEvent& event)
{
wxLogMessage( "you clicked button with id=%d", (event.GetId()-10000));
}