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

Go to the SVN repository for this file.

1 /* $Id: autodef_opt_feat_panel.cpp 37956 2017-03-08 13:58:01Z 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 // Generated by DialogBlocks (unregistered), 21/06/2013 14:54:07
31 
32 #include <ncbi_pch.hpp>
33 
34 ////@begin includes
35 ////@end includes
36 
38 
40 
41 #include <wx/sizer.h>
42 
43 ////@begin XPM images
44 ////@end XPM images
45 
47 
48 /*!
49  * CAutodefOptFeatPanel type definition
50  */
51 
52 IMPLEMENT_DYNAMIC_CLASS( CAutodefOptFeatPanel, wxPanel )
53 
54 
55 /*!
56  * CAutodefOptFeatPanel event table definition
57  */
58 
59 BEGIN_EVENT_TABLE( CAutodefOptFeatPanel, wxPanel )
60 
61 ////@begin CAutodefOptFeatPanel event table entries
63 
64 ////@end CAutodefOptFeatPanel event table entries
65 
67 
68 
69 /*!
70  * CAutodefOptFeatPanel constructors
71  */
72 
74 {
75  Init();
76 }
77 
78 CAutodefOptFeatPanel::CAutodefOptFeatPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
79 {
80  Init();
81  Create(parent, id, pos, size, style);
82 }
83 
84 
85 /*!
86  * CAutodefOptFeatPanel creator
87  */
88 
89 bool CAutodefOptFeatPanel::Create( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
90 {
91 ////@begin CAutodefOptFeatPanel creation
92  wxPanel::Create( parent, id, pos, size, style );
93 
95  if (GetSizer())
96  {
97  GetSizer()->SetSizeHints(this);
98  }
99  Centre();
100 ////@end CAutodefOptFeatPanel creation
101  return true;
102 }
103 
104 
105 /*!
106  * CAutodefOptFeatPanel destructor
107  */
108 
110 {
111 ////@begin CAutodefOptFeatPanel destruction
112 ////@end CAutodefOptFeatPanel destruction
113 }
114 
115 
116 /*!
117  * Member initialisation
118  */
119 
121 {
122 ////@begin CAutodefOptFeatPanel member initialisation
123  m_KeepExons = NULL;
127  m_Keep5UTRs = NULL;
128  m_Keep3UTRs = NULL;
133 ////@end CAutodefOptFeatPanel member initialisation
134 }
135 
136 
137 /*!
138  * Control creation for CAutodefOptFeatPanel
139  */
140 
142 {
143 ////@begin CAutodefOptFeatPanel content construction
144  CAutodefOptFeatPanel* itemPanel1 = this;
145 
146  wxStaticBox* itemStaticBoxSizer2Static = new wxStaticBox(itemPanel1, wxID_ANY, _("Optional Features"));
147  wxStaticBoxSizer* itemStaticBoxSizer2 = new wxStaticBoxSizer(itemStaticBoxSizer2Static, wxVERTICAL);
148  itemPanel1->SetSizer(itemStaticBoxSizer2);
149 
150  wxFlexGridSizer* itemFlexGridSizer3 = new wxFlexGridSizer(0, 4, 0, 0);
151  itemStaticBoxSizer2->Add(itemFlexGridSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 0);
152 
153  m_KeepExons = new wxCheckBox( itemStaticBoxSizer2->GetStaticBox(), ID_AD_FEAT_EXONS, _("Exons"), wxDefaultPosition, wxDefaultSize, 0 );
154  m_KeepExons->SetValue(false);
155  itemFlexGridSizer3->Add(m_KeepExons, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
156 
157  m_KeepIntrons = new wxCheckBox( itemStaticBoxSizer2->GetStaticBox(), ID_AD_FEAT_INTRONS, _("Introns"), wxDefaultPosition, wxDefaultSize, 0 );
158  m_KeepIntrons->SetValue(false);
159  itemFlexGridSizer3->Add(m_KeepIntrons, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
160 
161  wxCheckBox* itemCheckBox6 = new wxCheckBox( itemStaticBoxSizer2->GetStaticBox(), ID_AD_FEAT_PRERNA, _("Precursor RNAs"), wxDefaultPosition, wxDefaultSize, 0 );
162  itemCheckBox6->SetValue(false);
163  itemFlexGridSizer3->Add(itemCheckBox6, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
164 
165  wxCheckBox* itemCheckBox7 = new wxCheckBox( itemStaticBoxSizer2->GetStaticBox(), ID_AD_FEAT_NCRNA, _("ncRNAs that overlap precursor RNAs"), wxDefaultPosition, wxDefaultSize, 0 );
166  itemCheckBox7->SetValue(false);
167  itemFlexGridSizer3->Add(itemCheckBox7, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
168 
169  m_KeepMiscRecomb = new wxCheckBox( itemStaticBoxSizer2->GetStaticBox(), ID_CHECKBOX2, _("Misc_recomb"), wxDefaultPosition, wxDefaultSize, 0 );
170  m_KeepMiscRecomb->SetValue(false);
171  itemFlexGridSizer3->Add(m_KeepMiscRecomb, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
172 
173  wxCheckBox* itemCheckBox9 = new wxCheckBox( itemStaticBoxSizer2->GetStaticBox(), ID_AD_FEAT_UORF, _("uORFs"), wxDefaultPosition, wxDefaultSize, 0 );
174  itemCheckBox9->SetValue(false);
175  itemFlexGridSizer3->Add(itemCheckBox9, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
176 
177  wxCheckBox* itemCheckBox10 = new wxCheckBox( itemStaticBoxSizer2->GetStaticBox(), ID_AD_FEAT_MOBILE_ELEMENT, _("Optional Mobile Element"), wxDefaultPosition, wxDefaultSize, 0 );
178  itemCheckBox10->SetValue(false);
179  itemFlexGridSizer3->Add(itemCheckBox10, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
180 
181  m_KeepRepeatRegion = new wxCheckBox( itemStaticBoxSizer2->GetStaticBox(), ID_AD_FEAT_REPEAT_REGION, _("Repeat Regions"), wxDefaultPosition, wxDefaultSize, 0 );
182  m_KeepRepeatRegion->SetValue(false);
183  itemFlexGridSizer3->Add(m_KeepRepeatRegion, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
184 
185  m_Keep5UTRs = new wxCheckBox( itemStaticBoxSizer2->GetStaticBox(), ID_AD_FEAT_5UTR, _("5' UTRs"), wxDefaultPosition, wxDefaultSize, 0 );
186  m_Keep5UTRs->SetValue(false);
187  itemFlexGridSizer3->Add(m_Keep5UTRs, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
188 
189  m_Keep3UTRs = new wxCheckBox( itemStaticBoxSizer2->GetStaticBox(), ID_AD_FEAT_3UTR, _("3' UTRs"), wxDefaultPosition, wxDefaultSize, 0 );
190  m_Keep3UTRs->SetValue(false);
191  itemFlexGridSizer3->Add(m_Keep3UTRs, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
192 
193  wxBoxSizer* itemBoxSizer14 = new wxBoxSizer(wxVERTICAL);
194  itemFlexGridSizer3->Add(itemBoxSizer14, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 0);
195 
196  m_KeepMiscFeats = new wxCheckBox( itemStaticBoxSizer2->GetStaticBox(), ID_KEEP_MISC_FEATS, _("Misc feats with comments"), wxDefaultPosition, wxDefaultSize, 0 );
197  m_KeepMiscFeats->SetValue(false);
198  itemBoxSizer14->Add(m_KeepMiscFeats, 0, wxALIGN_LEFT|wxALL, 5);
199 
200  wxArrayString m_MiscFeatParseRuleStrings;
201  m_MiscFeatParseRuleStrings.Add(_("Look for Noncoding Products"));
202  m_MiscFeatParseRuleStrings.Add(_("Use comment before first semicolon"));
203  m_MiscFeatParseRule = new wxChoice( itemStaticBoxSizer2->GetStaticBox(), ID_AD_FEAT_MISC_FEAT_PARSE_RULE, wxDefaultPosition, wxDefaultSize, m_MiscFeatParseRuleStrings, 0 );
204  m_MiscFeatParseRule->SetStringSelection(_("Look for Noncoding Products"));
205  m_MiscFeatParseRule->Enable(false);
206  itemBoxSizer14->Add(m_MiscFeatParseRule, 0, wxALIGN_LEFT|wxALL, 5);
207 
208  wxBoxSizer* itemBoxSizer17 = new wxBoxSizer(wxVERTICAL);
209  itemFlexGridSizer3->Add(itemBoxSizer17, 0, wxALIGN_LEFT|wxALIGN_TOP|wxALL, 0);
210 
211  m_RegulatoryFeatures = new wxCheckBox( itemStaticBoxSizer2->GetStaticBox(), ID_REGULATORY_FEATURES, _("Regulatory features"), wxDefaultPosition, wxDefaultSize, 0 );
212  m_RegulatoryFeatures->SetValue(false);
213  itemBoxSizer17->Add(m_RegulatoryFeatures, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
214 
215  m_UseFakePromoters = new wxCheckBox( itemStaticBoxSizer2->GetStaticBox(), ID_AD_USE_FAKE_PROMOTERS, _("Add Promoters"), wxDefaultPosition, wxDefaultSize, 0 );
216  m_UseFakePromoters->SetValue(false);
217  itemBoxSizer17->Add(m_UseFakePromoters, 0, wxALIGN_LEFT|wxALL, 5);
218 
219 ////@end CAutodefOptFeatPanel content construction
220 }
221 
222 
223 /*!
224  * Should we show tooltips?
225  */
226 
228 {
229  return true;
230 }
231 
232 /*!
233  * Get bitmap resources
234  */
235 
236 wxBitmap CAutodefOptFeatPanel::GetBitmapResource( const wxString& name )
237 {
238  // Bitmap retrieval
239 ////@begin CAutodefOptFeatPanel bitmap retrieval
240  wxUnusedVar(name);
241  return wxNullBitmap;
242 ////@end CAutodefOptFeatPanel bitmap retrieval
243 }
244 
245 /*!
246  * Get icon resources
247  */
248 
249 wxIcon CAutodefOptFeatPanel::GetIconResource( const wxString& name )
250 {
251  // Icon retrieval
252 ////@begin CAutodefOptFeatPanel icon retrieval
253  wxUnusedVar(name);
254  return wxNullIcon;
255 ////@end CAutodefOptFeatPanel icon retrieval
256 }
257 
258 
260 {
261  m_KeepExons->SetValue (false);
262  m_Keep5UTRs->SetValue (false);
263  m_KeepIntrons->SetValue (false);
264  m_Keep3UTRs->SetValue (false);
265  m_RegulatoryFeatures->SetValue(false);
266  m_UseFakePromoters->SetValue(false);
267  m_KeepMiscRecomb->SetValue(false);
268  m_KeepRepeatRegion->SetValue(false);
269 
270  m_MiscFeatParseRule->SetSelection (0);
271 }
272 
273 
275 {
276  if (!params) {
277  Clear();
278  return;
279  }
280  m_KeepExons->SetValue (params->m_KeepExons);
281  m_Keep5UTRs->SetValue (params->m_Keep5UTRs);
282  m_KeepIntrons->SetValue (params->m_KeepIntrons);
283  m_Keep3UTRs->SetValue (params->m_Keep3UTRs);
285  m_UseFakePromoters->SetValue(params->m_UseFakePromoters);
286  m_KeepMiscRecomb->SetValue(params->m_KeepMiscRecomb);
287  m_KeepRepeatRegion->SetValue(params->m_KeepRepeatRegion);
288 
289  switch (params->m_MiscFeatRule) {
290  case objects::CAutoDefOptions::eNoncodingProductFeat:
291  m_KeepMiscFeats->SetValue (true);
292  m_MiscFeatParseRule->SetSelection (0);
293  m_MiscFeatParseRule->Enable(true);
294  break;
295  case objects::CAutoDefOptions::eCommentFeat:
296  m_KeepMiscFeats->SetValue (true);
297  m_MiscFeatParseRule->SetSelection (1);
298  m_MiscFeatParseRule->Enable(true);
299  break;
300  case objects::CAutoDefOptions::eDelete:
301  default:
302  m_KeepMiscFeats->SetValue (false);
303  m_MiscFeatParseRule->SetSelection (0);
304  m_MiscFeatParseRule->Enable(false);
305  break;
306  }
307 
308 }
309 
310 
312 {
313  params.m_KeepExons = m_KeepExons->GetValue ();
314  params.m_Keep5UTRs = m_Keep5UTRs->GetValue ();
315  params.m_KeepIntrons = m_KeepIntrons->GetValue ();
316  params.m_Keep3UTRs = m_Keep3UTRs->GetValue ();
317  params.m_KeepRegulatoryFeatures = m_RegulatoryFeatures->GetValue ();
318  params.m_UseFakePromoters = m_UseFakePromoters->GetValue();
319  params.m_KeepMiscRecomb = m_KeepMiscRecomb->GetValue();
320  params.m_KeepRepeatRegion = m_KeepRepeatRegion->GetValue();
321 
322  if (m_KeepMiscFeats->GetValue ()) {
323  if (m_MiscFeatParseRule->GetSelection() == 0) {
324  params.m_MiscFeatRule = objects::CAutoDefOptions::eNoncodingProductFeat;
325  } else {
326  params.m_MiscFeatRule = objects::CAutoDefOptions::eCommentFeat;
327  }
328  } else {
329  params.m_MiscFeatRule = objects::CAutoDefOptions::eDelete;
330  }
331 
332 }
333 
334 
335 
336 
337 /*!
338  * wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_KEEP_MISC_FEATS
339  */
340 
341 void CAutodefOptFeatPanel::OnKeepMiscFeatsClick( wxCommandEvent& event )
342 {
343  if (m_KeepMiscFeats->GetValue()) {
344  m_MiscFeatParseRule->Enable(true);
345  } else {
346  m_MiscFeatParseRule->Enable(false);
347  }
348 }
349 
350 
EVT_CHECKBOX(ID_CADJUSTFEATURES_CHECKBOX, CAdjustFeaturesForGaps::OnKnownUnknownSelected) EVT_CHECKBOX(ID_CADJUSTFEATURES_CHECKBOX1
static bool ShowToolTips()
Should we show tooltips?
void CreateControls()
Creates the controls and sizers.
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
bool Create(wxWindow *parent, wxWindowID id=ID_CAUTODEFOPTFEATPANEL, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxTAB_TRAVERSAL)
Creation.
void PopulateParams(SAutodefParams &params)
void Init()
Initialises member variables.
void OnKeepMiscFeatsClick(wxCommandEvent &event)
wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_KEEP_MISC_FEATS
void SetParams(SAutodefParams *params)
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
unsigned int m_MiscFeatRule
bool m_KeepRegulatoryFeatures
#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
Modified on Sun Mar 03 03:12:42 2024 by modify_doxy.py rev. 669887