Kod: Zaznacz cały
for(z=0;z<s;z=z++)
{
submenu->Append(PU_SUB2,seriale[z]);
}
Dodaj że od kilku dni uczę się wx i trochę bardzo się w tym gubie.
Kod: Zaznacz cały
for(z=0;z<s;z=z++)
{
submenu->Append(PU_SUB2,seriale[z]);
}
Kod: Zaznacz cały
#include "wx/wx.h"
class MyApp: public wxApp
{
virtual bool OnInit();
};
class MyFrame: public wxFrame
{
public:
MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size);
void OnQuit(wxCommandEvent& event);
void OnMyEvent(wxCommandEvent& event);
};
enum
{
ID_Quit = 1,
ID_UserEvent = 1000,
};
IMPLEMENT_APP(MyApp)
bool MyApp::OnInit()
{
MyFrame *frame = new MyFrame( _("Menu items..."), wxPoint(200, 200), wxSize(400, 100) );
frame->Show(true);
SetTopWindow(frame);
return true;
}
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size)
: wxFrame( NULL, -1, title, pos, size )
{
wxMenu *menu = new wxMenu;
for (int i = 0; i < 10; i++)
{
menu->Append(ID_UserEvent + i, wxString::Format(wxT("Item id: %d"), static_cast<int> (ID_UserEvent + i)));
Connect(ID_UserEvent + i, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MyFrame::OnMyEvent));
}
menu->AppendSeparator();
menu->Append( ID_Quit, _("E&xit") );
Connect(ID_Quit, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MyFrame::OnQuit));
wxMenuBar *menuBar = new wxMenuBar;
menuBar->Append( menu, _("&Test") );
SetMenuBar( menuBar );
}
void MyFrame::OnQuit(wxCommandEvent& WXUNUSED(event))
{
Close(TRUE);
}
void MyFrame::OnMyEvent(wxCommandEvent& event)
{
wxMessageBox(wxString::Format(wxT("Clicked id: %d"), static_cast<int> (event.GetId())), _("test"), wxOK | wxICON_INFORMATION, this);
}
Użytkownicy przeglądający to forum: Obecnie na forum nie ma żadnego zarejestrowanego użytkownika i 9 gości