NCBI C++ ToolKit
open_objects_panel.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS___LOADERS___OPEN_OBJECTS_PANEL__HPP
2 #define GUI_WIDGETS___LOADERS___OPEN_OBJECTS_PANEL__HPP
3 
4 /* $Id: open_objects_panel.hpp 28939 2013-09-17 22:03:53Z katargir $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Roman Katargin
30  *
31  * File Description:
32  *
33  */
34 #include <corelib/ncbistd.hpp>
35 #include <corelib/ncbiobj.hpp>
36 
37 #include <gui/gui_export.h>
38 
40 
43 
45 
46 class wxSimpleHtmlListBox;
47 
48 #define SYMBOL_OPENOBJECTSPANEL_STYLE wxFULL_REPAINT_ON_RESIZE
49 #define SYMBOL_OPENOBJECTSPANEL_TITLE _("Open Objects Panel")
50 #define SYMBOL_OPENOBJECTSPANEL_IDNAME ID_SPLITTER_PANEL
51 #define SYMBOL_OPENOBJECTSPANEL_SIZE wxSize(400, 300)
52 #define SYMBOL_OPENOBJECTSPANEL_POSITION wxDefaultPosition
53 
55 
56 class IObjectLoader;
57 
59  public CSplitter, public IRegSettings
60 {
61  DECLARE_DYNAMIC_CLASS( COpenObjectsPanel )
62  DECLARE_EVENT_TABLE()
63 
64 public:
66  COpenObjectsPanel( wxWindow* parent, wxWindowID id = SYMBOL_OPENOBJECTSPANEL_IDNAME, const wxPoint& pos = SYMBOL_OPENOBJECTSPANEL_POSITION, const wxSize& size = SYMBOL_OPENOBJECTSPANEL_SIZE, long style = SYMBOL_OPENOBJECTSPANEL_STYLE );
67 
68  bool Create( wxWindow* parent, wxWindowID id = SYMBOL_OPENOBJECTSPANEL_IDNAME, const wxPoint& pos = SYMBOL_OPENOBJECTSPANEL_POSITION, const wxSize& size = SYMBOL_OPENOBJECTSPANEL_SIZE, long style = SYMBOL_OPENOBJECTSPANEL_STYLE );
69 
71 
72  void Init();
73 
74  void CreateControls();
75 
76  IWizardPage* GetWizardPage() { return &m_WizardPage; }
77 
78  void OnLoaderSelected( wxCommandEvent& event );
79 
80  void SetManagers(vector<CIRef<IOpenObjectsPanelClient> >& managers);
81 
82  IObjectLoader* GetObjectLoader();
83 
84  /// @name IRegSettings interface
85  /// @{
86  virtual void SetRegistryPath(const string& path);
87  virtual void LoadSettings();
88  virtual void SaveSettings() const;
89  /// @}
90 
91 protected:
92  class CPage : public IWizardPage
93  {
94  public:
95  CPage(COpenObjectsPanel& panel) : m_OpenObjectPanel(panel) {}
96  virtual bool CanLeavePage(bool forward) { return m_OpenObjectPanel.x_CanLeavePage(forward); }
97  virtual wxPanel* GetPanel() { return m_OpenObjectPanel.x_GetPanel(); }
98 
99  virtual IWizardPage* GetNextPage() { return m_OpenObjectPanel.x_GetNextPage(); }
100  virtual IWizardPage* GetPrevPage() { return 0; }
101  virtual IWizardPage* GetOptionsPage() { return m_OpenObjectPanel.x_GetOptionsPage(); }
102  virtual void SetNextPage(IWizardPage*) {}
103  virtual void SetPrevPage(IWizardPage*) {}
104  virtual void SetOptionsPage(IWizardPage*) {}
105 
106  private:
108  };
109 
110  bool x_CanLeavePage(bool forward);
111  wxPanel* x_GetPanel();
112  IWizardPage* x_GetNextPage();
113  IWizardPage* x_GetOptionsPage();
114 
115  void x_AppendOptionForManager(IOpenObjectsPanelClient& manager);
116  void x_SelectManager(int index);
117 
118  enum {
119  ID_SPLITTER_PANEL = 10003,
121  ID_OPTION_PANEL
122  };
123 
124  string m_RegPath;
125 
126  wxSimpleHtmlListBox* m_LoadersListBox;
127  wxPanel* m_OptionPanel;
128 
130  /// Load Managers corresponding to Loading Options
131  vector<CIRef<IOpenObjectsPanelClient> > m_Managers;
132 
134 };
135 
137 
138 #endif // GUI_WIDGETS___LOADERS___OPEN_OBJECTS_PANEL__HPP
virtual wxPanel * GetPanel()
COpenObjectsPanel & m_OpenObjectPanel
virtual bool CanLeavePage(bool forward)
virtual IWizardPage * GetOptionsPage()
virtual void SetOptionsPage(IWizardPage *)
virtual IWizardPage * GetNextPage()
virtual void SetPrevPage(IWizardPage *)
virtual void SetNextPage(IWizardPage *)
CPage(COpenObjectsPanel &panel)
virtual IWizardPage * GetPrevPage()
vector< CIRef< IOpenObjectsPanelClient > > m_Managers
Load Managers corresponding to Loading Options.
wxSimpleHtmlListBox * m_LoadersListBox
IWizardPage * GetWizardPage()
CSplitter - container with resizable separators.
Definition: splitter.hpp:54
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
Include a standard set of the NCBI C++ Toolkit most basic headers.
static void Init(void)
Definition: cursor6.c:76
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define NCBI_GUIWIDGETS_LOADERS_EXPORT
Definition: gui_export.h:525
Defines to provide correct exporting from DLLs in Windows.
const struct ncbi::grid::netcache::search::fields::SIZE size
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
#define SYMBOL_OPENOBJECTSPANEL_POSITION
#define SYMBOL_OPENOBJECTSPANEL_IDNAME
#define SYMBOL_OPENOBJECTSPANEL_STYLE
#define SYMBOL_OPENOBJECTSPANEL_SIZE
Modified on Mon May 20 05:03:11 2024 by modify_doxy.py rev. 669887