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

Go to the SVN repository for this file.

1 /* $Id: subvalidate_panel.cpp 43399 2019-06-24 18:58:25Z filippov $
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: Andrea Asztalos
27  */
28 
29 
30 #include <ncbi_pch.hpp>
34 
35 #include <wx/sizer.h>
36 #include <wx/button.h>
37 #include <wx/icon.h>
38 
39 
41 
42 /*
43  * CSubValidatePanel type definition
44  */
45 
46 IMPLEMENT_DYNAMIC_CLASS( CSubValidatePanel, wxPanel )
47 
48 
49 /*
50  * CSubValidatePanel event table definition
51  */
52 
53 BEGIN_EVENT_TABLE( CSubValidatePanel, wxPanel )
54 
55 ////@begin CSubValidatePanel event table entries
56  EVT_BUTTON( ID_CSUBVALIDATE_REFRESH, CSubValidatePanel::OnValidateClick )
57 ////@end CSubValidatePanel event table entries
58 
60 
61 
62 /*
63  * CSubValidatePanel constructors
64  */
65 
67  : m_Workbench(nullptr)
68 {
69  Init();
70 }
71 
72 CSubValidatePanel::CSubValidatePanel( wxWindow* parent, IWorkbench* wb, objects::CGBProjectHandle* ph,
73  objects::CProjectItem* pi, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
74  : m_Workbench(wb), m_ProjectHandle(ph), m_ProjectItem(pi)
75 {
76  Init();
77  Create(parent, id, pos, size, style);
78 }
79 
80 
81 /*
82  * CSubValidatePanel creator
83  */
84 
85 bool CSubValidatePanel::Create( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
86 {
87 ////@begin CSubValidatePanel creation
88  SetExtraStyle(wxWS_EX_VALIDATE_RECURSIVELY);
89  wxPanel::Create( parent, id, pos, size, style );
90 
91  CreateControls();
92  Centre();
93 ////@end CSubValidatePanel creation
94  return true;
95 }
96 
97 
98 /*
99  * CSubValidatePanel destructor
100  */
101 
103 {
104 ////@begin CSubValidatePanel destruction
105 ////@end CSubValidatePanel destruction
106 }
107 
108 
109 /*
110  * Member initialisation
111  */
112 
114 {
115 ////@begin CSubValidatePanel member initialisation
116  m_Panel = NULL;
117 ////@end CSubValidatePanel member initialisation
118 }
119 
120 
121 /*
122  * Control creation for CSubValidatePanel
123  */
124 
126 {
127 ////@begin CSubValidatePanel content construction
128  CSubValidatePanel* itemPanel1 = this;
129 
130  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
131  itemPanel1->SetSizer(itemBoxSizer2);
132 
133  CRef<objects::CUser_object> params(new objects::CUser_object());
136 
137  m_Panel = new CValidatePanel( itemPanel1, m_Workbench, params);
138  itemBoxSizer2->Add(m_Panel, 1, wxGROW|wxALL, 0);
139 
140  itemBoxSizer2->Add(5, 5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
141 
142  wxButton* itemButton4 = new wxButton( itemPanel1, ID_CSUBVALIDATE_REFRESH, _("Validate record"), wxDefaultPosition, wxDefaultSize, 0 );
143  itemBoxSizer2->Add(itemButton4, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
144 
145 ////@end CSubValidatePanel content construction
146 }
147 
149 {
150  return false;
151 }
152 
153 
154 /*
155  * Should we show tooltips?
156  */
157 
159 {
160  return true;
161 }
162 
163 /*
164  * Get bitmap resources
165  */
166 
167 wxBitmap CSubValidatePanel::GetBitmapResource( const wxString& name )
168 {
169  // Bitmap retrieval
170 ////@begin CSubValidatePanel bitmap retrieval
171  wxUnusedVar(name);
172  return wxNullBitmap;
173 ////@end CSubValidatePanel bitmap retrieval
174 }
175 
176 /*
177  * Get icon resources
178  */
179 
180 wxIcon CSubValidatePanel::GetIconResource( const wxString& name )
181 {
182  // Icon retrieval
183 ////@begin CSubValidatePanel icon retrieval
184  wxUnusedVar(name);
185  return wxNullIcon;
186 ////@end CSubValidatePanel icon retrieval
187 }
188 
189 
190 /*
191  * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_CSUBVALIDATE_REFRESH
192  */
193 
194 void CSubValidatePanel::OnValidateClick(wxCommandEvent& event)
195 {
197  m_Panel->LoadData();
198  Refresh();
199 }
200 
201 
203 {
204  return wxPanel::TransferDataToWindow();
205 }
206 
208 
bool Create(wxWindow *parent, wxWindowID id=ID_CSUBVALIDATEPANEL, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxTAB_TRAVERSAL)
Creation.
static bool ShowToolTips()
Should we show tooltips?
CValidatePanel * m_Panel
void OnValidateClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_CSUBVALIDATE_REFRESH
CSubValidatePanel()
Constructors.
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
objects::CGBProjectHandle * m_ProjectHandle
~CSubValidatePanel()
Destructor.
void Init()
Initialises member variables.
virtual bool TransferDataToWindow()
virtual bool IsLastPage() const
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
objects::CProjectItem * m_ProjectItem
void CreateControls()
Creates the controls and sizers.
static void SetDoInference(objects::CUser_object &params, bool val)
static void SetDoAlignment(objects::CUser_object &params, bool val)
void LoadData(void)
void SetProjectHandleAndItem(objects::CGBProjectHandle *ph, objects::CProjectItem *pi)
IWorkbench is the central interface in the application framework.
Definition: workbench.hpp:113
#define _(proto)
Definition: ct_nlmzip_i.h:78
static void Init(void)
Definition: cursor6.c:76
#define NULL
Definition: ncbistd.hpp:225
const float pi
Definition: math.hpp:54
#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
Modified on Sun Mar 03 03:11:25 2024 by modify_doxy.py rev. 669887