42 #include <wx/checkbox.h>
43 #include <wx/textctrl.h>
44 #include <wx/stattext.h>
45 #include <wx/valtext.h>
46 #include <wx/listctrl.h>
47 #include <wx/statbox.h>
50 #include <wx/bitmap.h>
52 #include <wx/toplevel.h>
53 #include <wx/scrolwin.h>
54 #include <wx/hyperlink.h>
103 m_User =
new objects::CUser_object();
119 wxPanel::Create( parent,
id, pos,
size, style );
124 GetSizer()->SetSizeHints(
this);
154 bool replace_all =
false;
155 wxSizer *sizer =
NULL;
156 wxWindow *win = GetParent();
158 sizer = win->GetSizer();
162 wxSizerItemList& itemList = sizer->GetChildren();
163 for (
size_t i = 0;
i < itemList.size();
i++)
165 wxCheckBox* c_btn =
dynamic_cast<wxCheckBox*
>(itemList[
i]->GetWindow());
166 if (c_btn && c_btn->GetLabel() ==
_(
"Replace All"))
168 replace_all = c_btn->GetValue();
217 wxBoxSizer* itemBoxSizer2 =
new wxBoxSizer(wxVERTICAL);
218 itemPanel1->SetSizer(itemBoxSizer2);
220 wxArrayString standardCommentCtrlStrings;
222 if (structuredCommentRules)
225 standardCommentCtrlStrings.Add(wxEmptyString);
231 standardCommentCtrlStrings.Add(wxString(
prefix));
239 wxStaticBox* itemStaticBoxSizer3Static =
new wxStaticBox(itemPanel1,
wxID_ANY,
_(
"What methods were used to obtain these sequences?"));
240 wxStaticBoxSizer* itemStaticBoxSizer3 =
new wxStaticBoxSizer(itemStaticBoxSizer3Static, wxVERTICAL);
241 itemBoxSizer2->Add(itemStaticBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
244 itemStaticBoxSizer3->Add(
m_MethodsSizer, 0, wxALIGN_LEFT|wxALL, 0);
246 wxCheckBox* itemCheckBox5 =
new wxCheckBox( itemPanel1,
ID_CHECKBOX5,
_(
"Sanger dideoxy sequencing"), wxDefaultPosition, wxDefaultSize, 0 );
247 itemCheckBox5->SetValue(
false);
250 wxCheckBox* itemCheckBox6 =
new wxCheckBox( itemPanel1,
ID_CHECKBOX6,
_(
"454"), wxDefaultPosition, wxDefaultSize, 0 );
251 itemCheckBox6->SetValue(
false);
254 wxCheckBox* itemCheckBox7 =
new wxCheckBox( itemPanel1,
ID_CHECKBOX7,
_(
"Helicos"), wxDefaultPosition, wxDefaultSize, 0 );
255 itemCheckBox7->SetValue(
false);
258 wxCheckBox* itemCheckBox8 =
new wxCheckBox( itemPanel1,
ID_CHECKBOX8,
_(
"Illumina"), wxDefaultPosition, wxDefaultSize, 0 );
259 itemCheckBox8->SetValue(
false);
262 wxCheckBox* itemCheckBox9 =
new wxCheckBox( itemPanel1,
ID_CHECKBOX9,
_(
"Ion Torrent"), wxDefaultPosition, wxDefaultSize, 0 );
263 itemCheckBox9->SetValue(
false);
266 wxCheckBox* itemCheckBox10 =
new wxCheckBox( itemPanel1,
ID_CHECKBOX10,
_(
"Pacific Biosciences"), wxDefaultPosition, wxDefaultSize, 0 );
267 itemCheckBox10->SetValue(
false);
270 wxCheckBox* itemCheckBox11 =
new wxCheckBox( itemPanel1,
ID_CHECKBOX11,
_(
"SOLiD"), wxDefaultPosition, wxDefaultSize, 0 );
271 itemCheckBox11->SetValue(
false);
274 wxBoxSizer* itemBoxSizer12 =
new wxBoxSizer(wxHORIZONTAL);
275 itemStaticBoxSizer3->Add(itemBoxSizer12, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 0);
279 itemBoxSizer12->Add(
m_OtherMethod, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
285 wxStaticBox* itemStaticBoxSizer15Static =
new wxStaticBox(itemPanel1,
wxID_ANY,
_(
"What program(s) did you use to assemble your sequences?"));
286 wxStaticBoxSizer* itemStaticBoxSizer15 =
new wxStaticBoxSizer(itemStaticBoxSizer15Static, wxVERTICAL);
287 itemBoxSizer2->Add(itemStaticBoxSizer15, 0, wxGROW|wxALL, 5);
295 m_AddPrograms =
new wxHyperlinkCtrl( itemPanel1,
ID_BUTTON2,
_(
"Add More Assembly Programs"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
298 wxFlexGridSizer* itemFlexGridSizer19 =
new wxFlexGridSizer(2, 2, 0, 0);
299 itemBoxSizer2->Add(itemFlexGridSizer19, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
301 wxStaticText* itemStaticText20 =
new wxStaticText( itemPanel1, wxID_STATIC,
_(
"Assembly Name (optional):"), wxDefaultPosition, wxDefaultSize, 0 );
302 itemFlexGridSizer19->Add(itemStaticText20, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
305 itemFlexGridSizer19->Add(
m_AssemblyName, 0, wxALIGN_CENTER_HORIZONTAL|wxALIGN_CENTER_VERTICAL|wxALL, 5);
307 wxStaticText* itemStaticText22 =
new wxStaticText( itemPanel1, wxID_STATIC,
_(
"Coverage (optional):"), wxDefaultPosition, wxDefaultSize, 0 );
308 itemFlexGridSizer19->Add(itemStaticText22, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
311 itemFlexGridSizer19->Add(
m_Coverage, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);
313 wxBoxSizer* itemBoxSizer23 =
new wxBoxSizer(wxHORIZONTAL);
314 itemBoxSizer2->Add(itemBoxSizer23, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 0);
316 wxHyperlinkCtrl* itemHyperlinkCtrl24 =
new wxHyperlinkCtrl( itemPanel1,
ID_BUTTON,
_(
"Clear"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
317 itemBoxSizer23->Add(itemHyperlinkCtrl24, 0, wxALL, 5);
330 while (pos < itemList.size()) {
331 wxCheckBox* method_check =
dynamic_cast<wxCheckBox*
>(itemList[pos]->GetWindow());
333 method_check->SetValue(
false);
369 if (!wxPanel::TransferDataToWindow())
375 string field_name =
"";
377 if ( obj_id.
IsStr() ) {
378 field_name = obj_id.
GetStr();
381 if ((*it)->IsSetData()) {
382 if ((*it)->GetData().IsStr()) {
383 value = (*it)->GetData().GetStr();
384 }
else if ((*it)->GetData().IsInt()) {
399 vector<string> techs;
401 string other_methods =
"";
402 ITERATE (vector<string>, it, techs) {
407 while (pos < itemList.size() && !found) {
408 wxCheckBox* method_check =
dynamic_cast<wxCheckBox*
>(itemList[pos]->GetWindow());
411 method_check->SetValue(
true);
419 other_methods +=
"; ";
421 other_methods += *it;
440 "Sequencing Technology",
441 "StructuredCommentPrefix",
442 "StructuredCommentSuffix"
449 if (!
label.IsStr()) {
463 if (!wxPanel::TransferDataFromWindow())
466 CUser_object::TData::iterator it =
m_User->SetData().begin();
467 while (it !=
m_User->SetData().end()) {
469 it =
m_User->SetData().erase(it);
504 while (pos < itemList.size()) {
505 wxCheckBox* method_check =
dynamic_cast<wxCheckBox*
>(itemList[pos]->GetWindow());
507 if (method_check->GetValue()) {
522 method += other_method;
526 seqtech.
SetData().SetStr(method);
619 m_User->Assign(desc.GetUser());
User-defined methods of the data storage class.
EVT_CHECKBOX(ID_CADJUSTFEATURES_CHECKBOX, CAdjustFeaturesForGaps::OnKnownUnknownSelected) EVT_CHECKBOX(ID_CADJUSTFEATURES_CHECKBOX1
virtual string GetValue()
virtual void SetValue(const string &val)
CRegistryWriteView GetWriteView(const string §ion)
get a read-write view at a particular level.
static CGuiRegistry & GetInstance()
access the application-wide singleton
CRegistryReadView GetReadView(const string §ion) const
get a read-only view at a particular level.
class CRegistryReadView provides a nested hierarchical view at a particular key.
bool GetBool(const string &key, bool default_val=false) const
void Set(const string &key, int val)
access a named key at this level, with no recursion
wxHyperlinkCtrl * m_AddPrograms
virtual bool TransferDataFromWindow()
wxBoxSizer * m_MethodsSizer
void x_ChangeToMultiplePrograms()
CRef< objects::CUser_object > GetUser_object() const
CRef< objects::CUser_object > m_User
bool Create(wxWindow *parent, wxWindowID id=ID_CSEQUENCINGTECHNOLOGYPANEL, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxTAB_TRAVERSAL)
Creation.
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
CSingleAssemblyProgramPanel * m_SingleAssemblyProgram
~CSequencingTechnologyPanel()
Destructor.
wxChoice * m_StandardCommentCtrl
void CreateControls()
Creates the controls and sizers.
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
void SaveSettings() const
static bool ShowToolTips()
Should we show tooltips?
void SetRegistryPath(const string ®_path)
wxTextCtrl * m_AssemblyName
virtual void UpdateSeqdesc(objects::CSeqdesc &desc)
virtual bool TransferDataToWindow()
void Init()
Initialises member variables.
wxTextCtrl * m_OtherMethodText
wxCheckBox * m_OtherMethod
virtual void ChangeSeqdesc(const objects::CSeqdesc &desc)
void OnOtherMethodClick(wxCommandEvent &event)
wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX12
void OnButton2HyperlinkClicked(wxHyperlinkEvent &event)
wxEVT_COMMAND_HYPERLINK event handler for ID_BUTTON2
CSequencingTechnologyPanel()
Constructors.
void OnClearClicked(wxHyperlinkEvent &event)
wxEVT_COMMAND_HYPERLINK event handler for ID_BUTTON
wxBoxSizer * m_AssemblyProgramSizer
CAssemblyProgramPanel * m_AssemblyProgram
virtual string GetValue()
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
void Reset(void)
Reset reference object.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static list< string > & Split(const CTempString str, const CTempString delim, list< string > &arr, TSplitFlags flags=0, vector< SIZE_TYPE > *token_pos=NULL)
Split a string using specified delimiters.
static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
static SIZE_TYPE Find(const CTempString str, const CTempString pattern, ECase use_case=eCase, EDirection direction=eForwardSearch, SIZE_TYPE occurrence=0)
Find the pattern in the string.
static bool EqualNocase(const CTempString s1, SIZE_TYPE pos, SIZE_TYPE n, const char *s2)
Case-insensitive equality of a substring with another string.
static string & ReplaceInPlace(string &src, const string &search, const string &replace, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
Replace occurrences of a substring within a string.
static string TruncateSpaces(const string &str, ETrunc where=eTrunc_Both)
Truncate spaces in a string.
static const char label[]
bool IsStr(void) const
Check if variant Str is selected.
const TStr & GetStr(void) const
Get the variant data.
void SetData(TData &value)
Assign a value to Data data member.
vector< CRef< CUser_field > > TData
const struct ncbi::grid::netcache::search::fields::SIZE size
static const char * prefix[]
static const int kNumKnownFields
static bool IsKnownField(const CObject_id &label)
static const char * kReplaceAll
static const string kKnownFields[]
wxString ToWxString(const string &s)
string ToStdString(const wxString &s)