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

Go to the SVN repository for this file.

1 /* $Id: debug_macro_tool_panel.cpp 37345 2016-12-27 18:24:36Z katargir $
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: Roman Katargin
27  */
28 
29 
30 #include <ncbi_pch.hpp>
31 
32 ////@begin includes
33 ////@end includes
34 
36 
37 
38 #include <wx/sizer.h>
39 #include <wx/textctrl.h>
40 #include "wx/valgen.h"
41 #include "wx/valtext.h"
42 
43 #include "wx/bitmap.h"
44 #include "wx/icon.h"
45 
46 
47 ////@begin XPM images
48 ////@end XPM images
49 
51 
52 /*!
53  * CDebugMacroToolPanel type definition
54  */
55 
56 IMPLEMENT_DYNAMIC_CLASS( CDebugMacroToolPanel, CAlgoToolManagerParamsPanel )
57 
58 
59 /*!
60  * CDebugMacroToolPanel event table definition
61  */
62 
64 
65 ////@begin CDebugMacroToolPanel event table entries
66 ////@end CDebugMacroToolPanel event table entries
67 
69 
70 
71 /*!
72  * CDebugMacroToolPanel constructors
73  */
74 
76 {
77  Init();
78 }
79 
80 CDebugMacroToolPanel::CDebugMacroToolPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
81 {
82  Init();
83  Create(parent, id, pos, size, style);
84 }
85 
86 
87 /*!
88  * CDebugMacroTool creator
89  */
90 
91 bool CDebugMacroToolPanel::Create( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
92 {
93 ////@begin CDebugMacroToolPanel creation
94  SetExtraStyle(wxWS_EX_VALIDATE_RECURSIVELY);
95  CAlgoToolManagerParamsPanel::Create( parent, id, pos, size, style );
96 
98  if (GetSizer())
99  {
100  GetSizer()->SetSizeHints(this);
101  }
102  Centre();
103 ////@end CDebugMacroToolPanel creation
104  return true;
105 }
106 
107 
108 /*!
109  * CDebugMacroToolPanel destructor
110  */
111 
113 {
114 ////@begin CDebugMacroToolPanel destruction
115 ////@end CDebugMacroToolPanel destruction
116 }
117 
118 
119 /*!
120  * Member initialisation
121  */
122 
124 {
125 ////@begin CDebugMacroToolPanel member initialisation
126  m_ObjectSel = NULL;
127 ////@end CDebugMacroToolPanel member initialisation
128 }
129 
130 
131 /*!
132  * Control creation for CDebugMacroTool
133  */
134 
136 {
137 ////@begin CDebugMacroToolPanel content construction
138  CDebugMacroToolPanel* itemCAlgoToolManagerParamsPanel1 = this;
139 
140  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
141  itemCAlgoToolManagerParamsPanel1->SetSizer(itemBoxSizer2);
142 
143  m_ObjectSel = new CObjectListWidgetSel( itemCAlgoToolManagerParamsPanel1, ID_PANEL, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL );
144  itemBoxSizer2->Add(m_ObjectSel, 1, wxGROW|wxALL, 5);
145 
146  wxTextCtrl* itemTextCtrl4 = new wxTextCtrl( itemCAlgoToolManagerParamsPanel1, ID_TEXTCTRL9, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_RICH2 | wxTE_MULTILINE );
147  itemBoxSizer2->Add(itemTextCtrl4, 1, wxGROW|wxALL, 5);
148  /*
149  wxFont new_font = wxFont(10, wx.MODERN, wx.NORMAL, wx.NORMAL, False, u'Consolas')
150  myTextCtrl.SetFont(new_font);
151  */
152 
153  /*
154  wxTextAttr style = itemTextCtrl4->GetDefaultStyle();
155  style.SetFontFamily(wxFONTFAMILY_TELETYPE);
156  itemTextCtrl4->SetDefaultStyle (style);
157  */
158 
159  // Set validators
160  itemTextCtrl4->SetValidator( wxTextValidator(wxFILTER_NONE, & GetData().m_Text) );
161 ////@end CDebugMacroToolPanel content construction
162 
163  m_ObjectSel->SetTitle(wxT("Select Objects"));
164 }
165 
167 {
169 }
170 
171 /*!
172  * Should we show tooltips?
173  */
174 
176 {
177  return true;
178 }
179 
180 /*!
181  * Get bitmap resources
182  */
183 
184 wxBitmap CDebugMacroToolPanel::GetBitmapResource( const wxString& name )
185 {
186  // Bitmap retrieval
187 ////@begin CDebugMacroToolPanel bitmap retrieval
188  wxUnusedVar(name);
189  return wxNullBitmap;
190 ////@end CDebugMacroToolPanel bitmap retrieval
191 }
192 
193 /*!
194  * Get icon resources
195  */
196 
197 wxIcon CDebugMacroToolPanel::GetIconResource( const wxString& name )
198 {
199  // Icon retrieval
200 ////@begin CDebugMacroToolPanel icon retrieval
201  wxUnusedVar(name);
202  return wxNullIcon;
203 ////@end CDebugMacroToolPanel icon retrieval
204 }
205 
206 /*!
207  * Transfer data from the window
208  */
209 
211 {
212  if (!CAlgoToolManagerParamsPanel::TransferDataFromWindow())
213  return false;
214 
216  GetData().SetObjects() = selection;
217 
218  return true;
219 }
220 
221 static const char* kObjectSel = ".ObjectSel";
222 
224 {
225  m_RegPath = path;
227 }
228 
230 {
232 }
233 
235 {
237 }
238 
240 {
241  GetData().Init();
242  TransferDataToWindow();
243 }
244 
CAlgoToolManagerParamsPanel.
string m_RegPath
registry path to the settings
virtual void SetRegistryPath(const string &path)
CAlgoToolManagerParamsPanel.
bool Create(wxWindow *parent, wxWindowID id=ID_CDEBUGMACROTOOL, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxNO_BORDER|wxTAB_TRAVERSAL)
Creation.
CDebugMacroToolParams & GetData()
Data access.
void RestoreDefaults()
override in derived classes
void Init()
Initialises member variables.
void SetObjects(map< string, TConstScopedObjects > *objects)
virtual bool TransferDataFromWindow()
Transfer data from the window.
virtual void SaveSettings() const
override in derived classes
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void CreateControls()
Creates the controls and sizers.
static bool ShowToolTips()
Should we show tooltips?
CObjectListWidgetSel * m_ObjectSel
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
TConstScopedObjects & SetObjects()
void Init()
Initialises member variables.
virtual void SetRegistryPath(const string &path)
IRegSettings.
TConstScopedObjects GetSelection() const
void SetObjects(const TObjectListMap &value)
void SetTitle(const wxString &value)
virtual void SaveSettings() const
static const char * kObjectSel
static void Init(void)
Definition: cursor6.c:76
#define NULL
Definition: ncbistd.hpp:225
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
END_EVENT_TABLE()
#define wxT(x)
Definition: muParser.cpp:41
const struct ncbi::grid::netcache::search::fields::SIZE size
Modified on Fri Sep 20 14:58:26 2024 by modify_doxy.py rev. 669887