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

Go to the SVN repository for this file.

1 /* $Id: identifiers_panel.hpp 41991 2018-11-28 18:39:32Z asztalos $
2  * ===========================================================================
3  *
4  * PUBLIC DOMAIN NOTICE
5  * National Center for Biotechnology Information
6  *
7  * This software/database is a "United States Government Work" under the
8  * terms of the United States Copyright Act. It was written as part of
9  * the author's official duties as a United States Government employee and
10  * thus cannot be copyrighted. This software/database is freely available
11  * to the public for use. The National Library of Medicine and the U.S.
12  * Government have not placed any restriction on its use or reproduction.
13  *
14  * Although all reasonable efforts have been taken to ensure the accuracy
15  * and reliability of the software and data, the NLM and the U.S.
16  * Government do not and cannot warrant the performance or results that
17  * may be obtained by using this software or data. The NLM and the U.S.
18  * Government disclaim all warranties, express or implied, including
19  * warranties of performance, merchantability or fitness for any particular
20  * purpose.
21  *
22  * Please cite the author in any work or product based on this material.
23  *
24  * ===========================================================================
25  *
26  * Authors: Colleen Bollin
27  */
28 #ifndef _IDENTIFIERS_PANEL_H_
29 #define _IDENTIFIERS_PANEL_H_
30 
31 #include <corelib/ncbistd.hpp>
33 #include <objmgr/scope.hpp>
34 
35 #include <wx/scrolwin.h>
36 
38 
39 /*!
40  * Control identifiers
41  */
42 
43 ////@begin control identifiers
44 #define SYMBOL_CIDENTIFIERSPANEL_STYLE wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL
45 #define SYMBOL_CIDENTIFIERSPANEL_TITLE _("IdentifiersPanel")
46 #define SYMBOL_CIDENTIFIERSPANEL_IDNAME ID_CIDENTIFIERSPANEL
47 #define SYMBOL_CIDENTIFIERSPANEL_SIZE wxSize(400, 300)
48 #define SYMBOL_CIDENTIFIERSPANEL_POSITION wxDefaultPosition
49 ////@end control identifiers
50 
51 
52 /*!
53  * CIdentifiersPanel class declaration
54  */
55 
56 class CIdentifiersPanel: public wxPanel
57 {
58  DECLARE_DYNAMIC_CLASS( CIdentifiersPanel )
59  DECLARE_EVENT_TABLE()
60 
61 public:
62  /// Constructors
64  CIdentifiersPanel( wxWindow* parent,
65  objects::CSeq_feat& feat,
66  CRef<objects::CScope> scope,
67  wxWindowID id = SYMBOL_CIDENTIFIERSPANEL_IDNAME,
68  const wxString& caption = SYMBOL_CIDENTIFIERSPANEL_TITLE,
69  const wxPoint& pos = SYMBOL_CIDENTIFIERSPANEL_POSITION,
70  const wxSize& size = SYMBOL_CIDENTIFIERSPANEL_SIZE,
71  long style = SYMBOL_CIDENTIFIERSPANEL_STYLE );
72 
73  /// Creation
74  bool Create( wxWindow* parent,
75  wxWindowID id = SYMBOL_CIDENTIFIERSPANEL_IDNAME,
76  const wxString& caption = SYMBOL_CIDENTIFIERSPANEL_TITLE,
77  const wxPoint& pos = SYMBOL_CIDENTIFIERSPANEL_POSITION,
78  const wxSize& size = SYMBOL_CIDENTIFIERSPANEL_SIZE,
79  long style = SYMBOL_CIDENTIFIERSPANEL_STYLE );
80 
81  /// Destructor
83 
84  /// Initialises member variables
85  void Init();
86 
87  /// Creates the controls and sizers
88  void CreateControls();
89 
90  virtual bool TransferDataToWindow();
91  virtual bool TransferDataFromWindow();
92 
93  void PopulateIdentifiers(objects::CSeq_feat& seq_feat);
94 
95 ////@begin CIdentifiersPanel event handler declarations
96 
97  void OnDelete(wxHyperlinkEvent& event);
98  void OnNewText(wxCommandEvent& event);
99 
100 ////@end CIdentifiersPanel event handler declarations
101 
102 ////@begin CIdentifiersPanel member function declarations
103 
104  /// Retrieves bitmap resources
105  wxBitmap GetBitmapResource( const wxString& name );
106 
107  /// Retrieves icon resources
108  wxIcon GetIconResource( const wxString& name );
109 ////@end CIdentifiersPanel member function declarations
110 
111  /// Should we show tooltips?
112  static bool ShowToolTips();
113 
114 ////@begin CIdentifiersPanel member variables
115  wxTextCtrl* m_FeatureIdCtrl;
116  /// Control identifiers
117  enum {
119  ID_TEXTCTRL25 = 10077,
120  };
121 ////@end CIdentifiersPanel member variables
122 
123 private:
124  void GetIdXrefs();
125  void AddXref(const string &value);
126  void SetIdXrefs(objects::CSeq_feat& seq_feat);
128  bool x_IsLastXref(wxTextCtrl* win);
129  bool x_IsReciprocalXref(const objects::CSeq_feat& one, const objects::CSeq_feat& two);
130  bool x_CollectFeatId();
131 
134  wxScrolledWindow *m_ScrolledWindow;
135  wxBoxSizer *m_Sizer;
136 };
137 
139 
140 #endif
141  // _IDENTIFIERS_PANEL_H_
void OnDelete(wxHyperlinkEvent &event)
static bool ShowToolTips()
Should we show tooltips?
bool Create(wxWindow *parent, wxWindowID id=ID_CIDENTIFIERSPANEL, const wxString &caption=_("IdentifiersPanel"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
void OnNewText(wxCommandEvent &event)
void Init()
Initialises member variables.
CRef< objects::CScope > m_Scope
void SetIdXrefs(objects::CSeq_feat &seq_feat)
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void PopulateIdentifiers(objects::CSeq_feat &seq_feat)
bool x_IsReciprocalXref(const objects::CSeq_feat &one, const objects::CSeq_feat &two)
CRef< objects::CSeq_feat > m_EditedFeat
void CreateControls()
Creates the controls and sizers.
wxScrolledWindow * m_ScrolledWindow
~CIdentifiersPanel()
Destructor.
bool x_IsLastXref(wxTextCtrl *win)
CIdentifiersPanel(wxWindow *parent, objects::CSeq_feat &feat, CRef< objects::CScope > scope, wxWindowID id=ID_CIDENTIFIERSPANEL, const wxString &caption=_("IdentifiersPanel"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
wxTextCtrl * m_FeatureIdCtrl
void AddXref(const string &value)
virtual bool TransferDataToWindow()
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
virtual bool TransferDataFromWindow()
CIdentifiersPanel()
Constructors.
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 BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define SYMBOL_CIDENTIFIERSPANEL_SIZE
#define SYMBOL_CIDENTIFIERSPANEL_POSITION
#define SYMBOL_CIDENTIFIERSPANEL_STYLE
#define SYMBOL_CIDENTIFIERSPANEL_TITLE
#define SYMBOL_CIDENTIFIERSPANEL_IDNAME
const struct ncbi::grid::netcache::search::fields::SIZE size
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Fri Apr 26 16:23:12 2024 by modify_doxy.py rev. 669887