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

Go to the SVN repository for this file.

1 /* $Id: gui.cpp 39670 2017-10-25 18:01:21Z katargir $
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: Andrey Yazhuk
27  *
28  */
29 
30 #include <ncbi_pch.hpp>
31 #include <corelib/ncbistd.hpp>
32 #include <corelib/ncbitime.hpp>
33 #include <util/thread_pool.hpp>
34 
36 
38 
46 
51 
52 #include <gui/widgets/wx/dock_frames.hpp> //TODO
53 
55 
57 
58 #include <wx/menu.h>
59 #include <wx/log.h>
60 #include <wx/msgdlg.h>
61 #include <wx/toolbar.h>
62 #include <wx/dnd.h>
63 
64 
67 
68 
69 ///////////////////////////////////////////////////////////////////////////////
70 /// CFrameworkDemoGUIDropTarget
71 ///
72 /// An example of how File D&D can be handled in an application.
73 class CFrameworkDemoGUIDropTarget : public wxDropTarget
74 {
75 public:
77  : m_GUI(gui)
78  {
79  SetDataObject(new wxFileDataObject);
80  }
81 
82  virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def)
83  {
84  if ( !GetData() )
85  return wxDragNone;
86 
87  wxFileDataObject* dobj = (wxFileDataObject *)m_dataObject;
88 
89  if(dobj && (def == wxDragMove || def == wxDragCopy)) {
90  wxArrayString filenames = dobj->GetFilenames();
91  vector<string> names;
93 
94  // here we can do something usefull with the filenames
95  string s = "The following files were dropped into the application:";
96  for( size_t i = 0; i < names.size(); i++ ) {
97  s += "\n" + names[i];
98  }
99  wxMessageBox(ToWxString(s));
100  return def;
101  }
102  return wxDragError;
103  }
104 protected:
106 };
107 
108 ///////////////////////////////////////////////////////////////////////////////
109 ///
110 
111 static int const kDiagTimerID = 1;
112 static int const kStatusTimerID = 2;
113 
114 BEGIN_EVENT_TABLE(CFrameworkDemoGUI, wxEvtHandler)
120  //EVT_MENU( eCmdCreateTextCtrl, CFrameworkDemoGUI::OnCreateTextCtrlClick )
121  //EVT_MENU( eCmdCreateHTMLView, CFrameworkDemoGUI::OnCreateHTMLViewClick )
122  //EVT_MENU( eCmdCreateTreeCtrl, CFrameworkDemoGUI::OnCreateTreeControlClick )
136 
137 
139 : m_Timer(this, kDiagTimerID),
140  m_DiagnosticsTesting(true),
141  m_StatusTimer(this, kStatusTimerID),
142  m_ProgressStage(-1)
143 {
144 }
145 
146 
147 void CFrameworkDemoGUI::SetRegistryPath(const string& reg_path)
148 {
149  m_RegPath = reg_path;
150 }
151 
152 
154 {
155  m_Workbench = workbench;
156 }
157 
158 
160 {
161  return "GUI Framework Demo";
162 }
163 
164 
166 {
168 
169  // register Commands
171 
172  // Connect to Menu Service
173  IMenuService* menu_srv = m_Workbench->GetMenuService();
174  menu_srv->AddContributor(this);
175  menu_srv->ResetMenuBar();
176 
177  // Connect to ToolBar Service
180 
182  factory->RegisterImageAliases(provider);
183 
184  tb_srv->AddToolBarFactory(factory);
185 
186  /// TODO
187  /// Connect Window Manager Service
189  wm_srv->SetAdvisor(this);
190 
191  //TODO
192  IMenuContributor* contributor = dynamic_cast<IMenuContributor*>(wm_srv);
193  menu_srv->AddContributor(contributor);
194 
195  // connect itself to event handling
196  m_Workbench->GetMainWindow()->PushEventHandler(this);
197 
198  m_Workbench->GetMainWindow()->SetDropTarget(new CFrameworkDemoGUIDropTarget(*this));
199 }
200 
201 
202 static const char* kDefLayoutTag = "DefaultLayout";
203 
205 {
206  // Register view factories
207  if (m_Workbench) {
209 
210  manager->RegisterFactory(*new CwxGLTestViewFactory());
211  manager->RegisterFactory(*new CClockViewFactory());
212  }
213 }
214 
215 
217 {
218  if( ! m_RegPath.empty()) {
220  CRegistryReadView view = gui_reg.GetReadView(m_RegPath);
221 
222  /// load default window layout
223  LOG_POST(Info << "Loading default window layout");
225  CConstRef<objects::CUser_field> field = view.GetField("Layouts");
226 
227  if(field && field->HasField(kDefLayoutTag)) {
228  /// create windows
229  LOG_POST(Info << "Creating default window layout");
230  const CUser_object& layout = field->GetField(kDefLayoutTag).GetData().GetObject();
232  IWMClientFactory* factory = dynamic_cast<IWMClientFactory*>(view_mrg);
233  _ASSERT(factory);
234  wm_srv->LoadLayout(layout, *factory);
235  }
236  }
237 }
238 
239 
241 {
242  x_CloseAllViews();
243 
244  //here we can unregister application-specific services
245 }
246 
247 
249 {
250  // disconnect from event handling
251  m_Workbench->GetMainWindow()->RemoveEventHandler(this);
252 
253  // unsubscribe from menus
254  IMenuService* menu_srv = m_Workbench->GetMenuService();
255  menu_srv->RemoveContributor(this);
256 
257  /// Disconnect Window Manager Service
259  wm_srv->SetAdvisor(NULL);
260 
261  IMenuContributor* contributor = dynamic_cast<IMenuContributor*>(wm_srv);
262  menu_srv->RemoveContributor(contributor);
263 
264  // toolbar factory will be deleted by ToolBar Service
265 }
266 
267 
269 {
270  return true;
271 }
272 
273 
274 /*void CFrameworkDemoGUI::SetMenuService(IMenuService* service)
275 {
276  m_MenuService = service;
277 }*/
278 
279 
281 {
284 
285  // fisrt we call functions that register standard commands provided by the
286  // libraries we depend on
287  WidgetsWx_RegisterCommands(cmd_reg, provider);
288 
289  // now register our own application commands
290  cmd_reg.RegisterCommand(eCmdCreateOpenGLView, "Create OpenGL View", "Create OpenGL View",
291  "", "");
292  cmd_reg.RegisterCommand(eCmdCreateTaskView, "Create Task View", "Create Task View",
293  "", "");
294  cmd_reg.RegisterCommand(eCmdCreateEventView, "Create Event View", "Create Event View",
295  "", "");
296  cmd_reg.RegisterCommand(eCmdCreateDiagConsole, "Create Diagnostic Console", "Create Diagnostic Console",
297  "", "");
298  /*cmd_reg.RegisterCommand(eCmdCreateTextCtrl, "Create Text View", "Create Text View",
299  "Creates and instance of Text View", "");
300  cmd_reg.RegisterCommand(eCmdCreateHtmlView, "Create HTML View", "Create HTML View",
301  "Creates an instance of HTML View", "");
302  cmd_reg.RegisterCommand(eCmdCreateClockView, "Create Clock View", "Create Clock View","", "");*/
303 
304  cmd_reg.RegisterCommand(eCmdCloseView, "Close View", "Close View",
305  "", "");
306  cmd_reg.RegisterCommand(eCmdCloseAllViews, "Close All Views", "Close All Views",
307  "", "");
308  cmd_reg.RegisterCommand(eCmdSaveLayout, "Save Layout", "Save Layout",
309  "", "");
310  cmd_reg.RegisterCommand(eCmdRestoreLayout, "Restore Layout", "Restore Layout",
311  "", "");
312  cmd_reg.RegisterCommand(eCmdTestDiagPanel, "Test Diagnostic Console", "",
313  "", "");
314  cmd_reg.RegisterCommand(eCmdTestStatusProgress, "Test Status Progress", "",
315  "", "");
316 }
317 
318 
319 // the preferred way to defines statc menus is using static declarations (see below)
320 WX_DEFINE_MENU(kMainMenu)
321  WX_SUBMENU("&File")
322  WX_MENU_ITEM(wxID_EXIT)
324  WX_SUBMENU("&Edit")
325  WX_MENU_ITEM(wxID_CUT)
326  WX_MENU_ITEM(wxID_COPY)
327  WX_MENU_ITEM(wxID_PASTE)
329  WX_SUBMENU("&View")
334  //WX_MENU_ITEM(eCmdCreateTextCtrl)
335  //WX_MENU_ITEM(eCmdCreateHtmlView)
337  WX_SUBMENU("&Window")
338  WX_MENU_SEPARATOR_L("Actions")
341  WX_MENU_SEPARATOR_L("Actions2")
344  WX_MENU_SEPARATOR_L("Windows")
346 WX_END_MENU()
347 
348 
349 const wxMenu* CFrameworkDemoGUI::GetMenu()
350 {
351  // Use CUICommandRegistry to create the menu from the static definition
353  wxMenu* menu = cmd_reg.CreateMenu(kMainMenu);
354  return menu;
355 }
356 
357 
358 /*void CFrameworkDemoGUI::UpdateMenuBar(wxMenu& menu)
359 {
360 }*/
361 
362 
364 {
366  IView* view = dynamic_cast<IView*>(client);
367  if(view) {
368  manager->AddToWorkbench(*view);
369  }
370 }
371 
372 
373 void CFrameworkDemoGUI::x_AddView(const string& view_ui_name)
374 {
376 
377  CIRef<IView> view = manager->CreateViewInstance(view_ui_name);
378 
379  if(view) {
380  /// create wxWindow for the view
381  view->CreateViewWindow(x_GetMainWindow());
382  manager->AddToWorkbench(*view);
383  }
384 }
385 
386 
387 void CFrameworkDemoGUI::x_ShowSingletonView(const string& view_ui_name)
388 {
390 
391  IView* view = manager->GetSingletonView(view_ui_name);
392  if(view) {
393  // activate existing view
395  IWMClient* client = dynamic_cast<IWMClient*>(view);
396 
397  _ASSERT(client);
398 
399  srv->ActivateClient(*client);
400  } else {
401  // create a new view
402  x_AddView(view_ui_name);
403  }
404 }
405 
406 
408 {
409  return m_Workbench->GetMainWindow();
410 }
411 
412 
413 void CFrameworkDemoGUI::OnCreateClockViewClick(wxCommandEvent& event)
414 {
415  x_AddView("Clock View");
416 }
417 
418 
419 /*void CFrameworkDemoGUI::OnCreateHTMLViewClick(wxCommandEvent& event)
420 {
421 
422  _ASSERT(false); // not implemented
423 }
424 
425 
426 void CFrameworkDemoGUI::OnCreateTreeControlClick(wxCommandEvent& event)
427 {
428  _ASSERT(false); // not implemented
429 }
430 
431 
432 *void CFrameworkDemoGUI::OnCreateTextCtrlClick(wxCommandEvent& event)
433 {
434  _ASSERT(false); // not implemented/
435 }*/
436 
437 
439 {
440  x_AddView("OpenGL Test View");
441 }
442 
443 
445 {
446  x_ShowSingletonView("Diagnostic Console");
447 }
448 
449 
450 void CFrameworkDemoGUI::OnCreateEventViewClick(wxCommandEvent& event)
451 {
452  x_ShowSingletonView("Event View");
453 }
454 
455 
456 void CFrameworkDemoGUI::OnCreateTaskViewClick(wxCommandEvent& event)
457 {
458  x_ShowSingletonView("Task View");
459 }
460 
461 
462 void CFrameworkDemoGUI::OnCloseViewClick(wxCommandEvent& event)
463 {
465  IWMClient* client = srv->GetActiveClient();
466  if(client) {
467  srv->CloseClient(*client);
468  }
469 }
470 
471 
472 void CFrameworkDemoGUI::OnCloseAllViewsClick(wxCommandEvent& event)
473 {
474  x_CloseAllViews();
475 }
476 
477 
479 {
481 
483  vector<IWMClient*> clients;
484  wm_srv->GetAllClients(clients);
485 
486  OnCloseClientsRequest(clients);
487 }
488 
489 
490 void CFrameworkDemoGUI::OnTestDiagPanelClick(wxCommandEvent& event)
491 {
494  m_Timer.Start(100);
495  else
496  m_Timer.Stop();
497 }
498 
499 
500 
501 void CFrameworkDemoGUI::OnTestDiagPanelUpdate( wxUpdateUIEvent& event )
502 {
503  wxString text = (m_DiagnosticsTesting) ?
504  _("Stop Diagnostics Testing") : _("Start Diagnostics Testing");
505  event.SetText(text);
506 }
507 
508 
509 void CFrameworkDemoGUI::OnDiagnosticsTimer(wxTimerEvent& event)
510 {
511  static int counter = 1;
512  int val = (rand()%7);
513  if (val&4) {
514  switch(val&3) {
515  case 3:
516  wxLogDebug(wxT("wxWidgets Debug %d"), counter);
517  break;
518  case 2:
519  wxLogMessage(wxT("wxWidgets Info %d"), counter);
520  break;
521  case 1:
522  wxLogWarning(wxT("wxWidgets Warning %d"), counter);
523  break;
524  default:
525  wxLogError(wxT("wxWidgets Error %d"), counter);
526  break;
527  }
528  }
529  else {
530  CNcbiDiag diag;
531  switch(val&3) {
532  case 3:
533  diag << Trace;
534  diag << "NCBI Trace " << counter << Endm;
535  break;
536  case 2:
537  diag << Info;
538  diag << "NCBI Info " << counter << Endm;
539  break;
540  case 1:
541  diag << Warning;
542  diag << "NCBI Warning " << counter << Endm;
543  break;
544  default:
545  diag << Error;
546  diag << "NCBI Error " << counter << Endm;
547  break;
548  }
549  }
550  counter++;
551 }
552 
553 
554 void CFrameworkDemoGUI::OnStatusTimer(wxTimerEvent& event)
555 {
557 
558  if(m_ProgressStage <= 10) {
559  if(m_ProgressStage == 0) { // just starting
560  sb_srv->SetStatusMessage("Testing progress bar - regular mode");
561  }
562 
563  sb_srv->ShowStatusProgress(m_ProgressStage, 10);
564  m_ProgressStage++;
565  } else if(m_ProgressStage < 20) {
566  if(m_ProgressStage == 11) { // just starting pulse mode
567  sb_srv->SetStatusMessage("Testing progress bar - pulse mode");
568 
569  }
570  sb_srv->ShowStatusProgress(); // call this on every tick
571  m_ProgressStage++;
572  } else {
573  m_StatusTimer.Stop();
574  sb_srv->HideStatusProgress();
575  sb_srv->SetStatusMessage("");
576 
577  m_ProgressStage = -1;
578  }
579 }
580 
581 
583 {
584  /// close clients unconditionally
585  //IWindowManagerService* wm_srv = m_Workbench->GetWindowManagerService();
586  //wm_srv->CloseClients(clients);
588  for( size_t i = 0; i < clients.size(); i++ ) {
589  IWMClient* client = clients[i];
590  IView* view = dynamic_cast<IView*>(client);
591  if(view) {
592  manager->RemoveFromWorkbench(*view);
593  }
594  }
595 }
596 
597 
599 {
600  LOG_POST(Info << "CFrameworkDemoGUI::OnClientAboutToClose()");
601 }
602 
603 
605 {
606  LOG_POST(Info << "CFrameworkDemoGUI::OnClientClosed()");
607 }
608 
609 
611 {
612  LOG_POST(Info << "CFrameworkDemoGUI::OnActiveClientChanged()");
613 }
614 
615 
617 {
618  return GetAppTitle();
619 }
620 
621 
623 {
624  if(client) {
626  wm_srv->ActivateClient(*client);
627  }
628 }
629 
630 
631 void CFrameworkDemoGUI::OnSaveLayoutClick(wxCommandEvent& event)
632 {
634  m_Layout.Reset(wm_srv->SaveLayout());
635 }
636 
637 
638 void CFrameworkDemoGUI::OnSaveLayoutUpdate( wxUpdateUIEvent& event )
639 {
640 }
641 
642 
643 void CFrameworkDemoGUI::OnRestoreLayoutClick(wxCommandEvent& event)
644 {
647  IWMClientFactory* factory = dynamic_cast<IWMClientFactory*>(view_mrg);
648 
649  _ASSERT(wm_srv && factory);
650 
651  wm_srv->CloseAllClients();
652  wm_srv->LoadLayout(*m_Layout, *factory);
653 }
654 
655 
656 void CFrameworkDemoGUI::OnRestoreLayoutUpdate( wxUpdateUIEvent& event )
657 {
658  event.Enable(m_Layout.NotEmpty());
659 }
660 
661 
662 void CFrameworkDemoGUI::OnTestStatusProgress(wxCommandEvent& event)
663 {
664  m_ProgressStage = 0;
665  m_StatusTimer.Start(250);
666 }
667 
668 
670 {
671  event.Enable(m_ProgressStage < 0);
672 }
673 
674 
675 ///////////////////////////////////////////////////////////////////////////////
676 /// CFrameworkDemoToolBarFactory
677 
679 {
680  provider.RegisterFileAlias(wxT("about"), wxT("about.png"));
681  // other icons already registered
682 }
683 
684 
685 static const char* kTBViews = "Views";
686 
688 {
689  names.push_back(kTBViews);
690 }
691 
692 
693 wxAuiToolBar* CFrameworkDemoToolBarFactory::CreateToolBar(const string& name, wxWindow* parent)
694 {
695  if(name == kTBViews) {
696  long style = wxTB_HORIZONTAL | wxTB_FLAT | wxTB_TEXT | wxTB_HORZ_LAYOUT | wxTB_NODIVIDER;
697  wxAuiToolBar* toolbar = new wxAuiToolBar(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, style);
698  toolbar->SetMargins(4, 4);
699 
700  /*toolbar->AddTool(ID_CREATE_TEXT_CTRL, wxT("Text Ctrl"), wxArtProvider::GetBitmap("menu::about"));
701  toolbar->AddTool(ID_CREATE_HTML_VIEW, wxT("HTML View"), wxArtProvider::GetBitmap("menu::search"));
702  toolbar->AddTool(ID_CREATE_TREE_CONTROL, wxT("Tree Ctrl"), wxArtProvider::GetBitmap("menu::zoom_in"));
703  toolbar->AddTool(ID_CREATE_CLOCK_VIEW, wxT("Clock View"), wxArtProvider::GetBitmap("menu::zoom_out"));*/
704  toolbar->AddTool(eCmdCreateOpenGLView, wxT("OpenGL View"),
705  wxArtProvider::GetBitmap(wxT("menu::zoom_all")));
706 
707  toolbar->Realize();
708  return toolbar;
709  }
710  return NULL;
711 }
712 
713 
714 
EVT_UPDATE_UI(eCmdAlnShowMethodsDlg, CAlnMultiWidget::OnUpdateShowMethodDlg) EVT_UPDATE_UI(eCmdMethodProperties
CClockViewFactory.
Definition: test_views.hpp:130
CFrameworkDemoGUIDropTarget.
Definition: gui.cpp:74
CFrameworkDemoGUIDropTarget(CFrameworkDemoGUI &gui)
Definition: gui.cpp:76
virtual wxDragResult OnData(wxCoord x, wxCoord y, wxDragResult def)
Definition: gui.cpp:82
CFrameworkDemoGUI & m_GUI
Definition: gui.cpp:105
CFrameworkDemoFrame.
Definition: gui.hpp:79
wxWindow * x_GetMainWindow()
Definition: gui.cpp:407
void OnCloseViewClick(wxCommandEvent &event)
Definition: gui.cpp:462
void OnRestoreLayoutUpdate(wxUpdateUIEvent &event)
Definition: gui.cpp:656
void OnCreateOpenglViewClick(wxCommandEvent &event)
Definition: gui.cpp:438
void ActivateClient(IWMClient *client)
Definition: gui.cpp:622
virtual void PostInit()
called after Workbench initialization has been completed
Definition: gui.cpp:204
virtual void PreShutDown()
called by Workbench before starting ShutDown
Definition: gui.cpp:240
void x_ShowSingletonView(const string &view_ui_name)
Definition: gui.cpp:387
void OnSaveLayoutUpdate(wxUpdateUIEvent &event)
Definition: gui.cpp:638
void OnShowDiagnosticsConsoleClick(wxCommandEvent &event)
Definition: gui.cpp:444
virtual void OnActiveClientChanged(IWMClient *new_active)
called when Active Client is changed (i.e. focus goes into another client)
Definition: gui.cpp:610
virtual string GetAppTitle()
get application title
Definition: gui.cpp:159
void OnCreateEventViewClick(wxCommandEvent &event)
Definition: gui.cpp:450
virtual bool CanShutDown()
Definition: gui.cpp:268
virtual void PostCreateWindow()
called by Workbench after creating main app window
Definition: gui.cpp:165
void OnCloseAllViewsClick(wxCommandEvent &event)
Definition: gui.cpp:472
void OnTestStatusProgressUpdate(wxUpdateUIEvent &event)
Definition: gui.cpp:669
bool m_DiagnosticsTesting
Definition: gui.hpp:173
void OnTestDiagPanelClick(wxCommandEvent &event)
Definition: gui.cpp:490
virtual void OnCloseClientsRequest(const TClients &clients)
indicates that user requested closing the following clients (by pressing a "close" button,...
Definition: gui.cpp:582
virtual void OnClientAboutToClose(IWMClient &client)
called before removing the client
Definition: gui.cpp:598
void OnCreateClockViewClick(wxCommandEvent &event)
Definition: gui.cpp:413
int m_ProgressStage
Definition: gui.hpp:176
void x_RegisterCommands()
Definition: gui.cpp:280
virtual void SetWorkbench(IWorkbench *workbench)
Definition: gui.cpp:153
void x_CloseAllViews()
Definition: gui.cpp:478
void OnCreateTaskViewClick(wxCommandEvent &event)
Definition: gui.cpp:456
void OnDiagnosticsTimer(wxTimerEvent &event)
Definition: gui.cpp:509
void OnRestoreLayoutClick(wxCommandEvent &event)
Definition: gui.cpp:643
void OnTestStatusProgress(wxCommandEvent &event)
Definition: gui.cpp:662
wxTimer m_Timer
Definition: gui.hpp:172
virtual void OnClientClosed(IWMClient &client)
called after the client has been removed
Definition: gui.cpp:604
void x_AddClient(IWMClient *client)
Definition: gui.cpp:363
CRef< objects::CUser_object > m_Layout
Definition: gui.hpp:178
virtual void RestoreWindowLayout()
Definition: gui.cpp:216
virtual void SetRegistryPath(const string &path)
Definition: gui.cpp:147
void OnSaveLayoutClick(wxCommandEvent &event)
Definition: gui.cpp:631
void x_AddView(const string &view_ui_name)
Definition: gui.cpp:373
wxTimer m_StatusTimer
Definition: gui.hpp:175
void OnTestDiagPanelUpdate(wxUpdateUIEvent &event)
Definition: gui.cpp:501
virtual string GetFloatingFrameTitle(int index)
returns the title for the floating frames created by the Window Manager
Definition: gui.cpp:616
void OnStatusTimer(wxTimerEvent &event)
Definition: gui.cpp:554
IWorkbench * m_Workbench
Definition: gui.hpp:170
virtual void PreDestroyWindow()
called by Workbench before destroying main app window
Definition: gui.cpp:248
string m_RegPath
Definition: gui.hpp:168
CFrameworkDemoToolBarFactory.
Definition: gui.hpp:186
void RegisterImageAliases(wxFileArtProvider &provider)
CFrameworkDemoToolBarFactory.
Definition: gui.cpp:678
virtual wxAuiToolBar * CreateToolBar(const string &name, wxWindow *parent)
creates a toolbar with the given name (must be deleted by the caller)
Definition: gui.cpp:693
virtual void GetToolBarNames(vector< string > &names)
returns the names of toolbars produced
Definition: gui.cpp:687
static CGuiRegistry & GetInstance()
access the application-wide singleton
Definition: registry.cpp:400
CRegistryReadView GetReadView(const string &section) const
get a read-only view at a particular level.
Definition: registry.cpp:428
CNcbiDiag –.
Definition: ncbidiag.hpp:924
class CRegistryReadView provides a nested hierarchical view at a particular key.
Definition: reg_view.hpp:58
CConstRef< objects::CUser_field > GetField(const string &key) const
provide raw field access
Definition: reg_view.cpp:104
CUICommandRegistry is a centralized registry where all application commands should be registered.
Definition: ui_command.hpp:146
static CUICommandRegistry & GetInstance()
the main instance associated with the application
Definition: ui_command.cpp:176
wxMenu * CreateMenu(const SwxMenuItemRec *items)
create a menu from a static definition (see WX_*_MENU macros)
Definition: ui_command.cpp:349
int RegisterCommand(CUICommand *cmd)
assumes ownership of the given object returns a command id (useful when registry is used for auto id ...
Definition: ui_command.cpp:198
CwxGLTestViewFactory.
Definition: test_views.hpp:90
IMenuContributor - contributes menu to Menu Service.
Definition: ui_command.hpp:371
IMenuService - Menu Service.
IToolBarService.
IViewManagerService IViewManagerService manages views in Workbench.
IView - represents a standard visual part of Workbench UI.
Definition: view.hpp:73
IWMClientFactory - IWMClient factory.
Definition: wm_client.hpp:133
IWClient - abstract Window Manager client.
Definition: wm_client.hpp:50
vector< IWMClient * > TClients
IWindowManagerService Window Manager Service provides access to Window Manager functionality.
IWorkbench is the central interface in the application framework.
Definition: workbench.hpp:113
virtual void RegisterFileAlias(const wxArtID &anId, const wxArtClient &aClient, const wxSize &aSize, const wxString &aName, long aType=wxBITMAP_TYPE_ANY, int anIndex=-1)
Include a standard set of the NCBI C++ Toolkit most basic headers.
#define _(proto)
Definition: ct_nlmzip_i.h:78
static const struct name_t names[]
#define true
Definition: bool.h:35
#define NULL
Definition: ncbistd.hpp:225
#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
void Error(CExceptionArgs_Base &args)
Definition: ncbiexpt.hpp:1197
void Trace(CExceptionArgs_Base &args)
Definition: ncbiexpt.hpp:1179
void Warning(CExceptionArgs_Base &args)
Definition: ncbiexpt.hpp:1191
void Info(CExceptionArgs_Base &args)
Definition: ncbiexpt.hpp:1185
virtual wxFrame * GetMainWindow()=0
returns a pointer to the main application frame window
virtual void HideStatusProgress()=0
virtual IToolBarService * GetToolBarService()=0
virtual void RegisterFactory(IViewFactory &factory)=0
assumes ownership of the factory
virtual IMenuService * GetMenuService()=0
virtual CUICommandRegistry & GetUICommandRegistry()=0
returns an instance of Command Registry associated with the Workbench
virtual void AddToWorkbench(IView &view, bool bFloat=false)=0
adds view to Workbench and connects to the services the view must be already initialized
virtual void SetStatusMessage(const string &msg)=0
virtual void LoadLayout(const objects::CUser_object &layout, IWMClientFactory &factory)=0
creates a new window layout based on description in the given CUser_object creates clients using IWMC...
virtual void RemoveFromWorkbench(IView &view)=0
disconnects view from services and removes from the Workbench
virtual IStatusBarService * GetStatusBarService()=0
virtual void ShowStatusProgress(int value, int range)=0
virtual void AddToolBarFactory(IToolBarContributor *factory)=0
the service assumes ownership of the given factory (will delete it)
virtual wxFileArtProvider & GetFileArtProvider()=0
virtual void RemoveContributor(IMenuContributor *contributor)=0
virtual CIRef< IView > CreateViewInstance(const string &type_ui_name)=0
create a view instance of the specified type
virtual void AddContributor(IMenuContributor *contributor)=0
the service does NOT assume ownership of the contributor
virtual IViewManagerService * GetViewManagerService()=0
virtual IWindowManagerService * GetWindowManagerService()=0
virtual void ResetMenuBar()=0
virtual void GetAllClients(TClients &clients)=0
returns a list of all registered IWMClients
virtual void CloseClient(IWMClient &client)=0
remove client(s) from Window Manager these functions do not disconnect clients from other services
virtual IWMClient * GetActiveClient()=0
returns Active client (i.e. client that has focus)
virtual objects::CUser_object * SaveLayout()=0
saves current window layout to CUser_object
virtual void ActivateClient(IWMClient &client)=0
makes client visible and focused
virtual void CloseAllClients()=0
virtual void SetAdvisor(IWindowManagerAdvisor *advisor)=0
the service does not assume ownership of the given object
virtual CIRef< IView > GetSingletonView(const string &singleton_ui_name)=0
returns a pointer singleton view if it already exists in workbench or NULL
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:773
bool NotEmpty(void) const THROWS_NONE
Check if CRef is not empty – pointing to an object and has a non-null value.
Definition: ncbiobj.hpp:726
TObjectType & GetObject(void) const
Get object.
Definition: ncbiobj.hpp:1697
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
@ eCmdCloseView
Definition: gui.hpp:64
@ eCmdCreateEventView
Definition: gui.hpp:60
@ eCmdCreateOpenGLView
Definition: gui.hpp:58
@ eCmdTestDiagPanel
Definition: gui.hpp:68
@ eCmdTestStatusProgress
Definition: gui.hpp:69
@ eCmdCreateTaskView
Definition: gui.hpp:59
@ eCmdCloseAllViews
Definition: gui.hpp:65
@ eCmdCreateDiagConsole
Definition: gui.hpp:61
@ eCmdCreateClockView
Definition: gui.hpp:57
@ eCmdSaveLayout
Definition: gui.hpp:66
@ eCmdRestoreLayout
Definition: gui.hpp:67
static int const kDiagTimerID
Definition: gui.cpp:111
USING_SCOPE(objects)
static const char * kDefLayoutTag
Definition: gui.cpp:202
static int const kStatusTimerID
Definition: gui.cpp:112
static const char * kTBViews
Definition: gui.cpp:685
END_EVENT_TABLE()
int i
static void text(MDB_val *v)
Definition: mdb_dump.c:62
#define wxT(x)
Definition: muParser.cpp:41
Defines: CTimeFormat - storage class for time format.
static int filenames
Definition: pcre2grep.c:247
static static static wxID_ANY
ViewerWindowBase::OnEditMenu ViewerWindowBase::OnJustification EVT_MENU(MID_SHOW_GEOM_VLTNS, ViewerWindowBase::OnShowGeomVltns) EVT_MENU(MID_FIND_PATTERN
static CNamedPipeClient * client
#define _ASSERT
Pool of generic task-executing threads.
#define WX_DEFINE_MENU(name)
New macros for defining menus for use with CUICommandRegistry.
Definition: ui_command.hpp:266
#define WX_SUBMENU(label)
Definition: ui_command.hpp:288
#define WX_END_MENU()
Definition: ui_command.hpp:294
#define WX_MENU_SEPARATOR_L(label)
Definition: ui_command.hpp:285
#define WX_MENU_ITEM(cmd)
Definition: ui_command.hpp:270
#define WX_MENU_CHECK_ITEM(cmd)
Definition: ui_command.hpp:276
#define WX_END_SUBMENU()
Definition: ui_command.hpp:291
void WidgetsWx_RegisterCommands(CUICommandRegistry &cmd_reg, wxFileArtProvider &provider)
Register standard commands defined in this file and wxWidgets headers.
Definition: commands.cpp:46
void FromArrayString(const wxArrayString &in, vector< string > &out)
Definition: wx_utils.cpp:343
wxString ToWxString(const string &s)
Definition: wx_utils.hpp:173
#define const
Definition: zconf.h:232
Modified on Fri Sep 20 14:57:19 2024 by modify_doxy.py rev. 669887