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

Go to the SVN repository for this file.

1 #ifndef GUI_PKG_SEQ_EDIT___GENERAL_PANEL__HPP
2 #define GUI_PKG_SEQ_EDIT___GENERAL_PANEL__HPP
3 
4 /* $Id: general_panel.hpp 46622 2021-08-06 20:19:47Z asztalos $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Andrea Asztalos
30  */
31 
32 #include <corelib/ncbiobj.hpp>
33 #include <gui/gui_export.h>
37 
38 #include <wx/panel.h>
39 
40 
41 class wxDatePickerCtrl;
42 class wxRadioButton;
43 class wxTextCtrl;
44 class wxStaticText;
45 
47 
48 /*!
49  * Control identifiers
50  */
51 
52 ////@begin control identifiers
53 #define SYMBOL_CGENERALPANEL_STYLE wxTAB_TRAVERSAL
54 #define SYMBOL_CGENERALPANEL_TITLE _("General Panel")
55 #define SYMBOL_CGENERALPANEL_IDNAME ID_CGENERALPANEL
56 #define SYMBOL_CGENERALPANEL_SIZE wxSize(400, 300)
57 #define SYMBOL_CGENERALPANEL_POSITION wxDefaultPosition
58 ////@end control identifiers
59 
60 
61 /*!
62  * CGeneralPanel class declaration
63  */
64 
66 {
67  DECLARE_DYNAMIC_CLASS( CGeneralPanel )
68  DECLARE_EVENT_TABLE()
69 
70 public:
71  /// Constructors
72  CGeneralPanel();
73  CGeneralPanel( wxWindow* parent,
74  ICommandProccessor* cmdproc,
75  objects::CSeq_entry_Handle seh,
76  wxWindowID id = SYMBOL_CGENERALPANEL_IDNAME,
77  const wxPoint& pos = SYMBOL_CGENERALPANEL_POSITION,
78  const wxSize& size = SYMBOL_CGENERALPANEL_SIZE,
79  long style = SYMBOL_CGENERALPANEL_STYLE );
80 
81  /// Creation
82  bool Create( wxWindow* parent,
83  wxWindowID id = SYMBOL_CGENERALPANEL_IDNAME,
84  const wxPoint& pos = SYMBOL_CGENERALPANEL_POSITION,
85  const wxSize& size = SYMBOL_CGENERALPANEL_SIZE,
86  long style = SYMBOL_CGENERALPANEL_STYLE );
87 
88  /// Destructor
89  ~CGeneralPanel();
90 
91  /// Initialises member variables
92  void Init();
93 
94  /// Creates the controls and sizers
95  void CreateControls();
96 
97  virtual bool TransferDataToWindow();
98  virtual bool TransferDataFromWindow();
99 
100 ////@begin CGeneralPanel event handler declarations
101 
102  /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_SUBMITTER_IMMEDIATE
103  void OnSubmitterImmediateSelected( wxCommandEvent& event );
104 
105  /// wxEVT_COMMAND_RADIOBUTTON_SELECTED event handler for ID_SUBMITTER_HUP
106  void OnSubmitterHupSelected( wxCommandEvent& event );
107 
108 ////@end CGeneralPanel event handler declarations
109 
110 ////@begin CGeneralPanel member function declarations
111 
112  /// Retrieves bitmap resources
113  wxBitmap GetBitmapResource( const wxString& name );
114 
115  /// Retrieves icon resources
116  wxIcon GetIconResource( const wxString& name );
117 ////@end CGeneralPanel member function declarations
118 
119  /// Should we show tooltips?
120  static bool ShowToolTips();
121 
122  virtual void ApplySubmitBlock(objects::CSubmit_block& block);
123  virtual void ApplyDescriptor(objects::CSeqdesc& desc);
124  virtual void SetSeqEntryHandle(objects::CSeq_entry_Handle seh) {m_Seh = seh;}
125  virtual void ApplyCommand();
126  void ApplyDescriptorCommand();
127  virtual wxString GetAnchor() { return _("general"); }
128  virtual wxString GetName() const { return SYMBOL_CGENERALPANEL_TITLE; }
129 
130 private:
131 ////@begin CGeneralPanel member variables
132  wxTextCtrl* m_Bioproject;
133  wxTextCtrl* m_Biosample;
134  wxRadioButton* m_ImmediateRelease;
135  wxRadioButton* m_HUP;
136  wxStaticText* m_Label;
137  wxDatePickerCtrl* m_Date;
138 public:
139  /// Control identifiers
140  enum {
141  ID_CGENERALPANEL = 6532,
142  ID_SUBMITTER_BIOPROJECT = 6533,
143  ID_SUBMITTER_BIOSAMPLE = 6534,
144  ID_SUBMITTER_IMMEDIATE = 6535,
145  ID_SUBMITTER_HUP = 6536,
146  ID_DATEPICKERCTRL = 6537
147  };
148 ////@end CGeneralPanel member variables
149 
150 private:
152  objects::CSeq_entry_Handle m_Seh;
155 
156  void x_Reset();
157  void x_UpdateBlockControls();
158  void x_UpdateDescControls();
159 
160 };
161 
163 
164 #endif
165  // GUI_PKG_SEQ_EDIT___GENERAL_PANEL__HPP
CRef< objects::CSubmit_block > m_Block
virtual wxString GetName() const
CRef< objects::CSeqdesc > m_Dblink
virtual wxString GetAnchor()
wxDatePickerCtrl * m_Date
objects::CSeq_entry_Handle m_Seh
wxTextCtrl * m_Biosample
wxRadioButton * m_ImmediateRelease
wxTextCtrl * m_Bioproject
wxRadioButton * m_HUP
ICommandProccessor * m_CmdProcessor
wxStaticText * m_Label
virtual void SetSeqEntryHandle(objects::CSeq_entry_Handle seh)
Undo/Redo interface for editing operations.
virtual void ApplyDescriptor(objects::CSeqdesc &desc)
virtual void ApplySubmitBlock(objects::CSubmit_block &block)
#define _(proto)
Definition: ct_nlmzip_i.h:78
static void Init(void)
Definition: cursor6.c:76
#define SYMBOL_CGENERALPANEL_POSITION
#define SYMBOL_CGENERALPANEL_TITLE
#define SYMBOL_CGENERALPANEL_STYLE
#define SYMBOL_CGENERALPANEL_IDNAME
#define SYMBOL_CGENERALPANEL_SIZE
#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 NCBI_GUIWIDGETS_EDIT_EXPORT
Definition: gui_export.h:526
Defines to provide correct exporting from DLLs in Windows.
const struct ncbi::grid::netcache::search::fields::SIZE size
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
Modified on Wed Sep 04 15:05:32 2024 by modify_doxy.py rev. 669887