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

Go to the SVN repository for this file.

1 /* $Id: net_blast_dm_search_form_panel.cpp 27848 2013-04-12 18:51:49Z kuznets $
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: Andrey Yazhuk
27  *
28  * File Description:
29  *
30  */
31 
32 #include <ncbi_pch.hpp>
33 
34 ////@begin includes
35 ////@end includes
36 
38 
40 
41 ////@begin XPM images
42 ////@end XPM images
43 
44 
45 #include <wx/sizer.h>
46 #include <wx/icon.h>
47 #include <wx/bitmap.h>
48 #include <wx/stattext.h>
49 #include <wx/textctrl.h>
50 #include <wx/button.h>
51 #include <wx/checkbox.h>
52 #include <wx/statbox.h>
53 
54 
56 
57 IMPLEMENT_DYNAMIC_CLASS( CNetBlastDMSearchFormPanel, wxPanel )
58 
59 BEGIN_EVENT_TABLE( CNetBlastDMSearchFormPanel, wxPanel )
60 ////@begin CNetBlastDMSearchFormPanel event table entries
61  EVT_TEXT( ID_FILTER_INPUT, CNetBlastDMSearchFormPanel::OnFilterInputTextUpdated )
62 
63  EVT_BUTTON( wxID_RESET, CNetBlastDMSearchFormPanel::OnResetClick )
64 
66 
67 ////@end CNetBlastDMSearchFormPanel event table entries
73 
74 
76 {
77  Init();
78 }
79 
80 
81 CNetBlastDMSearchFormPanel::CNetBlastDMSearchFormPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
82 {
83  Init();
84  Create(parent, id, pos, size, style);
85 }
86 
87 
88 bool CNetBlastDMSearchFormPanel::Create( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
89 {
90 ////@begin CNetBlastDMSearchFormPanel creation
91  wxPanel::Create( parent, id, pos, size, style );
92 
94  Centre();
95 ////@end CNetBlastDMSearchFormPanel creation
96  return true;
97 }
98 
99 
101 {
102 ////@begin CNetBlastDMSearchFormPanel destruction
103 ////@end CNetBlastDMSearchFormPanel destruction
104 }
105 
106 
108 {
109 ////@begin CNetBlastDMSearchFormPanel member initialisation
110  m_Completed = true;
111  m_Submitted = true;
112  m_Failed = true;
113  m_Retrieved = true;
114  m_Expired = true;
115  m_SearchCtrl = NULL;
116  m_ResetBtn = NULL;
117 ////@end CNetBlastDMSearchFormPanel member initialisation
118 }
119 
120 
122 {
123 ////@begin CNetBlastDMSearchFormPanel content construction
124  CNetBlastDMSearchFormPanel* itemPanel1 = this;
125 
126  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
127  itemPanel1->SetSizer(itemBoxSizer2);
128 
129  wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
130  itemBoxSizer2->Add(itemBoxSizer3, 0, wxGROW, 5);
131 
132  wxStaticText* itemStaticText4 = new wxStaticText( itemPanel1, wxID_STATIC, wxT("Filter:"), wxDefaultPosition, wxDefaultSize, 0 );
133  itemBoxSizer3->Add(itemStaticText4, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
134 
135  m_SearchCtrl = new wxTextCtrl( itemPanel1, ID_FILTER_INPUT, wxT(""), wxDefaultPosition, wxDefaultSize, 0 );
136  itemBoxSizer3->Add(m_SearchCtrl, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5);
137 
138  m_ResetBtn = new wxButton( itemPanel1, wxID_RESET, wxT("Reset"), wxDefaultPosition, wxDefaultSize, 0 );
139  itemBoxSizer3->Add(m_ResetBtn, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
140 
141  wxBoxSizer* itemBoxSizer7 = new wxBoxSizer(wxHORIZONTAL);
142  itemBoxSizer2->Add(itemBoxSizer7, 0, wxGROW, 5);
143 
144  wxStaticText* itemStaticText8 = new wxStaticText( itemPanel1, wxID_STATIC, wxT("Show Jobs:"), wxDefaultPosition, wxDefaultSize, 0 );
145  itemBoxSizer7->Add(itemStaticText8, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
146 
147  wxCheckBox* itemCheckBox9 = new wxCheckBox( itemPanel1, ID_SUBMITTED_CHECK, wxT("Submitted"), wxDefaultPosition, wxDefaultSize, 0 );
148  itemCheckBox9->SetValue(false);
149  itemBoxSizer7->Add(itemCheckBox9, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
150 
151  wxCheckBox* itemCheckBox10 = new wxCheckBox( itemPanel1, ID_COMPLETED_CHECK, wxT("Completed"), wxDefaultPosition, wxDefaultSize, 0 );
152  itemCheckBox10->SetValue(false);
153  itemBoxSizer7->Add(itemCheckBox10, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
154 
155  wxCheckBox* itemCheckBox11 = new wxCheckBox( itemPanel1, ID_FAILED_CHECK, wxT("Failed"), wxDefaultPosition, wxDefaultSize, 0 );
156  itemCheckBox11->SetValue(false);
157  itemBoxSizer7->Add(itemCheckBox11, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
158 
159  wxCheckBox* itemCheckBox12 = new wxCheckBox( itemPanel1, ID_RETRIEVED_CHECK, wxT("Retrieved"), wxDefaultPosition, wxDefaultSize, 0 );
160  itemCheckBox12->SetValue(false);
161  itemBoxSizer7->Add(itemCheckBox12, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
162 
163  wxCheckBox* itemCheckBox13 = new wxCheckBox( itemPanel1, ID_EXPIRED_CHECK, wxT("Expired / Invalid"), wxDefaultPosition, wxDefaultSize, 0 );
164  itemCheckBox13->SetValue(false);
165  itemBoxSizer7->Add(itemCheckBox13, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
166 
167  // Set validators
168  m_SearchCtrl->SetValidator( wxGenericValidator(& m_SearchValue) );
169  itemCheckBox9->SetValidator( wxGenericValidator(& m_Submitted) );
170  itemCheckBox10->SetValidator( wxGenericValidator(& m_Completed) );
171  itemCheckBox11->SetValidator( wxGenericValidator(& m_Failed) );
172  itemCheckBox12->SetValidator( wxGenericValidator(& m_Retrieved) );
173  itemCheckBox13->SetValidator( wxGenericValidator(& m_Expired) );
174 ////@end CNetBlastDMSearchFormPanel content construction
175 }
176 
177 
178 wxBitmap CNetBlastDMSearchFormPanel::GetBitmapResource( const wxString& name )
179 {
180  // Bitmap retrieval
181 ////@begin CNetBlastDMSearchFormPanel bitmap retrieval
182  wxUnusedVar(name);
183  return wxNullBitmap;
184 ////@end CNetBlastDMSearchFormPanel bitmap retrieval
185 }
186 
187 
188 wxIcon CNetBlastDMSearchFormPanel::GetIconResource( const wxString& name )
189 {
190  // Icon retrieval
191 ////@begin CNetBlastDMSearchFormPanel icon retrieval
192  wxUnusedVar(name);
193  return wxNullIcon;
194 ////@end CNetBlastDMSearchFormPanel icon retrieval
195 }
196 
197 
199 {
200  if( ! m_BlockEvents) {
201  m_SearchValue = m_SearchCtrl->GetValue();
202  RestartSearch();
203  }
204 }
205 
206 
207 void CNetBlastDMSearchFormPanel::OnResetClick( wxCommandEvent& event )
208 {
209  m_SearchCtrl->SetValue(wxT(""));
210 }
211 
212 
214 {
215  return true;
216 }
217 
218 
220 {
221  RestartSearch();
222 }
223 
224 
226 {
228  evt.SetEventObject(this);
229  GetEventHandler()->ProcessEvent(evt);
230 }
231 
232 
234 {
235  m_BlockEvents = true;
236  bool res = wxPanel::TransferDataToWindow();
237  m_BlockEvents = false;
238  return res;
239 }
240 
EVT_CHECKBOX(ID_CADJUSTFEATURES_CHECKBOX, CAdjustFeaturesForGaps::OnKnownUnknownSelected) EVT_CHECKBOX(ID_CADJUSTFEATURES_CHECKBOX1
static void Init(void)
Definition: cursor6.c:76
#define NULL
Definition: ncbistd.hpp:225
void OnSubmittedCheckClick(wxCommandEvent &event)
wxBitmap GetBitmapResource(const wxString &name)
void OnFilterInputTextUpdated(wxCommandEvent &event)
bool Create(wxWindow *parent, wxWindowID id=ID_CNETBLASTDMSEARCHFORM, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL)
wxIcon GetIconResource(const wxString &name)
void OnResetClick(wxCommandEvent &event)
#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
wxEVT_COMMAND_MENU_SELECTED
Modified on Fri Mar 01 10:07:30 2024 by modify_doxy.py rev. 669887