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

Go to the SVN repository for this file.

1 /* $Id: wig_params_panel.cpp 28586 2013-08-02 19:32:29Z 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 #include <wx/sizer.h>
33 #include "wx/valgen.h"
34 #include "wx/valtext.h"
35 #include "wx/stattext.h"
36 #include "wx/statbox.h"
37 #include "wx/choice.h"
38 #include "wx/spinctrl.h"
39 #include "wx/bitmap.h"
40 #include "wx/icon.h"
41 
44 
46 
47 /*!
48  * CWigParamsPanel type definition
49  */
50 
51 IMPLEMENT_DYNAMIC_CLASS( CWigParamsPanel, wxPanel )
52 
53 
54 /*!
55  * CWigParamsPanel event table definition
56  */
57 
58 BEGIN_EVENT_TABLE( CWigParamsPanel, wxPanel )
59 
60 ////@begin CWigParamsPanel event table entries
61 ////@end CWigParamsPanel event table entries
62 
64 
65 
66 /*!
67  * CWigParamsPanel constructors
68  */
69 
71 {
72  Init();
73 }
74 
75 CWigParamsPanel::CWigParamsPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
76 {
77  Init();
78  Create(parent, id, pos, size, style);
79 }
80 
81 
82 /*!
83  * CWigParamsPanel creator
84  */
85 
86 bool CWigParamsPanel::Create( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
87 {
88 ////@begin CWigParamsPanel creation
89  SetExtraStyle(wxWS_EX_VALIDATE_RECURSIVELY);
90  wxPanel::Create( parent, id, pos, size, style );
91 
93  if (GetSizer())
94  {
95  GetSizer()->SetSizeHints(this);
96  }
97  Centre();
98 ////@end CWigParamsPanel creation
99  return true;
100 }
101 
102 
103 /*!
104  * CWigParamsPanel destructor
105  */
106 
108 {
109 ////@begin CWigParamsPanel destruction
110 ////@end CWigParamsPanel destruction
111 }
112 
113 
114 /*!
115  * Member initialisation
116  */
117 
119 {
120 ////@begin CWigParamsPanel member initialisation
122 ////@end CWigParamsPanel member initialisation
123 }
124 
125 
126 /*!
127  * Control creation for CWigParamsPanel
128  */
129 
130 // Fix Solaris/DialogBlocks issue
131 #ifndef _T
132  #define _T wxT
133 #endif
134 
136 {
137 ////@begin CWigParamsPanel content construction
138  CWigParamsPanel* itemPanel1 = this;
139 
140  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxHORIZONTAL);
141  itemPanel1->SetSizer(itemBoxSizer2);
142 
143  wxStaticBox* itemStaticBoxSizer3Static = new wxStaticBox(itemPanel1, wxID_ANY, _("WIG Load Parameters"));
144  wxStaticBoxSizer* itemStaticBoxSizer3 = new wxStaticBoxSizer(itemStaticBoxSizer3Static, wxVERTICAL);
145  itemBoxSizer2->Add(itemStaticBoxSizer3, 0, wxALIGN_TOP|wxALL, 5);
146 
147  wxFlexGridSizer* itemFlexGridSizer4 = new wxFlexGridSizer(0, 2, 0, 0);
148  itemStaticBoxSizer3->Add(itemFlexGridSizer4, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
149 
150  wxStaticText* itemStaticText5 = new wxStaticText( itemPanel1, wxID_STATIC, _("Stop when number of errors reaches"), wxDefaultPosition, wxDefaultSize, 0 );
151  itemFlexGridSizer4->Add(itemStaticText5, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
152 
153  wxSpinCtrl* itemSpinCtrl6 = new wxSpinCtrl( itemPanel1, ID_SPINCTRL1, _T("10"), wxDefaultPosition, wxDefaultSize, wxSP_ARROW_KEYS, 1, 1000, 10 );
154  itemFlexGridSizer4->Add(itemSpinCtrl6, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);
155 
156  m_AssemblyPanel = new CAssemblySelPanel( itemPanel1, ID_PANEL10, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxTAB_TRAVERSAL );
157  itemBoxSizer2->Add(m_AssemblyPanel, 1, wxALIGN_TOP|wxALL, 5);
158 
159  // Set validators
160  itemSpinCtrl6->SetValidator( wxGenericValidator(& GetData().m_NumErrors) );
161 ////@end CWigParamsPanel content construction
162 }
163 
164 
165 /*!
166  * Should we show tooltips?
167  */
168 
170 {
171  return true;
172 }
173 
174 /*!
175  * Get bitmap resources
176  */
177 
178 wxBitmap CWigParamsPanel::GetBitmapResource( const wxString& name )
179 {
180  // Bitmap retrieval
181 ////@begin CWigParamsPanel bitmap retrieval
182  wxUnusedVar(name);
183  return wxNullBitmap;
184 ////@end CWigParamsPanel bitmap retrieval
185 }
186 
187 /*!
188  * Get icon resources
189  */
190 
191 wxIcon CWigParamsPanel::GetIconResource( const wxString& name )
192 {
193  // Icon retrieval
194 ////@begin CWigParamsPanel icon retrieval
195  wxUnusedVar(name);
196  return wxNullIcon;
197 ////@end CWigParamsPanel icon retrieval
198 }
199 
200 /*!
201  * Transfer data to the window
202  */
203 
205 {
206  m_AssemblyPanel->SetData(GetData().GetMapAssembly());
207 
208  if (!wxPanel::TransferDataToWindow())
209  return false;
210 
211  return true;
212 }
213 
214 /*!
215  * Transfer data from the window
216  */
217 
219 {
220  if (!wxPanel::TransferDataFromWindow())
221  return false;
222 
224 
225  return true;
226 }
227 
CMapAssemblyParams & GetData()
Data access.
void SetData(const CMapAssemblyParams &data)
void SetMapAssembly(CMapAssemblyParams value)
CAssemblySelPanel * m_AssemblyPanel
~CWigParamsPanel()
Destructor.
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
bool Create(wxWindow *parent, wxWindowID id=10052, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxTAB_TRAVERSAL)
Creation.
virtual bool TransferDataFromWindow()
Transfer data from the window.
virtual bool TransferDataToWindow()
Transfer data to the window.
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
void CreateControls()
Creates the controls and sizers.
void Init()
Initialises member variables.
CWigLoadParams & GetData()
Data access.
static bool ShowToolTips()
Should we show tooltips?
CWigParamsPanel()
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
static static static wxID_ANY
#define _T
#define ID_SPINCTRL1
#define ID_PANEL10
Modified on Mon Feb 26 04:01:36 2024 by modify_doxy.py rev. 669887