//------------------------------------------------------------------------------ void OutputTree::ShowMenu(wxTreeItemId itemId, const wxPoint& pt) { GmatTreeItemData *treeItem = (GmatTreeItemData *)GetItemData(itemId); theSubscriberName = treeItem->GetName(); GmatTree::ItemType itemType = treeItem->GetItemType(); #if DEBUG_OUTPUT_TREE MessageInterface::ShowMessage ("OutputTree::ShowMenu() theSubscriberName=%s\n", theSubscriberName.c_str()); #endif #if wxUSE_MENUS wxMenu menu; if (itemType == GmatTree::OUTPUT_REPORT) { if (GmatGlobal::Instance()->GetRunMode() == GmatGlobal::TESTING) { menu.Append(POPUP_COMPARE_TEXT_LINES, wxT("Compare Text Lines")); menu.Append(POPUP_COMPARE_NUMERIC_LINES, wxT("Compare Lines Numerically")); menu.Append(POPUP_COMPARE_NUMERIC_COLUMNS, wxT("Compare Columns Numerically")); } } PopupMenu(&menu, pt); #endif // wxUSE_MENUS }
//------------------------------------------------------------------------------ void OutputTree::OnItemActivated(wxTreeEvent &event) { // get some info about this item wxTreeItemId itemId = event.GetItem(); GmatTreeItemData *item = (GmatTreeItemData *)GetItemData(itemId); item->SetTitle(GetItemText(itemId)); GmatAppData::Instance()->GetMainFrame()->CreateChild(item); }
//------------------------------------------------------------------------------ void OutputTree::OnEndLabelEdit(wxTreeEvent &event) { wxString newLabel = event.GetLabel(); // check to see if label is a single word if (newLabel.IsWord()) { GmatTreeItemData *selItem = (GmatTreeItemData *) GetItemData(GetSelection()); wxString oldLabel = selItem->GetName(); selItem->SetName(newLabel); } else { event.Veto(); } }
//------------------------------------------------------------------------------ void OutputTree::OnRename(wxCommandEvent &event) { #if DEBUG_OUTPUT_TREE MessageInterface::ShowMessage("OutputTree::OnRename() entered\n"); #endif wxTreeItemId item = GetSelection(); GmatTreeItemData *selItem = (GmatTreeItemData *) GetItemData(item); wxString oldName = selItem->GetName(); wxString newName = oldName; newName = wxGetTextFromUser(wxT("New name: "), wxT("Input Text"), newName, this); if ( !newName.IsEmpty() && !(newName.IsSameAs(oldName))) { } }
//------------------------------------------------------------------------------ void OutputTree::ShowMenu(wxTreeItemId itemId, const wxPoint& pt) { GmatTreeItemData *treeItem = (GmatTreeItemData *)GetItemData(itemId); theSubscriberName = treeItem->GetName(); GmatTree::ItemType itemType = treeItem->GetItemType(); #if DEBUG_OUTPUT_TREE MessageInterface::ShowMessage (wxT("OutputTree::ShowMenu() theSubscriberName=%s\n"), theSubscriberName.c_str()); #endif #if wxUSE_MENUS wxMenu menu; if (itemType == GmatTree::OUTPUT_REPORT) { menu.Append(POPUP_COMPARE_NUMERIC_VALUES, wxT("Compare Numeric Values")); menu.Append(POPUP_COMPARE_TEXT_LINES, wxT("Compare Text Lines")); } PopupMenu(&menu, pt); #endif // wxUSE_MENUS }