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

Go to the SVN repository for this file.

1 /* $Id: advanced_cleanup_params_panel.cpp 44058 2019-10-17 16:50:04Z 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  * File Description:
29  *
30  */
31 
32 // Generated by DialogBlocks (unregistered), 16/09/2019 14:29:11
33 
34 #include <ncbi_pch.hpp>
35 
37 
39 
40 #include <wx/sizer.h>
41 #include <wx/statbox.h>
42 #include <wx/stattext.h>
43 #include <wx/checkbox.h>
44 
46 
48 
50 
51 ////@begin CAdvancedCleanupParamsPanel event table entries
52 ////@end CAdvancedCleanupParamsPanel event table entries
53 
55 
57 {
58  Init();
59 }
60 
61 CAdvancedCleanupParamsPanel::CAdvancedCleanupParamsPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
62 {
63  Init();
64  Create(parent, id, pos, size, style);
65 }
66 
67 bool CAdvancedCleanupParamsPanel::Create( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
68 {
69 ////@begin CAdvancedCleanupParamsPanel creation
70  SetExtraStyle(wxWS_EX_VALIDATE_RECURSIVELY);
71  CAlgoToolManagerParamsPanel::Create( parent, id, pos, size, style );
72 
74  if (GetSizer())
75  {
76  GetSizer()->SetSizeHints(this);
77  }
78  Centre();
79 ////@end CAdvancedCleanupParamsPanel creation
80  return true;
81 }
82 
84 {
85 ////@begin CAdvancedCleanupParamsPanel destruction
86 ////@end CAdvancedCleanupParamsPanel destruction
87 }
88 
90 {
91 ////@begin CAdvancedCleanupParamsPanel member initialisation
93 ////@end CAdvancedCleanupParamsPanel member initialisation
94 }
95 
97 {
98 ////@begin CAdvancedCleanupParamsPanel content construction
99  CAdvancedCleanupParamsPanel* itemPanel1 = this;
100 
101  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
102  itemPanel1->SetSizer(itemBoxSizer2);
103 
104  wxStaticBox* itemStaticBoxSizer1Static = new wxStaticBox(itemPanel1, wxID_ANY, _("Choose a set of alignments"));
105  wxStaticBoxSizer* itemStaticBoxSizer1 = new wxStaticBoxSizer(itemStaticBoxSizer1Static, wxVERTICAL);
106  itemBoxSizer2->Add(itemStaticBoxSizer1, 1, wxGROW|wxALL, 5);
107 
108  m_ObjectList = new CObjectListWidget( itemStaticBoxSizer1->GetStaticBox(), ID_LISTCTRL2, wxDefaultPosition, wxSize(300, 200), wxLC_REPORT );
109  itemStaticBoxSizer1->Add(m_ObjectList, 1, wxGROW|wxALL, 5);
110 
111  wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxHORIZONTAL);
112  itemBoxSizer2->Add(itemBoxSizer4, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
113 
114  wxStaticText* itemStaticText1 = new wxStaticText( itemPanel1, wxID_STATIC, _("Query type:"), wxDefaultPosition, wxDefaultSize, 0 );
115  itemBoxSizer4->Add(itemStaticText1, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
116 
117  wxArrayString itemChoice2Strings;
118  itemChoice2Strings.Add(_("Infer"));
119  itemChoice2Strings.Add(_("Genomic"));
120  itemChoice2Strings.Add(_("RNA"));
121  itemChoice2Strings.Add(_("Protein"));
122  wxChoice* itemChoice2 = new wxChoice( itemPanel1, ID_CHOICE, wxDefaultPosition, wxDefaultSize, itemChoice2Strings, 0 );
123  itemChoice2->SetStringSelection(_("Infer"));
124  itemBoxSizer4->Add(itemChoice2, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
125 
126  wxStaticText* itemStaticText3 = new wxStaticText( itemPanel1, wxID_STATIC, _("Splign direction:"), wxDefaultPosition, wxDefaultSize, 0 );
127  itemBoxSizer4->Add(itemStaticText3, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
128 
129  wxArrayString itemChoice4Strings;
130  itemChoice4Strings.Add(_("Sense"));
131  itemChoice4Strings.Add(_("Antisense"));
132  itemChoice4Strings.Add(_("Both"));
133  wxChoice* itemChoice4 = new wxChoice( itemPanel1, ID_CHOICE1, wxDefaultPosition, wxDefaultSize, itemChoice4Strings, 0 );
134  itemChoice4->SetStringSelection(_("Both"));
135  itemBoxSizer4->Add(itemChoice4, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
136 
137  wxCheckBox* itemCheckBox5 = new wxCheckBox( itemPanel1, ID_CHECKBOX, _("Invoke best placement"), wxDefaultPosition, wxDefaultSize, 0 );
138  itemCheckBox5->SetValue(true);
139  itemBoxSizer4->Add(itemCheckBox5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
140 
141  // Set validators
142  itemChoice2->SetValidator( wxGenericValidator(& GetData().m_QueryType) );
143  itemChoice4->SetValidator( wxGenericValidator(& GetData().m_SplignDirection) );
144  itemCheckBox5->SetValidator( wxGenericValidator(& GetData().m_InvokeBest) );
145 ////@end CAdvancedCleanupParamsPanel content construction
146 }
147 
149 {
150  return true;
151 }
152 wxBitmap CAdvancedCleanupParamsPanel::GetBitmapResource( const wxString& name )
153 {
154  // Bitmap retrieval
155 ////@begin CAdvancedCleanupParamsPanel bitmap retrieval
156  wxUnusedVar(name);
157  return wxNullBitmap;
158 ////@end CAdvancedCleanupParamsPanel bitmap retrieval
159 }
160 wxIcon CAdvancedCleanupParamsPanel::GetIconResource( const wxString& name )
161 {
162  // Icon retrieval
163 ////@begin CAdvancedCleanupParamsPanel icon retrieval
164  wxUnusedVar(name);
165  return wxNullIcon;
166 ////@end CAdvancedCleanupParamsPanel icon retrieval
167 }
168 
170 {
171  m_RegPath = path;
172 }
173 
174 static const char* kTableTag = "Table";
175 
177 {
178  if( ! m_RegPath.empty()) {
180  string reg_path = CGuiRegistryUtil::MakeKey(m_RegPath, kTableTag);
181 
182  CRegistryWriteView table_view = gui_reg.GetWriteView(reg_path);
183  m_ObjectList->SaveTableSettings(table_view);
184  }
185 }
186 
187 
189 {
190  if( ! m_RegPath.empty()) {
192  string reg_path = CGuiRegistryUtil::MakeKey(m_RegPath, kTableTag);
193 
194  CRegistryReadView table_view = gui_reg.GetReadView(reg_path);
195  m_ObjectList->LoadTableSettings(table_view);
196  }
197 }
198 
200 {
201  GetData().Init();
203 }
204 
206 {
207  return CAlgoToolManagerParamsPanel::TransferDataToWindow();
208 }
209 
211 {
212  if (!CAlgoToolManagerParamsPanel::TransferDataFromWindow())
213  return false;
214 
215  GetData().m_Objects.clear();
216  m_ObjectList->GetSelection(GetData().m_Objects);
217 
218  return true;
219 }
220 
222 {
225 }
226 
static const char * kTableTag
wxBitmap GetBitmapResource(const wxString &name)
virtual void SetRegistryPath(const string &path)
CAlgoToolManagerParamsPanel.
void SetObjects(TConstScopedObjects *objects)
virtual void SaveSettings() const
override in derived classes
wxIcon GetIconResource(const wxString &name)
void RestoreDefaults()
override in derived classes
bool Create(wxWindow *parent, wxWindowID id=ID_CADVANCEDCLEANUPPARAMSPANEL, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxTAB_TRAVERSAL)
CAlgoToolManagerParamsPanel.
static string MakeKey(const string &section, const string &key, const string &delim=CGuiRegistry::kDecimalDot)
create a key from a section and a subkey
Definition: registry.cpp:504
CRegistryWriteView GetWriteView(const string &section)
get a read-write view at a particular level.
Definition: registry.cpp:462
static CGuiRegistry & GetInstance()
access the application-wide singleton
Definition: registry.cpp:400
CRegistryReadView GetReadView(const string &section) const
get a read-only view at a particular level.
Definition: registry.cpp:428
CObjectListWidget - mediator widget.
void SetObjects(TConstScopedObjects &objects)
void GetSelection(TConstScopedObjects &objects)
ISelection-style API.
class CRegistryReadView provides a nested hierarchical view at a particular key.
Definition: reg_view.hpp:58
void LoadTableSettings(const CRegistryReadView &view, bool byName=false)
void SaveTableSettings(CRegistryWriteView &view, bool saveSorting=true) const
#define _(proto)
Definition: ct_nlmzip_i.h:78
static void Init(void)
Definition: cursor6.c:76
#define NULL
Definition: ncbistd.hpp:225
vector< SConstScopedObject > TConstScopedObjects
Definition: objects.hpp:65
#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 Wed May 01 14:22:52 2024 by modify_doxy.py rev. 669887