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

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS_EDIT___MACRO_CONSTRAINT_PANEL__HPP
2 #define GUI_WIDGETS_EDIT___MACRO_CONSTRAINT_PANEL__HPP
3 /* $Id: macro_constraint_panel.hpp 46892 2021-11-26 16:59:44Z asztalos $
4  * ===========================================================================
5  *
6  * PUBLIC DOMAIN NOTICE
7  * National Center for Biotechnology Information
8  *
9  * This software/database is a "United States Government Work" under the
10  * terms of the United States Copyright Act. It was written as part of
11  * the author's official duties as a United States Government employee and
12  * thus cannot be copyrighted. This software/database is freely available
13  * to the public for use. The National Library of Medicine and the U.S.
14  * Government have not placed any restriction on its use or reproduction.
15  *
16  * Although all reasonable efforts have been taken to ensure the accuracy
17  * and reliability of the software and data, the NLM and the U.S.
18  * Government do not and cannot warrant the performance or results that
19  * may be obtained by using this software or data. The NLM and the U.S.
20  * Government disclaim all warranties, express or implied, including
21  * warranties of performance, merchantability or fitness for any particular
22  * purpose.
23  *
24  * Please cite the author in any work or product based on this material.
25  *
26  * ===========================================================================
27  *
28  * Authors: Igor Filippov
29  *
30  * File Description:
31  *
32  */
33 
34 #include <corelib/ncbistd.hpp>
36 #include <wx/panel.h>
37 
38 class wxCheckListBox;
39 class wxButton;
40 
42 
43 
44 /*!
45  * Control identifiers
46  */
47 #define ID_CONSTRAINT_CHOICEBOOK 14002
48 #define ID_CONSTRAINT_ADD 14003
49 #define ID_CONSTRAINT_REMOVE 14004
50 #define ID_CONSTRAINT_LIST 14005
51 
52 
54 {
55  DECLARE_DYNAMIC_CLASS(CMacroCompoundConstraintPanel)
56  DECLARE_EVENT_TABLE()
57 
58 public:
60  CMacroCompoundConstraintPanel(wxWindow* parent,
61  wxWindowID id = wxID_ANY,
62  const wxPoint& pos = wxDefaultPosition,
63  const wxSize& size = wxDefaultSize,
64  long style = wxTAB_TRAVERSAL);
65 
66  bool Create( wxWindow* parent,
67  wxWindowID id = wxID_ANY,
68  const wxPoint& pos = wxDefaultPosition,
69  const wxSize& size = wxDefaultSize,
70  long style = wxTAB_TRAVERSAL );
71 
73 
74  void Init();
75  void CreateControls();
76 
77  wxBitmap GetBitmapResource( const wxString& name );
78  wxIcon GetIconResource( const wxString& name );
79  static bool ShowToolTips();
80 
81  void ClearValues(bool enable_add);
82 
83  void OnAddConstraint( wxCommandEvent& event );
84  void OnRemoveConstraint( wxCommandEvent& event );
85  void OnEditConstraint( wxCommandEvent& event );
86  void OnUpdateClearButton(wxUpdateUIEvent& event);
87 
88  void AddConstraint(pair<string, string> item, int id,
89  const vector<string> &vars = vector<string>(),
90  const string &qual_name = kEmptyStr,
92  const vector<CFuncWithArgs>& func_info = vector<CFuncWithArgs>());
93 
94  void SetConstraints(const vector<CFuncWithArgs>&);
95  bool IsSetConstraints();
96 
97  TStringPairsVector GetConstraints();
98  vector<string> GetDescription();
99 
100  bool HasVariables();
101  string GetVariables();
102 
103 private:
104  void x_PrintState() const;
105  wxCheckListBox *m_CheckListBox;
106  wxButton* m_Add;
107  wxButton* m_Clear;
108 
109  size_t m_Num{ 0 };
111  vector<SMacroConstraint> m_Constraints;
112 };
113 
115 
116 #endif // GUI_WIDGETS_EDIT___MACRO_CONSTRAINT_PANEL__HPP
vector< SMacroConstraint > m_Constraints
map< string, unsigned > m_ConstraintMap
Include a standard set of the NCBI C++ Toolkit most basic headers.
static void Init(void)
Definition: cursor6.c:76
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
vector< pair< string, string > > TStringPairsVector
Definition: ncbistr.hpp:4810
#define kEmptyStr
Definition: ncbistr.hpp:123
#define NCBI_GUIWIDGETS_EDIT_EXPORT
Definition: gui_export.h:526
EMMatcherPanelType
Denotes the type of panel that is used to create macro constraint.
const struct ncbi::grid::netcache::search::fields::SIZE size
static static static wxID_ANY
Modified on Fri Feb 23 11:50:12 2024 by modify_doxy.py rev. 669887