NCBI C++ ToolKit
add_constraint_panel.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: add_constraint_panel.hpp 45436 2020-08-03 17:23:15Z asztalos $
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 
32 #ifndef ADD_CONSTRAINT_PANEL__HPP
33 #define ADD_CONSTRAINT_PANEL__HPP
34 
35 
36 #include <corelib/ncbistd.hpp>
37 
38 /*!
39  * Includes
40  */
41 
42 
43 ////@begin includes
44 #include <wx/listbook.h>
45 #include <wx/choicebk.h>
46 #include <wx/checklst.h>
47 ////@end includes
64 
65 
67 
68 ////@begin control identifiers
69 #define SYMBOL_CADDCONSTRAINT_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL
70 #define SYMBOL_CADDCONSTRAINT_TITLE _("Constraint")
71 #define SYMBOL_CADDCONSTRAINT_IDNAME wxID_ANY
72 #define SYMBOL_CADDCONSTRAINT_SIZE wxDefaultSize
73 #define SYMBOL_CADDCONSTRAINT_POSITION wxDefaultPosition
74 ////@end control identifiers
75 
76 
77 class CAddConstraint: public wxFrame, public CFieldNamePanelParent
78 {
79  DECLARE_DYNAMIC_CLASS( CAddConstraint )
80  DECLARE_EVENT_TABLE()
81 
82 public:
84  CAddConstraint( wxWindow* parent, objects::CSeq_entry_Handle seh,
85  wxWindowID id = SYMBOL_CADDCONSTRAINT_IDNAME,
86  const wxString& caption = SYMBOL_CADDCONSTRAINT_TITLE,
87  const wxPoint& pos = SYMBOL_CADDCONSTRAINT_POSITION,
88  const wxSize& size = SYMBOL_CADDCONSTRAINT_SIZE,
89  long style = SYMBOL_CADDCONSTRAINT_STYLE );
90 
91  bool Create( wxWindow* parent,
92  wxWindowID id = SYMBOL_CADDCONSTRAINT_IDNAME,
93  const wxString& caption = SYMBOL_CADDCONSTRAINT_TITLE,
94  const wxPoint& pos = SYMBOL_CADDCONSTRAINT_POSITION,
95  const wxSize& size = SYMBOL_CADDCONSTRAINT_SIZE,
96  long style = SYMBOL_CADDCONSTRAINT_STYLE );
97 
99 
100  void Init();
101 
102  void CreateControls();
103 
104 ////@begin CAddConstraint event handler declarations
105 
106 ////@end CAddConstraint event handler declarations
107 
108 ////@begin CAddConstraint member function declarations
109 
110  wxBitmap GetBitmapResource( const wxString& name );
111 
112  wxIcon GetIconResource( const wxString& name );
113 ////@end CAddConstraint member function declarations
114 
115  static bool ShowToolTips();
116 
117  void OnAccept( wxCommandEvent& event );
118  void OnCancel( wxCommandEvent& event );
119 
120  // inherited from CFieldNamePanelParent
121  virtual void UpdateEditor(void) {}
122 
123  void SetSelection(int page);
124  void SetEditId(int id) {m_id = id;}
125  void SetConstraint(const SFieldTypeAndMatcher &constraint);
126 private:
127 
128 ////@begin CAddConstraint member variables
129  wxChoicebook* m_Notebook;
130  objects::CSeq_entry_Handle m_TopSeqEntry;
131  int m_id;
132 };
133 
135 {
136 public:
137  virtual ~CMatcherPanelBase() {}
139  virtual void SetMatcher(const SFieldTypeAndMatcher &item) = 0;
140  virtual string GetLabel(void) = 0;
141  virtual void SetFieldName(const string& field) {}
142  virtual void PopulateFeatureListbox(objects::CSeq_entry_Handle seh) {}
143  virtual void SetFieldNames(const vector<string>& field_names) {}
144 };
145 
147 {
149 public:
152 
154 
155 
156  pair<string, SFieldTypeAndMatcher > GetItem(CFieldNamePanel::EFieldType field_type) {return m_panel->GetItem(field_type);}
157 private:
159 };
160 
162 
163 #endif // ADD_CONSTRAINT_PANEL__HPP
User-defined methods of the data storage class.
User-defined methods of the data storage class.
User-defined methods of the data storage class.
#define SYMBOL_CADDCONSTRAINT_STYLE
#define SYMBOL_CADDCONSTRAINT_TITLE
#define SYMBOL_CADDCONSTRAINT_IDNAME
#define SYMBOL_CADDCONSTRAINT_SIZE
#define SYMBOL_CADDCONSTRAINT_POSITION
wxChoicebook * m_Notebook
static bool ShowToolTips()
wxBitmap GetBitmapResource(const wxString &name)
void OnCancel(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)
wxIcon GetIconResource(const wxString &name)
objects::CSeq_entry_Handle m_TopSeqEntry
virtual void UpdateEditor(void)
void SetSelection(int page)
void OnAccept(wxCommandEvent &event)
void SetConstraint(const SFieldTypeAndMatcher &constraint)
virtual string GetLabel(void)=0
virtual void PopulateFeatureListbox(objects::CSeq_entry_Handle seh)
virtual void SetMatcher(const SFieldTypeAndMatcher &item)=0
virtual void SetFieldNames(const vector< string > &field_names)
virtual void SetFieldName(const string &field)
virtual SFieldTypeAndMatcher GetMatcher(CFieldNamePanel::EFieldType field_type)=0
wxDECLARE_NO_COPY_CLASS(CTripleConstraintPanel_CSourceFieldNamePanel_Wrapper)
pair< string, SFieldTypeAndMatcher > GetItem(CFieldNamePanel::EFieldType field_type)
virtual pair< string, SFieldTypeAndMatcher > GetItem(CFieldNamePanel::EFieldType field_type)=0
Include a standard set of the NCBI C++ Toolkit most basic headers.
#define NULL
Definition: ncbistd.hpp:225
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
const struct ncbi::grid::netcache::search::fields::SIZE size
Modified on Sat May 25 14:21:18 2024 by modify_doxy.py rev. 669887