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

Go to the SVN repository for this file.

1 /* $Id: edit_obj_view_dlg.hpp 43609 2019-08-08 16:12:53Z filippov $
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: Colleen Bollin
27  */
28 #ifndef _EDIT_OBJ_VIEW_DLG_H_
29 #define _EDIT_OBJ_VIEW_DLG_H_
30 
31 #include <corelib/ncbistd.hpp>
32 
37 
38 /*!
39  * Includes
40  */
41 
42 ////@begin includes
43 #include "wx/statline.h"
44 ////@end includes
45 #include <wx/sizer.h>
46 #include <wx/frame.h>
47 
48 /*!
49  * Forward declarations
50  */
51 
52 ////@begin forward declarations
53 class wxBoxSizer;
54 class wxPanel;
55 class wxHyperlinkCtrl;
56 ////@end forward declarations
57 
58 /*!
59  * Control identifiers
60  */
61 
62 ////@begin control identifiers
63 #define SYMBOL_CEDITOBJVIEWDLG_STYLE wxCAPTION|wxRESIZE_BORDER|wxCLOSE_BOX|wxTAB_TRAVERSAL
64 #define SYMBOL_CEDITOBJVIEWDLG_TITLE _("EditObjViewDlg")
65 #define SYMBOL_CEDITOBJVIEWDLG_IDNAME ID_CEDITOBJVIEWDLG
66 #define SYMBOL_CEDITOBJVIEWDLG_SIZE wxSize(400, 300)
67 #define SYMBOL_CEDITOBJVIEWDLG_POSITION wxDefaultPosition
68 ////@end control identifiers
69 
71 
72 /*!
73  * CEditObjViewDlg class declaration
74  */
75 
76 
78 {
79  DECLARE_DYNAMIC_CLASS( CEditObjViewDlg )
80  DECLARE_EVENT_TABLE()
81 
82 public:
83  /// Constructors
85  CEditObjViewDlg( wxWindow* parent, bool create, wxWindowID id = SYMBOL_CEDITOBJVIEWDLG_IDNAME, const wxString& caption = SYMBOL_CEDITOBJVIEWDLG_TITLE, const wxPoint& pos = SYMBOL_CEDITOBJVIEWDLG_POSITION, const wxSize& size = SYMBOL_CEDITOBJVIEWDLG_SIZE, long style = SYMBOL_CEDITOBJVIEWDLG_STYLE );
86 
87  /// Creation
88  bool Create( wxWindow* parent, wxWindowID id = SYMBOL_CEDITOBJVIEWDLG_IDNAME, const wxString& caption = SYMBOL_CEDITOBJVIEWDLG_TITLE, const wxPoint& pos = SYMBOL_CEDITOBJVIEWDLG_POSITION, const wxSize& size = SYMBOL_CEDITOBJVIEWDLG_SIZE, long style = SYMBOL_CEDITOBJVIEWDLG_STYLE );
89 
90  /// Destructor
91  ~CEditObjViewDlg();
92 
93  /// Initialises member variables
94  void Init();
95 
96  /// Creates the controls and sizers
97  void CreateControls();
98 
99 ////@begin CEditObjViewDlg event handler declarations
100 
101  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
102  void OnOkClick( wxCommandEvent& event );
103  void OnExport( wxCommandEvent& event );
104  void OnImport( wxCommandEvent& event );
105  void OnCancelClick( wxCommandEvent& event );
106 
107  virtual void EnableImport(bool enable);
108  virtual void EnableExport(bool enable);
109  CImportExportAccess* GetImportExportWindow();
110 ////@end CEditObjViewDlg event handler declarations
111 
112  void Activate(wxIdleEvent&);
113 
114 ////@begin CEditObjViewDlg member function declarations
115 
116  /// Retrieves bitmap resources
117  wxBitmap GetBitmapResource( const wxString& name );
118 
119  /// Retrieves icon resources
120  wxIcon GetIconResource( const wxString& name );
121 ////@end CEditObjViewDlg member function declarations
122 
123  /// Should we show tooltips?
124  static bool ShowToolTips();
125 
126 ////@begin CEditObjViewDlg member variables
127  wxBoxSizer* m_EditWindowSizer;
128  /// Control identifiers
129  enum {
130  ID_CEDITOBJVIEWDLG = 10175,
132  CEDITOBJVIEWDLG_BUTTON_EXPORT
133  };
134 
135  // Creates panels corresponding to object
136  void SetEditorWindow(wxWindow* editorWindow);
137 
138 
139  // Data
140  virtual void SetUndoManager(ICommandProccessor* cmdProccessor) {
141  m_CmdProccessor = cmdProccessor; }
142  ICommandProccessor* GetUndoManager(void) {return m_CmdProccessor;}
143 
144  void SetEditor(CIRef<IEditObject> editor) {m_Editor = editor;}
145 
146  /// @name IWorkDirClient implementation
147  /// @{
148  virtual void SetWorkDir(const wxString& workDir) { m_WorkDir = workDir; }
149  /// @}
150 
151  virtual void SetHelpUrl(const wxString &url);
152 protected:
155  wxWindow* m_EditorWindow;
157  bool m_Create;
158  wxButton *m_ButtonImport, *m_ButtonExport;
160  wxString m_WorkDir;
161  wxHyperlinkCtrl* m_ButtonHelp;
162 };
163 
165 {
166  DECLARE_DYNAMIC_CLASS( CEditObjViewDlgModal )
167  DECLARE_EVENT_TABLE()
168 
169 public:
170  /// Constructors
172  CEditObjViewDlgModal( wxWindow* parent, bool create, wxWindowID id = SYMBOL_CEDITOBJVIEWDLG_IDNAME, const wxString& caption = SYMBOL_CEDITOBJVIEWDLG_TITLE, const wxPoint& pos = SYMBOL_CEDITOBJVIEWDLG_POSITION, const wxSize& size = SYMBOL_CEDITOBJVIEWDLG_SIZE, long style = SYMBOL_CEDITOBJVIEWDLG_STYLE );
173 
174  /// Creation
175  bool Create( wxWindow* parent, wxWindowID id = SYMBOL_CEDITOBJVIEWDLG_IDNAME, const wxString& caption = SYMBOL_CEDITOBJVIEWDLG_TITLE, const wxPoint& pos = SYMBOL_CEDITOBJVIEWDLG_POSITION, const wxSize& size = SYMBOL_CEDITOBJVIEWDLG_SIZE, long style = SYMBOL_CEDITOBJVIEWDLG_STYLE );
176 
177  /// Destructor
179 
180  /// Initialises member variables
181  void Init();
182 
183  /// Creates the controls and sizers
184  void CreateControls();
185 
186 ////@begin CEditObjViewDlg event handler declarations
187 
188  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK
189  void OnOkClick( wxCommandEvent& event );
190  void OnExport( wxCommandEvent& event );
191  void OnImport( wxCommandEvent& event );
192  void OnClose(wxCloseEvent& event);
193  virtual bool Show(bool show = true);
194 
195  virtual void EnableImport(bool enable);
196  virtual void EnableExport(bool enable);
197  CImportExportAccess* GetImportExportWindow();
198 ////@end CEditObjViewDlg event handler declarations
199 
200 ////@begin CEditObjViewDlg member function declarations
201 
202  /// Retrieves bitmap resources
203  wxBitmap GetBitmapResource( const wxString& name );
204 
205  /// Retrieves icon resources
206  wxIcon GetIconResource( const wxString& name );
207 ////@end CEditObjViewDlg member function declarations
208 
209  /// Should we show tooltips?
210  static bool ShowToolTips();
211 
212 ////@begin CEditObjViewDlg member variables
213  wxBoxSizer* m_EditWindowSizer;
214  /// Control identifiers
215  enum {
216  ID_CEDITOBJVIEWDLG = 10175,
218  CEDITOBJVIEWDLG_BUTTON_EXPORT
219  };
220 ////@end CEditObjViewDlg member variables
221  static wxWindow* CreateDialogNew(wxWindow* parent);
222  static wxWindow* CreateDialogEdit(wxWindow* parent);
223 
224  // Creates panels corresponding to object
225  void SetEditorWindow(wxWindow* editorWindow);
226 
227  /// @name IGuiWidget implementation
228  /// @{
229  virtual void SetHost(IGuiWidgetHost* host);
230  virtual bool InitWidget(TConstScopedObjects& objects);
231  virtual const CObject* GetOrigObject() const;
232 
233  // Selection
234  virtual void GetSelectedObjects (TConstObjects& objects) const;
235  virtual void SetSelectedObjects (const TConstObjects& objects);
236 
237  // Data
238  virtual void SetUndoManager(ICommandProccessor* cmdProccessor) {
239  m_CmdProccessor = cmdProccessor; }
240  ICommandProccessor* GetUndoManager(void) {return m_CmdProccessor;}
241  virtual void DataChanging();
242  virtual void DataChanged();
243 
244  // Objects for action
245  virtual void GetActiveObjects(vector<TConstScopedObjects>& objects);
246  /// @}
247  void SetEditor(CIRef<IEditObject> editor) {m_Editor = editor;}
248  virtual void SetHelpUrl(const wxString &url);
249 protected:
252  wxWindow* m_EditorWindow;
253  bool m_Create;
254  wxButton *m_ButtonImport, *m_ButtonExport;
255  wxHyperlinkCtrl* m_ButtonHelp;
256 };
257 
259 
260 #endif
261  // _EDIT_OBJ_VIEW_DLG_H_
wxHyperlinkCtrl * m_ButtonHelp
void SetEditor(CIRef< IEditObject > editor)
CIRef< IEditObject > m_Editor
TConstScopedObjects m_Orig_Objects
ICommandProccessor * GetUndoManager(void)
virtual void SetUndoManager(ICommandProccessor *cmdProccessor)
CIRef< IEditObject > m_Editor
ICommandProccessor * GetUndoManager(void)
wxHyperlinkCtrl * m_ButtonHelp
wxBoxSizer * m_EditWindowSizer
ICommandProccessor * m_CmdProccessor
void SetEditor(CIRef< IEditObject > editor)
virtual void SetWorkDir(const wxString &workDir)
virtual void SetUndoManager(ICommandProccessor *cmdProccessor)
TConstScopedObjects m_Orig_Objects
virtual void EnableImport(bool enable)=0
virtual void EnableExport(bool enable)=0
CObject –.
Definition: ncbiobj.hpp:180
Undo/Redo interface for editing operations.
virtual void SetHelpUrl(const wxString &url)=0
IWorkDirClient.
Definition: work_dir.hpp:45
Include a standard set of the NCBI C++ Toolkit most basic headers.
static void Init(void)
Definition: cursor6.c:76
#define SYMBOL_CEDITOBJVIEWDLG_IDNAME
#define SYMBOL_CEDITOBJVIEWDLG_STYLE
#define SYMBOL_CEDITOBJVIEWDLG_TITLE
#define SYMBOL_CEDITOBJVIEWDLG_POSITION
#define SYMBOL_CEDITOBJVIEWDLG_SIZE
vector< CConstRef< CObject > > TConstObjects
Definition: objects.hpp:64
vector< SConstScopedObject > TConstScopedObjects
Definition: objects.hpp:65
#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_EDIT_EXPORT
Definition: gui_export.h:526
const struct ncbi::grid::netcache::search::fields::SIZE size
Modified on Fri Dec 08 08:20:19 2023 by modify_doxy.py rev. 669887