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

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS_EDIT___MACRO_ADD_CONSTRAINT_PANEL__HPP
2 #define GUI_WIDGETS_EDIT___MACRO_ADD_CONSTRAINT_PANEL__HPP
3 /* $Id: macro_add_constraint_panel.hpp 46865 2021-11-15 20:54:03Z 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 
35 #include <corelib/ncbistd.hpp>
38 #include <wx/frame.h>
39 
40 class wxChoicebook;
41 
43 
44 ////@begin control identifiers
45 #define SYMBOL_CMACROADDCONSTRAINT_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxMINIMIZE_BOX|wxMAXIMIZE_BOX|wxCLOSE_BOX|wxTAB_TRAVERSAL
46 #define SYMBOL_CMACROADDCONSTRAINT_TITLE _("Add Macro Constraint")
47 #define SYMBOL_CMACROADDCONSTRAINT_IDNAME wxID_ANY
48 #define SYMBOL_CMACROADDCONSTRAINT_SIZE wxDefaultSize
49 #define SYMBOL_CMACROADDCONSTRAINT_POSITION wxDefaultPosition
50 ////@end control identifiers
51 
52 
53 class CMacroAddConstraint: public wxFrame, public CFieldNamePanelParent
54 {
55  DECLARE_DYNAMIC_CLASS(CMacroAddConstraint)
56  DECLARE_EVENT_TABLE()
57 
58 public:
60  CMacroAddConstraint(wxWindow* parent, const pair<string, string>& target,
61  wxWindowID id = SYMBOL_CMACROADDCONSTRAINT_IDNAME,
62  const wxString& caption = SYMBOL_CMACROADDCONSTRAINT_TITLE,
63  const wxPoint& pos = SYMBOL_CMACROADDCONSTRAINT_POSITION,
64  const wxSize& size = SYMBOL_CMACROADDCONSTRAINT_SIZE,
66 
67  bool Create( wxWindow* parent,
68  wxWindowID id = SYMBOL_CMACROADDCONSTRAINT_IDNAME,
69  const wxString& caption = SYMBOL_CMACROADDCONSTRAINT_TITLE,
70  const wxPoint& pos = SYMBOL_CMACROADDCONSTRAINT_POSITION,
71  const wxSize& size = SYMBOL_CMACROADDCONSTRAINT_SIZE,
73 
75 
76  void Init();
77 
78  void CreateControls();
79 
80 ////@begin CAddConstraint event handler declarations
81 
82 ////@end CAddConstraint event handler declarations
83 
84 ////@begin CAddConstraint member function declarations
85 
86  wxBitmap GetBitmapResource( const wxString& name );
87 
88  wxIcon GetIconResource( const wxString& name );
89 ////@end CAddConstraint member function declarations
90 
91  static bool ShowToolTips();
92 
93  void OnAccept( wxCommandEvent& event );
94  void OnCancel( wxCommandEvent& event );
95 
96  // inherited from CFieldNamePanelParent
97  virtual void UpdateEditor(void) {}
98 
99  void SetEditId(int id) {m_id = id;}
100  void SetNumConstraints(size_t num) { m_num = num; }
101  void SetConstraint(const SMacroConstraint& constr);
102 
104 
105  enum {
107  };
108 
109 private:
110  void SetStringSelection(const string& sel);
111 
112  wxChoicebook* m_Notebook;
113 
114  // corresponds to the matching type of the elements of m_Notebook
115  vector<EMMatcherPanelType> m_MatchingTypes;
116 
117  pair<string, string> m_target;
118  int m_id{ -1 };
119  size_t m_num{ 0 };
120 };
121 
122 
124 
125 #endif // GUI_WIDGETS_EDIT___MACRO_ADD_CONSTRAINT_PANEL__HPP
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &caption=_("Add Macro Constraint"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxMINIMIZE_BOX|wxMAXIMIZE_BOX|wxCLOSE_BOX|wxTAB_TRAVERSAL)
wxBitmap GetBitmapResource(const wxString &name)
wxIcon GetIconResource(const wxString &name)
void OnAccept(wxCommandEvent &event)
vector< EMMatcherPanelType > m_MatchingTypes
pair< string, string > m_target
void SetAndUpdateConstraint(SMacroConstraint &constr)
void SetConstraint(const SMacroConstraint &constr)
void SetStringSelection(const string &sel)
void OnCancel(wxCommandEvent &event)
Include a standard set of the NCBI C++ Toolkit most basic headers.
#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 SYMBOL_CMACROADDCONSTRAINT_POSITION
#define SYMBOL_CMACROADDCONSTRAINT_STYLE
#define SYMBOL_CMACROADDCONSTRAINT_SIZE
#define SYMBOL_CMACROADDCONSTRAINT_IDNAME
#define SYMBOL_CMACROADDCONSTRAINT_TITLE
const struct ncbi::grid::netcache::search::fields::SIZE size
Modified on Fri Sep 20 14:57:58 2024 by modify_doxy.py rev. 669887