//------------------------------------------------------------------------------ //void OnIconize(wxIconizeEvent &event) //------------------------------------------------------------------------------ void GmatMdiChildFrame::OnIconize(wxIconizeEvent &event) { #ifdef DEBUG_ICONIZE MessageInterface::ShowMessage ("\nGmatMdiChildFrame::OnIconize() entered, title='%s', mItemType=%d\n", GetTitle().c_str(), mItemType); #endif // Update both edit and animation tools if frame is restored #ifdef DEBUG_UPDATE_GUI_ITEM MessageInterface::ShowMessage(" Calling UpdateGuiItem()\n"); #endif if (event.Iconized()) { #ifdef DEBUG_UPDATE_GUI_ITEM MessageInterface::ShowMessage(" Frame is iconized.\n"); #endif UpdateGuiItem(0, 0); } else { #ifdef DEBUG_UPDATE_GUI_ITEM MessageInterface::ShowMessage(" Frame is restored.\n"); #endif UpdateGuiItem(1, 1); } #ifdef DEBUG_ICONIZE MessageInterface::ShowMessage ("GmatMdiChildFrame::OnIconize() leaving, title='%s'\n", GetTitle().c_str()); #endif event.Skip(); }
//------------------------------------------------------------------------------ // ~GmatMdiChildFrame() //------------------------------------------------------------------------------ GmatMdiChildFrame::~GmatMdiChildFrame() { #ifdef DEBUG_MDI_CHILD_FRAME MessageInterface::ShowMessage ("GmatMdiChildFrame::~GmatMdiChildFrame() entered, name='%s'\n title='%s'\n", GetName().c_str(), GetTitle().c_str()); #endif #ifdef __CREATE_CHILD_MENU_BAR__ delete theMenuBar; #else // There should be only one MenuBar associated with GmatMainFrame, // so we cannot delete it here. Enable or disable edit menu and tools. #ifdef DEBUG_UPDATE_GUI_ITEM MessageInterface::ShowMessage ("GmatMdiChildFrame() destructor calling UpdateGuiItem()\n"); #endif UpdateGuiItem(0, 0); #endif #ifdef DEBUG_MDI_CHILD_FRAME MessageInterface::ShowMessage ("GmatMdiChildFrame::~GmatMdiChildFrame() leaving, name='%s'\n title='%s'\n", GetName().c_str(), GetTitle().c_str()); #endif }
//------------------------------------------------------------------------------ // ~GmatMdiChildFrame() //------------------------------------------------------------------------------ GmatMdiChildFrame::~GmatMdiChildFrame() { #ifdef DEBUG_MDI_CHILD_FRAME MessageInterface::ShowMessage (wxT("GmatMdiChildFrame::~GmatMdiChildFrame() name='%s', title='%s' entered\n"), GetName().c_str(), GetTitle().c_str()); #endif #ifdef __CREATE_CHILD_MENU_BAR__ delete theMenuBar; #else // There should be only one MenuBar associated with GmatMainFrame, // so we cannot delete it here. // Disable Edit menu and tools #ifdef DEBUG_UPDATE_GUI_ITEM MessageInterface::ShowMessage (wxT("GmatMdiChildFrame() destructor calling UpdateGuiItem()\n")); #endif UpdateGuiItem(2, 0); #endif #ifdef DEBUG_MDI_CHILD_FRAME MessageInterface::ShowMessage (wxT("GmatMdiChildFrame::~GmatMdiChildFrame() name='%s', title='%s' exiting\n"), GetName().c_str(), GetTitle().c_str()); #endif }
void SymbolTree::UpdateSymbols(const std::vector<std::pair<wxString, TagEntry> > &items) { if ( !m_tree ) return; Freeze(); for (size_t i=0; i<items.size(); i++) { wxString key = items[i].first; TagEntry data= items[i].second; UpdateGuiItem(data, key); } Thaw(); }
//------------------------------------------------------------------------------ //void OnActivate(wxActivateEvent &event) //------------------------------------------------------------------------------ void GmatMdiChildFrame::OnActivate(wxActivateEvent &event) { #ifdef DEBUG_ACTIVATE MessageInterface::ShowMessage (wxT("GmatMdiChildFrame::OnActivate() entered, title='%s', mItemType=%d\n"), GetTitle().c_str(), mItemType); #endif // update both edit and animation tools #ifdef DEBUG_UPDATE_GUI_ITEM MessageInterface::ShowMessage (wxT("GmatMdiChildFrame()::OnActivate calling UpdateGuiItem()\n")); #endif UpdateGuiItem(1, 1); relativeZOrder = maxZOrder++; #ifdef DEBUG_ACTIVATE MessageInterface::ShowMessage (wxT("GmatMdiChildFrame::OnActivate() setting zOrder for %s to %d, and maxZOrder set to %d\n"), GetTitle().c_str(), relativeZOrder, maxZOrder); #endif event.Skip(); }
//------------------------------------------------------------------------------ // GmatMdiChildFrame::GmatMdiChildFrame(...) //------------------------------------------------------------------------------ GmatMdiChildFrame::GmatMdiChildFrame(wxMDIParentFrame *parent, const wxString &name, const wxString &title, const GmatTree::ItemType type, wxWindowID id, const wxPoint &pos, const wxSize &size, long style) : wxMDIChildFrame(parent, id, title, pos, size, style, name) { #ifdef DEBUG_MDI_CHILD_FRAME MessageInterface::ShowMessage ("GmatMdiChildFrame::GmatMdiChildFrame() entered, type=%d\n " "name='%s'\n title='%s'\n", type, name.c_str(), title.c_str()); #endif relativeZOrder = maxZOrder++; usingSavedConfiguration = false; mChildName = name; theParent = parent; mDirty = false; mOverrideDirty = false; mCanClose = true; mCanSaveLocation = true; mIsActiveChild = false; mCanBeDeleted = true; mItemType = type; theScriptTextCtrl = NULL; theMenuBar = NULL; theAssociatedWin = NULL; GmatAppData *gmatAppData = GmatAppData::Instance(); theGuiInterpreter = gmatAppData->GetGuiInterpreter(); #ifdef __USE_STC_EDITOR__ theEditor = NULL; #endif #ifdef __WXMAC__ childTitle = title; #endif #ifdef __CREATE_CHILD_MENU_BAR__ // create a menu bar, pass Window menu if Windows #ifdef __WXMSW__ theMenuBar = new GmatMenuBar(mItemType, parent->GetWindowMenu()); #else theMenuBar = new GmatMenuBar(mItemType, NULL); #endif #ifdef DEBUG_MENUBAR MessageInterface::ShowMessage ("GmatMdiChildFrame::GmatMdiChildFrame() theMenuBarCreated %p\n", theMenuBar); #endif // Commented out so that Window menu works for MdiChildFrame (loj: 2008.02.08) // Double Window menu appears when more than one child is open and cannot // delete theMenuBar in the destructor. //SetMenuBar(theMenuBar); #else theMenuBar = (GmatMenuBar*)(parent->GetMenuBar()); #endif // Enable Edit menu and tools if ScriptFile #ifdef DEBUG_UPDATE_GUI_ITEM MessageInterface::ShowMessage ("GmatMdiChildFrame() constructor calling UpdateGuiItem()\n"); #endif UpdateGuiItem(1, 0); // Set GMAT main icon GmatAppData::Instance()->SetIcon(this, "GmatMdiChildFrame"); }
//------------------------------------------------------------------------------ // GmatMdiChildFrame::GmatMdiChildFrame(...) //------------------------------------------------------------------------------ GmatMdiChildFrame::GmatMdiChildFrame(wxMDIParentFrame *parent, const wxString &name, const wxString &title, const GmatTree::ItemType type, wxWindowID id, const wxPoint &pos, const wxSize &size, long style) : wxMDIChildFrame(parent, id, title, pos, size, style, name) { #ifdef DEBUG_MDI_CHILD_FRAME MessageInterface::ShowMessage (wxT("GmatMdiChildFrame::GmatMdiChildFrame() entered, type=%d\n ") wxT("name='%s'\n title='%s'"), type, name.c_str(), title.c_str()); #endif relativeZOrder = maxZOrder++; usingSavedConfiguration = false; mPlotName = name; theParent = parent; mDirty = false; mOverrideDirty = false; mCanClose = true; mCanSaveLocation = true; mItemType = type; theScriptTextCtrl = NULL; theMenuBar = NULL; theAssociatedWin = NULL; GmatAppData *gmatAppData = GmatAppData::Instance(); theGuiInterpreter = gmatAppData->GetGuiInterpreter(); #ifdef __USE_STC_EDITOR__ theEditor = NULL; #endif #ifdef __WXMAC__ childTitle = title; #endif #ifdef __CREATE_CHILD_MENU_BAR__ // create a menu bar, pass Window menu if Windows #ifdef __WXMSW__ theMenuBar = new GmatMenuBar(mItemType, parent->GetWindowMenu()); #else theMenuBar = new GmatMenuBar(mItemType, NULL); #endif #ifdef DEBUG_MENUBAR MessageInterface::ShowMessage (wxT("GmatMdiChildFrame::GmatMdiChildFrame() theMenuBarCreated %p\n"), theMenuBar); #endif // Commented out so that Window menu works for MdiChildFrame (loj: 2008.02.08) // Double Window menu appears when more than one child is open and cannot // delete theMenuBar in the destructor. //SetMenuBar(theMenuBar); #else theMenuBar = (GmatMenuBar*)(parent->GetMenuBar()); #endif // Enable Edit menu and tools if ScriptFile #ifdef DEBUG_UPDATE_GUI_ITEM MessageInterface::ShowMessage (wxT("GmatMdiChildFrame() constructor calling UpdateGuiItem()\n")); #endif UpdateGuiItem(1, 0); // Set icon if icon file is in the start up file FileManager *fm = FileManager::Instance(); try { wxString iconfile = fm->GetFullPathname(wxT("MAIN_ICON_FILE")).c_str(); #if defined __WXMSW__ SetIcon(wxIcon(iconfile, wxBITMAP_TYPE_ICO)); #elif defined __WXGTK__ SetIcon(wxIcon(iconfile, wxBITMAP_TYPE_XPM)); #elif defined __WXMAC__ SetIcon(wxIcon(iconfile, wxBITMAP_TYPE_PICT_RESOURCE)); #endif } catch (GmatBaseException &e) { MessageInterface::ShowMessage(e.GetFullMessage()); } }