NCBI C++ ToolKit
structuredcomment_panel.cpp

Search Toolkit Book for uredcomment_panel_8cpp_source

Go to the documentation of this file.
1 /* $Id: structuredcomment_panel.cpp 37524 2017-01-18 16:24:56Z 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: Colleen Bollin
27  */
28 
29 
30 #include <ncbi_pch.hpp>
34 #include <util/util_misc.hpp>
37 #include <serial/objistr.hpp>
38 ////@begin includes
39 ////@end includes
40 
41 #include <wx/panel.h>
42 #include <wx/sizer.h>
43 #include <wx/bitmap.h>
44 #include <wx/icon.h>
45 #include <wx/choice.h>
46 #include <wx/textctrl.h>
47 #include <wx/stattext.h>
48 #include <wx/valtext.h>
49 #include <wx/toplevel.h>
50 #include <wx/scrolwin.h>
51 #include <wx/hyperlink.h>
52 #include <wx/checkbox.h>
53 
54 
56 
57 
58 ////@begin XPM images
59 ////@end XPM images
60 
63 
64 /*!
65  * CStructuredCommentPanel type definition
66  */
67 
68 IMPLEMENT_DYNAMIC_CLASS( CStructuredCommentPanel, wxPanel )
69 
70 
71 /*!
72  * CStructuredCommentPanel event table definition
73  */
74 
75 BEGIN_EVENT_TABLE( CStructuredCommentPanel, wxPanel )
76 
77 ////@begin CStructuredCommentPanel event table entries
78  EVT_CHOICE( ID_CHOICE11, CStructuredCommentPanel::OnChoice11Selected )
79 
80  EVT_HYPERLINK( ID_HYPERLINKCTRL, CStructuredCommentPanel::OnHyperlinkctrlHyperlinkClicked )
81 
82 ////@end CStructuredCommentPanel event table entries
83 
84  EVT_HYPERLINK(wxID_ANY, CStructuredCommentPanel::OnDelete)
85 
87 
88 
89 /*!
90  * CStructuredCommentPanel constructors
91  */
92 
93 CStructuredCommentPanel::CStructuredCommentPanel()
94 {
95  Init();
96 }
97 
98 CStructuredCommentPanel::CStructuredCommentPanel( wxWindow* parent, CRef<CUser_object> user, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
99 {
100  Init();
101  m_User = new objects::CUser_object();
102  if (user) {
103  m_User->Assign(*user);
104  }
105  Create(parent, id, caption, pos, size, style);
106 }
107 
108 
109 /*!
110  * CStructuredCommentPanel creator
111  */
112 
113 bool CStructuredCommentPanel::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
114 {
115 ////@begin CStructuredCommentPanel creation
116  SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
117  wxPanel::Create( parent, id, pos, size, style );
118 
119  CreateControls();
120  if (GetSizer())
121  {
122  GetSizer()->SetSizeHints(this);
123  }
124  Centre();
125 ////@end CStructuredCommentPanel creation
126  return true;
127 }
128 
129 
130 /*!
131  * CStructuredCommentPanel destructor
132  */
133 
135 {
136 ////@begin CStructuredCommentPanel destruction
137 ////@end CStructuredCommentPanel destruction
138 }
139 
140 
141 /*!
142  * Member initialisation
143  */
144 
146 {
147 ////@begin CStructuredCommentPanel member initialisation
152  m_Sizer = NULL;
153 ////@end CStructuredCommentPanel member initialisation
154 }
155 
156 
158 {
159  while (NStr::StartsWith (str, "#")) {
160  str = str.substr(1);
161  }
162  while (NStr::EndsWith (str, "#")) {
163  str = str.substr(0, str.length() - 1);
164  }
165 }
166 
167 
169 {
170  if (NStr::StartsWith(str, "##")) {
171  // done
172  } else if (NStr::StartsWith (str, "#")) {
173  // add one more
174  str = "#" + str;
175  } else {
176  // add two
177  str = "##" + str;
178  }
179 
180  if (NStr::EndsWith(str, "##")) {
181  // done
182  } else if (NStr::EndsWith (str, "#")) {
183  // add one more
184  str = str + "#";
185  } else {
186  // add two
187  str = str + "##";
188  }
189 }
190 
191 
192 /*!
193  * Control creation for CStructuredCommentPanel
194  */
195 
197 {
198 ////@begin CStructuredCommentPanel content construction
199  CStructuredCommentPanel* itemPanel1 = this;
200 
201  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
202  itemPanel1->SetSizer(itemBoxSizer2);
203 
204  m_StandardCommentSizer = new wxBoxSizer(wxHORIZONTAL);
205  itemBoxSizer2->Add(m_StandardCommentSizer, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
206 
207  m_StandardCommentTypeLabel = new wxStaticText( itemPanel1, wxID_STATIC, _("Standard Comment Type"), wxDefaultPosition, wxDefaultSize, 0 );
208  m_StandardCommentSizer->Add(m_StandardCommentTypeLabel, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
209 
210  wxArrayString m_StandardCommentCtrlStrings;
211  m_StandardCommentCtrl = new wxChoice( itemPanel1, ID_CHOICE11, wxDefaultPosition, wxDefaultSize, m_StandardCommentCtrlStrings, 0 );
212  m_StandardCommentSizer->Add(m_StandardCommentCtrl, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
213 
214  wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxHORIZONTAL);
215  itemBoxSizer2->Add(itemBoxSizer6, 0, wxALIGN_LEFT|wxALL, 5);
216 
217  wxStaticText* itemStaticText7 = new wxStaticText( itemPanel1, wxID_STATIC, _("Field Name"), wxDefaultPosition, wxSize(200, -1), 0 );
218  itemBoxSizer6->Add(itemStaticText7, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
219 
220  wxStaticText* itemStaticText8 = new wxStaticText( itemPanel1, wxID_STATIC, _("Value"), wxDefaultPosition, wxSize(200, -1), 0 );
221  itemBoxSizer6->Add(itemStaticText8, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
222 
223  wxHyperlinkCtrl* itemHyperlinkCtrl9 = new wxHyperlinkCtrl( itemPanel1, ID_HYPERLINKCTRL, _("Add Field"), wxEmptyString, wxDefaultPosition, wxSize(50, -1), wxHL_DEFAULT_STYLE );
224  itemBoxSizer6->Add(itemHyperlinkCtrl9, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
225 
226  m_ScrolledWindow = new wxScrolledWindow( itemPanel1, ID_SCROLLEDWINDOW, wxDefaultPosition, wxDefaultSize, wxSUNKEN_BORDER|wxTAB_TRAVERSAL );
227  itemBoxSizer2->Add(m_ScrolledWindow, 1, wxGROW|wxALL, 5);
228  m_ScrolledWindow->SetScrollbars(1, 1, 0, 0);
229  m_Sizer = new wxBoxSizer(wxVERTICAL);
230  m_ScrolledWindow->SetSizer(m_Sizer);
231 
232  m_ScrolledWindow->SetMinSize(wxSize(-1, 250));
233 
234 
235 
236 ////@end CStructuredCommentPanel content construction
237 
240  // add wxchoice with available comment rules
241  m_StandardCommentCtrlStrings.Add(wxEmptyString);
243  const CComment_rule& rule = **it;
244  string prefix = rule.GetPrefix();
245  s_RemovePoundSigns(prefix);
246  m_StandardCommentCtrlStrings.Add(ToWxString(prefix));
247  }
248 
249  m_StandardCommentCtrl->Append(m_StandardCommentCtrlStrings);
250  } else {
251  }
252 }
253 
254 
255 void CStructuredCommentPanel::s_AddRow (string field_name, string field_value, bool static_fieldname)
256 {
257  wxBoxSizer* row_sizer = new wxBoxSizer(wxHORIZONTAL);
258  m_Sizer->Add (row_sizer, 0, wxALIGN_NOT|wxALL);
259  if (static_fieldname) {
260  wxStaticText* fieldNameText = new wxStaticText( m_ScrolledWindow, 0, ToWxString(field_name), wxDefaultPosition, wxSize(200, -1), 0 );
261  row_sizer->Add(fieldNameText, 0, wxALIGN_NOT|wxALL);
262  m_FieldNameCtrls.push_back(fieldNameText);
263  } else {
264  wxTextCtrl* fieldNameText = new wxTextCtrl( m_ScrolledWindow, 0, ToWxString(field_name), wxDefaultPosition, wxSize(200, -1), 0 );
265  row_sizer->Add(fieldNameText, 0, wxALIGN_NOT|wxALL);
266  m_FieldNameCtrls.push_back(fieldNameText);
267  }
268  wxTextCtrl* fieldValueText = new wxTextCtrl( m_ScrolledWindow, 0, ToWxString(field_value), wxDefaultPosition, wxSize(200, -1), 0 );
269  row_sizer->Add(fieldValueText, 0, wxALIGN_NOT|wxALL);
270  m_FieldValueCtrls.push_back(fieldValueText);
271 
272  if (!static_fieldname) {
273  wxHyperlinkCtrl* itemHyperLink = new wxHyperlinkCtrl(m_ScrolledWindow, wxID_ANY, wxT("Delete"), wxT(""));
274  itemHyperLink->SetVisitedColour(itemHyperLink->GetNormalColour());
275  row_sizer->Add(itemHyperLink, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT, 5);
276  }
277 
278  int row_width;
279  int row_height;
280  fieldValueText->GetClientSize(&row_width, &row_height);
281  m_TotalHeight += row_height;
282  m_ScrollRate = row_height;
283 
284 }
285 
286 
288 {
289  if (!wxPanel::TransferDataToWindow())
290  return false;
291 
292  Freeze();
293 
294  m_Sizer->Clear(true);
295 
296  m_TotalHeight = 0;
297  m_ScrollRate = 0;
298 
299  m_FieldNameCtrls.clear();
300  m_FieldValueCtrls.clear();
301 
302  // first, find prefix and add it, save suffix for later
303  string prefix = "";
304  string suffix = "";
305  vector<string> field_names;
306  vector<string> field_values;
307  vector<bool> displayed;
308 
309  ITERATE (CUser_object::TData, it, m_User->GetData()) {
310  string field_name = "";
311  const CObject_id& obj_id = (*it)->GetLabel();
312  if ( obj_id.IsStr() ) {
313  field_name = obj_id.GetStr();
314  }
315 
316  if (NStr::EqualNocase (field_name, "StructuredCommentPrefix")) {
317  if ((*it)->IsSetData() && (*it)->GetData().IsStr()) {
318  prefix = (*it)->GetData().GetStr();
319  s_RemovePoundSigns(prefix);
320  }
321  } else if (NStr::EqualNocase(field_name, "StructuredCommentSuffix")) {
322  if ((*it)->IsSetData() && (*it)->GetData().IsStr()) {
323  suffix = (*it)->GetData().GetStr();
324  s_RemovePoundSigns(suffix);
325  }
326  } else {
327  field_names.push_back(field_name);
328  string value = "";
329  if ((*it)->IsSetData()) {
330  if ((*it)->GetData().IsStr()) {
331  value = (*it)->GetData().GetStr();
332  } else if ((*it)->GetData().IsInt()) {
333  value = NStr::IntToString ((*it)->GetData().GetInt());
334  }
335  }
336  field_values.push_back(value);
337  displayed.push_back(false);
338  }
339  }
340 
341  // if this is a standard comment, set the control, and list the expected fields first
342  bool use_default_layout = true;
343 
345  try {
346  const CComment_rule& rule = m_StructuredCommentRules->FindCommentRule("##" + prefix + "##");
347  m_StandardCommentCtrl->SetStringSelection(ToWxString (prefix));
348  ITERATE (CComment_rule::TFields::Tdata, field_it, rule.GetFields().Get()) {
349  // find existing value if we have one
350  // note - display multiple values here if present
351  bool found = false;
352  for (int i = 0; i < field_names.size(); i++) {
353  if (NStr::EqualNocase(field_names[i], (*field_it)->GetField_name())) {
354  s_AddRow((*field_it)->GetField_name(), field_values[i], true);
355  displayed[i] = true;
356  found = true;
357  }
358  }
359  if (!found) {
360  s_AddRow((*field_it)->GetField_name(), "", true);
361  }
362  }
363 
364  use_default_layout = false;
365  } catch (CException ) {
366  }
367  }
368 
369  if (use_default_layout) {
370  s_AddRow("StructuredCommentPrefix", prefix, true);
371  }
372 
373  for (int i = 0; i < field_names.size(); i++) {
374  if (!displayed[i]) {
375  s_AddRow (field_names[i], field_values[i]);
376  }
377  }
378 
379  if (use_default_layout) {
380  s_AddRow("StructuredCommentSuffix", suffix, true);
381  }
382 
383  m_ScrolledWindow->SetVirtualSize(400 + 10, m_TotalHeight);
384  m_ScrolledWindow->SetScrollRate(0, m_ScrollRate);
385  m_ScrolledWindow->FitInside();
386 
387  Layout();
388  Thaw();
389  return true;
390 }
391 
392 
394 {
395  if (!wxPanel::TransferDataFromWindow())
396  return false;
397 
398  m_User->ResetData();
399 
400  string prefix = "";
401 
402  if (m_StandardCommentCtrl) {
403  prefix = ToStdString (m_StandardCommentCtrl->GetStringSelection());
404  if (!NStr::IsBlank(prefix)) {
405  // structured comment prefix
406  s_AddPoundSigns(prefix);
407  m_User->AddField ("StructuredCommentPrefix", prefix);
408  }
409  }
410 
411  for (int i = 0; i < m_FieldValueCtrls.size(); i++) {
412  string field_name = "";
413  string field_value = "";
414 
415  /* first is either label or text */
416  wxTextCtrl* fieldNameText = dynamic_cast<wxTextCtrl*> (m_FieldNameCtrls[i]);
417  if (fieldNameText) {
418  field_name = ToStdString(fieldNameText->GetValue());
419  } else {
420  wxStaticText* staticFieldNameText = dynamic_cast<wxStaticText*> (m_FieldNameCtrls[i]);
421  if (staticFieldNameText) {
422  field_name = ToStdString (staticFieldNameText->GetLabel());
423  }
424  }
425 
426  /* second is value - could be wxText or ?*/
427  field_value = ToStdString(m_FieldValueCtrls[i]->GetValue());
428 
429  if (keep_blanks || (!NStr::IsBlank(field_name) && !NStr::IsBlank(field_value))) {
430  if (NStr::EqualNocase(field_name, "StructuredCommentPrefix")
431  || NStr::EqualNocase(field_name, "StructuredCommentSuffix")) {
432  if (NStr::IsBlank (prefix)) {
433  s_AddPoundSigns (field_value);
434  m_User->AddField (field_name, field_value);
435  }
436  } else {
437  m_User->AddField (field_name, field_value);
438  }
439  }
440  }
441 
442  if (!NStr::IsBlank(prefix)) {
443  NStr::ReplaceInPlace (prefix, "START##", "END##");
444  m_User->AddField ("StructuredCommentSuffix", prefix);
445  }
446  return true;
447 }
448 
449 
451 {
452  return x_GetFields (false);
453 }
454 
455 
457 {
458  if (m_User)
459  return m_User;
460 
462 }
463 
464 
465 static bool s_FieldRuleCompare (
466  const CRef<CField_rule>& p1,
467  const CRef<CField_rule>& p2
468 )
469 
470 {
471  return NStr::Compare(p1->GetField_name(), p2->GetField_name()) < 0;
472 }
473 
474 
476 {
477  CRef<objects::CComment_set> structuredCommentRules;
478  string fname = g_FindDataFile("validrules.prt");
479  if (fname.empty()) {
480  // do nothing
481  } else {
482  auto_ptr<CObjectIStream> in;
483  in.reset(CObjectIStream::Open(fname, eSerial_AsnText));
484  string header = in->ReadFileHeader();
485 
486  structuredCommentRules.Reset(new CComment_set());
487  in->Read(ObjectInfo(*structuredCommentRules), CObjectIStream::eNoFileHeader);
488  if (structuredCommentRules->IsSet()) {
489  NON_CONST_ITERATE(CComment_set::Tdata, it, structuredCommentRules->Set()) {
490  if (!(*it)->GetRequire_order() && (*it)->IsSetFields()) {
491  CField_set& fields = (*it)->SetFields();
492  fields.Set().sort(s_FieldRuleCompare);
493  }
494  }
495  }
496 
497  }
498 
499  return structuredCommentRules;
500 }
501 
502 
503 /*!
504  * Should we show tooltips?
505  */
506 
508 {
509  return true;
510 }
511 
512 /*!
513  * Get bitmap resources
514  */
515 
516 wxBitmap CStructuredCommentPanel::GetBitmapResource( const wxString& name )
517 {
518  // Bitmap retrieval
519 ////@begin CStructuredCommentPanel bitmap retrieval
520  wxUnusedVar(name);
521  return wxNullBitmap;
522 ////@end CStructuredCommentPanel bitmap retrieval
523 }
524 
525 /*!
526  * Get icon resources
527  */
528 
529 wxIcon CStructuredCommentPanel::GetIconResource( const wxString& name )
530 {
531  // Icon retrieval
532 ////@begin CStructuredCommentPanel icon retrieval
533  wxUnusedVar(name);
534  return wxNullIcon;
535 ////@end CStructuredCommentPanel icon retrieval
536 }
537 
538 
539 /*!
540  * wxEVT_COMMAND_HYPERLINK event handler for ID_HYPERLINKCTRL
541  */
542 
544 {
545  x_GetFields(true);
546  m_User->AddField("", "");
548 }
549 
550 
551 int CStructuredCommentPanel::x_FindRow(wxWindow* wnd, wxSizerItemList& itemList)
552 {
553  if (NULL == wnd)
554  return -1;
555 
556  int row_num = 0;
557  if (!NStr::IsBlank(ToStdString(m_StandardCommentCtrl->GetStringSelection()))) {
558  // add one because prefix field will be first in user object but will not
559  // be represented by a sizer
560  row_num ++;
561  }
562  for(wxSizerItemList::iterator it = itemList.begin(); it != itemList.end(); ++it, ++row_num) {
563  wxSizer* sizer = (**it).GetSizer();
564  if (sizer && sizer->GetItem(wnd))
565  return row_num;
566  }
567 
568  return -1;
569 }
570 
571 
572 void CStructuredCommentPanel::OnDelete (wxHyperlinkEvent& event)
573 {
574  wxSizerItemList& itemList = m_Sizer->GetChildren();
575 
576  int row_num = x_FindRow((wxWindow*)event.GetEventObject(), itemList);
577  if (row_num > -1) {
578  x_GetFields(true);
579  int row = 0;
580  NON_CONST_ITERATE (CUser_object::TData, it, m_User->SetData()) {
581  if (row == row_num) {
582  it = m_User->SetData().erase(it);
583  break;
584  }
585  row++;
586  }
588  }
589 }
590 
591 
592 /*!
593  * wxEVT_COMMAND_CHOICE_SELECTED event handler for ID_CHOICE11
594  */
595 
596 void CStructuredCommentPanel::OnChoice11Selected( wxCommandEvent& event )
597 {
598  x_GetFields(true);
600 }
601 
602 
603 void CStructuredCommentPanel::ChangeSeqdesc(const objects::CSeqdesc& desc)
604 {
606  m_User->Assign(desc.GetUser());
608 }
609 
610 
611 void CStructuredCommentPanel::UpdateSeqdesc(objects::CSeqdesc& desc)
612 {
614  desc.SetUser(*user);
615 }
616 
618 {
619  return true;
620 }
621 
623 {
624  return true;
625 }
626 
628 {
630  CRef<CSerialObject> so((CSerialObject*)(new objects::CUser_object));
631  so->Assign(*GetUser_object());
632  return so;
633 }
634 
636 {
638  istr >> MSerial_AsnText >> *m_User;
640 }
641 
int x_FindRow(wxWindow *wnd, wxSizerItemList &itemList)
CRef< objects::CUser_object > m_User
void OnHyperlinkctrlHyperlinkClicked(wxHyperlinkEvent &event)
wxEVT_COMMAND_HYPERLINK event handler for ID_HYPERLINKCTRL
Tdata & Set(void)
Assign a value to data member.
Definition: Field_set_.hpp:170
#define NON_CONST_ITERATE(Type, Var, Cont)
Non constant version of ITERATE macro.
Definition: ncbimisc.hpp:802
static const char * suffix[]
Definition: pcregrep.c:254
static int Compare(const CTempString str, SIZE_TYPE pos, SIZE_TYPE n, const char *pattern, ECase use_case=eCase)
Compare of a substring with a pattern.
Definition: ncbistr.hpp:5033
static bool ShowToolTips()
Should we show tooltips?
#define MSerial_AsnText
I/O stream manipulators –.
Definition: serialbase.hpp:682
static bool IsBlank(const CTempString str, SIZE_TYPE pos=0)
Check if a string is blank (has no text).
Definition: ncbistr.cpp:102
User-defined methods of the data storage class.
END_EVENT_TABLE()
virtual void ChangeSeqdesc(const objects::CSeqdesc &desc)
static string & ReplaceInPlace(string &src, const string &search, const string &replace, 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:3306
void OnDelete(wxHyperlinkEvent &event)
wxString ToWxString(const char *s)
Definition: wx_utils.hpp:159
ASN.1 text.
Definition: serialdef.hpp:73
static bool s_FieldRuleCompare(const CRef< CField_rule > &p1, const CRef< CField_rule > &p2)
User-defined methods of the data storage class.
list< CRef< CField_rule > > Tdata
Definition: Field_set_.hpp:89
#define NULL
Definition: ncbistd.hpp:225
#define ID_HYPERLINKCTRL
USING_SCOPE(objects)
void OnChoice11Selected(wxCommandEvent &event)
wxEVT_COMMAND_CHOICE_SELECTED event handler for ID_CHOICE11
vector< CRef< CUser_field > > TData
#define ITERATE(Type, Var, Cont)
ITERATE macro to sequence through container elements.
Definition: ncbimisc.hpp:795
static void s_RemovePoundSigns(string &str)
int i
static CObjectIStream * Open(ESerialDataFormat format, CNcbiIstream &inStream, bool deleteInStream)
Create serial object reader and attach it to an input stream.
Definition: objistr.cpp:195
void CreateControls()
Creates the controls and sizers.
void Init()
Initialises member variables.
static string IntToString(int value, TNumToStringFlags flags=0, int base=10)
Convert int to string.
Definition: ncbistr.hpp:4808
static void s_AddPoundSigns(string &str)
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:101
string g_FindDataFile(const CTempString &name, CDirEntry::EType type=CDirEntry::eFile)
Look for an NCBI application data file or directory of the given name and type; in general...
Definition: util_misc.cpp:139
CField_set –.
Definition: Field_set.hpp:65
const TStr & GetStr(void) const
Get the variant data.
Definition: Object_id_.hpp:297
virtual CRef< CSerialObject > OnExport(void)
virtual void UpdateSeqdesc(objects::CSeqdesc &desc)
const TPrefix & GetPrefix(void) const
Get the Prefix member data.
CRef< objects::CComment_set > m_StructuredCommentRules
virtual void Assign(const CSerialObject &source, ESerialRecursionMode how=eRecursive)
Set object to copy of another one.
static void Init(void)
Definition: cursor6.c:76
static bool StartsWith(const CTempString str, const CTempString start, ECase use_case=eCase)
Check if a string starts with a specified prefix value.
Definition: ncbistr.hpp:5141
const Tdata & Get(void) const
Get the member data.
Definition: Field_set_.hpp:164
vector< wxTextCtrl * > m_FieldValueCtrls
static CRef< objects::CComment_set > GetStructuredCommentRules()
vector< wxControl * > m_FieldNameCtrls
Base class for all serializable objects.
Definition: serialbase.hpp:149
#define _(proto)
Definition: ct_nlmzip_i.h:78
virtual void OnImport(CNcbiIfstream &istr)
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1185
#define wxT(x)
Definition: muParser.cpp:41
const TField_name & GetField_name(void) const
Get the Field_name member data.
CRef< objects::CUser_object > GetUser_object() const
static bool EqualNocase(const CTempString str, SIZE_TYPE pos, SIZE_TYPE n, const char *pattern)
Case-insensitive equality of a substring with a pattern.
Definition: ncbistr.hpp:5087
static bool EndsWith(const CTempString str, const CTempString end, ECase use_case=eCase)
Check if a string ends with a specified suffix value.
Definition: ncbistr.hpp:5157
IO_PREFIX::ifstream CNcbiIfstream
Portable alias for ifstream.
Definition: ncbistre.hpp:247
bool Create(wxWindow *parent, wxWindowID id=ID_CSTRUCTUREDCOMMENTPANEL, const wxString &caption=_("StructuredCommentPanel"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
const TFields & GetFields(void) const
Get the Fields member data.
list< CRef< CComment_rule > > Tdata
static const char * prefix[]
Definition: pcregrep.c:251
std::istream & in(std::istream &in_, double &x_)
string ToStdString(const wxString &s)
Definition: wx_utils.hpp:147
static const char * str(char *buf, int n)
Definition: stats.c:84
bool x_GetFields(bool keep_blanks=false)
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:98
static static static wxID_ANY
bool IsStr(void) const
Check if variant Str is selected.
Definition: Object_id_.hpp:291
void s_AddRow(string field_name, string field_value, bool static_fieldname=false)
pair< TObjectPtr, TTypeInfo > ObjectInfo(C &obj)
Definition: objectinfo.hpp:762
void Reset(void)
Reset reference object.
Definition: ncbiobj.hpp:768
Modified on Sun May 20 14:14:12 2018 by modify_doxy.py rev. 546573