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

Go to the SVN repository for this file.

1 /////////////////////////////////////////////////////////////////////////////
2 // Name: tree_demo_dlg.cpp
3 // Purpose:
4 // Author: Vladimir Tereshkov
5 // Modified by:
6 // Created: 05/02/2008 14:43:40
7 // RCS-ID:
8 // Copyright:
9 // Licence:
10 /////////////////////////////////////////////////////////////////////////////
11 
12 #include <ncbi_pch.hpp>
13 
14 
15 #include <wx/bitmap.h>
16 #include <wx/icon.h>
17 #include <wx/sizer.h>
18 #include <wx/stattext.h>
19 #include <wx/button.h>
20 
21 ////@begin includes
22 #include "wx/imaglist.h"
23 ////@end includes
24 
25 #include "tree_demo_dlg.hpp"
27 
28 ////@begin XPM images
29 ////@end XPM images
30 
31 
32 
34 
35 
36 /*!
37  * CTreeDemoDlg type definition
38  */
39 
40 IMPLEMENT_DYNAMIC_CLASS( CTreeDemoDlg, wxDialog )
41 
42 
43 /*!
44  * CTreeDemoDlg event table definition
45  */
46 
47 BEGIN_EVENT_TABLE( CTreeDemoDlg, wxDialog )
48 
49 ////@begin CTreeDemoDlg event table entries
50 ////@end CTreeDemoDlg event table entries
51 
53 
54 
55 /*!
56  * CTreeDemoDlg constructors
57  */
58 
60 {
61  Init();
62 }
63 
64 CTreeDemoDlg::CTreeDemoDlg( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
65 {
66  Init();
67  Create(parent, id, caption, pos, size, style);
68 }
69 
70 
71 /*!
72  * CTreeDemoDlg creator
73  */
74 
75 bool CTreeDemoDlg::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
76 {
77 ////@begin CTreeDemoDlg creation
78  SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
79  wxDialog::Create( parent, id, caption, pos, size, style );
80 
82  if (GetSizer())
83  {
84  GetSizer()->SetSizeHints(this);
85  }
86  Centre();
87 ////@end CTreeDemoDlg creation
88  return true;
89 }
90 
91 
92 /*!
93  * CTreeDemoDlg destructor
94  */
95 
97 {
98 ////@begin CTreeDemoDlg destruction
99 ////@end CTreeDemoDlg destruction
100 }
101 
102 
103 /*!
104  * Member initialisation
105  */
106 
108 {
109 ////@begin CTreeDemoDlg member initialisation
110  m_Tree = NULL;
111 ////@end CTreeDemoDlg member initialisation
112 }
113 
114 
115 /*!
116  * Control creation for CTreeDemoDlg
117  */
118 
120 {
121 ////@begin CTreeDemoDlg content construction
122  CTreeDemoDlg* itemDialog1 = this;
123 
124  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
125  itemDialog1->SetSizer(itemBoxSizer2);
126 
127  m_Tree = new CwxTreeCtrlEx( itemDialog1, ID_TREECTRL1, wxDefaultPosition, wxSize(300, 300), wxTR_HAS_BUTTONS |wxTR_MULTIPLE );
128  itemBoxSizer2->Add(m_Tree, 0, wxALIGN_LEFT|wxALL, 5);
129 
130  wxStaticLine* itemStaticLine4 = new wxStaticLine( itemDialog1, wxID_STATIC, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
131  itemBoxSizer2->Add(itemStaticLine4, 0, wxGROW|wxALL, 5);
132 
133  wxStdDialogButtonSizer* itemStdDialogButtonSizer5 = new wxStdDialogButtonSizer;
134 
135  itemBoxSizer2->Add(itemStdDialogButtonSizer5, 0, wxALIGN_RIGHT|wxALL, 5);
136  wxButton* itemButton6 = new wxButton( itemDialog1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
137  itemStdDialogButtonSizer5->AddButton(itemButton6);
138 
139  wxButton* itemButton7 = new wxButton( itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
140  itemStdDialogButtonSizer5->AddButton(itemButton7);
141 
142  itemStdDialogButtonSizer5->Realize();
143 
144 ////@end CTreeDemoDlg content construction
145 }
146 
147 
148 /*!
149  * Should we show tooltips?
150  */
151 
153 {
154  return true;
155 }
156 
157 /*!
158  * Get bitmap resources
159  */
160 
161 wxBitmap CTreeDemoDlg::GetBitmapResource( const wxString& name )
162 {
163  // Bitmap retrieval
164 ////@begin CTreeDemoDlg bitmap retrieval
165  wxUnusedVar(name);
166  return wxNullBitmap;
167 ////@end CTreeDemoDlg bitmap retrieval
168 }
169 
170 /*!
171  * Get icon resources
172  */
173 
174 wxIcon CTreeDemoDlg::GetIconResource( const wxString& name )
175 {
176  // Icon retrieval
177 ////@begin CTreeDemoDlg icon retrieval
178  wxUnusedVar(name);
179  return wxNullIcon;
180 ////@end CTreeDemoDlg icon retrieval
181 }
182 
183 
static bool ShowToolTips()
Should we show tooltips?
void Init()
Initialises member variables.
~CTreeDemoDlg()
Destructor.
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
bool Create(wxWindow *parent, wxWindowID id=10001, const wxString &caption=_("Tree With Checkboxes"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
CwxTreeCtrlEx * m_Tree
void CreateControls()
Creates the controls and sizers.
CTreeDemoDlg()
Constructors.
#define _(proto)
Definition: ct_nlmzip_i.h:78
static void Init(void)
Definition: cursor6.c:76
#define NULL
Definition: ncbistd.hpp:225
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
END_EVENT_TABLE()
const struct ncbi::grid::netcache::search::fields::SIZE size
#define ID_TREECTRL1
Modified on Sun Mar 03 03:10:40 2024 by modify_doxy.py rev. 669887