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

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS_EDIT___FEATURE_FIELD_NAME_PANEL__HPP
2 #define GUI_WIDGETS_EDIT___FEATURE_FIELD_NAME_PANEL__HPP
3 /* $Id: feature_field_name_panel.hpp 45328 2020-07-07 13:43:49Z 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: Colleen Bollin
29  */
30 // Generated by DialogBlocks (unregistered), 10/06/2013 17:47:10
31 
32 #include <corelib/ncbistd.hpp>
36 
37 /*!
38  * Includes
39  */
40 
41 ////@begin includes
42 ////@end includes
43 
44 #include <wx/listbox.h>
45 #include <wx/stattext.h>
46 
47 /*!
48  * Forward declarations
49  */
50 
51 ////@begin forward declarations
52 class CFeatureTypePanel;
53 ////@end forward declarations
54 
56 
57 /*!
58  * Control identifiers
59  */
60 
61 ////@begin control identifiers
62 #define SYMBOL_CFEATUREFIELDNAMEPANEL_STYLE wxTAB_TRAVERSAL
63 #define SYMBOL_CFEATUREFIELDNAMEPANEL_TITLE _("FeatureFieldNamePanel")
64 #define SYMBOL_CFEATUREFIELDNAMEPANEL_IDNAME ID_CFEATUREFIELDNAMEPANEL
65 #define SYMBOL_CFEATUREFIELDNAMEPANEL_SIZE wxDefaultSize
66 #define SYMBOL_CFEATUREFIELDNAMEPANEL_POSITION wxDefaultPosition
67 ////@end control identifiers
68 
69 
70 /*!
71  * CFeatureFieldNamePanel class declaration
72  */
73 
75 {
76  DECLARE_DYNAMIC_CLASS( CFeatureFieldNamePanel )
77  DECLARE_EVENT_TABLE()
78 
79 public:
80  /// Constructors
82  CFeatureFieldNamePanel( wxWindow* parent, CFeatureFieldNamePanel* sibling = NULL,
83  wxWindowID id = SYMBOL_CFEATUREFIELDNAMEPANEL_IDNAME,
84  const wxPoint& pos = SYMBOL_CFEATUREFIELDNAMEPANEL_POSITION,
87 
88  /// Creation
89  bool Create( wxWindow* parent,
90  wxWindowID id = SYMBOL_CFEATUREFIELDNAMEPANEL_IDNAME,
91  const wxPoint& pos = SYMBOL_CFEATUREFIELDNAMEPANEL_POSITION,
94 
95  /// Destructor
97 
98  /// Initialises member variables
99  void Init();
100 
101  /// Creates the controls and sizers
102  void CreateControls();
103 
104 ////@begin CFeatureFieldNamePanel event handler declarations
105 
106  /// wxEVT_COMMAND_LISTBOX_SELECTED event handler for ID_QUALIFIER_LISTBOX
107  void OnQualifierListboxSelected( wxCommandEvent& event );
108 
109  // triggers the event of populating the listbox with the relevant features first
110  void PopulateFeatureListbox(void);
111 ////@end CFeatureFieldNamePanel event handler declarations
112 
113 ////@begin CFeatureFieldNamePanel member function declarations
114 
115  /// Retrieves bitmap resources
116  wxBitmap GetBitmapResource( const wxString& name );
117 
118  /// Retrieves icon resources
119  wxIcon GetIconResource( const wxString& name );
120 ////@end CFeatureFieldNamePanel member function declarations
121 
122  /// Should we show tooltips?
123  static bool ShowToolTips();
124 
125 ////@begin CFeatureFieldNamePanel member variables
126  wxStaticText* m_FeatureTypeLabel;
128  wxListBox* m_QualifierName;
129 ////@end CFeatureFieldNamePanel member variables
130 
131  string GetFeatureType();
132  bool SetFeatureType(const string& feature_type);
133  string GetQualifierName();
134  virtual string GetFieldName(const bool subfield = false);
135  virtual bool SetFieldName(const string& field);
136  virtual string GetMacroFieldName(const string &target, const string& selected_field = kEmptyStr);
137 
138  static string s_GetMacroFieldName(const string& feature, const string& qualifier, const string& target, const string& selected_field = kEmptyStr);
139  CFeatureTypePanel* GetFeatureTypePanel(void) {return m_FeatureType;}
140  enum {
141  ID_CFEATUREFIELDNAMEPANEL = 6110,
142  ID_FEATQUALIFIER_LISTBOX
143  };
144  virtual void ClearValues(void);
145  virtual vector<string> GetChoices(bool& allow_other);
146  void ListPresentFeaturesFirst(objects::CSeq_entry_Handle seh, vector<const objects::CFeatListItem *> *featlist = nullptr);
147  virtual void UpdateEditor();
148  virtual void SetShowLegalOnly(bool show);
149 
150  static wxArrayString s_FillFeatQualList(objects::CSeqFeatData::ESubtype subtype);
151 
152 private:
154  const objects::CGenetic_code_table& m_code_table;
156 };
157 
158 
159 DECLARE_EXPORTED_EVENT_TYPE(NCBI_GUIWIDGETS_EDIT_EXPORT, wxEVT_COMMAND_UPDATE_FEATLIST, wxCommandEvent);
160 
161 typedef void (wxEvtHandler::*CUpdateFeatListEventFunction)(wxCommandEvent&);
162 
163 #define CUpdateFeatListEventHandler(func) \
164  (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(CUpdateFeatListEventFunction, &func)
165 
166 #define EVT_UPDATE_FEATURE_LIST(id, fn) \
167  wx__DECLARE_EVT1(wxEVT_COMMAND_UPDATE_FEATLIST, id, CUpdateFeatListEventHandler(fn))
168 
170 
171 #endif
172  // GUI_WIDGETS_EDIT___FEATURE_FIELD_NAME_PANEL__HPP
const objects::CGenetic_code_table & m_code_table
CFeatureFieldNamePanel * m_Sibling
CFeatureTypePanel * GetFeatureTypePanel(void)
virtual void UpdateEditor()=0
virtual string GetFieldName(const bool subfield=false)=0
Returns the name of the field as selected in the panel.
virtual void SetShowLegalOnly(bool show)
virtual string GetMacroFieldName(const string &target, const string &selected_field=kEmptyStr)
virtual vector< string > GetChoices(bool &allow_other)
virtual bool SetFieldName(const string &field)=0
virtual void ClearValues(void)
Include a standard set of the NCBI C++ Toolkit most basic headers.
void(wxEvtHandler::* CUpdateFeatListEventFunction)(wxCommandEvent &)
#define SYMBOL_CFEATUREFIELDNAMEPANEL_SIZE
#define SYMBOL_CFEATUREFIELDNAMEPANEL_IDNAME
#define SYMBOL_CFEATUREFIELDNAMEPANEL_POSITION
DECLARE_EXPORTED_EVENT_TYPE(, wxEVT_COMMAND_UPDATE_FEATLIST, wxCommandEvent)
#define SYMBOL_CFEATUREFIELDNAMEPANEL_STYLE
static void Init(void)
Definition: cursor6.c:76
#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
#define kEmptyStr
Definition: ncbistr.hpp:123
#define NCBI_GUIWIDGETS_EDIT_EXPORT
Definition: gui_export.h:526
const struct ncbi::grid::netcache::search::fields::SIZE size
Modified on Sun Jun 16 04:32:51 2024 by modify_doxy.py rev. 669887