wxWindowID
id,
constwxPoint& pos,
constwxSize&
size,
longstyle )
82m_CmdProcessor(processor),
83m_Workbench(workbench)
97wxPanel::Create( parent,
id, pos,
size, style );
102GetSizer()->SetSizeHints(
this);
155wxBoxSizer* itemBoxSizer2 =
newwxBoxSizer(wxHORIZONTAL);
156itemPanel1->SetSizer(itemBoxSizer2);
158 m_Label=
newwxStaticText( itemPanel1, wxID_STATIC,
_(
"Static text field"), wxDefaultPosition, wxSize(60, 45), wxALIGN_CENTRE );
160itemBoxSizer2->Add(
m_Label, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
162 m_Star=
newwxStaticText( itemPanel1, wxID_STATIC,
_(
"*"), wxDefaultPosition, wxSize(5, -1), 0 );
163 m_Star->SetForegroundColour(wxColour(255, 0, 0));
164itemBoxSizer2->Add(
m_Star, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
167itemBoxSizer2->Add(
m_ValueSizer, 0, wxALIGN_CENTER_VERTICAL|wxALL, 0);
169 m_Mix=
newwxTextCtrl( itemPanel1,
ID_MIX, wxEmptyString, wxDefaultPosition, wxSize(400, 45), wxTE_MULTILINE|wxTE_READONLY );
173itemBoxSizer2->Add(
m_EditSizer, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
175 m_EditSizer->Add(200, 40, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
240 m_Mix=
newwxTextCtrl(
this,
ID_MIX, wxEmptyString, wxDefaultPosition, wxSize(400, -1), wxTE_MULTILINE|wxTE_READONLY );
245}
else if(has_choices) {
254wxArrayString m_GlobalValueStrings;
270wxEmptyString, wxDefaultPosition, wxSize(400, -1),
291wxHyperlinkCtrl* action =
newwxHyperlinkCtrl(
this,
ID_CLEARCTRL,
_(
"Clear"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
292 m_EditSizer->Add(action, 0, wxALIGN_LEFT|wxALL, 5);
294wxHyperlinkCtrl* action =
newwxHyperlinkCtrl(
this,
ID_EDITCTRL,
_(
"Edit"), wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
295 m_EditSizer->Add(action, 0, wxALIGN_LEFT|wxALL, 5);
300wxStaticText*
error=
newwxStaticText(
this, wxID_STATIC,
ToWxString(message), wxDefaultPosition, wxDefaultSize, 0 );
301 error->SetForegroundColour(*wxRED);
310 label=
"Register new "+
label+
" accession";
314 ToWxString(
m_Url), wxDefaultPosition, wxDefaultSize, wxHL_DEFAULT_STYLE );
330 boolmust_choose =
false;
334 stringcurr_val = default_val;
337}
else if(all_same && col && col->GetData().GetSize() > 0) {
338curr_val = col->GetData().GetString()[0];
340curr_val = default_val;
343vector<string> expected_values;
345 if(options && options->IsSetColumns()) {
346objects::CSeq_table::TColumns::const_iterator val_it =
table->GetColumns().begin();
349objects::CSeq_table::TColumns::const_iterator opt_it = options->GetColumns().begin();
350 while(val_it !=
table->GetColumns().end() && opt_it != options->GetColumns().end()
351&& (!(*val_it)->IsSetHeader()
352|| !(*val_it)->GetHeader().IsSetTitle()
357 if(opt_it != options->GetColumns().end()) {
358 for(
size_t i= 0;
i< (*opt_it)->GetData().GetString().
size();
i++) {
359expected_values.push_back((*opt_it)->GetData().GetString()[
i]);
364 if(!must_choose && all_same && expected_values.size() == 1 &&
NStr::EqualNocase(curr_val, expected_values[0])) {
369 if(!must_choose && (!
m_Required|| !any_missing)) {
379 boolhas_choices = (expected_values.size() > 0);
381 stringerror_msg =
"";
386}
else if(has_choices) {
390wxArrayString val_strings;
392 intpos = 0, sel = -1;
393 for(vector<string>::iterator s = expected_values.begin(); s != expected_values.end(); ++s, ++pos) {
412error_msg =
"You must provide a value for "+
ToStdString(
m_Label->GetLabel()) +
".";
414error_msg =
ToStdString(
m_Label->GetLabel()) +
" "+ curr_val +
" is unexpected.";
433 boolmust_choose,
boolrequired,
stringdefault_val,
466 boolany_change =
false;
468col =
newobjects::CSeqTable_column();
471col->SetData().SetString().push_back (new_val);
473 table->SetColumns().push_back(col);
477 string val= col->GetData().GetString()[
row];
479col->SetData().SetString()[
row] = new_val;
517wxWindow* w = this->GetParent();
wxBoxSizer * m_ValueSizer
bool x_SetEditorType(bool mixed, bool has_choices)
void OnEditctrlHyperlinkClicked(wxHyperlinkEvent &event)
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
CSubPrep_panel * x_GetParent()
CSubPrepFieldEditor()
Constructors.
bool Create(wxWindow *parent, wxWindowID id=10093, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxTAB_TRAVERSAL)
Creation.
void OnRegisterHyperlinkClicked(wxHyperlinkEvent &event)
void x_ShowStar(bool show)
void x_SetEditorControls(bool mixed, string message)
void SetConverter(string label, string column_name, CTableFieldCommandConverter *converter, bool must_choose=false, bool required=false, string default_val="", string url="", bool allow_mix=true)
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void OnClearValues(wxHyperlinkEvent &event)
bool UpdateValues(string default_val="")
void CreateControls()
Creates the controls and sizers.
void x_SetOneValue(string new_val)
void Init()
Initialises member variables.
CTableFieldCommandConverter * m_Converter
wxTextCtrl * m_GlobalText
objects::CSeq_entry_Handle m_Seh
void OnGlobalchoiceSelected(wxCommandEvent &event)
@end CSubPrepFieldEditor event handler declarations
static bool ShowToolTips()
Should we show tooltips?
ICommandProccessor * m_CmdProcessor
~CSubPrepFieldEditor()
Destructor.
void OnLeaveTextColumnWindow(wxMouseEvent &event)
static string GetWizardFieldFromSeqEntry(objects::CSeq_entry_Handle entry, string field_name)
void SetSubmissionNotReady(string error)
void HandleBulkCmdDlg(CBulkCmdDlg *dlg, string label="")
CTableCommandConverter * GetConverterForFieldName(string field_name)
static CRef< CCmdComposite > SetWizardFieldInSeqEntry(objects::CSeq_entry_Handle entry, string field_name, string value)
virtual CRef< objects::CSeq_table > GetValuesTableFromSeqEntry(objects::CSeq_entry_Handle seh)=0
virtual CRef< CCmdComposite > GetCommandFromValuesTable(CRef< objects::CSeq_table >, objects::CSeq_entry_Handle seh)=0
virtual CRef< objects::CSeq_table > GetChoices(CRef< objects::CSeq_table > values_table)
virtual string CheckForMixedValues(CRef< objects::CSeq_table > values_table, string column_name)
virtual CRef< CCmdComposite > ClearAllValues(objects::CSeq_entry_Handle seh)=0
Undo/Redo interface for editing operations.
virtual void Execute(IEditCommand *command, wxWindow *window=0)=0
IWorkbench is the central interface in the application framework.
static bool PopupURL(const string &url)
launch an application to handle a URL
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
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 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.
static const char label[]
<!DOCTYPE HTML >< html > n< header > n< title > PubSeq Gateway Help Page</title > n< style > n table
const struct ncbi::grid::netcache::search::fields::SIZE size
bool MatchColumnName(string name1, string name2)
CRef< CSeqTable_column > FindSeqTableColumnByName(CRef< objects::CSeq_table > values_table, string column_name)
#define row(bind, expected)
bool AreAnyColumnValuesMissing(CRef< objects::CSeqTable_column > col)
bool AreAllColumnValuesTheSame(CRef< objects::CSeqTable_column > col, string default_val="")
bool AreAnyColumnValuesPresent(CRef< objects::CSeqTable_column > col, string default_val="")
#define SYMBOL_CTBLEDITDLG_IDNAME
wxString ToWxString(const string &s)
string ToStdString(const wxString &s)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4