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

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS_WX__WINDOWS_DLG__HPP
2 #define GUI_WIDGETS_WX__WINDOWS_DLG__HPP
3 
4 /* $Id: windows_dlg.hpp 26253 2012-08-10 18:19:02Z 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: Andrey Yazhuk
30  */
31 
32 #include <corelib/ncbistd.hpp>
33 
34 
36 
38 
39 #include <wx/listctrl.h>
40 
41 ////@begin control identifiers
42 #define SYMBOL_CWINDOWSDLG_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL
43 #define SYMBOL_CWINDOWSDLG_TITLE _("Windows")
44 #define SYMBOL_CWINDOWSDLG_IDNAME ID_WINDOWS_DLG
45 #define SYMBOL_CWINDOWSDLG_SIZE wxSize(400, 300)
46 #define SYMBOL_CWINDOWSDLG_POSITION wxDefaultPosition
47 ////@end control identifiers
48 
49 
50 class wxButton;
51 
52 
54 
55 class CwxTableListCtrl;
56 class CWindowManager;
57 class IWMClient;
58 
59 ///////////////////////////////////////////////////////////////////////////////
60 /// CWindowsDlg
61 
62 class CWindowsDlg: public CDialog
63 {
64  DECLARE_DYNAMIC_CLASS( CWindowsDlg )
65  DECLARE_EVENT_TABLE()
66 
67 public:
68  /// Constructors
69  CWindowsDlg();
70  CWindowsDlg( wxWindow* parent, wxWindowID id = SYMBOL_CWINDOWSDLG_IDNAME, const wxString& caption = SYMBOL_CWINDOWSDLG_TITLE, const wxPoint& pos = SYMBOL_CWINDOWSDLG_POSITION, const wxSize& size = SYMBOL_CWINDOWSDLG_SIZE, long style = SYMBOL_CWINDOWSDLG_STYLE );
71 
72  /// Creation
73  bool Create( wxWindow* parent, wxWindowID id = SYMBOL_CWINDOWSDLG_IDNAME, const wxString& caption = SYMBOL_CWINDOWSDLG_TITLE, const wxPoint& pos = SYMBOL_CWINDOWSDLG_POSITION, const wxSize& size = SYMBOL_CWINDOWSDLG_SIZE, long style = SYMBOL_CWINDOWSDLG_STYLE );
74 
75  /// Destructor
76  ~CWindowsDlg();
77 
78  /// Initialises member variables
79  void Init();
80 
81  /// Creates the controls and sizers
82  void CreateControls();
83 
84 ////@begin CWindowsDlg event handler declarations
85 
86  /// wxEVT_COMMAND_LIST_ITEM_SELECTED event handler for ID_TABLE
87  void OnTableSelected( wxListEvent& event );
88 
89  /// wxEVT_COMMAND_LIST_ITEM_DESELECTED event handler for ID_TABLE
90  void OnTableDeselected( wxListEvent& event );
91 
92  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_ACTIVATE
93  void OnActivateClick( wxCommandEvent& event );
94 
95  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_FLOAT
96  void OnFloatClick( wxCommandEvent& event );
97 
98  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RECOVER
99  void OnRecoverClick( wxCommandEvent& event );
100 
101  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_MINIMIZE
102  void OnMinimizeClick( wxCommandEvent& event );
103 
104  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RESTORE
105  void OnRestoreClick( wxCommandEvent& event );
106 
107  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CLOSE
108  void OnCloseClick( wxCommandEvent& event );
109 
110 ////@end CWindowsDlg event handler declarations
111 
112 ////@begin CWindowsDlg member function declarations
113 
114  /// Retrieves bitmap resources
115  wxBitmap GetBitmapResource( const wxString& name );
116 
117  /// Retrieves icon resources
118  wxIcon GetIconResource( const wxString& name );
119 ////@end CWindowsDlg member function declarations
120 
121  /// Should we show tooltips?
122  static bool ShowToolTips();
123 
124 ////@begin CWindowsDlg member variables
126  wxButton* m_FloatBtn;
127  wxButton* m_RecoverBtn;
128  wxButton* m_MinimizeBtn;
129  wxButton* m_RestoreBtn;
130  wxButton* m_CloseBtn;
131  /// Control identifiers
132  enum {
133  ID_WINDOWS_DLG = 10002,
134  ID_TABLE = 10003,
135  ID_ACTIVATE = 10004,
136  ID_FLOAT = 10000,
137  ID_RECOVER = 10005,
138  ID_MINIMIZE = 10001,
139  ID_RESTORE = 10006
140  };
141 ////@end CWindowsDlg member variables
142 
143 public:
144  void SetWindowManager(CWindowManager* manager);
145 
146 protected:
147  void x_UpdateTable(const vector<IWMClient*>& clients);
148  void x_GetSelectedClients(vector<IWMClient*>& clients);
149  void x_UpdateButtons();
150  void x_SelectClients(vector<IWMClient*>& clients);
151 
152 protected:
155 };
156 
158 
159 
160 #endif //GUI_WIDGETS_WX__WINDOWS_DLG__HPP
CDialog.
Definition: dialog.hpp:47
CwxTextTableModel - very simple model for storing SMALL numbers fo strings.
CWindowManager - component controlling windowing of client windows.
CWindowsDlg.
Definition: windows_dlg.hpp:63
wxButton * m_FloatBtn
CwxTableListCtrl * m_Table
wxButton * m_RecoverBtn
~CWindowsDlg()
Destructor.
void OnActivateClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_ACTIVATE
void OnTableSelected(wxListEvent &event)
wxEVT_COMMAND_LIST_ITEM_SELECTED event handler for ID_TABLE
void OnRecoverClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RECOVER
CWindowsDlg()
Constructors.
Definition: windows_dlg.cpp:71
void SetWindowManager(CWindowManager *manager)
CTextTableModel m_Model
void x_UpdateButtons()
wxButton * m_MinimizeBtn
void x_UpdateTable(const vector< IWMClient * > &clients)
wxButton * m_CloseBtn
wxButton * m_RestoreBtn
void OnRestoreClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_RESTORE
CWindowManager * m_WindowManager
static bool ShowToolTips()
Should we show tooltips?
void x_SelectClients(vector< IWMClient * > &clients)
void OnFloatClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_FLOAT
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
void OnCloseClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_CLOSE
void x_GetSelectedClients(vector< IWMClient * > &clients)
void CreateControls()
Creates the controls and sizers.
bool Create(wxWindow *parent, wxWindowID id=ID_WINDOWS_DLG, const wxString &caption=_("Windows"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
Definition: windows_dlg.cpp:88
void Init()
Initialises member variables.
void OnMinimizeClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_MINIMIZE
void OnTableDeselected(wxListEvent &event)
wxEVT_COMMAND_LIST_ITEM_DESELECTED event handler for ID_TABLE
CwxTableListCtrl - generic wxListCtrl-based Table Control.
IWClient - abstract Window Manager client.
Definition: wm_client.hpp:50
Include a standard set of the NCBI C++ Toolkit most basic headers.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
const struct ncbi::grid::netcache::search::fields::SIZE size
#define SYMBOL_CWINDOWSDLG_SIZE
Definition: windows_dlg.hpp:45
#define SYMBOL_CWINDOWSDLG_TITLE
Definition: windows_dlg.hpp:43
#define SYMBOL_CWINDOWSDLG_STYLE
Definition: windows_dlg.hpp:42
#define SYMBOL_CWINDOWSDLG_POSITION
Definition: windows_dlg.hpp:46
#define SYMBOL_CWINDOWSDLG_IDNAME
Definition: windows_dlg.hpp:44
Modified on Sat Feb 24 07:46:23 2024 by modify_doxy.py rev. 669887