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

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS_EDIT___PUB_FIELD_NAME_PANEL__HPP
2 #define GUI_WIDGETS_EDIT___PUB_FIELD_NAME_PANEL__HPP
3 /* $Id: pub_field_name_panel.hpp 41307 2018-07-03 18:34:58Z filippov $
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 
31 #include <corelib/ncbistd.hpp>
33 
34 #include <wx/panel.h>
35 #include <wx/listbox.h>
36 
37 
39 
40 /*!
41  * Control identifiers
42  */
43 
44 ////@begin control identifiers
45 #define SYMBOL_CFIELDHANDLERNAMEPANEL_STYLE wxTAB_TRAVERSAL
46 #define SYMBOL_CFIELDHANDLERNAMEPANEL_TITLE _("PubFieldNamePanel")
47 #define SYMBOL_CFIELDHANDLERNAMEPANEL_IDNAME ID_PUBFIELDNAMEPANEL
48 #define SYMBOL_CFIELDHANDLERNAMEPANEL_SIZE wxSize(400, 300)
49 #define SYMBOL_CFIELDHANDLERNAMEPANEL_POSITION wxDefaultPosition
50 ////@end control identifiers
51 
52 
53 /*!
54  * CFieldHandlerNamePanel class declaration
55  */
56 
58 {
59  DECLARE_DYNAMIC_CLASS( CFieldHandlerNamePanel )
60  DECLARE_EVENT_TABLE()
61 
62 public:
63  /// Constructors
65  CFieldHandlerNamePanel( wxWindow* parent,
66  wxWindowID id = SYMBOL_CFIELDHANDLERNAMEPANEL_IDNAME,
67  const wxPoint& pos = SYMBOL_CFIELDHANDLERNAMEPANEL_POSITION,
70 
71  /// Creation
72  bool Create( wxWindow* parent,
73  wxWindowID id = SYMBOL_CFIELDHANDLERNAMEPANEL_IDNAME,
74  const wxPoint& pos = SYMBOL_CFIELDHANDLERNAMEPANEL_POSITION,
77 
78  /// Destructor
80 
81  /// Initialises member variables
82  void Init();
83 
84  /// Creates the controls and sizers
85  void CreateControls();
86 
87 ////@begin CFieldHandlerNamePanel event handler declarations
88 
89  /// wxEVT_COMMAND_CHOICE_SELECTED event handler for ID_PUBFIELDNAME_FIELD
90  void OnFieldSelected( wxCommandEvent& event );
91 
92 ////@end CFieldHandlerNamePanel event handler declarations
93 
94 ////@begin CFieldHandlerNamePanel member function declarations
95 
96  /// Retrieves bitmap resources
97  wxBitmap GetBitmapResource( const wxString& name );
98 
99  /// Retrieves icon resources
100  wxIcon GetIconResource( const wxString& name );
101 ////@end CFieldHandlerNamePanel member function declarations
102 
103  /// Should we show tooltips?
104  static bool ShowToolTips();
105 
106 ////@begin CFieldHandlerNamePanel member variables
107  wxListBox* m_Field;
108 ////@end CFieldHandlerNamePanel member variables
109 
110  virtual string GetFieldName(const bool subfield = false);
111  virtual bool SetFieldName(const string& field);
112  void SetFieldNames(const vector<string>& field_names);
113  virtual vector<string> GetChoices(bool& allow_other);
114  virtual vector<string> GetMacroValues();
115  virtual void ClearValues(void);
116  virtual string GetMacroFieldName(const string &target, const string& selected_field = kEmptyStr);
117  virtual string GetMacroFieldLabel(const string& target, const string& selected_field = kEmptyStr);
118  void SetMacroFieldNames(const vector<string>& field_names);
119  void SetMacroSelf(const string& self) {m_self = self;}
120 
121  enum {
122  ID_PUBFIELDNAMEPANEL = 6130,
123  ID_PUBFIELDNAME_FIELD
124  };
125 private:
126  vector<string> m_MacroField;
127  string m_self;
128 };
129 
131 
132 #endif
133  // GUI_WIDGETS_EDIT___PUB_FIELD_NAME_PANEL__HPP
void SetMacroSelf(const string &self)
virtual string GetFieldName(const bool subfield=false)=0
Returns the name of the field as selected in the panel.
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 string GetMacroFieldLabel(const string &target, const string &selected_field=kEmptyStr)
virtual vector< string > GetMacroValues()
virtual void ClearValues(void)
Include a standard set of the NCBI C++ Toolkit most basic headers.
static void Init(void)
Definition: cursor6.c:76
#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
#define SYMBOL_CFIELDHANDLERNAMEPANEL_POSITION
#define SYMBOL_CFIELDHANDLERNAMEPANEL_IDNAME
#define SYMBOL_CFIELDHANDLERNAMEPANEL_SIZE
#define SYMBOL_CFIELDHANDLERNAMEPANEL_STYLE
Modified on Wed May 29 18:37:32 2024 by modify_doxy.py rev. 669887