89 CFieldNamePanel::Create( parent,
id, pos,
size, style );
94 GetSizer()->SetSizeHints(
this);
134 wxBoxSizer* itemBoxSizer2 =
new wxBoxSizer(wxVERTICAL);
135 itemCFieldNamePanel1->SetSizer(itemBoxSizer2);
137 wxArrayString m_FieldStrings;
139 itemBoxSizer2->Add(
m_Field, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
205 field =
"affiliation " + field;
213 _ASSERT(field.front() ==
'\"');
215 if (end_dot !=
NPOS) {
216 return "\"" + field.substr(end_dot + 1,
NPOS);
231 if (
m_self == macro::CMacroBioData::sm_MolInfo)
233 if (target == macro::CMacroBioData::sm_MolInfo) {
235 return CTempString(macro::CMacroFunction_GetSequence::sm_SeqForDescr) +
"(" + field +
")";
242 if (target == macro::CMacroBioData::sm_BioSource) {
244 return CTempString(macro::CMacroFunction_GetSequence::sm_SeqForDescr) +
"(" + field +
")";
251 if (target == macro::CMacroBioData::sm_Seqdesc) {
253 return CTempString(macro::CMacroFunction_GetSequence::sm_SeqForDescr) +
"(" + field +
")";
257 if (target == macro::CMacroBioData::sm_Seq ||
258 target == macro::CMacroBioData::sm_SeqNa ||
259 target == macro::CMacroBioData::sm_SeqAa) {
261 if (field[0] ==
'\"' && field.back() == field[0]) {
262 field = field.
substr(1, field.length() - 2);
270 return CTempString(macro::CMacroFunction_GetSequence::sm_SeqForFeat) +
"(" + field +
")";
279 if (
m_self == macro::CMacroBioData::sm_DBLink) {
284 return macro::CMacroFunction_GetDBLink::GetFuncName() +
"(\"" + field +
"\")";
289 if (target == macro::CMacroBioData::sm_Seqdesc) {
290 size_t pos = field.find(
"..");
291 field = field.substr(pos + 2,
NPOS);
292 field =
"\"" + field;
295 return CTempString(macro::CMacroFunction_GetSequence::sm_SeqForFeat) +
"(" + field +
")";
297 else if ((target != macro::CMacroBioData::sm_SeqNa) && (target != macro::CMacroBioData::sm_SeqAa)){
298 return CTempString(macro::CMacroFunction_GetSequence::sm_SeqForDescr) +
"(" + field +
")";
315 return "obj.label.str = \"ProjectID\"";
319 return "obj.label.str = \"" + field +
"\"";
336 misc_field == field ||
338 m_Field->SetSelection(
static_cast<int>(
i));
339 m_Field->SetFirstItem(
static_cast<int>(
i));
351 wxArrayString field_strings;
352 ITERATE(vector<string>, it, field_names) {
356 m_Field->Append(field_strings);
364 vector<string> choices;
383 vector<string> values;
394 bool allow_other =
false;
CFieldHandlerNamePanel()
Constructors.
void SetMacroFieldNames(const vector< string > &field_names)
static bool ShowToolTips()
Should we show tooltips?
bool Create(wxWindow *parent, wxWindowID id=ID_PUBFIELDNAMEPANEL, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxTAB_TRAVERSAL)
Creation.
virtual string GetFieldName(const bool subfield=false)
Returns the name of the field as selected in the panel.
virtual vector< string > GetChoices(bool &allow_other)
~CFieldHandlerNamePanel()
Destructor.
virtual bool SetFieldName(const string &field)
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
void SetFieldNames(const vector< string > &field_names)
virtual void ClearValues(void)
void Init()
Initialises member variables.
virtual vector< string > GetMacroValues()
virtual string GetMacroFieldName(const string &target, const string &selected_field=kEmptyStr)
void OnFieldSelected(wxCommandEvent &event)
wxEVT_COMMAND_CHOICE_SELECTED event handler for ID_PUBFIELDNAME_FIELD
virtual string GetMacroFieldLabel(const string &target, const string &selected_field=kEmptyStr)
vector< string > m_MacroField
void CreateControls()
Creates the controls and sizers.
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void x_UpdateParent(void)
static bool IsFeature(const string &target)
static EMolInfoFieldType GetFieldType(const string &field_name)
static vector< string > GetChoicesForField(CMolInfoFieldType::EMolInfoFieldType field_type, bool &allow_other)
static vector< string > GetValuesForField(EMolInfoFieldType field_type)
static bool IsAffilField(EPubFieldType field_type)
static EPubFieldType GetTypeForLabel(string label)
static vector< string > GetChoicesForField(EPubFieldType field_type, bool &allow_other)
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
const char * kGenomeProjectID
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
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 StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
CTempString substr(size_type pos) const
Obtain a substring from this string, beginning at a given offset.
@ eReverseSearch
Search in a backward direction.
@ eNocase
Case insensitive compare.
const struct ncbi::grid::netcache::search::fields::SIZE size
static string s_GetMolinfoMember(const string &field)
bool QualifierNamesAreEquivalent(string name1, string name2)
wxString ToWxString(const string &s)
string ToStdString(const wxString &s)