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

Go to the SVN repository for this file.

1 /* $Id: virus_molecule_questions_panel.cpp 28329 2013-06-19 11:58:38Z bollin $
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: Colleen Bollin
27  */
28 
29 
30 #include <ncbi_pch.hpp>
31 
32 ////@begin includes
33 ////@end includes
34 
39 
40 #include <wx/statbox.h>
41 
42 ////@begin XPM images
43 ////@end XPM images
44 
46 
47 static const string kCdnaSource = "cDNA derived from";
48 static const string kVirusMaterial = "virus source material";
49 
50 /*!
51  * CVirusMoleculeQuestionsPanel type definition
52  */
53 
54 IMPLEMENT_DYNAMIC_CLASS( CVirusMoleculeQuestionsPanel, wxPanel )
55 
56 
57 /*!
58  * CVirusMoleculeQuestionsPanel event table definition
59  */
60 
61 BEGIN_EVENT_TABLE( CVirusMoleculeQuestionsPanel, wxPanel )
62 
63 ////@begin CVirusMoleculeQuestionsPanel event table entries
65 
67 
69 
71 
72 ////@end CVirusMoleculeQuestionsPanel event table entries
73 
75 
76 
77 /*!
78  * CVirusMoleculeQuestionsPanel constructors
79  */
80 
82 {
83  Init();
84 }
85 
87  objects::CSeq_entry_Handle seh,
88  ICommandProccessor* processor,
89  wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
90  : m_Seh(seh) ,
91  m_CmdProcessor(processor)
92 {
93  Init();
94  Create(parent, id, pos, size, style);
95 }
96 
97 
98 /*!
99  * CVirusMoleculeQuestionsPanel creator
100  */
101 
102 bool CVirusMoleculeQuestionsPanel::Create( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
103 {
104 ////@begin CVirusMoleculeQuestionsPanel creation
105  wxPanel::Create( parent, id, pos, size, style );
106 
107  CreateControls();
108  if (GetSizer())
109  {
110  GetSizer()->SetSizeHints(this);
111  }
112  Centre();
113 ////@end CVirusMoleculeQuestionsPanel creation
114  return true;
115 }
116 
117 
118 /*!
119  * CVirusMoleculeQuestionsPanel destructor
120  */
121 
123 {
124 ////@begin CVirusMoleculeQuestionsPanel destruction
125 ////@end CVirusMoleculeQuestionsPanel destruction
126 }
127 
128 
129 /*!
130  * Member initialisation
131  */
132 
134 {
135 ////@begin CVirusMoleculeQuestionsPanel member initialisation
138  m_Purified = NULL;
139  m_WholeCell = NULL;
140 ////@end CVirusMoleculeQuestionsPanel member initialisation
141 }
142 
143 
144 /*!
145  * Control creation for CVirusMoleculeQuestionsPanel
146  */
147 
149 {
150 ////@begin CVirusMoleculeQuestionsPanel content construction
151  // Generated by DialogBlocks, 10/06/2013 17:52:05 (unregistered)
152 
153  CVirusMoleculeQuestionsPanel* itemPanel1 = this;
154 
155  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
156  itemPanel1->SetSizer(itemBoxSizer2);
157 
158  wxStaticBox* itemStaticBoxSizer3Static = new wxStaticBox(itemPanel1, wxID_ANY, _("What do the mRNA sequences in your submission represent?"));
159  wxStaticBoxSizer* itemStaticBoxSizer3 = new wxStaticBoxSizer(itemStaticBoxSizer3Static, wxVERTICAL);
160  itemBoxSizer2->Add(itemStaticBoxSizer3, 0, wxALIGN_LEFT|wxALL, 5);
161 
162  m_CdnaFromMrna = new wxRadioButton( itemPanel1, ID_CDNA_FROM_MRNA, _("cDNA derived from mRNA"), wxDefaultPosition, wxSize(300, -1), 0 );
163  m_CdnaFromMrna->SetValue(false);
164  itemStaticBoxSizer3->Add(m_CdnaFromMrna, 0, wxALIGN_LEFT|wxALL, 5);
165 
166  m_CdnaFromGenomic = new wxRadioButton( itemPanel1, ID_CDNA_FROM_GENOMIC, _("cDNA derived from genomic RNA"), wxDefaultPosition, wxDefaultSize, 0 );
167  m_CdnaFromGenomic->SetValue(false);
168  itemStaticBoxSizer3->Add(m_CdnaFromGenomic, 0, wxALIGN_LEFT|wxALL, 5);
169 
170  wxStaticBox* itemStaticBoxSizer6Static = new wxStaticBox(itemPanel1, wxID_ANY, _("What is the source material for the virus?"));
171  wxStaticBoxSizer* itemStaticBoxSizer6 = new wxStaticBoxSizer(itemStaticBoxSizer6Static, wxVERTICAL);
172  itemBoxSizer2->Add(itemStaticBoxSizer6, 0, wxALIGN_LEFT|wxALL, 5);
173 
174  m_Purified = new wxRadioButton( itemPanel1, ID_PURIFIED, _("purified viral particles"), wxDefaultPosition, wxSize(300, -1), 0 );
175  m_Purified->SetValue(false);
176  itemStaticBoxSizer6->Add(m_Purified, 0, wxALIGN_LEFT|wxALL, 5);
177 
178  m_WholeCell = new wxRadioButton( itemPanel1, ID_WHOLE_CELL, _("whole cell/tissue lysate"), wxDefaultPosition, wxDefaultSize, 0 );
179  m_WholeCell->SetValue(false);
180  itemStaticBoxSizer6->Add(m_WholeCell, 0, wxALIGN_LEFT|wxALL, 5);
181 
182 ////@end CVirusMoleculeQuestionsPanel content construction
183 }
184 
185 
186 /*!
187  * Should we show tooltips?
188  */
189 
191 {
192  return true;
193 }
194 
195 /*!
196  * Get bitmap resources
197  */
198 
199 wxBitmap CVirusMoleculeQuestionsPanel::GetBitmapResource( const wxString& name )
200 {
201  // Bitmap retrieval
202 ////@begin CVirusMoleculeQuestionsPanel bitmap retrieval
203  wxUnusedVar(name);
204  return wxNullBitmap;
205 ////@end CVirusMoleculeQuestionsPanel bitmap retrieval
206 }
207 
208 /*!
209  * Get icon resources
210  */
211 
212 wxIcon CVirusMoleculeQuestionsPanel::GetIconResource( const wxString& name )
213 {
214  // Icon retrieval
215 ////@begin CVirusMoleculeQuestionsPanel icon retrieval
216  wxUnusedVar(name);
217  return wxNullIcon;
218 ////@end CVirusMoleculeQuestionsPanel icon retrieval
219 }
220 
221 
222 /*!
223  * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_WHOLE_CELL
224  */
225 
227 {
230 }
231 
232 
233 /*!
234  * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_PURIFIED
235  */
236 
238 {
241 }
242 
243 
244 /*!
245  * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_CDNA_FROM_GENOMIC
246  */
247 
249 {
252 }
253 
254 
255 /*!
256  * wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_CDNA_FROM_MRNA
257  */
258 
260 {
263 }
264 
265 
267 {
269  if (NStr::Equal(cdna_src, ToStdString(m_CdnaFromMrna->GetLabel()))) {
270  m_CdnaFromMrna->SetValue(true);
271  } else {
272  m_CdnaFromMrna->SetValue(false);
273  }
274  if (NStr::Equal(cdna_src, ToStdString(m_CdnaFromGenomic->GetLabel()))) {
275  m_CdnaFromGenomic->SetValue(true);
276  } else {
277  m_CdnaFromGenomic->SetValue(false);
278  }
280  if (NStr::Equal(virus_src, ToStdString(m_Purified->GetLabel()))) {
281  m_Purified->SetValue(true);
282  } else {
283  m_Purified->SetValue(false);
284  }
285  if (NStr::Equal(virus_src, ToStdString(m_WholeCell->GetLabel()))) {
286  m_WholeCell->SetValue(true);
287  } else {
288  m_WholeCell->SetValue(false);
289  }
290 }
291 
292 
static string GetWizardFieldFromSeqEntry(objects::CSeq_entry_Handle entry, string field_name)
static CRef< CCmdComposite > SetWizardFieldInSeqEntry(objects::CSeq_entry_Handle entry, string field_name, string value)
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void OnCdnaFromGenomicSelected(wxCommandEvent &event)
wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_CDNA_FROM_GENOMIC
void OnWholeCellSelected(wxCommandEvent &event)
wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_WHOLE_CELL
bool Create(wxWindow *parent, wxWindowID id=10114, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxTAB_TRAVERSAL)
Creation.
static bool ShowToolTips()
Should we show tooltips?
void OnPurifiedSelected(wxCommandEvent &event)
wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_PURIFIED
void OnCdnaFromMrnaSelected(wxCommandEvent &event)
wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_CDNA_FROM_MRNA
void Init()
Initialises member variables.
void CreateControls()
Creates the controls and sizers.
Undo/Redo interface for editing operations.
virtual void Execute(IEditCommand *command, wxWindow *window=0)=0
static CS_COMMAND * cmd
Definition: ct_dynamic.c:26
#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
static bool Equal(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2, ECase use_case=eCase)
Test for equality of a substring with another string.
Definition: ncbistr.hpp:5384
END_EVENT_TABLE()
const struct ncbi::grid::netcache::search::fields::SIZE size
static static static wxID_ANY
static const string kVirusMaterial
static const string kCdnaSource
#define ID_CDNA_FROM_GENOMIC
#define ID_CDNA_FROM_MRNA
string ToStdString(const wxString &s)
Definition: wx_utils.hpp:161
Modified on Wed Feb 28 07:14:36 2024 by modify_doxy.py rev. 669887