88 wxPanel::Create( parent,
id, pos,
size, style );
93 GetSizer()->SetSizeHints(
this);
150 wxStaticBox* itemStaticBoxSizer2Static =
new wxStaticBox(itemPanel1,
wxID_ANY,
_(
"SOURCE"));
151 wxStaticBoxSizer* itemStaticBoxSizer2 =
new wxStaticBoxSizer(itemStaticBoxSizer2Static, wxVERTICAL);
152 itemPanel1->SetSizer(itemStaticBoxSizer2);
154 wxBoxSizer* itemBoxSizer3 =
new wxBoxSizer(wxHORIZONTAL);
155 itemStaticBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 0);
157 wxStaticText* itemStaticText4 =
new wxStaticText( itemStaticBoxSizer2->GetStaticBox(), wxID_STATIC,
_(
"Modifier List"), wxDefaultPosition, wxDefaultSize, 0 );
158 itemBoxSizer3->Add(itemStaticText4, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
160 wxArrayString m_ModListTypeStrings;
161 m_ModListTypeStrings.Add(
_(
"Custom"));
162 m_ModListTypeStrings.Add(
_(
"All"));
163 m_ModListType =
new wxChoice( itemStaticBoxSizer2->GetStaticBox(),
ID_MOD_LIST_TYPE, wxDefaultPosition, wxDefaultSize, m_ModListTypeStrings, 0 );
165 itemBoxSizer3->Add(
m_ModListType, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
167 m_MaxMods =
new wxStaticText( itemStaticBoxSizer2->GetStaticBox(), wxID_STATIC,
_(
"Maximum modifiers per line"), wxDefaultPosition, wxDefaultSize, 0 );
168 itemBoxSizer3->Add(
m_MaxMods, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
170 wxArrayString m_MaxModifiersStrings;
171 m_MaxModifiersStrings.Add(
_(
"No limit"));
172 m_MaxModifiers =
new wxChoice( itemStaticBoxSizer2->GetStaticBox(),
ID_AD_MODLIMIT, wxDefaultPosition, wxDefaultSize, m_MaxModifiersStrings, 0 );
174 itemBoxSizer3->Add(
m_MaxModifiers, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
176 m_UseLabels =
new wxCheckBox( itemStaticBoxSizer2->GetStaticBox(),
ID_AD_USE_LABELS,
_(
"Use labels"), wxDefaultPosition, wxDefaultSize, 0 );
178 itemBoxSizer3->Add(
m_UseLabels, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
182 itemStaticBoxSizer2->Add(itemStaticBoxSizer9, 0, wxGROW|wxALL, 0);
187 wxStaticBox* itemStaticBoxSizer11Static =
new wxStaticBox(itemStaticBoxSizer2->GetStaticBox(),
wxID_ANY,
_(
"Other Options"));
188 wxStaticBoxSizer* itemStaticBoxSizer11 =
new wxStaticBoxSizer(itemStaticBoxSizer11Static, wxVERTICAL);
189 itemStaticBoxSizer2->Add(itemStaticBoxSizer11, 0, wxGROW|wxALL, 0);
206 m_NoSp =
new wxCheckBox( itemStaticBoxSizer11->GetStaticBox(),
ID_AD_DO_NOT_APPLY_TO_SP,
_(
"Do not apply modifiers to 'sp.' organisms"), wxDefaultPosition, wxDefaultSize, 0 );
210 m_NoCf =
new wxCheckBox( itemStaticBoxSizer11->GetStaticBox(),
ID_AD_DO_NOT_APPLY_TO_CF,
_(
"Do not apply modifiers to 'cf.' organisms"), wxDefaultPosition, wxDefaultSize, 0 );
214 m_NoAff =
new wxCheckBox( itemStaticBoxSizer11->GetStaticBox(),
ID_AD_DO_NOT_APPLY_TO_AFF,
_(
"Do not apply modifiers to 'aff.' organisms"), wxDefaultPosition, wxDefaultSize, 0 );
218 m_NoNr =
new wxCheckBox( itemStaticBoxSizer11->GetStaticBox(),
ID_AD_DO_NOT_APPLY_TO_NR,
_(
"Do not apply modifiers to 'nr.' organisms"), wxDefaultPosition, wxDefaultSize, 0 );
222 m_NoMatchTaxname =
new wxCheckBox( itemStaticBoxSizer11->GetStaticBox(),
ID_AD_NO_MATCH_TAXNAME,
_(
"Do not apply modifier to organisms with matching taxname"), wxDefaultPosition, wxDefaultSize, 0 );
227 itemStaticBoxSizer2->Add(
m_HIVRuleSizer, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 0);
280 if (all_present && all_unique)
282 status =
"All present, all unique";
284 else if (all_present && is_unique)
286 status =
"All present, one unique";
288 else if (all_present && ! is_unique)
290 status =
"All present, mixed";
292 else if (! all_present && all_unique)
294 status =
"Some missing, all unique";
296 else if (! all_present && is_unique)
298 status =
"Some missing, one unique";
300 else if (! all_present && ! is_unique)
302 status =
"Some missing, mixed";
310 wxArrayString HIVStrings;
311 HIVStrings.Add(
_(
"Prefer Clone"));
312 HIVStrings.Add(
_(
"Prefer Isolate"));
313 HIVStrings.Add(
_(
"Want Both Isolate and Clone"));
315 m_HIVRule =
new wxRadioBox (
this,
wxID_ANY,
_(
"HIV Rule"), wxDefaultPosition, wxDefaultSize,
316 HIVStrings, 1, wxRA_SPECIFY_ROWS);
320 bool sortByLabel(
const objects::CAutoDefAvailableModifier& name1,
const objects::CAutoDefAvailableModifier& name2)
322 return name1.Label() < name2.Label();
332 int num_available = 0;
334 if (it.AnyPresent()) {
340 if (num_available > 9) {
341 row = num_available / 3;
342 if (num_available % 3 != 0) {
347 vector<wxFlexGridSizer*> flex_sizers;
349 wxFlexGridSizer* flexsizerA =
new wxFlexGridSizer(0, 1, 0, 0);
351 flex_sizers.push_back(flexsizerA);
362 if (first_value.length() > 25) {
363 first_value = first_value.substr(0, 22) +
"...";
365 mod_status +=
" '" + first_value +
"'";
368 mod_name[0] =
toupper(mod_name[0]);
371 ToWxString(mod_name +
": " + mod_status), wxDefaultPosition, wxDefaultSize, 0);
374 size_t ratio = num_available /
row;
375 if (ratio < flex_sizers.size()) {
376 flex_sizers[ratio]->Add(btn, 0, wxALIGN_LEFT | wxALL, 5);
386 return num_available;
408 for (
int i = 1;
i < num_available;
i++) {
412 if (num_available < 1) {
442 GetSizer()->SetSizeHints(
this);
static string s_GetModifierStatus(bool all_present, bool all_unique, bool is_unique)
bool sortByLabel(const objects::CAutoDefAvailableModifier &name1, const objects::CAutoDefAvailableModifier &name2)
#define ID_AD_INCLUDE_COUNTRY_TEXT
#define ID_AD_DO_NOT_APPLY_TO_CF
#define ID_AD_DO_NOT_APPLY_TO_SP
#define ID_AD_NO_MATCH_TAXNAME
#define ID_AD_LEAVE_PARENTHETICAL
#define ID_AD_DO_NOT_APPLY_TO_AFF
#define ID_AD_DO_NOT_APPLY_TO_NR
#define ID_AD_KEEP_AFTER_SEMICOLON
vector< wxCheckBox * > m_ModifierButtons
int m_ModifierSizerColumns
wxBoxSizer * m_HIVRuleSizer
wxCheckBox * m_IncludeCountry
wxChoice * m_MaxModifiers
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
~CAutodefOrgPanel()
Destructor.
CAutodefOrgPanel()
Constructors.
void SetParams(SAutodefParams *params)
int x_ListModifiers(SAutodefParams ¶ms)
wxFlexGridSizer * m_OtherOptionsGrid
void CreateControls()
Creates the controls and sizers.
bool Create(wxWindow *parent, wxWindowID id=10204, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxTAB_TRAVERSAL)
Creation.
wxCheckBox * m_LeaveParen
wxStaticBox * m_AvailableModifiersSizer
wxCheckBox * m_NoMatchTaxname
static bool ShowToolTips()
Should we show tooltips?
wxFlexGridSizer * m_ModifierSizer
void PopulateParams(SAutodefParams ¶ms)
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
wxCheckBox * m_KeepAfterSemicolon
void Init()
Initialises member variables.
objects::CAutoDefSourceDescription::TAvailableModifierVector m_ModifierList
bool m_LeaveParenthetical
bool m_KeepAfterSemicolon
bool m_IncludeCountryText
#define END_NCBI_SCOPE
End previously defined NCBI scope.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
static enable_if< is_arithmetic< TNumeric >::value||is_convertible< TNumeric, Int8 >::value, string >::type NumericToString(TNumeric value, TNumToStringFlags flags=0, int base=10)
Convert numeric value to string.
constexpr auto sort(_Init &&init)
const struct ncbi::grid::netcache::search::fields::SIZE size
#define row(bind, expected)
wxString ToWxString(const string &s)