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

Go to the SVN repository for this file.

1 /* $Id: subprepfieldeditor.hpp 27600 2013-03-11 20:24:24Z 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 _SUBPREPFIELDEDITOR_H_
29 #define _SUBPREPFIELDEDITOR_H_
30 
31 #include <corelib/ncbistd.hpp>
32 
35 
36 /*!
37  * Includes
38  */
39 
40 ////@begin includes
41 ////@end includes
42 #include <wx/stattext.h>
43 #include <wx/choice.h>
44 #include <wx/textctrl.h>
45 
46 /*!
47  * Forward declarations
48  */
49 
50 ////@begin forward declarations
51 class wxBoxSizer;
52 ////@end forward declarations
53 
55 
56 class CSubPrep_panel;
57 
58 /*!
59  * Control identifiers
60  */
61 
62 ////@begin control identifiers
63 #define ID_CSUBPREPFIELDEDITOR 10093
64 #define ID_MIX 10094
65 #define SYMBOL_CSUBPREPFIELDEDITOR_STYLE wxTAB_TRAVERSAL
66 #define SYMBOL_CSUBPREPFIELDEDITOR_TITLE _("SubPrepFieldEditor")
67 #define SYMBOL_CSUBPREPFIELDEDITOR_IDNAME ID_CSUBPREPFIELDEDITOR
68 #define SYMBOL_CSUBPREPFIELDEDITOR_SIZE wxSize(400, 300)
69 #define SYMBOL_CSUBPREPFIELDEDITOR_POSITION wxDefaultPosition
70 ////@end control identifiers
71 #define ID_GLOBALTEXT 10096
72 #define ID_GLOBALCHOICE 10097
73 #define ID_CLEARCTRL 10098
74 #define ID_EDITCTRL 10099
75 #define ID_REGISTER_URL 10100
76 
77 /*!
78  * CSubPrepFieldEditor class declaration
79  */
80 
81 class CSubPrepFieldEditor: public wxPanel
82 {
83  DECLARE_DYNAMIC_CLASS( CSubPrepFieldEditor )
84  DECLARE_EVENT_TABLE()
85 
86 public:
87  /// Constructors
89  CSubPrepFieldEditor( wxWindow* parent, objects::CSeq_entry_Handle seh,
90  ICommandProccessor* proccessor,
91  IWorkbench* workbench,
93 
94  /// Creation
95  bool Create( wxWindow* parent, wxWindowID id = SYMBOL_CSUBPREPFIELDEDITOR_IDNAME, const wxPoint& pos = SYMBOL_CSUBPREPFIELDEDITOR_POSITION, const wxSize& size = SYMBOL_CSUBPREPFIELDEDITOR_SIZE, long style = SYMBOL_CSUBPREPFIELDEDITOR_STYLE );
96 
97  /// Destructor
99 
100  /// Initialises member variables
101  void Init();
102 
103  /// Creates the controls and sizers
104  void CreateControls();
105 
106 ////@begin CSubPrepFieldEditor event handler declarations
107 
108 ////@end CSubPrepFieldEditor event handler declarations
109  /// wxEVT_COMMAND_CHOICE_SELECTED event handler for ID_GLOBALCHOICE
110  void OnGlobalchoiceSelected( wxCommandEvent& event );
111  void OnLeaveTextColumnWindow(wxMouseEvent &event);
112  void OnClearValues( wxHyperlinkEvent& event );
113  void OnEditctrlHyperlinkClicked( wxHyperlinkEvent& event );
114  void OnRegisterHyperlinkClicked( wxHyperlinkEvent& event );
115 
116 ////@begin CSubPrepFieldEditor member function declarations
117 
118  /// Retrieves bitmap resources
119  wxBitmap GetBitmapResource( const wxString& name );
120 
121  /// Retrieves icon resources
122  wxIcon GetIconResource( const wxString& name );
123 ////@end CSubPrepFieldEditor member function declarations
124 
125  /// Should we show tooltips?
126  static bool ShowToolTips();
127 
128 ////@begin CSubPrepFieldEditor member variables
129  wxStaticText* m_Label;
130  wxStaticText* m_Star;
131  wxBoxSizer* m_ValueSizer;
132  wxTextCtrl* m_Mix;
133  wxBoxSizer* m_EditSizer;
134 ////@end CSubPrepFieldEditor member variables
135 
136  void SetConverter (string label, string column_name, CTableFieldCommandConverter * converter,
137  bool must_choose = false, bool required = false,
138  string default_val = "",
139  string url = "",
140  bool allow_mix = true);
141  bool UpdateValues(string default_val = "");
142  const string GetColumnName() { return m_ColumnName; };
143 
144 private:
145  wxChoice* m_GlobalValue;
146  wxTextCtrl* m_GlobalText;
147 
148  objects::CSeq_entry_Handle m_Seh;
152  string m_ColumnName;
153  string m_Url;
157 
158  void x_ShowStar(bool show);
159  bool x_SetEditorType(bool mixed, bool has_choices);
160  void x_SetEditorControls(bool mixed, string message);
162  void x_SetOneValue(string new_val);
163 
164 };
165 
167 
168 #endif
169  // _SUBPREPFIELDEDITOR_H_
bool x_SetEditorType(bool mixed, bool has_choices)
void OnEditctrlHyperlinkClicked(wxHyperlinkEvent &event)
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
CSubPrep_panel * x_GetParent()
CSubPrepFieldEditor()
Constructors.
const string GetColumnName()
bool Create(wxWindow *parent, wxWindowID id=10093, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxTAB_TRAVERSAL)
Creation.
void OnRegisterHyperlinkClicked(wxHyperlinkEvent &event)
void x_ShowStar(bool show)
void x_SetEditorControls(bool mixed, string message)
void SetConverter(string label, string column_name, CTableFieldCommandConverter *converter, bool must_choose=false, bool required=false, string default_val="", string url="", bool allow_mix=true)
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void OnClearValues(wxHyperlinkEvent &event)
bool UpdateValues(string default_val="")
void CreateControls()
Creates the controls and sizers.
void x_SetOneValue(string new_val)
void Init()
Initialises member variables.
CTableFieldCommandConverter * m_Converter
objects::CSeq_entry_Handle m_Seh
void OnGlobalchoiceSelected(wxCommandEvent &event)
@end CSubPrepFieldEditor event handler declarations
static bool ShowToolTips()
Should we show tooltips?
ICommandProccessor * m_CmdProcessor
~CSubPrepFieldEditor()
Destructor.
void OnLeaveTextColumnWindow(wxMouseEvent &event)
Undo/Redo interface for editing operations.
IWorkbench is the central interface in the application framework.
Definition: workbench.hpp:113
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
static const char label[]
const struct ncbi::grid::netcache::search::fields::SIZE size
#define SYMBOL_CSUBPREPFIELDEDITOR_POSITION
#define SYMBOL_CSUBPREPFIELDEDITOR_IDNAME
#define SYMBOL_CSUBPREPFIELDEDITOR_SIZE
#define SYMBOL_CSUBPREPFIELDEDITOR_STYLE
Modified on Mon Feb 26 03:58:51 2024 by modify_doxy.py rev. 669887