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

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS_EDIT___LOCATION_PANEL__HPP
2 #define GUI_WIDGETS_EDIT___LOCATION_PANEL__HPP
3 
4 /* $Id: location_panel.hpp 35777 2016-06-22 15:47:52Z filippov $
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: Roman Katargin
30  */
31 
32 #include <corelib/ncbistd.hpp>
33 
34 #include <objmgr/scope.hpp>
37 
38 /*!
39  * Includes
40  */
41 
42 ////@begin includes
43 ////@end includes
44 
45 #include <wx/checkbox.h>
46 
48 
49 /*!
50  * Forward declarations
51  */
52 
53 ////@begin forward declarations
54 class CLocationListCtrl;
55 ////@end forward declarations
56 
57 class CSerialObject;
58 
60  class CSeq_loc;
62 
63 /*!
64  * Control identifiers
65  */
66 
67 ////@begin control identifiers
68 #define SYMBOL_CLOCATIONPANEL_STYLE wxTAB_TRAVERSAL
69 #define SYMBOL_CLOCATIONPANEL_TITLE _("Location Panel")
70 #define SYMBOL_CLOCATIONPANEL_IDNAME ID_CLOCATIONPANEL
71 #define SYMBOL_CLOCATIONPANEL_SIZE wxDefaultSize
72 #define SYMBOL_CLOCATIONPANEL_POSITION wxDefaultPosition
73 ////@end control identifiers
74 
75 
76 /*!
77  * CLocationPanel class declaration
78  */
79 
80 class CLocationPanel: public wxPanel, public CImportExportAccess
81 {
82  DECLARE_DYNAMIC_CLASS( CLocationPanel )
83  DECLARE_EVENT_TABLE()
84 
85 public:
86  /// Constructors
88  CLocationPanel( wxWindow* parent, CSerialObject& object, objects::CScope* scope, bool allow_nuc = true, bool allow_prot = true, bool is_cds = false,
89  wxWindowID id = SYMBOL_CLOCATIONPANEL_IDNAME, const wxPoint& pos = SYMBOL_CLOCATIONPANEL_POSITION, const wxSize& size = SYMBOL_CLOCATIONPANEL_SIZE, long style = SYMBOL_CLOCATIONPANEL_STYLE );
90  CLocationPanel( wxWindow* parent, CSerialObject& object, objects::CScope& scope, bool allow_nuc = true, bool allow_prot = true, bool is_cds = false,
91  wxWindowID id = SYMBOL_CLOCATIONPANEL_IDNAME, const wxPoint& pos = SYMBOL_CLOCATIONPANEL_POSITION, const wxSize& size = SYMBOL_CLOCATIONPANEL_SIZE, long style = SYMBOL_CLOCATIONPANEL_STYLE );
92  /// Creation
93  bool Create( wxWindow* parent, wxWindowID id = SYMBOL_CLOCATIONPANEL_IDNAME, const wxPoint& pos = SYMBOL_CLOCATIONPANEL_POSITION, const wxSize& size = SYMBOL_CLOCATIONPANEL_SIZE, long style = SYMBOL_CLOCATIONPANEL_STYLE );
94 
95  /// Destructor
97 
98  /// Initialises member variables
99  void Init();
100 
101  /// Creates the controls and sizers
102  void CreateControls();
103 
104 ////@begin CLocationPanel event handler declarations
105 
106 ////@end CLocationPanel event handler declarations
107 
108 ////@begin CLocationPanel 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 CLocationPanel member function declarations
116 
117  /// Should we show tooltips?
118  static bool ShowToolTips();
119 
120 ////@begin CLocationPanel member variables
122  /// Control identifiers
123  enum {
125  ID_WINDOW2 = 10037
126  };
127 ////@end CLocationPanel member variables
128 
129  virtual bool TransferDataToWindow();
130  virtual bool TransferDataFromWindow();
131 
133  void SetSeq_loc(CSerialObject& object);
134 
135  virtual bool IsImportEnabled(void);
136  virtual bool IsExportEnabled(void);
137  virtual CRef<CSerialObject> OnExport(void);
138  virtual void OnImport( CNcbiIfstream &istr);
139  bool ShouldUpdatemRNALocation() { return m_UpdatemRNASpan ? m_UpdatemRNASpan->GetValue() : false; }
140 private:
144  void x_FillList();
145  void x_LoadSeqLoc(const objects::CSeq_loc& loc);
146  void x_SetJoinOrder();
150  wxCheckBox* m_UpdatemRNASpan;
151  bool m_is_cds;
152 };
153 
155 
156 #endif // GUI_WIDGETS_EDIT___LOCATION_PANEL__HPP
virtual bool IsExportEnabled(void)
void x_LoadSeqLoc(const objects::CSeq_loc &loc)
void Init()
Initialises member variables.
void SetSeq_loc(CSerialObject &object)
virtual bool TransferDataFromWindow()
CLocationPanel(wxWindow *parent, CSerialObject &object, objects::CScope &scope, bool allow_nuc=true, bool allow_prot=true, bool is_cds=false, wxWindowID id=ID_CLOCATIONPANEL, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL)
virtual bool IsImportEnabled(void)
bool Create(wxWindow *parent, wxWindowID id=ID_CLOCATIONPANEL, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL)
Creation.
static bool ShowToolTips()
Should we show tooltips?
CLocationPanel(wxWindow *parent, CSerialObject &object, objects::CScope *scope, bool allow_nuc=true, bool allow_prot=true, bool is_cds=false, wxWindowID id=ID_CLOCATIONPANEL, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL)
CSerialObject * m_Object
CRef< objects::CSeq_loc > GetSeq_loc() const
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void CreateControls()
Creates the controls and sizers.
CRef< objects::CScope > m_Scope
virtual CRef< CSerialObject > OnExport(void)
CLocationPanel()
Constructors.
bool ShouldUpdatemRNALocation()
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
~CLocationPanel()
Destructor.
CLocationListCtrl * m_LocationCtrl
CRef< objects::CPacked_seqint > m_ToEdit
virtual bool TransferDataToWindow()
virtual void OnImport(CNcbiIfstream &istr)
wxCheckBox * m_UpdatemRNASpan
Base class for all serializable objects.
Definition: serialbase.hpp:150
Include a standard set of the NCBI C++ Toolkit most basic headers.
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:75
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:72
IO_PREFIX::ifstream CNcbiIfstream
Portable alias for ifstream.
Definition: ncbistre.hpp:439
#define SYMBOL_CLOCATIONPANEL_POSITION
#define SYMBOL_CLOCATIONPANEL_SIZE
#define SYMBOL_CLOCATIONPANEL_STYLE
#define SYMBOL_CLOCATIONPANEL_IDNAME
const struct ncbi::grid::netcache::search::fields::SIZE size
Modified on Sun Apr 14 05:26:23 2024 by modify_doxy.py rev. 669887