, m_UpdatedFeature(
NULL)
103, m_UpdatedFeature(
NULL)
106 Create(parent,
id, caption, pos,
size, style);
112SetExtraStyle(wxWS_EX_VALIDATE_RECURSIVELY|wxWS_EX_BLOCK_EVENTS);
113wxDialog::Create( parent,
id, caption, pos,
size, style );
118GetSizer()->SetSizeHints(
this);
146wxBoxSizer* itemBoxSizer2 =
newwxBoxSizer(wxVERTICAL);
147itemDialog1->SetSizer(itemBoxSizer2);
149wxBoxSizer* itemBoxSizer3 =
newwxBoxSizer(wxHORIZONTAL);
150itemBoxSizer2->Add(itemBoxSizer3, 0, wxGROW|wxALL, 5);
152 m_List=
newwxListCtrl( itemDialog1,
ID_LISTCTRL1, wxDefaultPosition, wxSize(300, 120), wxLC_REPORT );
153itemBoxSizer3->Add(
m_List, 0, wxALIGN_TOP|wxALL, 5);
155wxBoxSizer* itemBoxSizer5 =
newwxBoxSizer(wxVERTICAL);
156itemBoxSizer3->Add(itemBoxSizer5, 0, wxALIGN_TOP|wxALL, 5);
158wxButton* itemButton6 =
newwxButton( itemDialog1,
ID_BUTTON4,
_(
"Add"), wxDefaultPosition, wxDefaultSize, 0 );
159itemBoxSizer5->Add(itemButton6, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
161wxButton* itemButton7 =
newwxButton( itemDialog1,
ID_BUTTON5,
_(
"Remove"), wxDefaultPosition, wxDefaultSize, 0 );
162itemBoxSizer5->Add(itemButton7, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
164wxButton* itemButton8 =
newwxButton( itemDialog1,
ID_BUTTON,
_(
"Update"), wxDefaultPosition, wxDefaultSize, 0 );
165itemBoxSizer5->Add(itemButton8, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
167wxStaticBox* itemStaticBoxSizer9Static =
newwxStaticBox(itemDialog1,
wxID_ANY, wxEmptyString);
168wxStaticBoxSizer* itemStaticBoxSizer9 =
newwxStaticBoxSizer(itemStaticBoxSizer9Static, wxVERTICAL);
169itemBoxSizer2->Add(itemStaticBoxSizer9, 1, wxGROW|wxALL, 5);
171wxBoxSizer* itemBoxSizer10 =
newwxBoxSizer(wxHORIZONTAL);
172itemStaticBoxSizer9->Add(itemBoxSizer10, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT, 5);
174wxStaticText* itemStaticText11 =
newwxStaticText( itemDialog1, wxID_STATIC,
_(
"Name"), wxDefaultPosition, wxDefaultSize, 0 );
175itemBoxSizer10->Add(itemStaticText11, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
177 m_Name=
newwxTextCtrl( itemDialog1,
ID_TEXTCTRL14, wxEmptyString, wxDefaultPosition, wxSize(150, -1), 0 );
178itemBoxSizer10->Add(
m_Name, 1, wxALIGN_CENTER_VERTICAL|wxALL, 5);
180wxBoxSizer* itemBoxSizer13 =
newwxBoxSizer(wxHORIZONTAL);
181itemStaticBoxSizer9->Add(itemBoxSizer13, 1, wxGROW|wxLEFT|wxRIGHT, 5);
183wxBoxSizer* itemBoxSizer14 =
newwxBoxSizer(wxHORIZONTAL);
184itemBoxSizer13->Add(itemBoxSizer14, 1, wxALIGN_TOP|wxRIGHT|wxTOP|wxBOTTOM, 5);
186wxStaticText* itemStaticText15 =
newwxStaticText( itemDialog1, wxID_STATIC,
_(
"Value"), wxDefaultPosition, wxDefaultSize, 0 );
187itemBoxSizer14->Add(itemStaticText15, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
189 m_Value=
newwxTextCtrl( itemDialog1,
ID_TEXTCTRL15, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
190itemBoxSizer14->Add(
m_Value, 1, wxGROW|wxALL, 5);
192wxStaticText* itemStaticText17 =
newwxStaticText( itemDialog1, wxID_STATIC,
_(
"Color"), wxDefaultPosition, wxDefaultSize, 0 );
193itemBoxSizer14->Add(itemStaticText17, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
195 m_ColorPicker=
newwxColourPickerCtrl( itemDialog1,
ID_COLOURCTRL, wxColour(0, 255, 0), wxDefaultPosition, wxDefaultSize, wxCLRP_DEFAULT_STYLE );
196itemBoxSizer13->Add(
m_ColorPicker, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
198wxStaticLine* itemStaticLine19 =
newwxStaticLine( itemDialog1,
ID_STATICLINE1, wxDefaultPosition, wxDefaultSize, wxLI_HORIZONTAL );
199itemBoxSizer2->Add(itemStaticLine19, 0, wxGROW|wxALL, 5);
201wxStdDialogButtonSizer* itemStdDialogButtonSizer20 =
newwxStdDialogButtonSizer;
203itemBoxSizer2->Add(itemStdDialogButtonSizer20, 0, wxALIGN_RIGHT|wxALL, 5);
204wxButton* itemButton21 =
newwxButton( itemDialog1, wxID_OK,
_(
"&OK"), wxDefaultPosition, wxDefaultSize, 0 );
205itemStdDialogButtonSizer20->AddButton(itemButton21);
207wxButton* itemButton22 =
newwxButton( itemDialog1, wxID_CANCEL,
_(
"&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
208itemStdDialogButtonSizer20->AddButton(itemButton22);
210itemStdDialogButtonSizer20->Realize();
218wxString
n=
m_Name->GetValue();
221 if(
n.Length() == 0)
230item_num =
m_List->GetNextItem(item_num,
232wxLIST_STATE_DONTCARE);
233 if( item_num == -1 )
237 info.m_itemId = item_num;
238 info.m_mask = wxLIST_MASK_TEXT;
243wxString
msg=
wxT(
"Item '");
245 msg+=
wxT(
"' is already a property.\n");
246 msg+=
wxT(
"Select the property from the list to update it.");
248wxMessageBox(
msg,
wxT(
"Duplicate Property Name"),
249wxOK | wxICON_WARNING);
257wxListItem* item =
newwxListItem();
258item->SetId(
count);
259 m_List->InsertItem(*item);
268 if(
m_List->GetSelectedItemCount() == 0)
272 autoindex =
m_List->GetNextItem(-1,
274wxLIST_STATE_SELECTED);
276 m_List->DeleteItem(index);
293item =
m_List->GetNextItem(item,
295wxLIST_STATE_DONTCARE);
300 info.m_itemId = item;
301 info.m_mask = wxLIST_MASK_TEXT;
313 for(
id=0;
id< 255;
id++){
322 "CPhyloTreeNode::SetFeature - maximum number of features exceeded");
360 intw =
m_List->GetSize().GetWidth();
363 m_List->InsertColumn(0,
wxT(
"Name"), wxLIST_FORMAT_LEFT, w/3 );
364 m_List->InsertColumn(1,
wxT(
"Value"), wxLIST_FORMAT_LEFT, (w*2)/3 );
373 stringsValue = it->value;
375wxListItem* item =
newwxListItem();
377 m_List->InsertItem(*item);
389 if(
m_List->GetSelectedItemCount() == 0)
393 autoindex =
m_List->GetNextItem(-1,
395wxLIST_STATE_SELECTED);
398 info.m_itemId = index;
399 info.m_mask = wxLIST_MASK_TEXT;
401wxString name =
m_List->GetItem(
info) ?
info.m_text : wxString(
"");
410string::size_type idx1 = current_value.find_first_of(
'[');
411 if(idx1 != string::npos) {
412string::size_type idx2 = current_value.find_first_of(
']');
413 if(idx2 != string::npos && idx2 > idx1) {
416 stringcolor_str = current_value.substr(idx1, idx2-idx1 + 1);
422 color.GetBlueUC()));
444 if(
m_List->GetSelectedItemCount() == 0)
448 autoindex =
m_List->GetNextItem(-1,
450wxLIST_STATE_SELECTED);
453wxString
n=
m_Name->GetValue();
456 if(
n.Length() == 0)
473string::size_type idx1 = current_value.find_first_of(
'[');
474 if(idx1 != string::npos) {
475string::size_type idx2 = current_value.find_first_of(
']');
476 if(idx2 != string::npos && idx2 > idx1) {
478 stringold_color_str = current_value.substr(idx1, idx2-idx1 + 1);
488current_value.replace(idx1, idx2-idx1 + 1, new_color_str);
499new_color.
SetAlpha((
unsigned char)64);
Things for representing and manipulating bio trees.
Features storage for the bio tree node.
Tree subclass also has functions and data needed for rendering and selection.
CBioTreeFeatureDictionary & GetFeatureDict()
Return feature dictionary.
class CRgbaColor provides a simple abstraction for managing colors.
void OnButton4Click(wxCommandEvent &event)
void x_UpdateSelectedRow()
void SetParams(CPhyloTree *tree, CPhyloTree::TTreeIdx node_idx, CFeatureEdit *updated_feature)
void OnButtonClick(wxCommandEvent &event)
static bool ShowToolTips()
wxIcon GetIconResource(const wxString &name)
void OnColourctrlColourPickerChanged(wxColourPickerEvent &event)
void OnButton5Click(wxCommandEvent &event)
void OnListctrl1Selected(wxListEvent &event)
bool Create(wxWindow *parent, wxWindowID id=10000, const wxString &caption=_("Node Properties"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxCAPTION|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
wxBitmap GetBitmapResource(const wxString &name)
wxColourPickerCtrl * m_ColorPicker
CFeatureEdit * m_UpdatedFeature
CPhyloTree::TTreeIdx m_NodeIdx
void OnOkClick(wxCommandEvent &event)
void OnListctrl1Deselected(wxListEvent &event)
const_iterator find(const key_type &key) const
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define NCBI_THROW(exception_class, err_code, message)
Generic macro to throw an exception, given the exception class, error code and message string.
string ToString(bool printAlpha=true, bool uchars=true) const
Return a string representation of the current color.
float GetAlpha(void) const
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static string & ToLower(string &str)
Convert string to lower case â string& version.
unsigned int TBioTreeFeatureId
Feature Id.
TBioTreeFeatureId GetId(const string &feature_name) const
If feature is already registered returns its id by name.
const TFeatureList & GetFeatureList() const
Return reference on the internal container.
TBioTreeFeatureId Register(const string &feature_name)
Register new feature, return its id.
bool HasFeature(const string &feature_name) const
Check if feature is listed in the dictionary.
const TFeatureDict & GetFeatureDict() const
Get reference on the internal map.
vector< CBioTreeFeaturePair > TFeatureList
const struct ncbi::grid::netcache::search::fields::SIZE size
const GenericPointer< typename T::ValueType > T2 value
static SLJIT_INLINE sljit_ins msg(sljit_gpr r, sljit_s32 d, sljit_gpr x, sljit_gpr b)
Edits for one or more nodes.
vector< CUpdatedFeature > & GetUpdated()
CBioTreeFeatureDictionary & GetDictionary()
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