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

Go to the SVN repository for this file.

1 /* $Id: open_dlg.cpp 47479 2023-05-02 13:24:02Z ucko $
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 
32 #include <ncbi_pch.hpp>
33 
34 #include <gui/core/open_dlg.hpp>
35 
37 
41 
44 
45 #include <gui/utils/extension.hpp>
47 
48 
49 ////@begin includes
50 ////@end includes
51 
52 #include <wx/listctrl.h>
53 #include <wx/sizer.h>
54 #include <wx/button.h>
55 #include <wx/icon.h>
56 #include <wx/msgdlg.h>
57 #include <wx/checkbox.h>
58 #include <wx/listbox.h>
59 
61 
62 
63 IMPLEMENT_DYNAMIC_CLASS( COpenDlg, CDialog )
64 
65 BEGIN_EVENT_TABLE( COpenDlg, CDialog )
66 ////@begin COpenDlg event table entries
67  EVT_LISTBOX( ID_option_list, COpenDlg::OnOptionListSelected )
68  EVT_BUTTON( wxID_BACKWARD, COpenDlg::OnBackwardClick )
69  EVT_BUTTON( wxID_FORWARD, COpenDlg::OnForwardClick )
70  EVT_BUTTON( wxID_CANCEL, COpenDlg::OnCancelClick )
71 ////@end COpenDlg event table entries
72  EVT_BUTTON( ID_SKIP, COpenDlg::OnSkipClick )
73 
74  EVT_LIST_ITEM_ACTIVATED(wxID_ANY, COpenDlg::OnListItemActivate)
75 
77 
79 {
80  Init();
81 }
82 
83 
84 COpenDlg::COpenDlg( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
85 {
86  Init();
87  Create(parent, id, caption, pos, size, style);
88 }
89 
90 
91 bool COpenDlg::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
92 {
93 ////@begin COpenDlg creation
94  SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
95  CDialog::Create( parent, id, caption, pos, size, style );
96 
98  Centre();
99 ////@end COpenDlg creation
100 
101  SetMinSize(ConvertDialogToPixels(SYMBOL_COPENDLG_SIZE));
102 
103  return true;
104 }
105 
106 
108 {
109 ////@begin COpenDlg destruction
110 ////@end COpenDlg destruction
111 }
112 
113 
115 {
116 ////@begin COpenDlg member initialisation
117  m_BaseTitle = wxT("Open");
118  m_Splitter = NULL;
119  m_OptionList = NULL;
120  m_BackBtn = NULL;
121  m_NextBtn = NULL;
122 ////@end COpenDlg member initialisation
123 
125  m_SrvLocator = NULL;
126  m_RequestedManager = -1;
127  m_CurrManager = -1;
128  m_CurrPanel = NULL;
129  m_OpenExportFolder = nullptr;
130 }
131 
132 namespace
133 {
134  class CUnfocusedListBox : public wxListBox
135  {
136  public:
137  CUnfocusedListBox(wxWindow *parent, wxWindowID id,
138  const wxPoint& pos, const wxSize& size, const wxArrayString &choices, long style)
139  {
140  Create(parent, id, pos, size, choices, style);
141  }
142 
143  virtual bool AcceptsFocus() const { return false; }
144  };
145 }
146 
147 static const char* kExportOpenFolderTag = "GBENCH.Application.ExportOpenFolder";
148 
150 {
151 ////@begin COpenDlg content construction
152  COpenDlg* itemCDialog1 = this;
153 
154  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
155  itemCDialog1->SetSizer(itemBoxSizer2);
156 
157  m_Splitter = new CSplitter( itemCDialog1, ID_MAIN_PANEL, wxDefaultPosition, wxDLG_UNIT(itemCDialog1, wxSize(266, 184)), wxFULL_REPAINT_ON_RESIZE );
158  itemBoxSizer2->Add(m_Splitter, 1, wxGROW|wxALL, wxDLG_UNIT(itemCDialog1, wxSize(5, -1)).x);
159 
160  wxArrayString m_OptionListStrings;
161  m_OptionList = new CUnfocusedListBox( m_Splitter, ID_option_list, wxDefaultPosition, wxDLG_UNIT(m_Splitter, wxSize(120, 195)), m_OptionListStrings, wxLB_SINGLE );
162 
163  wxStaticLine* itemStaticLine5 = new wxStaticLine( itemCDialog1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
164  itemBoxSizer2->Add(itemStaticLine5, 0, wxGROW|wxALL, wxDLG_UNIT(itemCDialog1, wxSize(5, -1)).x);
165 
166  wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxHORIZONTAL);
167  itemBoxSizer2->Add(itemBoxSizer6, 0, wxGROW|wxLEFT|wxRIGHT, wxDLG_UNIT(itemCDialog1, wxSize(5, -1)).x);
168 
169  wxHyperlinkCtrl* itemHyperlinkCtrl7 = new wxHyperlinkCtrl( itemCDialog1, wxID_HELP, _("Help"), wxT("https://www.ncbi.nlm.nih.gov/tools/gbench"), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
170  itemHyperlinkCtrl7->SetForegroundColour(wxColour(192, 192, 192));
171  itemBoxSizer6->Add(itemHyperlinkCtrl7, 0, wxALIGN_CENTER_VERTICAL|wxALL, wxDLG_UNIT(itemCDialog1, wxSize(5, -1)).x);
172 
173  itemBoxSizer6->Add(wxDLG_UNIT(itemCDialog1, wxSize(2, -1)).x, wxDLG_UNIT(itemCDialog1, wxSize(-1, 2)).y, 1, wxALIGN_CENTER_VERTICAL|wxALL, wxDLG_UNIT(itemCDialog1, wxSize(5, -1)).x);
174 
175  wxBoxSizer* itemBoxSizer9 = new wxBoxSizer(wxHORIZONTAL);
176  itemBoxSizer6->Add(itemBoxSizer9, 0, wxALIGN_CENTER_VERTICAL, wxDLG_UNIT(itemCDialog1, wxSize(5, -1)).x);
177 
178  m_BackBtn = new wxButton( itemCDialog1, wxID_BACKWARD, _("< &Back"), wxDefaultPosition, wxDefaultSize, 0 );
179  itemBoxSizer9->Add(m_BackBtn, 0, wxALIGN_CENTER_VERTICAL|wxTOP|wxBOTTOM, wxDLG_UNIT(itemCDialog1, wxSize(5, -1)).x);
180 
181  // in wxCocoa, we get a little button overlap here without the spacer. I believe
182  // this is a bug, but we need to pad for now. The variable is added
183  // to create a syntax error if this is overwritten by DialogBlocks
184  bool spacer_code_included = true;
185 #ifdef __WXOSX_COCOA__
186  itemBoxSizer9->AddSpacer(6);
187 #endif
188 
189  m_NextBtn = new wxButton( itemCDialog1, wxID_FORWARD, _("&Next >"), wxDefaultPosition, wxDefaultSize, 0 );
190  m_NextBtn->SetDefault();
191  itemBoxSizer9->Add(m_NextBtn, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT|wxTOP|wxBOTTOM, wxDLG_UNIT(itemCDialog1, wxSize(5, -1)).x);
192 
193  wxButton* itemButton12 = new wxButton( itemCDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
194  itemBoxSizer6->Add(itemButton12, 0, wxALIGN_CENTER_VERTICAL|wxALL, wxDLG_UNIT(itemCDialog1, wxSize(5, -1)).x);
195 
196 ////@end COpenDlg content construction
197 
198  if (!spacer_code_included) {
199  // If spacer_code_included is not defined, it has been overwritten
200  // so you must add the following code after m_BackBtn is added and
201  // before m_NextBtn is added. We need this since that section of code
202  // can be overridden by DialogBlocks.
203  /*
204  // in wxCocoa, we get a little button overlap here without the spacer. I believe
205  // this is a bug, but we need to pad for now. The variable is added
206  // to create a syntax error if this is overwritten by DialogBlocks
207  bool spacer_code included = true;
208 #ifdef __WXOSX_COCOA__
209  itemBoxSizer9->AddSpacer(6);
210 #endif
211  */
212  }
213 
214  m_OptionList->SetFont(m_OptionList->GetFont().MakeLarger());
215 
216  // init Splitter
217  int sizes[3] = { 170, 250, -1 };
219 
220  m_OptionPanel = new wxPanel(m_Splitter, ID_OPTION_PANEL, wxDefaultPosition,
221  wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL );
222 
223  wxBoxSizer* itemBoxSizer_op = new wxBoxSizer(wxVERTICAL);
224  m_OptionPanel->SetSizer(itemBoxSizer_op);
225 
226  m_OpenExportFolder = new wxCheckBox(m_OptionPanel, ID_OPEN_FOLDER_CHECKBOX, _("Open export folder in a file browser"), wxDefaultPosition, wxDefaultSize, 0);
228  m_OpenExportFolder->Show(false);
229  itemBoxSizer_op->Add(m_OpenExportFolder, 0, wxALIGN_RIGHT | wxRIGHT, 5);
230 
233  //m_ExplainLink->SetVisitedColour(m_ExplainLink->GetNormalColour());
234 }
235 
236 
238 {
239  m_SrvLocator = srv_locator;
240 }
241 
242 
243 void COpenDlg::SetManagers(vector<TManagerRef>& managers)
244 {
246 
247  /// disconnect existing managers
248  for( size_t i = 0; i < m_Managers.size(); i++ ) {
249  TManagerRef manager = m_Managers[i];
250  manager->CleanUI();
251  manager->SetServiceLocator(NULL);
252  manager->SetParentWindow(NULL);
253  }
254 
255  m_Managers = managers;
256 
257  // initialize the new managers
258  for( size_t i = 0; i < m_Managers.size(); i++ ) {
259  TManagerRef manager = m_Managers[i];
260  manager->SetServiceLocator(m_SrvLocator);
261  manager->SetParentWindow(this);
262  manager->InitUI();
263  x_AppendOptionForManager(*manager);
264  }
265 
266  //if(m_Managers.size()) {
267  // x_SelectManager(0);
268  //}
269 }
270 
271 
272 void COpenDlg::SetFilenames(const vector<wxString>& filenames)
273 {
275 }
276 
277 
279 {
280  for( size_t i = 0; i < m_Managers.size(); i++ ) {
281  TManagerRef& manager = m_Managers[i];
282  string s = manager->GetDescriptor().GetLabel();
283  if(s == label) {
285  break;
286  }
287  }
288 }
289 
290 
292 {
293  x_UpdateButtons();
294  x_UpdateTitle();
295 }
296 
297 
299 {
300  wxDialog::InitDialog();
301 
302  LoadSettings();
303 
304  for( size_t i = 0; i < m_Managers.size(); i++ ) {
305  TManagerRef manager = m_Managers[i];
306 
307  CFileLoadManager* file_mgr = dynamic_cast<CFileLoadManager*>(manager.GetPointer());
308  if(file_mgr) {
309  file_mgr->SetDialog(this);
310 
311  if( ! m_Filenames.empty()) {
312  // D&D happened - activate the Manager for "File" option
313  m_CurrManager = -1; // to force update
314  x_SelectManager((int)i); // make it active
315  file_mgr->SetFilenames(m_Filenames);
316  return;
317  }
318  }
319  }
320 
321  // select the default manager
322  int index = max(m_CurrManager, 0); // do not allow -1
323  if(m_RequestedManager == -1) {
324  /// select the manager based on saved settings
325  m_CurrManager = -1; // to force update
326  x_SelectManager(index);
327  } else {
328  /// select the requested option (ignore settings)
329  m_CurrManager = -1; // to force update
331  }
332 }
333 
334 
336 {
337  return m_AppTask;
338 }
339 
340 
342 {
343  return true;
344 }
345 
346 
347 wxBitmap COpenDlg::GetBitmapResource( const wxString& name )
348 {
349  // Bitmap retrieval
350 ////@begin COpenDlg bitmap retrieval
351  wxUnusedVar(name);
352  return wxNullBitmap;
353 ////@end COpenDlg bitmap retrieval
354 }
355 
356 wxIcon COpenDlg::GetIconResource( const wxString& name )
357 {
358  // Icon retrieval
359 ////@begin COpenDlg icon retrieval
360  wxUnusedVar(name);
361  return wxNullIcon;
362 ////@end COpenDlg icon retrieval
363 }
364 
365 
367 {
368  if(m_CurrManager != index) {
369  x_SetCurrentPanel(NULL, true);
370 
371  m_CurrManager = index;
372  m_OptionList->SetSelection(m_CurrManager);
373  m_OptionList->Update();
374 
375  if(m_CurrManager != -1) {
376  wxBusyCursor wait;
377  wxPanel* panel = m_Managers[m_CurrManager]->GetCurrentPanel();
378  x_SetCurrentPanel(panel, true);
379  }
380 
381  x_UpdateTitle();
382  x_UpdateButtons();
383  }
384 }
385 
386 
387 // changes the panel displayed in the dialog
388 void COpenDlg::x_SetCurrentPanel(wxPanel* panel, bool firstPage)
389 {
390  // remove the old panel
391  if(m_CurrPanel) {
392  m_CurrPanel->Hide();
393  m_CurrPanel = NULL;
394  }
395 
396  m_Splitter->Show(firstPage);
397 
398  if (!panel)
399  return;
400  // insert the new panel
401 
402  if (firstPage) {
403  if (panel->GetParent() != m_OptionPanel) {
404  panel->Reparent(m_OptionPanel);
405  }
406 
407  if(panel->GetContainingSizer() != m_OptionPanel->GetSizer()) {
408  m_OptionPanel->GetSizer()->Insert(0, panel, 1, wxEXPAND | wxALL, 5);
409  }
410 
411  m_OpenExportFolder->Show(m_BaseTitle == "Export");
412  }
413  else {
414  if (panel->GetParent() != this) {
415  panel->Reparent(this);
416  }
417 
418  if (panel->GetContainingSizer() != GetSizer()) {
419  GetSizer()->Insert(0, panel, 1, wxEXPAND | wxALL, 5);
420  }
421  m_OpenExportFolder->Show(false);
422  }
423 
424  m_CurrPanel = panel;
425  m_CurrPanel->Show();
426  m_CurrPanel->SetFocus();
427 
428  firstPage ? m_OptionPanel->Layout() : this->Layout();
429 }
430 
431 
432 /// add a Loading Option (displayed in the list on the left) for the given Manager
434 {
435  const IUIObject& descr = manager.GetDescriptor();
436  m_OptionList->Append(wxString::FromUTF8(descr.GetLabel().c_str()));
437 }
438 
439 
440 void COpenDlg::OnOptionListSelected( wxCommandEvent& event )
441 {
442  int index = m_OptionList->GetSelection();
443  x_SelectManager(index);
444 }
445 
446 
447 void COpenDlg::OnSkipClick( wxCommandEvent& event )
448 {
450 }
451 
452 
453 void COpenDlg::OnBackwardClick( wxCommandEvent& event )
454 {
456 }
457 
458 
459 void COpenDlg::OnForwardClick( wxCommandEvent& event )
460 {
462 }
463 
464 
465 void COpenDlg::OnListItemActivate( wxListEvent& event )
466 {
468 }
469 
470 
472 {
474 
475  bool success = false;
476  string errMsg;
477 
478  try {
479  success = manager->DoTransition(action);
480  }
481  catch (const CException& e) {
482  errMsg = e.GetMsg();
483  }
484  catch (const exception& e) {
485  errMsg = e.what();
486  }
487 
488  if (!errMsg.empty()) {
489  wxMessageBox (ToWxString(errMsg), wxT("Error"), wxOK | wxICON_ERROR);
490  return;
491  }
492 
493  // if its file manager and table, hack in change??
494  if (success) {
495  if(manager->IsCompletedState()) {
496  if (m_BaseTitle == "Export")
499 
500  // launch the task
501  m_AppTask.Reset(manager->GetTask());
502 
503  // Report usage
504  const IUIObject& descriptor = manager->GetDescriptor();
505  const string& log_event = descriptor.GetLogEvent();
506  if (!log_event.empty()) {
507  REPORT_USAGE(log_event, .Add("tool_name", descriptor.GetLabel()));
508  }
509 
510  EndModal(wxID_OK);
511  } else {
512  /// show the panel for the next step
513  wxPanel* new_panel = manager->GetCurrentPanel();
514  if(new_panel != m_CurrPanel) {
515  x_SetCurrentPanel(new_panel, !manager->CanDo(IUIToolManager::eBack));
516  }
517  x_UpdateButtons();
518  }
519  }
520  else {
521  // For one of the manager - file loader - it may recognize a file type
522  // (bam or table) but not be able to load it with one of its file loading
523  // wizards. In that case, it sets an alternate tool manager from the
524  // set of open dialog managers in m_Managers and returns that as
525  // the 'algernate tool manager' This code switches to the alternate tool
526  // manager and sets filenames so the user doesn't have to type them
527  // in again.
528  IUIToolManager* alt_mgr = manager->GetAlternateToolManager();
529  if (alt_mgr != NULL && alt_mgr != manager.GetPointer()) {
530  for (size_t i=0; i<m_Managers.size(); ++i) {
531  if (m_Managers[i].GetPointer() == alt_mgr) {
532  CFileLoadManager* flm = dynamic_cast<CFileLoadManager*>(
533  m_Managers[m_CurrManager].GetPointer());
534 
535  if (flm != NULL) {
536  vector<wxString> fnames = flm->GetFilenames();
537 
538  //CBamUIDataSource* blm = dynamic_cast<CBamUIDataSource*>(alt_mgr);
539  //if (blm != NULL) {
540  // Initialize bam files here
541  //}
542  }
543  x_SelectManager(static_cast<int>(i));
544 
545  break;
546  }
547  }
548  }
549  }
550 }
551 
552 
554 {
556 
557  bool can_back = manager->CanDo(IUIToolManager::eBack);
558  //m_OptionList->Show( ! can_back);
559 
560  m_BackBtn->Show(can_back);
561  m_NextBtn->Show(manager->CanDo(IUIToolManager::eNext));
562  m_NextBtn->SetLabel(manager->IsFinalState() ? wxT("Finish") : wxT("Next >"));
563  Layout();
564 }
565 
566 
568 {
569  wxString title = m_BaseTitle;
570  if(m_CurrManager > -1) {
572  wxString s = ToWxString(manager->GetDescriptor().GetLabel());
573  if( ! s.empty()) {
574  title += wxT(" - ") + s;
575  }
576  }
577  SetTitle(title);
578 }
579 
580 
581 void COpenDlg::EndModal(int ret_code)
582 {
583  for (auto &manager: m_Managers) {
584  manager->ResetState();
585  }
586 
587  SaveSettings();
588 
589  // reset Managers
590  for (auto &manager : m_Managers) {
591  manager->CleanUI();
592  }
593 
594  wxDialog::EndModal(ret_code);
595 }
596 
597 
598 void COpenDlg::SetRegistryPath(const string& path)
599 {
601 
602  /// set Registry paths for all Managers
603  /// each Manager will get a section located under the dialog's section
604  for( size_t i = 0; i < m_Managers.size(); i++ ) {
605  TManagerRef manager = m_Managers[i];
606  IRegSettings* rgs = dynamic_cast<IRegSettings*>(manager.GetPointer());
607  if(rgs) {
608  string sub_section = manager->GetDescriptor().GetLabel();
609  string mgr_path = m_RegPath + "." + sub_section;
610  rgs->SetRegistryPath(mgr_path);
611  }
612  }
613 }
614 
615 
616 static const char* kSplitterWidthsTag = "SplitterWidths";
617 static const char* kSelOptionTag = "SelectedOption";
618 
620 {
621  // load splitter configuration
622  vector<int> widths;
623  view.GetIntVec(kSplitterWidthsTag, widths);
624  if (widths.size() == 2) {
625  m_Splitter->SetWidths(widths);
626  }
627 
628  // load the default option
629  string sel_mgr_label = view.GetString(kSelOptionTag, "empty");
630 
631  // load Managers' settings and find the selected manager
632  for (size_t i = 0; i < m_Managers.size(); i++) {
633  TManagerRef manager = m_Managers[i];
634  // load settings (if supported)
635  IRegSettings* rgs = dynamic_cast<IRegSettings*>(manager.GetPointer());
636  if (rgs) {
637  rgs->LoadSettings();
638  }
639  // check whether this is the selected manager
640  string mgr_label = manager->GetDescriptor().GetLabel();
641  if (mgr_label == sel_mgr_label) {
642  m_CurrManager = (int)i; // found the selected manager
643  }
644  }
645 }
646 
648 {
649  // save splitter configuration
650  vector<int> widths;
651  m_Splitter->GetWidths(widths);
652  view.Set(kSplitterWidthsTag, widths);
653 
654  // remember the selected option
655  if (m_CurrManager != -1) {
657  string mgr_label = manager->GetDescriptor().GetLabel();
658  view.Set(kSelOptionTag, mgr_label);
659  }
660 
661  // save Managers' settigns
662  for (size_t i = 0; i < m_Managers.size(); i++) {
663  TManagerRef manager = m_Managers[i];
664  IRegSettings* rgs = dynamic_cast<IRegSettings*>(manager.GetPointer());
665  if (rgs) {
666  rgs->SaveSettings();
667  }
668  }
669 }
670 
671 void COpenDlg::OnCancelClick( wxCommandEvent& event )
672 {
673 ////@begin wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL in COpenDlg.
674  // Before editing this code, remove the block markers.
675  event.Skip();
676 ////@end wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CANCEL in COpenDlg.
677 }
678 
679 
681 
682 
CDialog.
Definition: dialog.hpp:47
virtual void SaveSettings() const
Definition: dialog.cpp:67
virtual void SetRegistryPath(const string &path)
Definition: dialog.cpp:59
virtual void LoadSettings()
Definition: dialog.cpp:112
string m_RegPath
Definition: dialog.hpp:70
CFileLoadManager CFileLoadManager - a Loader Manager implementing "File" option in "Open" dialog.
void SetDialog(COpenDlg *dlg)
virtual void SetFilenames(vector< wxString > &filenames)
vector< wxString > GetFilenames() const
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
COpenDlg.
Definition: open_dlg.hpp:78
void x_SelectManager(int index)
Definition: open_dlg.cpp:366
static bool ShowToolTips()
Definition: open_dlg.cpp:341
bool Create(wxWindow *parent, wxWindowID id=ID_COPENDLG, const wxString &caption=_("Open"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(450, 275), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxMAXIMIZE_BOX|wxTAB_TRAVERSAL)
Definition: open_dlg.cpp:91
virtual void SelectOptionByLabel(const string &label)
select loading options By Extension ID
Definition: open_dlg.cpp:278
void CreateControls()
Definition: open_dlg.cpp:149
virtual void SetRegistryPath(const string &path)
Definition: open_dlg.cpp:598
void Init()
Definition: open_dlg.cpp:114
void x_UpdateTitle()
Definition: open_dlg.cpp:567
wxButton * m_BackBtn
Definition: open_dlg.hpp:125
int m_RequestedManager
if >= 0, than the dialog shall show a particualr option
Definition: open_dlg.hpp:181
virtual void x_SaveSettings(CRegistryWriteView view) const
Definition: open_dlg.cpp:647
@ ID_OPTION_PANEL
Definition: open_dlg.hpp:137
@ ID_OPEN_FOLDER_CHECKBOX
Definition: open_dlg.hpp:138
wxButton * m_NextBtn
Definition: open_dlg.hpp:126
void OnBackwardClick(wxCommandEvent &event)
Definition: open_dlg.cpp:453
IServiceLocator * m_SrvLocator
Definition: open_dlg.hpp:175
CSplitter * m_Splitter
Definition: open_dlg.hpp:123
void x_SetCurrentPanel(wxPanel *panel, bool firstPage)
Definition: open_dlg.cpp:388
void x_UpdateButtons()
Definition: open_dlg.cpp:553
virtual void InitDialog()
Definition: open_dlg.cpp:298
@ ID_option_list
Definition: open_dlg.hpp:132
@ ID_MAIN_PANEL
Definition: open_dlg.hpp:131
wxIcon GetIconResource(const wxString &name)
Definition: open_dlg.cpp:356
void OnListItemActivate(wxListEvent &event)
Definition: open_dlg.cpp:465
wxPanel * m_CurrPanel
Definition: open_dlg.hpp:186
vector< wxString > m_Filenames
Definition: open_dlg.hpp:183
virtual void x_LoadSettings(const CRegistryReadView &view)
override these functions in derived classes
Definition: open_dlg.cpp:619
virtual void Update()
Definition: open_dlg.cpp:291
void OnForwardClick(wxCommandEvent &event)
Definition: open_dlg.cpp:459
void OnCancelClick(wxCommandEvent &event)
Definition: open_dlg.cpp:671
virtual void SetManagers(vector< TManagerRef > &managers)
Definition: open_dlg.cpp:243
virtual void SetFilenames(const vector< wxString > &filenames)
Definition: open_dlg.cpp:272
wxListBox * m_OptionList
Definition: open_dlg.hpp:124
vector< TManagerRef > m_Managers
Load Managers corresponding to Loading Options.
Definition: open_dlg.hpp:178
COpenDlg()
Definition: open_dlg.cpp:78
void x_DoTransition(IUIToolManager::EAction action)
Definition: open_dlg.cpp:471
void OnOptionListSelected(wxCommandEvent &event)
Definition: open_dlg.cpp:440
wxPanel * m_OptionPanel
Definition: open_dlg.hpp:187
virtual void EndModal(int ret_code)
Definition: open_dlg.cpp:581
wxString m_BaseTitle
Definition: open_dlg.hpp:128
wxCheckBox * m_OpenExportFolder
Definition: open_dlg.hpp:188
wxBitmap GetBitmapResource(const wxString &name)
Definition: open_dlg.cpp:347
void x_AppendOptionForManager(IUIToolManager &manager)
add a Loading Option (displayed in the list on the left) for the given Manager
Definition: open_dlg.cpp:433
virtual CIRef< IAppTask > GetLoadingTask()
Definition: open_dlg.cpp:335
CIRef< IAppTask > m_AppTask
Definition: open_dlg.hpp:190
int m_CurrManager
Definition: open_dlg.hpp:185
void OnSkipClick(wxCommandEvent &event)
Definition: open_dlg.cpp:447
virtual void SetServiceLocator(IServiceLocator *srv_locator)
Definition: open_dlg.cpp:237
class CRegistryReadView provides a nested hierarchical view at a particular key.
Definition: reg_view.hpp:58
void GetIntVec(const string &key, vector< int > &val) const
Definition: reg_view.cpp:252
string GetString(const string &key, const string &default_val=kEmptyStr) const
Definition: reg_view.cpp:246
void Set(const string &key, int val)
access a named key at this level, with no recursion
Definition: reg_view.cpp:533
CSplitter - container with resizable separators.
Definition: splitter.hpp:54
virtual bool Show(bool show=true)
Definition: splitter.cpp:612
bool InsertToCell(wxWindow *child, int col, int row)
If cell [col, row] exists and vacant - adds widget to the container.
Definition: splitter.cpp:374
void GetWidths(TPosVector &widths) const
Definition: splitter.cpp:291
void SetWidths(const TPosVector &widths)
Definition: splitter.cpp:297
@ eHorizontal
vertical space is splitted
Definition: splitter.hpp:64
virtual void Split(ESplitType type)
Creates a splitter with a single cell.
Definition: splitter.cpp:147
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
IUIObject - object that provides basic properties often required in a UI object.
Definition: ui_object.hpp:63
virtual const IUIObject & GetDescriptor() const =0
Returns the object describing this tool (UI meta data).
#define _(proto)
Definition: ct_nlmzip_i.h:78
static void Init(void)
Definition: cursor6.c:76
#define NULL
Definition: ncbistd.hpp:225
const string & GetMsg(void) const
Get message string.
Definition: ncbiexpt.cpp:461
virtual const char * what(void) const noexcept
Standard report (includes full backlog).
Definition: ncbiexpt.cpp:342
virtual const string & GetLogEvent() const =0
virtual const string & GetLabel() 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[]
unsigned int
A callback function used to compare two keys in a database.
Definition: types.hpp:1210
END_EVENT_TABLE()
int i
#define wxT(x)
Definition: muParser.cpp:41
const struct ncbi::grid::netcache::search::fields::SIZE size
T max(T x_, T y_)
static const char * kExportOpenFolderTag
Definition: open_dlg.cpp:147
static const char * kSplitterWidthsTag
Definition: open_dlg.cpp:616
static const char * kSelOptionTag
Definition: open_dlg.cpp:617
#define SYMBOL_COPENDLG_SIZE
Definition: open_dlg.hpp:65
#define ID_SKIP
Definition: open_dlg.hpp:68
static int filenames
Definition: pcregrep.c:172
static static static wxID_ANY
#define _ASSERT
static void SetTitle(CRef< CSeq_entry > entry, string title)
#define REPORT_USAGE(event, args)
Convenience macro to log usage statisitics.
wxString ToWxString(const string &s)
Definition: wx_utils.hpp:173
Modified on Sun Jul 14 04:54:01 2024 by modify_doxy.py rev. 669887