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

Go to the SVN repository for this file.

1 #ifndef GUI_PKG_SEQ_EDIT___ORGGENERAL_PANEL__HPP
2 #define GUI_PKG_SEQ_EDIT___ORGGENERAL_PANEL__HPP
3 
4 /* $Id: orggeneral_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>
35 #include <wx/panel.h>
39 
40 class wxChoice;
41 class wxTextCtrl;
42 
44 
45 /*!
46  * Control identifiers
47  */
48 
49 ////@begin control identifiers
50 #define SYMBOL_CORGGENERALPANEL_STYLE wxTAB_TRAVERSAL
51 #define SYMBOL_CORGGENERALPANEL_TITLE _("Organism General Panel")
52 #define SYMBOL_CORGGENERALPANEL_IDNAME ID_CORGGENERALPANEL
53 #define SYMBOL_CORGGENERALPANEL_SIZE wxSize(400, 300)
54 #define SYMBOL_CORGGENERALPANEL_POSITION wxDefaultPosition
55 ////@end control identifiers
56 
57 
58 /*!
59  * COrgGeneralPanel class declaration
60  */
61 
63 {
64  DECLARE_DYNAMIC_CLASS( COrgGeneralPanel )
65  DECLARE_EVENT_TABLE()
66 
67 public:
68  /// Constructors
70  COrgGeneralPanel( wxWindow* parent,
71  ICommandProccessor* cmdproc,
72  objects::CSeq_entry_Handle seh,
73  wxWindowID id = SYMBOL_CORGGENERALPANEL_IDNAME,
74  const wxPoint& pos = SYMBOL_CORGGENERALPANEL_POSITION,
75  const wxSize& size = SYMBOL_CORGGENERALPANEL_SIZE,
76  long style = SYMBOL_CORGGENERALPANEL_STYLE );
77 
78  /// Creation
79  bool Create( wxWindow* parent,
80  wxWindowID id = SYMBOL_CORGGENERALPANEL_IDNAME,
81  const wxPoint& pos = SYMBOL_CORGGENERALPANEL_POSITION,
82  const wxSize& size = SYMBOL_CORGGENERALPANEL_SIZE,
83  long style = SYMBOL_CORGGENERALPANEL_STYLE );
84 
85  /// Destructor
87 
88  /// Initialises member variables
89  void Init();
90 
91  /// Creates the controls and sizers
92  void CreateControls();
93 
94  void ApplyBioSource(objects::CBioSource& src);
95  virtual bool TransferDataToWindow();
96  virtual bool TransferDataFromWindow();
97 
98  virtual void ApplyCommand();
99  virtual void ReportMissingFields(string &text);
100  virtual wxString GetAnchor() { return _("organism-info-general"); }
101  virtual wxString GetName() const { return SYMBOL_CORGGENERALPANEL_TITLE; }
102 
103 
104 ////@begin COrgGeneralPanel event handler declarations
105 
106 ////@end COrgGeneralPanel event handler declarations
107 
108 ////@begin COrgGeneralPanel member function declarations
109 
110  /// Retrieves bitmap resources
111  wxBitmap GetBitmapResource( const wxString& name );
112 
113  /// Retrieves icon resources
114  wxIcon GetIconResource( const wxString& name );
115 ////@end COrgGeneralPanel member function declarations
116 
117  /// Should we show tooltips?
118  static bool ShowToolTips();
119 
120  void SetSeqEntryHandle(objects::CSeq_entry_Handle seh) { m_Seh = seh; }
121 
122 private:
125  objects::CSeq_entry_Handle m_Seh;
126 
127  void x_Reset();
128  bool x_ApplyChangesToSource(objects::CBioSource& src);
129  bool x_HasTaxnameChanged(const objects::CBioSource& orig_src, const objects::CBioSource& edited_src);
130 
131 ////@begin COrgGeneralPanel member variables
132  wxTextCtrl* m_Taxname;
133  wxTextCtrl* m_Strain;
134  wxTextCtrl* m_Isolate;
135  wxTextCtrl* m_Cultivar;
136  wxTextCtrl* m_Breed;
137 public:
138  /// Control identifiers
139  enum {
140  ID_CORGGENERALPANEL = 6580,
141  ID_ORGTAXNAME = 6581,
142  ID_ORGSTRAIN = 6582,
143  ID_ORGISOLATE = 6583,
144  ID_ORGCULTIVAR = 6584,
145  ID_ORGBREED = 6585
146  };
147 ////@end COrgGeneralPanel member variables
148 };
149 
151 
152 #endif
153  // GUI_PKG_SEQ_EDIT___ORGGENERAL_PANEL__HPP
wxTextCtrl * m_Cultivar
virtual wxString GetAnchor()
objects::CSeq_entry_Handle m_Seh
void SetSeqEntryHandle(objects::CSeq_entry_Handle seh)
ICommandProccessor * m_CmdProcessor
COrgGeneralPanel(wxWindow *parent, ICommandProccessor *cmdproc, objects::CSeq_entry_Handle seh, wxWindowID id=ID_CORGGENERALPANEL, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxTAB_TRAVERSAL)
wxTextCtrl * m_Isolate
virtual wxString GetName() const
CRef< objects::CBioSource > m_Source
wxTextCtrl * m_Taxname
Undo/Redo interface for editing operations.
virtual void ReportMissingFields(string &text)
#define _(proto)
Definition: ct_nlmzip_i.h:78
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 NCBI_GUIWIDGETS_EDIT_EXPORT
Definition: gui_export.h:526
Defines to provide correct exporting from DLLs in Windows.
static void text(MDB_val *v)
Definition: mdb_dump.c:62
const struct ncbi::grid::netcache::search::fields::SIZE size
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
#define SYMBOL_CORGGENERALPANEL_SIZE
#define SYMBOL_CORGGENERALPANEL_STYLE
#define SYMBOL_CORGGENERALPANEL_TITLE
#define SYMBOL_CORGGENERALPANEL_IDNAME
#define SYMBOL_CORGGENERALPANEL_POSITION
Modified on Sun Apr 14 05:24:48 2024 by modify_doxy.py rev. 669887