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

Go to the SVN repository for this file.

1 #ifndef GUI_FRAMEWORK___DIAG_PANEL_HPP
2 #define GUI_FRAMEWORK___DIAG_PANEL_HPP
3 
4 /* $Id: diag_panel.hpp 46601 2021-07-30 14:54:34Z asztalos $
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 
35 /** @addtogroup GUI_FRAMEWORK
36 *
37 * @{
38 */
39 
40 #include <corelib/ncbistd.hpp>
41 
42 #include <gui/gui_export.h>
43 
45 #include <gui/framework/view.hpp>
47 
48 #include <gui/utils/extension.hpp>
49 #include <gui/utils/command.hpp>
50 
51 #include <wx/imaglist.h>
52 
53 ////@begin includes
54 #include <wx/toolbar.h>
55 #include <wx/listctrl.h>
56 ////@end includes
57 
58 ////@begin forward declarations
59 ////@end forward declarations
60 
61 ////@begin control identifiers
62 #define ID_CWXDIAGPANEL 10030
63 #define ID_TOOLBAR2 10039
64 #define ID_TOOL_ERRORS 10040
65 #define ID_TOOL_WARNINGS 10041
66 #define ID_TOOL_INFO 10042
67 #define ID_TOOL_OTHER 10043
68 #define ID_CHOICE3 10044
69 #define ID_LISTCTRL1 10037
70 #define SYMBOL_CWXDIAGPANEL_STYLE 0
71 #define SYMBOL_CWXDIAGPANEL_TITLE wxT("Diagnostics Console")
72 #define SYMBOL_CWXDIAGPANEL_IDNAME ID_CWXDIAGPANEL
73 #define SYMBOL_CWXDIAGPANEL_SIZE wxSize(400, 300)
74 #define SYMBOL_CWXDIAGPANEL_POSITION wxDefaultPosition
75 ////@end control identifiers
76 
77 
79 
80 class CDiagConsoleList;
81 
82 ///////////////////////////////////////////////////////////////////////////////
83 /// CDiagConsolePanel
85  public wxPanel,
86  public IRegSettings
87 {
89 public:
91  virtual ~CDiagConsolePanel();
92 
93  /// Creation
94  bool Create(wxWindow* parent,
95  wxWindowID id = SYMBOL_CWXDIAGPANEL_IDNAME,
96  const wxPoint& pos = SYMBOL_CWXDIAGPANEL_POSITION,
97  const wxSize& size = SYMBOL_CWXDIAGPANEL_SIZE,
98  long style = SYMBOL_CWXDIAGPANEL_STYLE );
99 
100  void Init();
101  void CreateControls();
102 
103  /// @name IRegSettings interface implementation
104  /// @{
105  virtual void SetRegistryPath(const string& path);
106  virtual void LoadSettings();
107  virtual void SaveSettings() const;
108  /// @}
109 
110  void OnToolErrorsClick( wxCommandEvent& event );
111  void OnToolWarningsClick( wxCommandEvent& event );
112  void OnToolInfoClick( wxCommandEvent& event );
113  void OnToolOtherClick( wxCommandEvent& event );
114  void OnChoice3Selected( wxCommandEvent& event );
115 
116  void OnCopy( wxCommandEvent& event );
117  void OnCopyUpdateUI( wxUpdateUIEvent& event );
118 
119  int GetLogBufferIndex() const { return m_LogBufferIndex ; }
120  void SetLogBufferIndex(int value) { m_LogBufferIndex = value ; }
121 
122  wxBitmap GetBitmapResource(const wxString& name);
123 
124 private:
125  /// command callback for listener
126  void x_LoadMessages();
127  void x_UpdateUI();
128 
129 protected:
132  string m_RegPath;
133  wxImageList m_ImageList;
134 
135  // load icons into art provider once per run
136  static bool m_IconsInitialized;
137 };
138 
139 ///////////////////////////////////////////////////////////////////////////////
140 /// CDiagConsoleView
142  public CObject,
143  public IWMClient,
144  public IView,
145  public IRegSettings
146 {
148 
149 public:
151  virtual ~CDiagConsoleView();
152 
153  /// @name IView
154  /// @{
155  virtual const CViewTypeDescriptor& GetTypeDescriptor() const;
156  virtual void SetWorkbench(IWorkbench* workbench);
157  virtual void CreateViewWindow(wxWindow* parent);
158  virtual void DestroyViewWindow();
159  /// @}
160 
161  /// @name IWMClient interface implementation
162  /// @{
163  virtual wxWindow* GetWindow();
164  virtual wxEvtHandler* GetCommandHandler() { return GetWindow()->GetEventHandler(); }
165  virtual string GetClientLabel(IWMClient::ELabel ltype = IWMClient::eDefault) const;
166  virtual string GetIconAlias() const;
167  virtual const CRgbaColor* GetColor() const;
168  virtual void SetColor( const CRgbaColor& color );
169  virtual const wxMenu* GetMenu();
170  virtual void UpdateMenu( wxMenu& root_menu );
171  virtual CFingerprint GetFingerprint() const;
172  /// @}
173 
174  /// @name IRegSettings interface implementation
175  /// @{
176  virtual void SetRegistryPath(const string& path);
177  virtual void LoadSettings();
178  virtual void SaveSettings() const;
179  /// @}
180 
181 protected:
183 
184  string m_RegPath;
185 
187 };
188 
189 
190 ///////////////////////////////////////////////////////////////////////////////
191 /// CDiagConsoleViewFactory
193  public CObject,
194  public IExtension,
195  public IViewFactory
196 {
197 public:
198  /// @name IExtension interface implementation
199  /// @{
200  virtual string GetExtensionIdentifier() const;
201  virtual string GetExtensionLabel() const;
202  /// @}
203 
204  /// @name IViewFactory interface implementation
205  /// @{
206  virtual void RegisterIconAliases(wxFileArtProvider& provider);
207  virtual const CViewTypeDescriptor& GetViewTypeDescriptor() const;
208  virtual IView* CreateInstance() const;
209  virtual IView* CreateInstanceByFingerprint(const TFingerprint& fingerprint) const;
210  /// @}
211 };
212 
213 
215 
216 /* @} */
217 
218 #endif // GUI_FRAMEWORK___DIAG_PANEL_HPP
CDiagConsoleList.
CDiagConsolePanel.
Definition: diag_panel.hpp:87
CDiagConsoleViewFactory.
Definition: diag_panel.hpp:196
CDiagConsoleView.
Definition: diag_panel.hpp:146
CObject –.
Definition: ncbiobj.hpp:180
class CRgbaColor provides a simple abstraction for managing colors.
Definition: rgba_color.hpp:58
CViewTypeDescriptor - holds description of a view type.
Definition: view.hpp:98
IExtension IExtension interface represents an abstract pluggable component.
Definition: extension.hpp:57
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
IViewFactory - view factory for use with IViewManagerService.
Definition: view.hpp:140
IView - represents a standard visual part of Workbench UI.
Definition: view.hpp:73
CFingerprint identifies an instance of IWMClient and is used for labeling layout positions.
Definition: wm_client.hpp:58
IWClient - abstract Window Manager client.
Definition: wm_client.hpp:50
ELabel
Different flavors of label types for different GUI aspects.
Definition: wm_client.hpp:80
IWorkbench is the central interface in the application framework.
Definition: workbench.hpp:113
GUI command routing and handling framework.
char value[7]
Definition: config.c:431
Include a standard set of the NCBI C++ Toolkit most basic headers.
static void Init(void)
Definition: cursor6.c:76
CRgbaColor & GetColor(CSeqFeatData::ESubtype subtype)
#define SYMBOL_CWXDIAGPANEL_STYLE
Definition: diag_panel.hpp:70
#define SYMBOL_CWXDIAGPANEL_SIZE
Definition: diag_panel.hpp:73
void SetLogBufferIndex(int value)
Definition: diag_panel.hpp:120
static bool m_IconsInitialized
CDiagConsolePanel.
Definition: diag_panel.hpp:136
wxImageList m_ImageList
Definition: diag_panel.hpp:133
#define SYMBOL_CWXDIAGPANEL_POSITION
Definition: diag_panel.hpp:74
#define SYMBOL_CWXDIAGPANEL_IDNAME
Definition: diag_panel.hpp:72
CDiagConsolePanel * m_Panel
Definition: diag_panel.hpp:186
CDiagConsoleList * m_MsgList
Definition: diag_panel.hpp:131
int GetLogBufferIndex() const
Definition: diag_panel.hpp:119
virtual wxEvtHandler * GetCommandHandler()
returns a pointer to the command handler (for menu commands and updates)
Definition: diag_panel.hpp:164
static CViewTypeDescriptor m_TypeDescr
CDiagConsoleView.
Definition: diag_panel.hpp:182
#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_GUIFRAMEWORK_EXPORT
Definition: gui_export.h:509
Defines to provide correct exporting from DLLs in Windows.
n background color
const struct ncbi::grid::netcache::search::fields::SIZE size
Modified on Fri Mar 01 10:07:13 2024 by modify_doxy.py rev. 669887