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

Go to the SVN repository for this file.

1 /* $Id: apply_edit_convert_panel.hpp 38698 2017-06-09 20:08:17Z 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: Igor Filippov
27  */
28 
29 
30 // Generated by DialogBlocks (unregistered), 16/05/2014 10:25:31
31 
32 #ifndef _APPLY_EDIT_CONVERT_PANEL_H_
33 #define _APPLY_EDIT_CONVERT_PANEL_H_
34 
35 
36 /*!
37  * Includes
38  */
39 #include <corelib/ncbistd.hpp>
40 #include <set>
41 #include <wx/grid.h>
42 #include <wx/listbox.h>
43 #include <wx/listbook.h>
47 
48 ////@begin includes
49 ////@end includes
50 
51 /*!
52  * Forward declarations
53  */
54 
55 ////@begin forward declarations
56 ////@end forward declarations
57 
58 /*!
59  * Control identifiers
60  */
61 
63 
64 class CSubpanel;
66 
67 
68 ////@begin control identifiers
69 #define SYMBOL_CAPPLYEDITCONVERTPANEL_STYLE wxTAB_TRAVERSAL
70 #define SYMBOL_CAPPLYEDITCONVERTPANEL_TITLE _("apply edit convert panel")
71 #define SYMBOL_CAPPLYEDITCONVERTPANEL_IDNAME ID_CAPPLYEDITCONVERTPANEL
72 #define SYMBOL_CAPPLYEDITCONVERTPANEL_SIZE wxDefaultSize
73 #define SYMBOL_CAPPLYEDITCONVERTPANEL_POSITION wxDefaultPosition
74 ////@end control identifiers
75 
76 
77 /*!
78  * CApplyEditconvertPanel class declaration
79  */
80 
81 class CApplyEditconvertPanel: public wxPanel
82 {
83  DECLARE_DYNAMIC_CLASS( CApplyEditconvertPanel )
84  DECLARE_EVENT_TABLE()
85 
86 public:
87  /// Constructors
89  CApplyEditconvertPanel( wxWindow* parent, CSeqTableGridPanel* grid_panel, wxArrayString &choices,
90  int init_action = 0, bool horizontal = true, wxWindowID id = SYMBOL_CAPPLYEDITCONVERTPANEL_IDNAME,
91  const wxPoint& pos = SYMBOL_CAPPLYEDITCONVERTPANEL_POSITION,
94 
95  /// Creation
96  bool Create( wxWindow* parent,
97  wxWindowID id = SYMBOL_CAPPLYEDITCONVERTPANEL_IDNAME,
98  const wxPoint& pos = SYMBOL_CAPPLYEDITCONVERTPANEL_POSITION,
101 
102  /// Destructor
104 
105  /// Initialises member variables
106  void Init();
107 
108  /// Creates the controls and sizers
109  void CreateControls();
110 
111 ////@begin CApplyEditconvertPanel event handler declarations
112 
113  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_AECR_BUTTON
114  void OnApplyToAllButtonClick( wxCommandEvent& event );
115 
116  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_AECR_BUTTON1
117  void OnApplyToSelButtonClick( wxCommandEvent& event );
118 
119  void OnUndoButtonClick( wxCommandEvent& event );
120 
121 ////@end CApplyEditconvertPanel event handler declarations
122 
123 ////@begin CApplyEditconvertPanel member function declarations
124 
125  /// Retrieves bitmap resources
126  wxBitmap GetBitmapResource( const wxString& name );
127 
128  /// Retrieves icon resources
129  wxIcon GetIconResource( const wxString& name );
130 ////@end CApplyEditconvertPanel member function declarations
131 
132  /// Should we show tooltips?
133  static bool ShowToolTips();
134 
135  int GetColumn();
136  wxString GetAutopopulateValue();
137  void GetSelectedRows(std::set<int> &selected);
138  void SetColumns(wxArrayString &columns);
139 
140  bool GetModified() {return m_Modified;}
141 
142  void AddUndo(int i, int j, const string &val) {m_undo_values[i][j] = val;}
143 
144  ////@begin CApplyEditconvertPanel member variables
145 
146  enum {
153  };
154 private:
155  wxListBox* GetListBox();
156 
158  wxGrid *m_Grid;
159  wxArrayString *m_Choices;
160  wxListbook* m_Notebook;
162  wxButton* m_UndoButton;
165  // flag to indicate the layout of the CParseTextOptionsDlg in CParseSubpanel
167 ////@end CApplyEditconvertPanel member variables
168 };
169 
170 class CSubpanel: public wxPanel
171 {
172  DECLARE_DYNAMIC_CLASS( CSubpanel )
173  DECLARE_EVENT_TABLE()
174 
175 public:
176  CSubpanel() : wxPanel() { Init(); }
177  CSubpanel( wxWindow* parent, wxGrid *grid, wxArrayString &choices, wxWindowID id, const wxPoint& pos, const wxSize& size, long style) : wxPanel (parent, id, pos, size, style), m_Grid(grid), m_Choices(&choices)
178  {
179  Init();
180  Create(parent, id, pos, size, style);
181  }
182  bool Create( wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL )
183  {
184  wxPanel::Create( parent, id, pos, size, style );
185  CreateControls();
186  if (GetSizer())
187  {
188  GetSizer()->SetSizeHints(this);
189  }
190  Centre();
191  return true;
192  }
193  virtual ~CSubpanel() {}
194  bool ShowToolTips() { return true; }
195  wxBitmap GetBitmapResource( const wxString& name ) { wxUnusedVar(name); return wxNullBitmap; }
196  wxIcon GetIconResource( const wxString& name ) { wxUnusedVar(name); return wxNullIcon; }
198  virtual void Init() {m_ListBox = NULL; m_ListBox2 = NULL;}
199  virtual void CreateControls() {}
200  virtual void ApplyToAll(int col) {}
201  virtual void ApplyToSelected(int col, const std::set<int> &selected) {}
202  virtual void SetColumns(wxArrayString &columns) {m_ListBox->Set(columns);m_ListBox->SetSelection(0);}
203  void ChangeValue(const string &new_value, int row, int col);
205  wxListBox* GetListBox() {return m_ListBox;}
206  int GetColumn2();
207 
208 protected:
209  wxGrid *m_Grid;
210  wxListBox* m_ListBox;
211  wxListBox* m_ListBox2;
212  wxArrayString *m_Choices;
213 };
214 
215 
216 /*!
217  * CApplySubpanel class declaration
218  */
219 
221 {
222  DECLARE_DYNAMIC_CLASS( CApplySubpanel )
223  DECLARE_EVENT_TABLE()
224 
225 public:
226  /// Constructors
228  CApplySubpanel( wxWindow* parent, wxGrid *grid, wxArrayString &choices, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL )
229  {
230  this->m_Grid = grid;
231  this->m_Choices = &choices;
232  Init();
233  Create(parent, id, pos, size, style);
234  }
235 
236  /// Creates the controls and sizers
237  virtual void CreateControls();
238 
239  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_APPLYSUB_AUTOPOPULATE
240  void OnApplysubAutopopulateClick( wxCommandEvent& event );
241 
242  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_APPLYSUB_CLEAR
243  void OnApplysubClearClick( wxCommandEvent& event );
244 
245  virtual void ApplyToAll(int col);
246  virtual void ApplyToSelected(int col, const std::set<int> &selected);
247 
248 ////@begin CApplySubpanel member variables
249 ////@end CApplySubpanel member variables
250 
251  enum {
255  };
256 private:
257  wxTextCtrl *m_TextCtrl;
258 };
259 
260 
261 /*!
262  * CEditSubpanel class declaration
263  */
264 
266 {
267  DECLARE_DYNAMIC_CLASS( CEditSubpanel )
268  DECLARE_EVENT_TABLE()
269 
270 public:
271  /// Constructors
273  CEditSubpanel( wxWindow* parent, wxGrid *grid, wxArrayString &choices, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL )
274  {
275  this->m_Grid = grid;
276  this->m_Choices = &choices;
277  Init();
278  Create(parent, id, pos, size, style);
279  }
280  /// Creates the controls and sizers
281  virtual void CreateControls();
282 
283 ////@begin CEditSubpanel event handler declarations
284 
285  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_EDITSUB_COPY
286  void OnEditsubCopyClick( wxCommandEvent& event );
287 
288 ////@end CEditSubpanel event handler declarations
289 
290 
291  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_EDITSUB_AUTOPOPULATE
292  void OnEditsubAutopopulateClick( wxCommandEvent& event );
293 
294  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_EDITSUB_CLEAR
295  void OnEditsubClearClick( wxCommandEvent& event );
296 
297  virtual void ApplyToAll(int col);
298  virtual void ApplyToSelected(int col, const std::set<int> &selected);
299 
300 ////@begin CEditSubpanel member variables
301 ////@end CEditSubpanel member variables
302  enum {
311  };
312 private:
313  wxTextCtrl* m_Find;
314  wxTextCtrl* m_Replace;
315  wxRadioButton *m_Anywhere, *m_AtBegin, *m_AtEnd;
316 };
317 
318 
319 /*!
320  * CRemoveSubpanel class declaration
321  */
322 
324 {
325  DECLARE_DYNAMIC_CLASS( CRemoveSubpanel )
326  DECLARE_EVENT_TABLE()
327 
328 public:
329  /// Constructors
331  CRemoveSubpanel( wxWindow* parent, wxGrid *grid, wxArrayString &choices, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL )
332  {
333  this->m_Grid = grid;
334  this->m_Choices = &choices;
335  Init();
336  Create(parent, id, pos, size, style);
337  }
338  /// Creates the controls and sizers
339  virtual void CreateControls();
340  virtual void ApplyToAll(int col);
341  virtual void ApplyToSelected(int col, const std::set<int> &selected);
342 };
343 
344 
345 /*!
346  * CSwapSubpanel class declaration
347  */
348 
350 {
351  DECLARE_DYNAMIC_CLASS( CSwapSubpanel )
352  DECLARE_EVENT_TABLE()
353 
354 public:
356  CSwapSubpanel( wxWindow* parent, wxGrid *grid, wxArrayString &choices, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL )
357  {
358  this->m_Grid = grid;
359  this->m_Choices = &choices;
360  Init();
361  Create(parent, id, pos, size, style);
362  }
363  /// Creates the controls and sizers
364  virtual void CreateControls();
365  virtual void SetColumns(wxArrayString &columns) {CSubpanel::SetColumns(columns); m_ListBox2->Set(columns);m_ListBox2->SetSelection(0);}
366  virtual void ApplyToAll(int col);
367  virtual void ApplyToSelected(int col, const std::set<int> &selected);
368 };
369 
370 
371 
372 /*!
373  * CConvertSubpanel class declaration
374  */
375 
377 {
378  DECLARE_DYNAMIC_CLASS( CConvertSubpanel )
379  DECLARE_EVENT_TABLE()
380 
381 public:
382  /// Constructors
384  CConvertSubpanel( wxWindow* parent, wxGrid *grid, wxArrayString &choices, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL )
385  {
386  this->m_Grid = grid;
387  this->m_Choices = &choices;
388  Init();
389  Create(parent, id, pos, size, style);
390  }
391  /// Creates the controls and sizers
392  virtual void CreateControls();
393  virtual void SetColumns(wxArrayString &columns) {CSubpanel::SetColumns(columns); m_ListBox2->Set(columns);m_ListBox2->SetSelection(0);}
394  virtual void ApplyToAll(int col);
395  virtual void ApplyToSelected(int col, const std::set<int> &selected);
396 private:
397  wxCheckBox *m_CheckBox;
398 };
399 
400 /*!
401  * CParseSubpanel class declaration
402  */
403 
405 {
406  DECLARE_DYNAMIC_CLASS( CParseSubpanel )
407  DECLARE_EVENT_TABLE()
408 
409 public:
410  /// Constructors
412  CParseSubpanel( wxWindow* parent, wxGrid *grid, wxArrayString &choices, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL )
413  {
414  this->m_Grid = grid;
415  this->m_Choices = &choices;
416  Init();
417  Create(parent, id, pos, size, style);
418  }
419 
420 
421  /// Creates the controls and sizers
422  virtual void CreateControls();
423  virtual void SetColumns(wxArrayString &columns) {CSubpanel::SetColumns(columns); m_ListBox2->Set(columns);m_ListBox2->SetSelection(0);}
424  virtual void ApplyToAll(int col);
425  virtual void ApplyToSelected(int col, const std::set<int> &selected);
426 private:
428 };
429 
430 /*!
431  * CChangeCaseSubpanel class declaration
432  */
433 
435 {
436  DECLARE_DYNAMIC_CLASS( CChangeCaseSubpanel )
437  DECLARE_EVENT_TABLE()
438 
439 public:
440  /// Constructors
442  CChangeCaseSubpanel( wxWindow* parent, wxGrid *grid, wxArrayString &choices, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxTAB_TRAVERSAL )
443  {
444  this->m_Grid = grid;
445  this->m_Choices = &choices;
446  Init();
447  Create(parent, id, pos, size, style);
448  }
449  /// Creates the controls and sizers
450  virtual void CreateControls();
451  virtual void ApplyToAll(int col);
452  virtual void ApplyToSelected(int col, const std::set<int> &selected);
453 private:
455 };
456 
458 #endif
459  // _APPLY_EDIT_CONVERT_PANEL_H_
#define SYMBOL_CAPPLYEDITCONVERTPANEL_SIZE
#define SYMBOL_CAPPLYEDITCONVERTPANEL_IDNAME
#define SYMBOL_CAPPLYEDITCONVERTPANEL_POSITION
#define SYMBOL_CAPPLYEDITCONVERTPANEL_STYLE
void Init()
Initialises member variables.
void GetSelectedRows(std::set< int > &selected)
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
map< int, map< int, string > > m_undo_values
void CreateControls()
Creates the controls and sizers.
void OnUndoButtonClick(wxCommandEvent &event)
static bool ShowToolTips()
Should we show tooltips?
void OnApplyToAllButtonClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_AECR_BUTTON
void AddUndo(int i, int j, const string &val)
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void OnApplyToSelButtonClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_AECR_BUTTON1
void SetColumns(wxArrayString &columns)
bool Create(wxWindow *parent, wxWindowID id=ID_CAPPLYEDITCONVERTPANEL, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL)
Creation.
CApplySubpanel(wxWindow *parent, wxGrid *grid, wxArrayString &choices, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL)
void OnApplysubAutopopulateClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_APPLYSUB_AUTOPOPULATE
void OnApplysubClearClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_APPLYSUB_CLEAR
virtual void CreateControls()
Creates the controls and sizers.
virtual void ApplyToAll(int col)
virtual void ApplyToSelected(int col, const std::set< int > &selected)
virtual void ApplyToAll(int col)
virtual void CreateControls()
Creates the controls and sizers.
virtual void ApplyToSelected(int col, const std::set< int > &selected)
CChangeCaseSubpanel(wxWindow *parent, wxGrid *grid, wxArrayString &choices, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL)
CCapChangePanel * m_CapChangeOptions
virtual void ApplyToSelected(int col, const std::set< int > &selected)
virtual void CreateControls()
Creates the controls and sizers.
CConvertSubpanel(wxWindow *parent, wxGrid *grid, wxArrayString &choices, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL)
virtual void SetColumns(wxArrayString &columns)
virtual void ApplyToAll(int col)
CEditSubpanel(wxWindow *parent, wxGrid *grid, wxArrayString &choices, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL)
void OnEditsubCopyClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_EDITSUB_COPY
virtual void ApplyToAll(int col)
CEditSubpanel()
Constructors.
wxRadioButton * m_Anywhere
virtual void CreateControls()
Creates the controls and sizers.
void OnEditsubAutopopulateClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_EDITSUB_AUTOPOPULATE
virtual void ApplyToSelected(int col, const std::set< int > &selected)
void OnEditsubClearClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_EDITSUB_CLEAR
virtual void CreateControls()
Creates the controls and sizers.
CParseTextOptionsDlg * m_ParseOptions
CParseSubpanel(wxWindow *parent, wxGrid *grid, wxArrayString &choices, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL)
virtual void ApplyToAll(int col)
virtual void ApplyToSelected(int col, const std::set< int > &selected)
virtual void SetColumns(wxArrayString &columns)
virtual void CreateControls()
Creates the controls and sizers.
virtual void ApplyToSelected(int col, const std::set< int > &selected)
CRemoveSubpanel(wxWindow *parent, wxGrid *grid, wxArrayString &choices, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL)
virtual void ApplyToAll(int col)
virtual void ApplyToAll(int col)
wxBitmap GetBitmapResource(const wxString &name)
CSubpanel(wxWindow *parent, wxGrid *grid, wxArrayString &choices, wxWindowID id, const wxPoint &pos, const wxSize &size, long style)
CApplyEditconvertPanel * GetBaseFrame()
virtual void CreateControls()
wxArrayString * m_Choices
void ChangeValue(const string &new_value, int row, int col)
wxIcon GetIconResource(const wxString &name)
wxListBox * GetListBox()
virtual void SetColumns(wxArrayString &columns)
objects::edit::EExistingText GetExistingTextHandling(const string &field)
virtual void ApplyToSelected(int col, const std::set< int > &selected)
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL)
virtual void ApplyToAll(int col)
virtual void SetColumns(wxArrayString &columns)
virtual void CreateControls()
Creates the controls and sizers.
virtual void ApplyToSelected(int col, const std::set< int > &selected)
CSwapSubpanel(wxWindow *parent, wxGrid *grid, wxArrayString &choices, wxWindowID id=wxID_ANY, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL)
Definition: map.hpp:338
Include a standard set of the NCBI C++ Toolkit most basic headers.
static const column_t columns[]
Definition: utf8_2.c:22
#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
int i
const struct ncbi::grid::netcache::search::fields::SIZE size
static static static wxID_ANY
#define row(bind, expected)
Definition: string_bind.c:73
EExistingText
Modified on Fri Sep 20 14:57:07 2024 by modify_doxy.py rev. 669887