-// Popup menu callback
-void ObjectMenuProc(wxMenu *menu, wxCommandEvent& event)
-{
- wxWindow *data = (wxWindow *)menu->GetClientData();
- if (!data)
- return;
-
- switch (event.GetId())
- {
- case OBJECT_MENU_EDIT:
- {
- wxResourceManager::GetCurrentResourceManager()->EditWindow(data);
- break;
- }
- case OBJECT_MENU_DELETE:
- {
- if (data->IsKindOf(CLASSINFO(wxPanel)))
- {
- if (wxMessageBox(wxT("Are you sure?"), wxT("Deleting dialog"), wxYES_NO) == wxNO)
- return;
- }
-
- wxResourceManager::GetCurrentResourceManager()->DeselectItemIfNecessary(data);
-
- wxResourceManager::GetCurrentResourceManager()->SaveInfoAndDeleteHandler(data);
- wxResourceManager::GetCurrentResourceManager()->DeleteResource(data);
- wxResourceManager::GetCurrentResourceManager()->DeleteWindow(data);
- break;
- }
- default:
- break;
- }
-}
-