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

Go to the SVN repository for this file.

1 /* $Id: parse_text_options_dlg.hpp 36044 2016-08-01 16:05:38Z 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 #ifndef _PARSE_TEXT_OPTIONS_DLG_H_
29 #define _PARSE_TEXT_OPTIONS_DLG_H_
30 
31 #include <corelib/ncbistd.hpp>
34 
35 #include <wx/panel.h>
36 #include <wx/checkbox.h>
37 #include <wx/textctrl.h>
38 #include <wx/radiobut.h>
39 
41 
42 /*!
43  * Control identifiers
44  */
45 
46 ////@begin control identifiers
47 #define SYMBOL_CPARSETEXTOPTIONSDLG_STYLE wxTAB_TRAVERSAL
48 #define SYMBOL_CPARSETEXTOPTIONSDLG_TITLE _("ParseTextOptionsDlg")
49 #define SYMBOL_CPARSETEXTOPTIONSDLG_IDNAME ID_CPARSETEXTOPTIONSDLG
50 #define SYMBOL_CPARSETEXTOPTIONSDLG_SIZE wxSize(400, 300)
51 #define SYMBOL_CPARSETEXTOPTIONSDLG_POSITION wxDefaultPosition
52 ////@end control identifiers
53 
54 
55 /*!
56  * CParseTextOptionsDlg class declaration
57  */
58 
59 class CParseTextOptionsDlg: public wxPanel
60 {
61  DECLARE_DYNAMIC_CLASS( CParseTextOptionsDlg )
62  DECLARE_EVENT_TABLE()
63 
64 public:
65  /// Constructors
67  CParseTextOptionsDlg( wxWindow* parent,
68  wxWindowID id = SYMBOL_CPARSETEXTOPTIONSDLG_IDNAME,
69  const wxPoint& pos = SYMBOL_CPARSETEXTOPTIONSDLG_POSITION,
70  const wxSize& size = SYMBOL_CPARSETEXTOPTIONSDLG_SIZE,
72  bool hide_remove_text_options = false );
73 
74  /// Creation
75  bool Create( wxWindow* parent,
76  wxWindowID id = SYMBOL_CPARSETEXTOPTIONSDLG_IDNAME,
77  const wxPoint& pos = SYMBOL_CPARSETEXTOPTIONSDLG_POSITION,
78  const wxSize& size = SYMBOL_CPARSETEXTOPTIONSDLG_SIZE,
79  long style = SYMBOL_CPARSETEXTOPTIONSDLG_STYLE );
80 
81  /// Destructor
83 
84  /// Initialises member variables
85  void Init();
86 
87  /// Creates the controls and sizers
88  void CreateControls();
89 
90 ////@begin CParseTextOptionsDlg event handler declarations
91 
92  /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_START_TXT_BTN
93  void OnStartTxtBtnSelected( wxCommandEvent& event );
94 
95  /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_START_DIGITS_BTN
96  void OnStartDigitsBtnSelected( wxCommandEvent& event );
97 
98  /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_START_LETTERS_BTN
99  void OnStartLettersBtnSelected( wxCommandEvent& event );
100 
101  /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_END_TEXT_BTN
102  void OnEndTextBtnSelected( wxCommandEvent& event );
103 
104  /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_END_DIGITS_BTN
105  void OnEndDigitsBtnSelected( wxCommandEvent& event );
106 
107  /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_END_LETTERS_BTN
108  void OnEndLettersBtnSelected( wxCommandEvent& event );
109 
110  /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_REMOVE_FROM_PARSED_BTN
111  void OnRemoveFromParseSelected( wxCommandEvent& event );
112 
113 ////@end CParseTextOptionsDlg event handler declarations
114 
115 ////@begin CParseTextOptionsDlg member function declarations
116 
117  /// Retrieves bitmap resources
118  wxBitmap GetBitmapResource( const wxString& name );
119 
120  /// Retrieves icon resources
121  wxIcon GetIconResource( const wxString& name );
122 ////@end CParseTextOptionsDlg member function declarations
123 
124  /// Should we show tooltips?
125  static bool ShowToolTips();
126 
127 ////@begin CParseTextOptionsDlg member variables
128  enum {
147  };
151  wxTextCtrl* m_StartTextTxt;
158  wxTextCtrl* m_EndTextTxt;
165 ////@end CParseTextOptionsDlg member variables
166 
168  void ClearValues(void);
169  string GetSelectedText(const string& input);
170 
171  static void s_GetDigitsPosition(const string& str, size_t& pos, size_t& len);
172  static void s_GetLettersPosition(const string& str, size_t& pos, size_t& len);
173 private:
175 
176 };
177 
179 
180 #endif
181  // _PARSE_TEXT_OPTIONS_DLG_H_
static void s_GetLettersPosition(const string &str, size_t &pos, size_t &len)
void CreateControls()
Creates the controls and sizers.
CNoTabRadioButton * m_EndTextBtn
void OnStartTxtBtnSelected(wxCommandEvent &event)
wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_START_TXT_BTN
void OnRemoveFromParseSelected(wxCommandEvent &event)
wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_REMOVE_FROM_PARSED_BTN
void OnStartDigitsBtnSelected(wxCommandEvent &event)
wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_START_DIGITS_BTN
CNoTabCheckBox * m_AlsoRemoveBefore
string GetSelectedText(const string &input)
static void s_GetDigitsPosition(const string &str, size_t &pos, size_t &len)
CNoTabRadioButton * m_UpToBtn
CNoTabRadioButton * m_StartingAtBtn
CNoTabCheckBox * m_AlsoRemoveAfter
void OnEndLettersBtnSelected(wxCommandEvent &event)
wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_END_LETTERS_BTN
bool Create(wxWindow *parent, wxWindowID id=ID_CPARSETEXTOPTIONSDLG, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxTAB_TRAVERSAL)
Creation.
CNoTabRadioButton * m_StartLettersBtn
CNoTabRadioButton * m_JustAfterBtn
CNoTabRadioButton * m_EndDigitsBtn
CNoTabCheckBox * m_RemoveFromParsedBtn
void Init()
Initialises member variables.
void OnStartLettersBtnSelected(wxCommandEvent &event)
wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_START_LETTERS_BTN
static bool ShowToolTips()
Should we show tooltips?
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void OnEndDigitsBtnSelected(wxCommandEvent &event)
wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_END_DIGITS_BTN
CNoTabRadioButton * m_StartDigitsBtn
CRef< objects::edit::CParseTextOptions > GetParseOptions()
CNoTabRadioButton * m_EndLettersBtn
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
CNoTabRadioButton * m_IncludingBtn
void OnEndTextBtnSelected(wxCommandEvent &event)
wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_END_TEXT_BTN
CNoTabRadioButton * m_StartTextBtn
CRef –.
Definition: ncbiobj.hpp:618
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
static int input()
int len
const struct ncbi::grid::netcache::search::fields::SIZE size
#define SYMBOL_CPARSETEXTOPTIONSDLG_IDNAME
#define SYMBOL_CPARSETEXTOPTIONSDLG_STYLE
#define SYMBOL_CPARSETEXTOPTIONSDLG_SIZE
#define SYMBOL_CPARSETEXTOPTIONSDLG_POSITION
Modified on Wed Apr 24 14:17:38 2024 by modify_doxy.py rev. 669887