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

Go to the SVN repository for this file.

1 /* $Id: string_constraint_panel.hpp 45223 2020-06-18 17:24:33Z 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: Colleen Bollin
27  */
28 #ifndef _STRING_CONSTRAINT_PANEL_H_
29 #define _STRING_CONSTRAINT_PANEL_H_
30 
31 #include <corelib/ncbistd.hpp>
34 
35 /*!
36  * Includes
37  */
38 
39 ////@begin includes
40 ////@end includes
41 
42 #include <wx/choice.h>
43 #include <wx/textctrl.h>
44 #include <wx/checkbox.h>
45 #include <wx/panel.h>
46 #include <wx/sizer.h>
47 #include <wx/combobox.h>
48 
49 /*!
50  * Forward declarations
51  */
52 
53 ////@begin forward declarations
54 ////@end forward declarations
55 
57 
58 /*!
59  * Control identifiers
60  */
61 
62 ////@begin control identifiers
63 #define SYMBOL_CSTRINGCONSTRAINTPANEL_STYLE wxTAB_TRAVERSAL
64 #define SYMBOL_CSTRINGCONSTRAINTPANEL_TITLE _("StringConstraintPanel")
65 #define SYMBOL_CSTRINGCONSTRAINTPANEL_IDNAME ID_CSTRINGCONSTRAINTPANEL
66 #define SYMBOL_CSTRINGCONSTRAINTPANEL_SIZE wxSize(400,300)
67 #define SYMBOL_CSTRINGCONSTRAINTPANEL_POSITION wxDefaultPosition
68 ////@end control identifiers
69 
70 
71 /*!
72  * CStringConstraintPanel class declaration
73  */
74 
75 class CStringConstraintPanel: public wxPanel
76 {
77  DECLARE_DYNAMIC_CLASS( CStringConstraintPanel )
78  DECLARE_EVENT_TABLE()
79 
80 public:
81  /// Constructors
83  CStringConstraintPanel( wxWindow* parent, bool parentAECRDlg = false,
84  wxWindowID id = SYMBOL_CSTRINGCONSTRAINTPANEL_IDNAME,
85  const wxPoint& pos = SYMBOL_CSTRINGCONSTRAINTPANEL_POSITION,
88  bool cap_constraints = false );
89 
90  /// Creation
91  bool Create( wxWindow* parent,
92  wxWindowID id = SYMBOL_CSTRINGCONSTRAINTPANEL_IDNAME,
93  const wxPoint& pos = SYMBOL_CSTRINGCONSTRAINTPANEL_POSITION,
96 
97  /// Destructor
99 
100  /// Initialises member variables
101  void Init();
102 
103  /// Creates the controls and sizers
104  void CreateControls();
105 
106 ////@begin CStringConstraintPanel event handler declarations
107  void OnClear( wxCommandEvent& event );
108  void OnMatchTypeSelected( wxCommandEvent& event );
109 ////@end CStringConstraintPanel event handler declarations
110 
111 ////@begin CStringConstraintPanel member function declarations
112 
114  bool Match(const string &str);
115 
116  string GetMacroStringConstraint(const string& field_name);
117  void SetStringSelection(const wxString &str) { m_MatchType->SetStringSelection(str);}
118 
119  void ClearValues(void);
120  void SetChoices(const vector<string>& choices, const vector<string>& values);
121  void ShowChoiceOrText(void);
122 
123  /// Retrieves bitmap resources
124  wxBitmap GetBitmapResource( const wxString& name );
125 
126  /// Retrieves icon resources
127  wxIcon GetIconResource( const wxString& name );
128 ////@end CStringConstraintPanel member function declarations
129 
130  /// Should we show tooltips?
131  static bool ShowToolTips();
132 
133  enum {
140  };
141 
142 private:
143  enum EMatchType {
154 
158  };
159 
160  string x_ReplaceChoices(const string &orig);
161 
162  wxChoice* m_MatchType;
163  wxTextCtrl* m_MatchText;
164  wxCheckBox* m_IgnoreCase;
165  wxCheckBox* m_IgnoreSpace;
166  wxComboBox* m_MatchChoice;
167 
168  /// flag is set if parent is the AECRDlg, for having specific features
170 
172  wxBoxSizer* m_TextSizer;
175 };
176 
178 
179 #endif
180  // _STRING_CONSTRAINT_PANEL_H_
User-defined methods of the data storage class.
void SetStringSelection(const wxString &str)
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
void OnMatchTypeSelected(wxCommandEvent &event)
void OnClear(wxCommandEvent &event)
CRef< edit::CStringConstraint > GetStringConstraint()
void SetChoices(const vector< string > &choices, const vector< string > &values)
string GetMacroStringConstraint(const string &field_name)
void Init()
Initialises member variables.
map< string, string > m_ChoiceToValue
bool Match(const string &str)
string x_ReplaceChoices(const string &orig)
static bool ShowToolTips()
Should we show tooltips?
bool Create(wxWindow *parent, wxWindowID id=ID_CSTRINGCONSTRAINTPANEL, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxTAB_TRAVERSAL)
Creation.
bool m_ParentAECRDlg
flag is set if parent is the AECRDlg, for having specific features
void CreateControls()
Creates the controls and sizers.
Include a standard set of the NCBI C++ Toolkit most basic headers.
static const char * str(char *buf, int n)
Definition: stats.c:84
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
where boath are integers</td > n< td ></td > n</tr > n< tr > n< td > tse</td > n< td > optional</td > n< td > String</td > n< td class=\"description\"> TSE option controls what blob is orig
const struct ncbi::grid::netcache::search::fields::SIZE size
#define SYMBOL_CSTRINGCONSTRAINTPANEL_POSITION
#define SYMBOL_CSTRINGCONSTRAINTPANEL_STYLE
#define SYMBOL_CSTRINGCONSTRAINTPANEL_IDNAME
#define SYMBOL_CSTRINGCONSTRAINTPANEL_SIZE
Modified on Thu Apr 25 08:18:40 2024 by modify_doxy.py rev. 669887