: m_ParentAECRDlg(parentAECRDlg), m_CapConstraints(cap_constraints)
83wxPanel::Create( parent,
id, pos,
size, style );
88GetSizer()->SetSizeHints(
this);
135wxPanel* parentPanel =
this;
137wxBoxSizer* itemBoxSizer2 =
newwxBoxSizer(wxVERTICAL);
138parentPanel->SetSizer(itemBoxSizer2);
140wxBoxSizer* itemBoxSizer3 =
newwxBoxSizer(wxHORIZONTAL);
141itemBoxSizer2->Add(itemBoxSizer3, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
143wxArrayString m_MatchTypeStrings;
144m_MatchTypeStrings.Add(
_(
"Contains"));
145m_MatchTypeStrings.Add(
_(
"Does not contain"));
146m_MatchTypeStrings.Add(
_(
"Equals"));
147m_MatchTypeStrings.Add(
_(
"Does not equal"));
148m_MatchTypeStrings.Add(
_(
"Starts with"));
149m_MatchTypeStrings.Add(
_(
"Ends with"));
150m_MatchTypeStrings.Add(
_(
"Is one of"));
151m_MatchTypeStrings.Add(
_(
"Is not one of"));
152m_MatchTypeStrings.Add(
_(
"Does not start with"));
153m_MatchTypeStrings.Add(
_(
"Does not end with"));
156m_MatchTypeStrings.Add(
_(
"All caps"));
157m_MatchTypeStrings.Add(
_(
"First letter of each word"));
158m_MatchTypeStrings.Add(
_(
"First letter of first word"));
163itemBoxSizer3->Add(
m_MatchType, 0, wxALIGN_TOP|wxLEFT|wxRIGHT|wxBOTTOM, 5);
166itemBoxSizer3->Add(
m_TextSizer, 0, wxALIGN_TOP, 0);
174wxArrayString choice_strings;
175 m_MatchChoice=
newwxComboBox(parentPanel,
wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(300, -1), choice_strings, 0 );
179wxBoxSizer* itemBoxSizer6 =
newwxBoxSizer(wxHORIZONTAL);
180itemBoxSizer2->Add(itemBoxSizer6, 1, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
184itemBoxSizer6->Add(
m_IgnoreCase, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
188itemBoxSizer6->Add(
m_IgnoreSpace, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
191itemBoxSizer6->Add(itemButton4, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
221wxArrayString choice_strings;
222 ITERATE(vector<string>, it, choices)
228 _ASSERT(values.empty() || choices.size() == values.size());
230 for(
size_t i= 0;
i< values.size();
i++)
314edit::CStringConstraint::EMatchType match_type = edit::CStringConstraint::eMatchType_Contains;
316 boolnot_present =
false;
320match_type = edit::CStringConstraint::eMatchType_Contains;
321not_present =
false;
324match_type = edit::CStringConstraint::eMatchType_Contains;
328match_type = edit::CStringConstraint::eMatchType_Equals;
329not_present =
false;
332match_type = edit::CStringConstraint::eMatchType_Equals;
336match_type = edit::CStringConstraint::eMatchType_StartsWith;
337not_present =
false;
340match_type = edit::CStringConstraint::eMatchType_EndsWith;
341not_present =
false;
344match_type = edit::CStringConstraint::eMatchType_IsOneOf;
345not_present =
false;
348match_type = edit::CStringConstraint::eMatchType_IsOneOf;
352match_type = edit::CStringConstraint::eMatchType_StartsWith;
356match_type = edit::CStringConstraint::eMatchType_EndsWith;
364 if(match_text.size() > 0 || (match_type == edit::CStringConstraint::eMatchType_Equals && not_present)) {
365sc.
Reset(
newedit::CStringConstraint(match_text, match_type,
390 const stringnot_string =
"NOT ";
393 function= macro::CMacroFunction_StringConstraints::sm_Contain;
396 function= not_string +
CTempString(macro::CMacroFunction_StringConstraints::sm_Contain);
399 function= macro::CMacroFunction_StringConstraints::sm_Equal;
402 function= not_string +
CTempString(macro::CMacroFunction_StringConstraints::sm_Equal);
405 function= macro::CMacroFunction_StringConstraints::sm_Start;
408 function= macro::CMacroFunction_StringConstraints::sm_End;
411 function= macro::CMacroFunction_StringConstraints::sm_InList;
414 function= not_string +
CTempString(macro::CMacroFunction_StringConstraints::sm_InList);
417 function= not_string +
CTempString(macro::CMacroFunction_StringConstraints::sm_Start);
420 function= not_string +
CTempString(macro::CMacroFunction_StringConstraints::sm_End);
426 if(
function.
empty())
429 stringcase_sensitive = (
m_IgnoreCase->IsChecked()) ?
"false":
"true";
430 stringignore_space = (
m_IgnoreSpace->IsChecked()) ?
"true":
"false";
432 function+=
"("+ field_name +
", \""+ match_text +
"\", "+ case_sensitive +
", "+ ignore_space +
")";
449 returnconstraint->DoesTextMatch(
str);
@ eMatchType_DoesNotContain
@ eMatchType_DoesNotStartWith
@ eMatchType_DoesNotEqual
@ eMatchType_Is_first_each_cap
@ eMatchType_DoesNotEndWith
wxCheckBox * m_IgnoreSpace
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
wxComboBox * m_MatchChoice
void OnMatchTypeSelected(wxCommandEvent &event)
~CStringConstraintPanel()
Destructor.
void OnClear(wxCommandEvent &event)
CRef< edit::CStringConstraint > GetStringConstraint()
CStringConstraintPanel()
Constructors.
void ShowChoiceOrText(void)
void SetChoices(const vector< string > &choices, const vector< string > &values)
string GetMacroStringConstraint(const string &field_name)
wxCheckBox * m_IgnoreCase
void Init()
Initialises member variables.
map< string, string > m_ChoiceToValue
bool Match(const string &str)
string x_ReplaceChoices(const string &orig)
static bool ShowToolTips()
Should we show tooltips?
bool Create(wxWindow *parent, wxWindowID id=ID_CSTRINGCONSTRAINTPANEL, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxTAB_TRAVERSAL)
Creation.
bool m_ParentAECRDlg
flag is set if parent is the AECRDlg, for having specific features
void CreateControls()
Creates the controls and sizers.
@ ID_STRING_CONSTRAINT_CLEAR_BUTTON
@ ID_STRING_CONSTRAINT_CHECKBOX6
@ ID_STRING_CONSTRAINT_MATCH_CHOICE
@ ID_STRING_CONSTRAINT_MATCH_TEXT
@ ID_STRING_CONSTRAINT_CHECKBOX5
bool Match(const CMatchString &str) const
CTempString implements a light-weight string on top of a storage buffer whose lifetime management is ...
const_iterator end() const
const_iterator find(const key_type &key) const
static const char * str(char *buf, int n)
#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 string & Replace(const string &src, const string &search, const string &replace, string &dst, SIZE_TYPE start_pos=0, SIZE_TYPE max_replace=0, SIZE_TYPE *num_replace=0)
Replace occurrences of a substring within a string.
void SetIs_first_cap(TIs_first_cap value)
Assign a value to Is_first_cap data member.
void SetIs_first_each_cap(TIs_first_each_cap value)
Assign a value to Is_first_each_cap data member.
void SetIs_all_caps(TIs_all_caps value)
Assign a value to Is_all_caps data member.
where boath are integers</td > n< td ></td > n</tr > n< tr > n< td > tse</td > n< td > optional</td > n< td > String</td > n< td class=\"description\"> TSE option controls what blob is orig
constexpr bool empty(list< Ts... >) noexcept
const struct ncbi::grid::netcache::search::fields::SIZE size
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