NCBI C++ ToolKit
run_tool_dlg.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: run_tool_dlg.cpp 47080 2022-07-22 18:11:54Z asztalos $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Authors:
27  *
28  * File Description:
29  *
30  */
31 #include <ncbi_pch.hpp>
32 
42 
45 #include "add_quick_launch_dlg.hpp"
46 
47 #include <wx/sizer.h>
48 #include <wx/button.h>
49 #include <wx/icon.h>
50 #include <wx/msgdlg.h>
51 
52 
54 
55 
56 ///////////////////////////////////////////////////////////////////////////////
57 /// CToolManagerItem
59  public CObject,
61 {
62 public:
64  : m_Manager(&manager)
65  {
66  }
67 
68  virtual const IUIObject& GetDescriptor() const
69  {
70  return m_Manager->GetDescriptor();
71  }
72 
73  virtual string GetCategory()
74  {
75  return m_Manager->GetCategory();
76  }
77 
78  virtual bool ShowDefault() const { return false; }
79 
81 };
82 
83 
84 ///////////////////////////////////////////////////////////////////////////////
85 /// CRecentToolItem
87 {
88 public:
90  : CToolManagerItem(manager)
91  {
92  }
93 
94  virtual string GetCategory()
95  {
96  return "Recent Tools";
97  }
98 };
99 
100 
101 ///////////////////////////////////////////////////////////////////////////////
102 /// CRunToolDlg
103 
104 IMPLEMENT_DYNAMIC_CLASS( CRunToolDlg, CDialog )
105 
106 BEGIN_EVENT_TABLE( CRunToolDlg, CDialog )
107 ////@begin CRunToolDlg event table entries
108  EVT_BUTTON( ID_RESTORE_DEFAULTS_BTN, CRunToolDlg::OnRestoreDefaultsBtnClick )
110  EVT_BUTTON( wxID_BACKWARD, CRunToolDlg::OnBackwardClick )
111  EVT_BUTTON( wxID_FORWARD, CRunToolDlg::OnForwardClick )
112 ////@end CRunToolDlg event table entries
113  EVT_LISTBOX_DCLICK(wxID_ANY, CRunToolDlg::OnToolSelected)
115 
116 
118  : m_RecentTools(3)
119 {
120  Init();
121 }
122 
123 
124 CRunToolDlg::CRunToolDlg( wxWindow* parent, const vector<TManagerRef>& managers, IServiceLocator* srvLocator )
125  : m_SrvLocator(srvLocator), m_Managers(managers), m_RecentTools(3)
126 {
127  Init();
128  Create(parent);
129 }
130 
131 
132 bool CRunToolDlg::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
133 {
134 ////@begin CRunToolDlg creation
135  SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
136  CDialog::Create( parent, id, caption, pos, size, style );
137 
138  CreateControls();
139  if (GetSizer())
140  {
141  GetSizer()->SetSizeHints(this);
142  }
143  Centre();
144 ////@end CRunToolDlg creation
145  return true;
146 }
147 
148 
150 {
151 ////@begin CRunToolDlg destruction
152 ////@end CRunToolDlg destruction
153 }
154 
155 
157 {
158 ////@begin CRunToolDlg member initialisation
159  m_Panel = NULL;
160  m_HelpLink = NULL;
163  m_BackBtn = NULL;
164  m_NextBtn = NULL;
165 ////@end CRunToolDlg member initialisation
166  m_CurrPanel = NULL;
167  m_ItemPanel = NULL;
168 }
169 
170 
172 {
173 ////@begin CRunToolDlg content construction
174  CRunToolDlg* itemCDialog1 = this;
175 
176  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
177  itemCDialog1->SetSizer(itemBoxSizer2);
178 
179  m_Panel = new wxPanel( itemCDialog1, ID_PANEL, wxDefaultPosition, wxSize(400, 300), wxFULL_REPAINT_ON_RESIZE|wxTAB_TRAVERSAL );
180  itemBoxSizer2->Add(m_Panel, 1, wxGROW, 5);
181 
182  wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxVERTICAL);
183  m_Panel->SetSizer(itemBoxSizer4);
184 
185  wxStaticLine* itemStaticLine5 = new wxStaticLine( itemCDialog1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
186  itemBoxSizer2->Add(itemStaticLine5, 0, wxGROW|wxALL, 5);
187 
188  wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxHORIZONTAL);
189  itemBoxSizer2->Add(itemBoxSizer6, 0, wxGROW|wxLEFT|wxRIGHT, 5);
190 
191  m_HelpLink = new wxHyperlinkCtrl( itemCDialog1, ID_HYPERLINKCTRL, _("Help"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
192  m_HelpLink->SetForegroundColour(wxColour(128, 128, 128));
193  itemBoxSizer6->Add(m_HelpLink, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
194 
195  m_RestoreDefaultsBtn = new wxButton( itemCDialog1, ID_RESTORE_DEFAULTS_BTN, _("Defaults"), wxDefaultPosition, wxDefaultSize, 0 );
197  m_RestoreDefaultsBtn->SetToolTip(_("Restore default options"));
198  itemBoxSizer6->Add(m_RestoreDefaultsBtn, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
199 
200  itemBoxSizer6->Add(5, 5, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5);
201 
202  wxBoxSizer* itemBoxSizer10 = new wxBoxSizer(wxHORIZONTAL);
203  itemBoxSizer6->Add(itemBoxSizer10, 0, wxALIGN_CENTER_VERTICAL, 5);
204 
205  m_QuickLaunch = new wxButton( itemCDialog1, ID_BUTTON, _("Add Quick Launch..."), wxDefaultPosition, wxDefaultSize, 0 );
206  itemBoxSizer10->Add(m_QuickLaunch, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
207 
208  m_BackBtn = new wxButton( itemCDialog1, wxID_BACKWARD, _("< &Back"), wxDefaultPosition, wxDefaultSize, 0 );
209  itemBoxSizer10->Add(m_BackBtn, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxTOP|wxBOTTOM, 5);
210 
211  // in wxCocoa, we get a little button overlap here without the spacer. I believe
212  // this is a bug, but we need to pad for now. The variable is added
213  // to create a syntax error if this is overwritten by DialogBlocks
214  bool spacer_code_included = true;
215 #ifdef __WXOSX_COCOA__
216  itemBoxSizer10->AddSpacer(6);
217 #endif
218 
219  m_NextBtn = new wxButton( itemCDialog1, wxID_FORWARD, _("&Next >"), wxDefaultPosition, wxDefaultSize, 0 );
220  m_NextBtn->SetDefault();
221  itemBoxSizer10->Add(m_NextBtn, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxTOP|wxBOTTOM, 5);
222 
223  wxButton* itemButton14 = new wxButton( itemCDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
224  itemBoxSizer6->Add(itemButton14, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
225 
226 ////@end CRunToolDlg content construction
227 
228  if (!spacer_code_included) {
229  // If spacer_code_included is not defined, it has been overwritten
230  // so you must add the following code after m_BackBtn is added and
231  // before m_NextBtn is added. We need this since that section of code
232  // can be overridden by DialogBlocks.
233  /*
234  // in wxCocoa, we get a little button overlap here without the spacer. I believe
235  // this is a bug, but we need to pad for now. The variable is added
236  // to create a syntax error if this is overwritten by DialogBlocks
237  bool spacer_code_included = true;
238 #ifdef __WXOSX_COCOA__
239  itemBoxSizer10->AddSpacer(6);
240 #endif
241  */
242  }
243 
244  for( size_t i =0; i < m_Managers.size(); i++ ){
245  TManagerRef manager = m_Managers[i];
246  manager->SetServiceLocator(m_SrvLocator);
247  manager->SetParentWindow(m_Panel);
248  }
249 
250  if (m_Managers.size() == 1) {
252  } else {
254  m_ItemPanel->SetItemTypeLabel("tool");
255 
257  }
258 
260 
261  if (m_ItemPanel)
263 
264  x_UpdateButtons();
265 }
266 
267 
269 
270 class ToolCmp
271 {
272 public:
273  ToolCmp(const string& label) : m_ToolLabel(label) {}
274 
276  {
277  return (tool->GetDescriptor().GetLabel() == m_ToolLabel);
278  }
279 
280 private:
281  string m_ToolLabel;
282 };
283 
285 {
286  typedef CIRef<IItemWithDescription> TItemRef;
287  vector<TItemRef> items;
288 
289  bool have_recent_tool = false;
290  // Recent tools group
292  vector<TManagerRef>::iterator it_tool =
293  find_if(m_Managers.begin(), m_Managers.end(), ToolCmp(*it));
294 
295  if (it_tool != m_Managers.end()) {
296  have_recent_tool = true;
297  items.push_back(TItemRef(new CToolRecentItem(**it_tool)));
298  }
299  }
300 
301  for( size_t i =0; i < m_Managers.size(); i++ ){
302  TManagerRef manager = m_Managers[i];
303  manager->InitUI();
304  TItemRef item(new CToolManagerItem(*manager));
305  items.push_back(item);
306  }
307 
308  m_ItemPanel->SetItems(items);
309 
310  if (have_recent_tool) {
312  int selected = control->GetSelectedIndex();
313  if (selected != -1)
314  control->SelectItem(selected, false);
315  control->SelectItem(1);
316 
317  {
319  CToolManagerItem* tool_item = dynamic_cast<CToolManagerItem*>(item.GetPointer());
320  if (tool_item) {
321  const IUIObject& ui_obj = item->GetDescriptor();
322  wxString help_url = ui_obj.GetHelpId();
323  m_HelpLink->SetURL(help_url);
324  }
325  }
326  }
327 
328  x_UpdateButtons();
329 }
330 
331 
332 void CRunToolDlg::SetInputObjects(const vector<TConstScopedObjects>& objects)
333 {
335 }
336 
338 {
339  if (m_CurrManager) {
340  string err_str = m_CurrManager->SetInputObjects(m_InputObjects);
341 
342  if( !err_str.empty() ){
343  wxMessageBox(
344  ToWxString( err_str ), wxT("Error"),
345  wxOK | wxICON_ERROR, this
346  );
347  return wxID_CANCEL;
348  }
349 
351  return wxID_OK;
352  }
353  }
354  return CDialog::ShowModal();
355 }
356 
358 {
359  return m_AppTask;
360 }
361 
362 
363 void CRunToolDlg::OnToolSelected(wxCommandEvent& event)
364 {
366 }
367 
369 {
370  wxSizer* sizer = m_Panel->GetSizer();
371  wxSize minSize(0, 0);
372 
373  if (m_CurrManager) {
374  wxPanel* panel = m_CurrManager->GetMaxPanel();
375  if (panel) {
376  panel->Show();
377  sizer->Add(panel, 1, wxEXPAND | wxALL, 5);
378  minSize.IncTo(sizer->GetMinSize());
379  sizer->Detach(panel);
380  panel->Destroy();
381  }
382  }
383  else {
384  for( size_t i =0; i < m_Managers.size(); i++ ){
385  TManagerRef manager = m_Managers[i];
386  wxPanel* panel = manager->GetMaxPanel();
387  if (!panel) continue;
388  panel->Show();
389  sizer->Add(panel, 1, wxEXPAND | wxALL, 5);
390  minSize.IncTo(sizer->GetMinSize());
391  sizer->Detach(panel);
392  panel->Destroy();
393  }
394 
395  m_ItemPanel->Show();
396  sizer->Add(m_ItemPanel, 1, wxEXPAND | wxALL, 5);
397  minSize.IncTo(sizer->GetMinSize());
398  m_ItemPanel->Hide();
399  sizer->Detach(m_ItemPanel);
400  //sizer->SetMinSize(minSize);
401  }
402 
403  m_Panel->SetClientSize(minSize);
404  m_Panel->SetMinSize(m_Panel->GetSize());
405 
406  GetSizer()->SetSizeHints(this);
407 }
408 
409 // set ne pluggable panel
410 void CRunToolDlg::x_SetCurrentPanel(wxPanel* panel, const wxString& caption)
411 {
412  if(panel == m_CurrPanel) {
413  return;
414  }
415 
416  if(m_CurrPanel) {
417  m_CurrPanel->Hide();
418  m_CurrPanel = NULL;
419  SetTitle(wxT(""));
420  }
421  if(panel) {
422  if( panel->GetContainingSizer() != m_Panel->GetSizer()) {
423  m_Panel->GetSizer()->Add(panel, 1, wxEXPAND | wxALL, 5);
424  }
425  m_CurrPanel = panel;
426  SetTitle(caption);
427 
428  m_CurrPanel->Show();
429  m_Panel->Layout();
430  m_CurrPanel->SetFocus();
431  }
432 }
433 
434 
436 {
437  try {
438  if(m_CurrManager->DoTransition(action)) {
439  if(m_CurrManager->IsCompletedState()) {
440  // we are done
441  m_AppTask.Reset(m_CurrManager->GetTask());
442 
443  // Report usage
444  const IUIObject& descriptor = m_CurrManager->GetDescriptor();
445  const string& log_event = descriptor.GetLogEvent();
446  if (!log_event.empty()) {
447  REPORT_USAGE(log_event, .Add("tool_name", descriptor.GetLabel()));
448  }
449 
451  string toolLabel = m_CurrManager->GetDescriptor().GetLabel();
452  recentTool.AddItem(toolLabel);
453 
455  if (menu_srv)
456  menu_srv->ResetMenuBar();
457 
458  LOG_POST(Info << "CRunToolDlg: Task created: "
459  << toolLabel
460  << " task descr="
461  << m_AppTask->GetDescr()
462  );
463  return true;
464  } else {
465  /// show the panel for the next step
466  wxPanel* new_panel = m_CurrManager->GetCurrentPanel();
467 
468  if(new_panel == NULL) {
470 
471  } else {
472  wxString title = SYMBOL_CRUNTOOLDLG_TITLE;
473  title += wxT(" - ");
474  title += ToWxString(m_CurrManager->GetDescriptor().GetLabel());
475 
476  x_SetCurrentPanel(new_panel, title);
477  }
478  }
479  x_UpdateButtons();
480  }
481  }
482  catch(CException& ex)
483  {
484  ERR_POST(ex.ReportAll());
485  NcbiErrorBox(ex.GetMsg());
486  return true;
487  }
488  catch(std::exception& ex)
489  {
490  ERR_POST(ex.what());
491  NcbiErrorBox(ex.what());
492  return true;
493  }
494  return false;
495 }
496 
497 
498 /// handles the first step of the dialog - selecting the tool
500 {
502  CToolManagerItem* tool_item = dynamic_cast<CToolManagerItem*>(item.GetPointer());
503  if(tool_item) {
504 
505  const IUIObject &ui_obj = item->GetDescriptor();
506  wxString help_url = ui_obj.GetHelpId();
507  m_HelpLink->SetURL(help_url);
508 
509  m_CurrManager = tool_item->m_Manager;
510  m_RecentTools.AddItem(m_CurrManager->GetDescriptor().GetLabel());
511 
512  if( m_CurrManager ){
513  string err_str = m_CurrManager->SetInputObjects(m_InputObjects);
514 
515  if( !err_str.empty() ){
516  wxMessageBox(
517  ToWxString( err_str ), wxT("Error"),
518  wxOK | wxICON_ERROR, this
519  );
520  return;
521  }
522 
524  EndModal(wxID_OK);
525  }
526  }
527 
528  return;
529  }
530 
531  wxMessageBox(wxT("Please select a tool!"), wxT("Run Tool"),
532  wxOK | wxICON_EXCLAMATION, this);
533 }
534 
535 
537 {
538  bool can_back = false;
539  bool can_next = true;
540  bool final = false, quickLaunch = false;;
541 
542 
543  if(m_CurrManager) {
544  can_back = m_CurrManager->CanDo(IUIToolManager::eBack) ||
546  can_next = m_CurrManager->CanDo(IUIToolManager::eNext);
547  final = m_CurrManager->IsFinalState();
548  quickLaunch = m_CurrManager->CanQuickLaunch();
549  }
550 
551  m_RestoreDefaultsBtn->Show(can_back);
552  m_BackBtn->Show(can_back);
553  m_NextBtn->Show(can_next);
554  m_NextBtn->SetLabel(final? wxT("Finish") : wxT("Next >"));
555 
556  m_QuickLaunch->Show(final);
557  if (final)
558  m_QuickLaunch->Enable(quickLaunch);
559 
560  Layout();
561 }
562 
563 
564 void CRunToolDlg::OnBackwardClick(wxCommandEvent& event)
565 {
567  EndModal(wxID_OK);
568  }
569 }
570 
571 
572 void CRunToolDlg::OnForwardClick(wxCommandEvent& event)
573 {
575  // this is the first step
577  } else {
579  EndModal(wxID_OK);
580  }
581  }
582 }
583 
584 
585 void CRunToolDlg::SetRegistryPath(const string& path)
586 {
588 
589  if (m_ItemPanel)
590  m_ItemPanel->SetRegistryPath(path + "ItemsPanel");
591 
592  /// set Registry paths for all Managers
593  /// each Manager will get a section located under the dialog's section
594  for( size_t i = 0; i < m_Managers.size(); i++ ) {
595  TManagerRef manager = m_Managers[i];
596  IRegSettings* rgs = dynamic_cast<IRegSettings*>(manager.GetPointer());
597  if(rgs) {
598  string sub_section = manager->GetDescriptor().GetLabel();
599  string mgr_path = m_RegPath + "." + sub_section;
600  rgs->SetRegistryPath(mgr_path);
601  }
602  }
603 }
604 
605 
606 void CRunToolDlg::EndModal(int ret_code)
607 {
608  CDialog::EndModal(ret_code);
609 
610  for (auto& m : m_Managers)
611  m->CleanUI();
612 }
613 
614 
615 //static const char* kSelOptionTag = "SelectedOption";
616 static const char* kRecentTools = "Recent";
617 
618 
620 {
621  if( ! m_RegPath.empty()) {
622  // save Items Panel
623  if (m_ItemPanel)
625 
627 
628  // save Managers' settings
629  for( size_t i = 0; i < m_Managers.size(); i++ ) {
630  TManagerRef manager = m_Managers[i];
631  IRegSettings* rgs = dynamic_cast<IRegSettings*>(manager.GetPointer());
632  if(rgs) {
633  rgs->SaveSettings();
634  }
635  }
636  }
637 }
638 
639 
641 {
642  if( ! m_RegPath.empty()) {
643  // load Items panel settings
644  if (m_ItemPanel)
646 
648 
649  // load Managers' settigns and find the selected manager
650  for( size_t i = 0; i < m_Managers.size(); i++ ) {
651  TManagerRef manager = m_Managers[i];
652  // load settings (if supported)
653  IRegSettings* rgs = dynamic_cast<IRegSettings*>(manager.GetPointer());
654  if(rgs) {
655  rgs->LoadSettings();
656  }
657  }
658  }
659 
660  if (m_Managers.size() > 1)
662 }
663 
664 
666 {
667  return true;
668 }
669 
670 
671 wxBitmap CRunToolDlg::GetBitmapResource( const wxString& name )
672 {
673  // Bitmap retrieval
674 ////@begin CRunToolDlg bitmap retrieval
675  wxUnusedVar(name);
676  return wxNullBitmap;
677 ////@end CRunToolDlg bitmap retrieval
678 }
679 
680 
681 wxIcon CRunToolDlg::GetIconResource( const wxString& name )
682 {
683  // Icon retrieval
684 ////@begin CRunToolDlg icon retrieval
685  wxUnusedVar(name);
686  return wxNullIcon;
687 ////@end CRunToolDlg icon retrieval
688 }
689 
690 
691 void CRunToolDlg::OnButtonClick( wxCommandEvent& event )
692 {
693  if (!m_CurrManager)
694  return;
695 
696  CAddQuickLaunchDlg dlg(this);
697  if (dlg.ShowModal() != wxID_OK)
698  return;
699 
700  string toolLabel = m_CurrManager->GetDescriptor().GetLabel();
701  string entry = toolLabel + " (" + dlg.GetDescr() + ")";
702 
704  quickLaunch.AddItem(entry);
705 
706  string regPath = quickLaunch.GetItemPath(entry);
707  CGuiRegistry::GetInstance().Set(regPath + ".Tool", toolLabel);
708 
709  IRegSettings* rgs = dynamic_cast<IRegSettings*>(m_CurrManager.GetPointer());
710  if (rgs) {
711  rgs->SetRegistryPath(regPath + ".Params");
712  rgs->SaveSettings();
713  rgs->SetRegistryPath(m_RegPath + "." + toolLabel);
714  }
715 
717  if (menu_srv)
718  menu_srv->ResetMenuBar();
719 }
720 
721 void CRunToolDlg::OnRestoreDefaultsBtnClick( wxCommandEvent& event )
722 {
723  if (!m_CurrManager)
724  return;
725 
726  m_CurrManager->RestoreDefaults();
727 }
728 
CDialog.
Definition: dialog.hpp:47
virtual void EndModal(int retCode)
Definition: dialog.cpp:142
virtual void SetRegistryPath(const string &path)
Definition: dialog.cpp:59
string m_RegPath
Definition: dialog.hpp:70
virtual CMapControl * GetMapControl()
static CGuiRegistry & GetInstance()
access the application-wide singleton
Definition: registry.cpp:400
void Set(const string &key, int val)
set specific values
Definition: registry.cpp:178
CItemSelectionPanel.
CMRUList.
Definition: mru_list.hpp:51
const TItems & GetItems() const
Definition: mru_list.hpp:96
void SetItems(const TItems &items)
Definition: mru_list.hpp:110
void AddItem(T item)
Definition: mru_list.hpp:60
SProperties & GetProperties()
CObject –.
Definition: ncbiobj.hpp:180
CQuickLaunchList.
static CQuickLaunchList & GetInstance()
void AddItem(const string &item)
string GetItemPath(const string &item) const
CRecentToolList.
static CRecentToolList & GetInstance()
void AddItem(const string &item)
class CRegistryReadView provides a nested hierarchical view at a particular key.
Definition: reg_view.hpp:58
void GetStringList(const string &key, list< string > &val) const
Definition: reg_view.cpp:268
void Set(const string &key, int val)
access a named key at this level, with no recursion
Definition: reg_view.cpp:533
void OnBackwardClick(wxCommandEvent &event)
void SetInputObjects(const vector< TConstScopedObjects > &input_objects)
wxButton * m_QuickLaunch
void OnToolSelected(wxCommandEvent &event)
TManagerRef m_CurrManager
bool x_DoTransition(IUIToolManager::EAction action)
wxButton * m_RestoreDefaultsBtn
CRunToolDlg()
CRunToolDlg.
wxPanel * m_CurrPanel
void OnButtonClick(wxCommandEvent &event)
CItemSelectionPanel * m_ItemPanel
void CreateControls()
wxPanel * m_Panel
vector< TManagerRef > m_Managers
wxBitmap GetBitmapResource(const wxString &name)
static bool ShowToolTips()
wxIcon GetIconResource(const wxString &name)
void OnForwardClick(wxCommandEvent &event)
virtual CIRef< IAppTask > GetToolTask()
CIRef< IAppTask > m_AppTask
void x_OnToolSelected()
handles the first step of the dialog - selecting the tool
wxHyperlinkCtrl * m_HelpLink
virtual void SetRegistryPath(const string &path)
void x_CreateToolItems()
virtual void x_LoadSettings(const CRegistryReadView &view)
override these functions in derived classes
void x_UpdateButtons()
void OnRestoreDefaultsBtnClick(wxCommandEvent &event)
wxButton * m_NextBtn
void x_CalcMinPanelSize()
virtual void EndModal(int ret_code)
IServiceLocator * m_SrvLocator
wxButton * m_BackBtn
CMRUList< string > m_RecentTools
virtual void x_SaveSettings(CRegistryWriteView view) const
void x_SetCurrentPanel(wxPanel *panel, const wxString &caption=_("Run Tool"))
bool Create(wxWindow *parent, wxWindowID id=ID_CRUNTOOLDLG, const wxString &caption=_("Run Tool"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
virtual int ShowModal()
vector< TConstScopedObjects > m_InputObjects
objects that serve as input arguments for the tools
virtual TIndex GetSelectedIndex() const
virtual void SelectItem(TIndex index, bool select=true)
CToolManagerItem.
CToolManagerItem(IUIAlgoToolManager &manager)
virtual const IUIObject & GetDescriptor() const
virtual string GetCategory()
virtual bool ShowDefault() const
CIRef< IUIAlgoToolManager > m_Manager
CRecentToolItem.
CToolRecentItem(IUIAlgoToolManager &manager)
virtual string GetCategory()
IMenuService - Menu Service.
IRegSettings An interface for objects that save / restore settings using CGuiRegistry.
virtual void SaveSettings() const =0
virtual void LoadSettings()=0
virtual void SetRegistryPath(const string &path)=0
IServiceLocator - an abstract mechanism for locating services.
Definition: service.hpp:71
IUIAlgoToolManager is a IUIToolManager that represents an algorithmic tool.
IUIObject - object that provides basic properties often required in a UI object.
Definition: ui_object.hpp:63
string m_ToolLabel
bool operator()(CConstIRef< IUIAlgoToolManager > tool)
ToolCmp(const string &label)
#define _(proto)
Definition: ct_nlmzip_i.h:78
static void Init(void)
Definition: cursor6.c:76
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
#define NULL
Definition: ncbistd.hpp:225
#define ERR_POST(message)
Error posting with file, line number information but without error codes.
Definition: ncbidiag.hpp:186
#define LOG_POST(message)
This macro is deprecated and it's strongly recomended to move in all projects (except tests) to macro...
Definition: ncbidiag.hpp:226
const string & GetMsg(void) const
Get message string.
Definition: ncbiexpt.cpp:461
string ReportAll(TDiagPostFlags flags=eDPF_Exception) const
Report all exceptions.
Definition: ncbiexpt.cpp:370
virtual const char * what(void) const noexcept
Standard report (includes full backlog).
Definition: ncbiexpt.cpp:342
void Info(CExceptionArgs_Base &args)
Definition: ncbiexpt.hpp:1185
CIRef< T > GetServiceByType()
retrieves a typed reference to a service, the name of C++ type is used as the name of the service.
Definition: service.hpp:91
void SetItemTypeLabel(const string &label)
virtual void SetRegistryPath(const string &path)
virtual void SaveSettings() const
void SetItems(vector< TItemRef > &items)
CGroupMapWidget * m_MapWidget
virtual const string & GetLogEvent() const =0
void NcbiErrorBox(const string &message, const string &title="Error")
specialized Message Box function for reporting critical errors
virtual const string & GetLabel() const =0
virtual const string & GetHelpId() const =0
TObjectType * GetPointer(void) THROWS_NONE
Get pointer,.
Definition: ncbiobj.hpp:998
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:773
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
static const char label[]
END_EVENT_TABLE()
int i
#define wxT(x)
Definition: muParser.cpp:41
const struct ncbi::grid::netcache::search::fields::SIZE size
static const char * kRecentTools
CGroupMapWidget::SGroupDescr TGroupDescr
#define SYMBOL_CRUNTOOLDLG_TITLE
static static static wxID_ANY
static void SetTitle(CRef< CSeq_entry > entry, string title)
#define REPORT_USAGE(event, args)
Convenience macro to log usage statisitics.
#define ID_BUTTON
wxString ToWxString(const string &s)
Definition: wx_utils.hpp:173
Modified on Tue Apr 23 07:37:24 2024 by modify_doxy.py rev. 669887