NCBI C++ ToolKit
suspect_product_rules_add_constraint.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: suspect_product_rules_add_constraint.cpp 39866 2017-11-14 21:17:01Z filippov $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Authors: Igor Filippov
27  *
28  * File Description:
29  *
30  */
31 #include <ncbi_pch.hpp>
32 
33 // For compilers that support precompilation, includes "wx/wx.h".
34 #include "wx/wxprec.h"
35 
36 #ifdef __BORLANDC__
37 #pragma hdrstop
38 #endif
39 
40 #ifndef WX_PRECOMP
41 #include "wx/wx.h"
42 #endif
43 
48 
51 
53 
54 #include <wx/statline.h>
55 
58 
59 
60 
61 IMPLEMENT_DYNAMIC_CLASS( CSuspectAddConstraint, wxFrame )
62 
63 BEGIN_EVENT_TABLE( CSuspectAddConstraint, wxFrame )
64 
65 ////@begin CSuspectAddConstraint event table entries
66  EVT_BUTTON( wxID_OK, CSuspectAddConstraint::OnAccept )
67  EVT_BUTTON( wxID_CANCEL, CSuspectAddConstraint::OnCancel )
68 ////@end CSuspectAddConstraint event table entries
69 
71 
73 {
74  Init();
75 }
76 
77 CSuspectAddConstraint::CSuspectAddConstraint( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
78  : m_id(-1)
79 {
80  Init();
81  Create(parent, id, caption, pos, size, style);
82 }
83 
84 bool CSuspectAddConstraint::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
85 {
86 ////@begin CSuspectAddConstraint creation
87  SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
88  wxFrame::Create( parent, id, caption, pos, size, style );
89 
91  if (GetSizer())
92  {
93  GetSizer()->SetSizeHints(this);
94  }
95  Centre(wxBOTH|wxCENTRE_ON_SCREEN);
96 ////@end CSuspectAddConstraint creation
97  return true;
98 }
99 
101 {
102 ////@begin CSuspectAddConstraint destruction
103 ////@end CSuspectAddConstraint destruction
104 }
105 
107 {
108 ////@begin CSuspectAddConstraint member initialisation
109  m_MatchType = NULL;
110  m_MatchText = NULL;
111  m_IgnoreCase = NULL;
113  m_WholeWord = NULL;
115  m_IgnoreSyn = NULL;
116  m_AnyLetters = NULL;
117  m_AllUpper = NULL;
118  m_AllLower = NULL;
119  m_AllPunct = NULL;
121  m_TextSizer = NULL;
123  m_WordSubst = NULL;
124  m_is_choice = false;
125 ////@end CSuspectAddConstraint member initialisation
126 }
127 
129 {
130  wxBoxSizer* itemBoxSizer0 = new wxBoxSizer(wxVERTICAL);
131  SetSizer(itemBoxSizer0);
132 
133  wxPanel* parentPanel = new wxPanel(this, wxID_ANY);
134  itemBoxSizer0->Add(parentPanel, 1, wxGROW, 0);
135 
136  wxBoxSizer* itemBoxSizer1 = new wxBoxSizer(wxHORIZONTAL);
137  parentPanel->SetSizer(itemBoxSizer1);
138 
139  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
140  itemBoxSizer1->Add(itemBoxSizer2, 0, wxALIGN_TOP|wxALL, 5);
141 
142  wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
143  itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
144 
145  wxArrayString m_MatchTypeStrings;
146  m_MatchTypeStrings.Add(_("Contains"));
147  m_MatchTypeStrings.Add(_("Does not contain"));
148  m_MatchTypeStrings.Add(_("Equals"));
149  m_MatchTypeStrings.Add(_("Does not equal"));
150  m_MatchTypeStrings.Add(_("Starts with"));
151  m_MatchTypeStrings.Add(_("Ends with"));
152  m_MatchTypeStrings.Add(_("Is one of"));
153  m_MatchTypeStrings.Add(_("Is not one of"));
154  m_MatchTypeStrings.Add(_("Does not start with"));
155  m_MatchTypeStrings.Add(_("Does not end with"));
156 
157  m_MatchType = new wxChoice( parentPanel, ID_STRING_CONSTRAINT_MATCH_CHOICE, wxDefaultPosition, wxDefaultSize, m_MatchTypeStrings, 0 );
158  m_MatchType->SetStringSelection(_("Contains"));
159  itemBoxSizer3->Add(m_MatchType, 0, wxALIGN_TOP|wxLEFT|wxRIGHT|wxBOTTOM, 5);
160  m_MatchType->Bind(wxEVT_CHOICE, &CSuspectAddConstraint::OnMatchTypeSelected, this);
161 
162  m_TextSizer = new wxBoxSizer(wxVERTICAL);
163  itemBoxSizer3->Add(m_TextSizer, 0, wxALIGN_TOP, 0);
164 
165  m_MatchText = new wxTextCtrl( parentPanel, ID_STRING_CONSTRAINT_MATCH_TEXT, wxEmptyString, wxDefaultPosition, wxSize(300, -1), wxTE_MULTILINE );
166  m_TextSizer->Add(m_MatchText, 0, wxALIGN_LEFT|wxLEFT|wxRIGHT|wxBOTTOM, 5);
167  wxArrayString choice_strings;
168  m_MatchChoice = new wxComboBox(parentPanel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxSize(300, -1), choice_strings, 0 );
169  m_MatchChoice->Hide();
170 
171 
172  wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxHORIZONTAL);
173  itemBoxSizer2->Add(itemBoxSizer6, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
174 
175  m_IgnoreCase = new wxCheckBox( parentPanel, ID_STRING_CONSTRAINT_CHECKBOX5, _("Ignore Case"), wxDefaultPosition, wxDefaultSize, 0 );
176  m_IgnoreCase->SetValue(true);
177  itemBoxSizer6->Add(m_IgnoreCase, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
178 
179  m_IgnoreSpace = new wxCheckBox( parentPanel, ID_STRING_CONSTRAINT_CHECKBOX6, _("Ignore Space"), wxDefaultPosition, wxDefaultSize, 0 );
180  m_IgnoreSpace->SetValue(false);
181  itemBoxSizer6->Add(m_IgnoreSpace, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
182 
183  m_IgnorePunct = new wxCheckBox( parentPanel, ID_STRING_CONSTRAINT_CHECKBOX8, _("Ignore Punctuation"), wxDefaultPosition, wxDefaultSize, 0 );
184  m_IgnorePunct->SetValue(false);
185  itemBoxSizer6->Add(m_IgnorePunct, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
186 
187  wxBoxSizer* itemBoxSizer7 = new wxBoxSizer(wxHORIZONTAL);
188  itemBoxSizer2->Add(itemBoxSizer7, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
189 
190  m_WholeWord = new wxCheckBox( parentPanel, ID_STRING_CONSTRAINT_CHECKBOX7, _("Whole Word"), wxDefaultPosition, wxDefaultSize, 0 );
191  m_WholeWord->SetValue(false);
192  itemBoxSizer7->Add(m_WholeWord, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
193 
194  m_IgnoreSyn = new wxCheckBox( parentPanel, ID_STRING_CONSTRAINT_CHECKBOX9, _("Ignore 'putative' synonyms"), wxDefaultPosition, wxDefaultSize, 0 );
195  m_IgnoreSyn->SetValue(false);
196  itemBoxSizer7->Add(m_IgnoreSyn, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
197 
198  wxBoxSizer* itemBoxSizer8 = new wxBoxSizer(wxHORIZONTAL);
199  itemBoxSizer2->Add(itemBoxSizer8, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
200 
201  m_AnyLetters = new wxRadioButton( parentPanel, ID_STRING_CONSTRAINT_RADIO0, _("Any letters"), wxDefaultPosition, wxDefaultSize, 0 );
202  m_AnyLetters->SetValue(true);
203  itemBoxSizer8->Add(m_AnyLetters, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
204 
205  m_AllUpper = new wxRadioButton( parentPanel, ID_STRING_CONSTRAINT_RADIO1, _("All letters are upper case"), wxDefaultPosition, wxDefaultSize, 0 );
206  m_AllUpper->SetValue(false);
207  itemBoxSizer8->Add(m_AllUpper, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
208 
209  m_AllLower = new wxRadioButton( parentPanel, ID_STRING_CONSTRAINT_RADIO2, _("All letters are lower case"), wxDefaultPosition, wxDefaultSize, 0 );
210  m_AllLower->SetValue(false);
211  itemBoxSizer8->Add(m_AllLower, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
212 
213  m_AllPunct = new wxRadioButton( parentPanel, ID_STRING_CONSTRAINT_RADIO3, _("All characters are punctuation"), wxDefaultPosition, wxDefaultSize, 0 );
214  m_AllPunct->SetValue(false);
215  itemBoxSizer8->Add(m_AllPunct, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
216 
217  wxBoxSizer* itemBoxSizer9 = new wxBoxSizer(wxHORIZONTAL);
218  itemBoxSizer2->Add(itemBoxSizer9, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
219 
220  m_ClearButton = new wxButton( parentPanel, ID_STRING_CONSTRAINT_CLEAR_BUTTON, _("Clear Constraint"), wxDefaultPosition, wxDefaultSize, 0 );
221  itemBoxSizer9->Add(m_ClearButton, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
222  m_ClearButton->Connect(ID_STRING_CONSTRAINT_CLEAR_BUTTON, wxEVT_BUTTON, wxCommandEventHandler(CSuspectAddConstraint::OnClear), NULL, this);
223 
224  m_WordSubst = new wxButton( parentPanel, ID_STRING_CONSTRAINT_WORDSUBST_BUTTON, _("Word Substitutions"), wxDefaultPosition, wxDefaultSize, 0 );
225  itemBoxSizer9->Add(m_WordSubst, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
226  m_WordSubst->Connect(ID_STRING_CONSTRAINT_WORDSUBST_BUTTON, wxEVT_BUTTON, wxCommandEventHandler(CSuspectAddConstraint::OnWordSubstitution), NULL, this);
227 
228  wxBoxSizer* itemBoxSizer10 = new wxBoxSizer(wxHORIZONTAL);
229  itemBoxSizer2->Add(itemBoxSizer10, 0, wxALIGN_CENTER_HORIZONTAL, 0);
230 
231  wxButton* itemButton13 = new wxButton( parentPanel, wxID_OK, _("Accept"), wxDefaultPosition, wxDefaultSize, 0 );
232  itemBoxSizer10->Add(itemButton13, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
233 
234  wxButton* itemButton14 = new wxButton( parentPanel, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
235  itemBoxSizer10->Add(itemButton14, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
236 
237 }
238 
240 {
241  return true;
242 }
243 wxBitmap CSuspectAddConstraint::GetBitmapResource( const wxString& name )
244 {
245  // Bitmap retrieval
246 ////@begin CSuspectAddConstraint bitmap retrieval
247  wxUnusedVar(name);
248  return wxNullBitmap;
249 ////@end CSuspectAddConstraint bitmap retrieval
250 }
251 wxIcon CSuspectAddConstraint::GetIconResource( const wxString& name )
252 {
253  // Icon retrieval
254 ////@begin CSuspectAddConstraint icon retrieval
255  wxUnusedVar(name);
256  return wxNullIcon;
257 ////@end CSuspectAddConstraint icon retrieval
258 }
259 
260 void CSuspectAddConstraint::OnCancel( wxCommandEvent& event )
261 {
262  Close();
263 }
264 
265 void CSuspectAddConstraint::OnAccept( wxCommandEvent& event )
266 {
267  string label = GetDescription();
269  if (!sc || label.empty())
270  {
271  event.Skip();
272  return;
273  }
275  constraint->SetString(*sc);
276  pair<string, CRef<CConstraint_choice> > item(label, constraint);
277  wxWindow* parent = GetParent();
278  CSuspectCompoundConstraintPanel* compound_panel = dynamic_cast<CSuspectCompoundConstraintPanel*>(parent);
279  compound_panel->AddConstraint(item, m_id);
280  Close();
281 }
282 
283 
284 void CSuspectAddConstraint::OnClear( wxCommandEvent& event )
285 {
286  ClearValues();
287 }
288 
290 {
291  if (m_is_choice)
292  {
293  m_MatchChoice->Hide();
295  m_MatchText->Show();
296  m_is_choice = false;
297  Layout();
298  Fit();
299  }
300  m_MatchType->SetStringSelection(_("Contains"));
301  m_MatchText->SetValue(wxEmptyString);
302  m_IgnoreCase->SetValue(true);
303  m_IgnoreSpace->SetValue(false);
304  m_WholeWord->SetValue(false);
305  m_IgnorePunct->SetValue(false);
306  m_IgnoreSyn->SetValue(false);
307  m_AnyLetters->SetValue(true);
308  m_AllUpper->SetValue(false);
309  m_AllLower->SetValue(false);
310  m_AllPunct->SetValue(false);
312 }
313 
314 void CSuspectAddConstraint::SetChoices(const vector<string> &choices)
315 {
316  wxArrayString choice_strings;
317  ITERATE(vector<string>, it, choices)
318  {
319  choice_strings.Add(ToWxString(*it));
320  }
321  m_MatchChoice->Set(choice_strings);
323 }
324 
326 {
327  if (!m_MatchChoice->IsListEmpty() && (m_MatchType->GetSelection() == eMatchType_Equals || m_MatchType->GetSelection() == eMatchType_DoesNotEqual) )
328  {
329  if (!m_is_choice)
330  {
331  m_MatchText->Hide();
333  m_MatchChoice->Show();
334  }
335  m_is_choice = true;
336  }
337  else
338  {
339  if (m_is_choice)
340  {
341  m_MatchChoice->Hide();
343  m_MatchText->Show();
344  }
345  m_is_choice = false;
346  }
347  Layout();
348  Fit();
349 
350 }
351 
352 void CSuspectAddConstraint::OnMatchTypeSelected( wxCommandEvent& event )
353 {
355  event.Skip();
356 }
357 
359 {
360  string match_text;
361  if (!m_is_choice)
362  match_text = NStr::Replace(NStr::Replace(ToStdString(m_MatchText->GetValue()),"\r"," "),"\n"," ");
363  else
364  match_text = NStr::Replace(NStr::Replace(ToStdString(m_MatchChoice->GetValue()),"\r"," "),"\n"," ");
365 
367  c->SetMatch_text(match_text);
368  c->SetCase_sensitive(!m_IgnoreCase->GetValue());
369  c->SetIgnore_space(m_IgnoreSpace->GetValue());
370  c->SetIgnore_punct(m_IgnorePunct->GetValue());
371  c->SetWhole_word(m_WholeWord->GetValue());
372  c->SetIs_all_caps(m_AllUpper->GetValue());
373  c->SetIs_all_lower(m_AllLower->GetValue());
374  c->SetIs_all_punct(m_AllPunct->GetValue());
375  c->SetIgnore_weasel(m_IgnoreSyn->GetValue());
376 
377  if (m_word_subst && m_word_subst->IsSet() && !m_word_subst->Get().empty())
378  {
380  }
381 
382  switch(m_MatchType->GetSelection()) {
383  case eMatchType_Contains:
385  break;
388  c->SetNot_present(true);
389  break;
390  case eMatchType_Equals:
392  break;
395  c->SetNot_present(true);
396  break;
399  break;
400  case eMatchType_EndsWith:
402  break;
403  case eMatchType_IsOneOf:
405  break;
408  c->SetNot_present(true);
409  break;
412  c->SetNot_present(true);
413  break;
416  c->SetNot_present(true);
417  break;
418  default: c.Reset(); break;
419  }
420 
421  return c;
422 }
423 
425 {
426  string str;
427  if (!c)
428  return str;
429 
430  string match_text;
431  if (c->IsSetMatch_text())
432  match_text = c->GetMatch_text();
433 
434  if (!match_text.empty())
435  {
436  if (c->IsSetNot_present() && c->GetNot_present())
437  {
438  switch (c->GetMatch_location())
439  {
440  case eString_location_contains : str = "does not contain "; break;
441  case eString_location_equals : str = "does not equal "; break;
442  case eString_location_starts : str = "does not start with "; break;
443  case eString_location_ends : str = "does not ends with "; break;
444  case eString_location_inlist : str = "is not one of "; break;
445  default : break;
446  }
447  }
448  else
449  {
450  switch (c->GetMatch_location())
451  {
452  case eString_location_contains : str = "contains "; break;
453  case eString_location_equals : str = "equals "; break;
454  case eString_location_starts : str = "starts with "; break;
455  case eString_location_ends : str = "ends with "; break;
456  case eString_location_inlist : str = "is one of "; break;
457  default : break;
458  }
459  }
460 
461  str += "'" + match_text + "' ";
462 
463 
464  vector<string> subs;
465  if (c->IsSetCase_sensitive() && c->GetCase_sensitive())
466  subs.push_back("case-sensitive");
467 
468  if (c->IsSetIgnore_space() && c->GetIgnore_space())
469  subs.push_back("ignore spaces");
470 
471  if (c->IsSetIgnore_punct() && c->GetIgnore_punct())
472  subs.push_back("ignore punctuation");
473 
474  if (c->IsSetWhole_word() && c->GetWhole_word())
475  subs.push_back("whole word");
476 
477  if (c->IsSetIgnore_weasel() && c->GetIgnore_weasel())
478  subs.push_back("ignore 'putative' synonyms");
479 
480  if (!subs.empty())
481  {
482  string sub = NStr::Join(subs, ", ");
483  str += "(" + sub + ")";
484  }
485 
486  if (c->IsSetIgnore_words() && c->GetIgnore_words().IsSet())
487  {
488  for (auto ws : c->GetIgnore_words().Get())
489  {
491  str += ", " + label;
492  }
493  }
494 
495  }
496 
497 
498  string sub;
499  if (c->IsSetIs_all_caps() && c->GetIs_all_caps())
500  sub = "all letters are upper case";
501 
502  if (c->IsSetIs_all_lower() && c->GetIs_all_lower())
503  sub = "all letters are lower case";
504 
505  if (c->IsSetIs_all_punct() && c->GetIs_all_punct())
506  sub = "all characters are punctiation";
507 
508  if (!sub.empty())
509  {
510  if (!str.empty())
511  str += ", ";
512  str += sub;
513  }
514 
515  return str;
516 }
517 
519 {
521  return GetDescription(c);
522 }
523 
525 {
526 
528  if (constraint.IsString())
529  c->Assign(constraint.GetString());
530  else if (constraint.IsField() && constraint.GetField().IsSetField() && constraint.GetField().GetField().IsFeature_field()
534  && constraint.GetField().IsSetString_constraint())
535  c->Assign(constraint.GetField().GetString_constraint());
536  else
537  kEmptyStr;
538  return GetDescription(c);
539 }
540 
541 void CSuspectAddConstraint::OnWordSubstitution( wxCommandEvent& event )
542 {
544  dlg->Show(true);
545 }
546 
548 {
549  m_word_subst = word_subst;
550 }
551 
553 {
554 
556  if (constraint.IsString())
557  c->Assign(constraint.GetString());
558  else if (constraint.IsField() && constraint.GetField().IsSetField() && constraint.GetField().GetField().IsFeature_field()
562  && constraint.GetField().IsSetString_constraint())
563  c->Assign(constraint.GetField().GetString_constraint());
564  else
565  return;
566 
567  string match_text = c->GetMatch_text();
568 
569 
570 
571  if (c->IsSetIgnore_words())
572  {
573  m_word_subst.Reset(new objects::CWord_substitution_set);
574  m_word_subst->Assign(c->GetIgnore_words());
575  }
576 
577  if (c->IsSetNot_present() && c->GetNot_present())
578  {
579  switch (c->GetMatch_location())
580  {
582  case eString_location_equals : m_MatchType->SetSelection(eMatchType_DoesNotEqual); break;
584  case eString_location_ends : m_MatchType->SetSelection(eMatchType_DoesNotEndWith); break;
585  case eString_location_inlist : m_MatchType->SetSelection(eMatchType_IsNotOneOf); break;
586  default : break;
587  }
588  }
589  else
590  {
591  switch (c->GetMatch_location())
592  {
593  case eString_location_contains : m_MatchType->SetSelection(eMatchType_Contains); break;
594  case eString_location_equals : m_MatchType->SetSelection(eMatchType_Equals); break;
595  case eString_location_starts : m_MatchType->SetSelection(eMatchType_StartsWith); break;
596  case eString_location_ends : m_MatchType->SetSelection(eMatchType_EndsWith); break;
597  case eString_location_inlist : m_MatchType->SetSelection(eMatchType_IsOneOf); break;
598  default : break;
599  }
600  }
601 
602  if (c->IsSetCase_sensitive() && c->GetCase_sensitive())
603  m_IgnoreCase->SetValue(false);
604  else
605  m_IgnoreCase->SetValue(true);
606 
607  if (c->IsSetIgnore_space() && c->GetIgnore_space())
608  m_IgnoreSpace->SetValue(true);
609  else
610  m_IgnoreSpace->SetValue(false);
611 
612  if (c->IsSetIgnore_punct() && c->GetIgnore_punct())
613  m_IgnorePunct->SetValue(true);
614  else
615  m_IgnorePunct->SetValue(false);
616 
617  if (c->IsSetWhole_word() && c->GetWhole_word())
618  m_WholeWord->SetValue(true);
619  else
620  m_WholeWord->SetValue(false);
621 
622  if (c->IsSetIgnore_weasel() && c->GetIgnore_weasel())
623  m_IgnoreSyn->SetValue(true);
624  else
625  m_IgnoreSyn->SetValue(false);
626 
627  if (c->IsSetIs_all_caps() && c->GetIs_all_caps())
628  m_AllUpper->SetValue(true);
629  else
630  m_AllUpper->SetValue(false);
631 
632  if (c->IsSetIs_all_lower() && c->GetIs_all_lower())
633  m_AllLower->SetValue(true);
634  else
635  m_AllLower->SetValue(false);
636 
637  if (c->IsSetIs_all_punct() && c->GetIs_all_punct())
638  m_AllPunct->SetValue(true);
639  else
640  m_AllPunct->SetValue(false);
641 
643 
644  if (!m_is_choice)
645  m_MatchText->SetValue(wxString(match_text));
646  else
647  m_MatchChoice->SetValue(wxString(match_text));
648 }
649 
650 
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
void SetMatch_text(const TMatch_text &value)
void SetChoices(const vector< string > &choices)
CRef< objects::CString_constraint > GetStringConstraint()
void SetConstraint(const objects::CConstraint_choice &constraint)
wxIcon GetIconResource(const wxString &name)
CRef< objects::CWord_substitution_set > m_word_subst
virtual void AddWordSubstSet(CRef< objects::CWord_substitution_set > word_subst)
void OnClear(wxCommandEvent &event)
@begin CMacroAdvStringConstraintPanel event handler declarations
void OnMatchTypeSelected(wxCommandEvent &event)
wxBitmap GetBitmapResource(const wxString &name)
void OnWordSubstitution(wxCommandEvent &event)
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &caption=_("Constraint"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
void AddConstraint(pair< string, CRef< objects::CConstraint_choice > > item, int id)
static string GetDescription(CRef< objects::CWord_substitution > ws)
#define _(proto)
Definition: ct_nlmzip_i.h:78
static void Init(void)
Definition: cursor6.c:76
static const char * str(char *buf, int n)
Definition: stats.c:84
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:815
#define NULL
Definition: ncbistd.hpp:225
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:773
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define kEmptyStr
Definition: ncbistr.hpp:123
static string Join(const TContainer &arr, const CTempString &delim)
Join strings using the specified delimiter.
Definition: ncbistr.hpp:2699
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.
Definition: ncbistr.cpp:3305
static const char label[]
TCase_sensitive GetCase_sensitive(void) const
Get the Case_sensitive member data.
bool IsLegal_qual(void) const
Check if variant Legal_qual is selected.
bool IsSetIgnore_weasel(void) const
Check if a value has been assigned to Ignore_weasel data member.
bool IsSetIs_all_lower(void) const
Check if a value has been assigned to Is_all_lower data member.
bool IsSetIs_all_punct(void) const
Check if a value has been assigned to Is_all_punct data member.
const TIgnore_words & GetIgnore_words(void) const
Get the Ignore_words member data.
void SetIs_all_lower(TIs_all_lower value)
Assign a value to Is_all_lower data member.
TIgnore_space GetIgnore_space(void) const
Get the Ignore_space member data.
const TField & GetField(void) const
Get the variant data.
bool IsSetType(void) const
Check if a value has been assigned to Type data member.
TMatch_location GetMatch_location(void) const
Get the Match_location member data.
const TString & GetString(void) const
Get the variant data.
bool IsSetCase_sensitive(void) const
Check if a value has been assigned to Case_sensitive data member.
TIs_all_caps GetIs_all_caps(void) const
Get the Is_all_caps member data.
bool IsSetIgnore_punct(void) const
Check if a value has been assigned to Ignore_punct data member.
void SetIs_all_punct(TIs_all_punct value)
Assign a value to Is_all_punct data member.
bool IsSetNot_present(void) const
Check if a value has been assigned to Not_present data member.
TWhole_word GetWhole_word(void) const
Get the Whole_word member data.
TLegal_qual GetLegal_qual(void) const
Get the variant data.
TIgnore_weasel GetIgnore_weasel(void) const
Get the Ignore_weasel member data.
bool IsSetWhole_word(void) const
Check if a value has been assigned to Whole_word data member.
const TField & GetField(void) const
Get the Field member data.
bool IsSetField(void) const
Check if a value has been assigned to Field data member.
void SetIgnore_punct(TIgnore_punct value)
Assign a value to Ignore_punct data member.
const TFeature_field & GetFeature_field(void) const
Get the variant data.
TIgnore_punct GetIgnore_punct(void) const
Get the Ignore_punct member data.
void SetIgnore_words(TIgnore_words &value)
Assign a value to Ignore_words data member.
bool IsFeature_field(void) const
Check if variant Feature_field is selected.
void SetMatch_location(TMatch_location value)
Assign a value to Match_location data member.
const TMatch_text & GetMatch_text(void) const
Get the Match_text member data.
bool IsString(void) const
Check if variant String is selected.
const TString_constraint & GetString_constraint(void) const
Get the String_constraint member data.
TNot_present GetNot_present(void) const
Get the Not_present member data.
bool IsSetString_constraint(void) const
Check if a value has been assigned to String_constraint data member.
bool IsSetField(void) const
Check if a value has been assigned to Field data member.
void SetIs_all_caps(TIs_all_caps value)
Assign a value to Is_all_caps data member.
TIs_all_punct GetIs_all_punct(void) const
Get the Is_all_punct member data.
bool IsField(void) const
Check if variant Field is selected.
TIs_all_lower GetIs_all_lower(void) const
Get the Is_all_lower member data.
const Tdata & Get(void) const
Get the member data.
void SetCase_sensitive(TCase_sensitive value)
Assign a value to Case_sensitive data member.
bool IsSetIgnore_space(void) const
Check if a value has been assigned to Ignore_space data member.
bool IsSetIs_all_caps(void) const
Check if a value has been assigned to Is_all_caps data member.
void SetIgnore_space(TIgnore_space value)
Assign a value to Ignore_space data member.
TType GetType(void) const
Get the Type member data.
bool IsSet(void) const
Check if a value has been assigned to data member.
void SetWhole_word(TWhole_word value)
Assign a value to Whole_word data member.
void SetIgnore_weasel(TIgnore_weasel value)
Assign a value to Ignore_weasel data member.
void SetNot_present(TNot_present value)
Assign a value to Not_present data member.
bool IsSetMatch_text(void) const
Check if a value has been assigned to Match_text data member.
const TField & GetField(void) const
Get the Field member data.
bool IsSetIgnore_words(void) const
Check if a value has been assigned to Ignore_words data member.
@ eMacro_feature_type_cds
@ eString_location_inlist
@ eString_location_equals
@ eString_location_contains
@ eString_location_starts
@ eString_location_ends
@ eFeat_qual_legal_product
END_EVENT_TABLE()
const struct ncbi::grid::netcache::search::fields::SIZE size
static static static wxID_ANY
USING_SCOPE(objects)
wxString ToWxString(const string &s)
Definition: wx_utils.hpp:173
string ToStdString(const wxString &s)
Definition: wx_utils.hpp:161
Modified on Fri Sep 20 14:58:23 2024 by modify_doxy.py rev. 669887