X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9a83f860948059b0273b5cc6d9e43fadad3ebfca..814028444d682b23af3809227cd485f4bebc1286:/samples/ownerdrw/ownerdrw.cpp diff --git a/samples/ownerdrw/ownerdrw.cpp b/samples/ownerdrw/ownerdrw.cpp index f7c3a5d32b..80a7c2eb74 100644 --- a/samples/ownerdrw/ownerdrw.cpp +++ b/samples/ownerdrw/ownerdrw.cpp @@ -6,7 +6,7 @@ // Created: 13.11.97 // RCS-ID: $Id$ // Copyright: (c) 1998 Vadim Zeitlin -// Licence: wxWindows license +// Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// // ============================================================================ @@ -69,6 +69,8 @@ enum Menu_Bitmap, Menu_Bitmap2, Menu_Submenu, Menu_Sub1, Menu_Sub2, Menu_Sub3, Menu_Toggle, Menu_About, + Menu_Drawn1, Menu_Drawn2, Menu_Drawn3, Menu_Drawn4, Menu_Drawn5, + Menu_Native1, Menu_Native2, Menu_Native3, Menu_Native4, Menu_Native5, Control_First = 1000, Control_Listbox, Control_Listbox2 }; @@ -95,8 +97,6 @@ bool OwnerDrawnApp::OnInit(void) = new OwnerDrawnFrame(NULL, wxT("wxWidgets Ownerdraw Sample"), 50, 50, 450, 340); - SetTopWindow(pFrame); - return true; } @@ -198,9 +198,62 @@ void OwnerDrawnFrame::InitMenu() wxITEM_NORMAL); file_menu->Append(pItem); + wxMenu* drawn_menu = new wxMenu; + pItem = new wxMenuItem(drawn_menu, Menu_Drawn1, wxT("&Menu item\tCtrl+K")); + drawn_menu->Append(pItem); + + drawn_menu->AppendSeparator(); + + pItem = new wxMenuItem(drawn_menu, Menu_Drawn2, wxT("&Checked item"), + wxT("check/uncheck me!"), wxITEM_CHECK); + drawn_menu->Append(pItem); + drawn_menu->Check(Menu_Drawn2, true); + + pItem = new wxMenuItem(drawn_menu, Menu_Drawn3, wxT("&Radio item"), + wxT("check/uncheck me!"), wxITEM_RADIO); + drawn_menu->Append(pItem); + + drawn_menu->AppendSeparator(); + + pItem = new wxMenuItem(drawn_menu, Menu_Drawn4, wxT("&Disabled item\tCtrl+RatherLongAccel"), + wxT("disabled item")); + pItem->Enable(false); + drawn_menu->Append(pItem); + + pItem = new wxMenuItem(drawn_menu, Menu_Drawn5, wxT("&Other\tCtrl+O"), wxT("other item")); + pItem->SetTextColour(*wxRED); + drawn_menu->Append(pItem); + + wxMenu* native_menu = new wxMenu; + pItem = new wxMenuItem(native_menu, Menu_Native1, wxT("&Menu item\tCtrl+K")); + native_menu->Append(pItem); + + native_menu->AppendSeparator(); + + pItem = new wxMenuItem(native_menu, Menu_Native2, wxT("&Checked item"), + wxT("check/uncheck me!"), wxITEM_CHECK); + native_menu->Append(pItem); + native_menu->Check(Menu_Native2, true); + + pItem = new wxMenuItem(native_menu, Menu_Native3, wxT("&Radio item"), + wxT("check/uncheck me!"), wxITEM_RADIO); + native_menu->Append(pItem); + + native_menu->AppendSeparator(); + + pItem = new wxMenuItem(native_menu, Menu_Native4, wxT("&Disabled item\tCtrl+RatherLongAccel"), + wxT("disabled item")); + pItem->Enable(false); + native_menu->Append(pItem); + + pItem = new wxMenuItem(native_menu, Menu_Native5, wxT("&Other\tCtrl+O"), wxT("other item")); + native_menu->Append(pItem); + wxMenuBar *menu_bar = new wxMenuBar; menu_bar->Append(file_menu, wxT("&File")); + menu_bar->Append(drawn_menu, wxT("&Drawn")); + menu_bar->Append(native_menu, wxT("&Native")); SetMenuBar(menu_bar); } @@ -210,7 +263,7 @@ OwnerDrawnFrame::OwnerDrawnFrame(wxFrame *frame, const wxChar *title, : wxFrame(frame, wxID_ANY, title, wxPoint(x, y), wxSize(w, h)) { // set the icon - SetIcon(wxIcon(wxT("mondrian"))); + SetIcon(wxICON(sample)); // create the menu InitMenu();