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

Go to the SVN repository for this file.

1 #ifndef GUI_PKG_SEQ_EDIT___ORGADVANCED_PANEL__HPP
2 #define GUI_PKG_SEQ_EDIT___ORGADVANCED_PANEL__HPP
3 /* $Id: orgadvanced_panel.hpp 46622 2021-08-06 20:19:47Z 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: Andrea Asztalos
29  */
30 
31 #include <corelib/ncbistd.hpp>
32 #include <gui/gui_export.h>
34 #include <wx/panel.h>
35 #include <wx/hyperlink.h>
41 
42 class wxScrolledWindow;
43 class wxFlexGridSizer;
44 
45 
47 
48 /*!
49  * Control identifiers
50  */
51 
52 ////@begin control identifiers
53 #define SYMBOL_CORGADVANCEDPANEL_STYLE wxTAB_TRAVERSAL
54 #define SYMBOL_CORGADVANCEDPANEL_TITLE _("Organism Advanced Panel")
55 #define SYMBOL_CORGADVANCEDPANEL_IDNAME ID_CORGADVANCEDPANEL
56 #define SYMBOL_CORGADVANCEDPANEL_SIZE wxSize(400, 300)
57 #define SYMBOL_CORGADVANCEDPANEL_POSITION wxDefaultPosition
58 ////@end control identifiers
59 
60 
61 /*!
62  * COrgAdvancedPanel class declaration
63  */
64 
66 {
67  DECLARE_DYNAMIC_CLASS( COrgAdvancedPanel )
68  DECLARE_EVENT_TABLE()
69 
70 public:
71  /// Constructors
73  COrgAdvancedPanel( wxWindow* parent,
74  ICommandProccessor* cmdproc,
75  objects::CSeq_entry_Handle seh,
76  wxWindowID id = SYMBOL_CORGADVANCEDPANEL_IDNAME,
77  const wxPoint& pos = SYMBOL_CORGADVANCEDPANEL_POSITION,
78  const wxSize& size = SYMBOL_CORGADVANCEDPANEL_SIZE,
79  long style = SYMBOL_CORGADVANCEDPANEL_STYLE );
80 
81  /// Creation
82  bool Create( wxWindow* parent,
83  wxWindowID id = SYMBOL_CORGADVANCEDPANEL_IDNAME,
84  const wxPoint& pos = SYMBOL_CORGADVANCEDPANEL_POSITION,
85  const wxSize& size = SYMBOL_CORGADVANCEDPANEL_SIZE,
86  long style = SYMBOL_CORGADVANCEDPANEL_STYLE );
87 
88  /// Destructor
90 
91  /// Initialises member variables
92  void Init();
93 
94  /// Creates the controls and sizers
95  void CreateControls();
96 
97  void ApplyBioSource(objects::CBioSource& src);
98  virtual bool TransferDataToWindow();
99  virtual bool TransferDataFromWindow();
100 
101  void ApplyCommand();
102 
103 ////@begin COrgAdvancedPanel event handler declarations
104 
105  /// wxEVT_COMMAND_HYPERLINK event handler for ID_ORGADVHYPERLINK
106  void OnAddAttributeHyperlinkClicked( wxHyperlinkEvent& event );
107 
108  void OnDeleteQualifier(wxHyperlinkEvent& event);
109 
110 ////@end COrgAdvancedPanel event handler declarations
111 
112 ////@begin COrgAdvancedPanel member function declarations
113 
114  /// Retrieves bitmap resources
115  wxBitmap GetBitmapResource( const wxString& name );
116 
117  /// Retrieves icon resources
118  wxIcon GetIconResource( const wxString& name );
119 ////@end COrgAdvancedPanel member function declarations
120 
121  /// Should we show tooltips?
122  static bool ShowToolTips();
123 
124  virtual void SetSeqEntryHandle(objects::CSeq_entry_Handle seh) { m_Seh = seh; }
125  virtual wxString GetAnchor() { return _("organism-info-additional-qualifiers"); }
126  virtual wxString GetName() const { return SYMBOL_CORGADVANCEDPANEL_TITLE; }
127 
128 private:
129  void x_AddEmptyRow();
130  void x_AddRowToWindow(wxWindow* row);
131 
132  void x_Reset();
133  void x_SetBioSourceModifier(objects::CBioSource& src, const string& name, const string& value);
134  void x_SetBioSourceModifier(const string& name, const string& value);
135  bool x_ApplyChangesToSource(objects::CBioSource& src);
136 
137  size_t m_Rows{ 2 };
138  int m_RowHeight{ 0 };
139 #ifndef __WXMSW__
140  int m_TotalHeight{ 0 };
141  int m_TotalWidth{ 0 };
142  int m_ScrollRate{ 0 };
143  int m_MaxRows{ 4 };
144 #endif
147  objects::CSeq_entry_Handle m_Seh;
148 
149 ////@begin COrgAdvancedPanel member variables
150  wxScrolledWindow* m_ScrolledWindow;
151  wxFlexGridSizer* m_Sizer;
152 public:
153  /// Control identifiers
154  enum {
155  ID_CORGADVANCEDPANEL = 6592,
156  ID_ORGADVSCROLLEDWND = 6593,
157  ID_ORGADVHYPERLINK = 6594,
158  ID_ORGADVDELETE = 6595
159  };
160 ////@end COrgAdvancedPanel member variables
161 };
162 
164 
165 #endif
166  // GUI_PKG_SEQ_EDIT___ORGADVANCED_PANEL__HPP
CRef< objects::CBioSource > m_Source
virtual void SetSeqEntryHandle(objects::CSeq_entry_Handle seh)
virtual wxString GetName() const
wxScrolledWindow * m_ScrolledWindow
objects::CSeq_entry_Handle m_Seh
ICommandProccessor * m_CmdProcessor
virtual wxString GetAnchor()
wxFlexGridSizer * m_Sizer
Undo/Redo interface for editing operations.
Include a standard set of the NCBI C++ Toolkit most basic headers.
#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.
const struct ncbi::grid::netcache::search::fields::SIZE size
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
#define SYMBOL_CORGADVANCEDPANEL_TITLE
#define SYMBOL_CORGADVANCEDPANEL_STYLE
#define SYMBOL_CORGADVANCEDPANEL_SIZE
#define SYMBOL_CORGADVANCEDPANEL_POSITION
#define SYMBOL_CORGADVANCEDPANEL_IDNAME
#define row(bind, expected)
Definition: string_bind.c:73
Modified on Sun Apr 14 05:27:48 2024 by modify_doxy.py rev. 669887