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

Go to the SVN repository for this file.

1 /* $Id: wx_marker_info_panel.hpp 27058 2012-12-13 14:34:04Z wuliangs $
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: Liangshou Wu
27  *
28  * File Description:
29  *
30  */
31 #ifndef _WX_MARKER_INFO_PANEL_H_
32 #define _WX_MARKER_INFO_PANEL_H_
33 
34 
35 /*!
36  * Includes
37  */
38 
39 #include <wx/panel.h>
40 #include <string>
41 
42 
43 ////@begin includes
44 #include "wx/grid.h"
45 ////@end includes
46 
47 /*!
48  * Forward declarations
49  */
50 
51 ////@begin forward declarations
52 class wxGrid;
53 ////@end forward declarations
54 class wxStaticText;
55 
57 
58 /*!
59  * Control identifiers
60  */
61 
62 ////@begin control identifiers
63 #define ID_CWXMARKERINFOPANEL 10047
64 #define ID_PANEL 10041
65 #define RemoveButton 10044
66 #define ID_GRID 10042
67 #define SYMBOL_CWXMARKERINFOPANEL_STYLE wxTAB_TRAVERSAL
68 #define SYMBOL_CWXMARKERINFOPANEL_TITLE _("Marker Info Panel")
69 #define SYMBOL_CWXMARKERINFOPANEL_IDNAME ID_CWXMARKERINFOPANEL
70 #define SYMBOL_CWXMARKERINFOPANEL_SIZE wxDefaultSize
71 #define SYMBOL_CWXMARKERINFOPANEL_POSITION wxDefaultPosition
72 ////@end control identifiers
73 
74 
76 {
77  string m_Acc;
78  string m_Loc;
79  string m_LocRef;
80  string m_Hgvs;
81  string m_Seq;
82 };
83 
84 typedef vector<SMarkerCoord> SMarkerCoordVec;
85 
87 {
88  string m_Id;
89  string m_Label;
90  size_t m_Pos;
92 };
93 
94 /*!
95  * CwxMarkerInfoPanel class declaration
96  */
97 
98 class CwxMarkerInfoPanel: public wxPanel
99 {
100  DECLARE_DYNAMIC_CLASS( CwxMarkerInfoPanel )
101  DECLARE_EVENT_TABLE()
102 
103 public:
105  CwxMarkerInfoPanel(const wxString& marker_id, const wxString& marker_label,
106  size_t marker_pos, wxWindow* parent, wxEvtHandler* eventHandler,
107  wxWindowID id = SYMBOL_CWXMARKERINFOPANEL_IDNAME,
108  const wxPoint& pos = SYMBOL_CWXMARKERINFOPANEL_POSITION,
109  const wxSize& size = SYMBOL_CWXMARKERINFOPANEL_SIZE,
110  long style = SYMBOL_CWXMARKERINFOPANEL_STYLE );
111 
112  bool Create( wxWindow* parent, wxWindowID id = SYMBOL_CWXMARKERINFOPANEL_IDNAME,
113  const wxPoint& pos = SYMBOL_CWXMARKERINFOPANEL_POSITION,
114  const wxSize& size = SYMBOL_CWXMARKERINFOPANEL_SIZE,
115  long style = SYMBOL_CWXMARKERINFOPANEL_STYLE );
116 
118 
119  void Init();
120 
121  void CreateControls();
122 
123  void UpdateMarker(const SMarkerInfo& marker_info);
124  string GetMarkerId() const;
125 
126 ////@begin CwxMarkerInfoPanel event handler declarations
127 
128  void OnRemoveButtonClick( wxCommandEvent& event );
129 
130 ////@end CwxMarkerInfoPanel event handler declarations
131 
132 ////@begin CwxMarkerInfoPanel member function declarations
133 
134  wxBitmap GetBitmapResource( const wxString& name );
135 
136  wxIcon GetIconResource( const wxString& name );
137 ////@end CwxMarkerInfoPanel member function declarations
138 
139  static bool ShowToolTips();
140 
141 private:
142  void x_UpdateMarkerLabel();
143 
144 ////@begin CwxMarkerInfoPanel member variables
145  wxStaticText* m_MarkerName;
147 ////@end CwxMarkerInfoPanel member variables
148  wxEvtHandler* m_EventHandler;
149 
150  wxString m_MarkerId;
151  wxString m_MarkerLabel;
152  size_t m_MarkerPos;
153 };
154 
155 
156 class CSeqMarkerEvent : public wxCommandEvent
157 {
158 public:
159  CSeqMarkerEvent(wxEventType commandType = wxEVT_NULL, int id = 0)
160  : wxCommandEvent(commandType, id) { }
161 
162  const string& GetMarkerId() const { return m_MarkerId; }
163  void SetMarkerId(const string& str) { m_MarkerId = str; }
164 private:
165  DECLARE_DYNAMIC_CLASS_NO_COPY(CSeqMarkerEvent)
166 
168 };
169 
170 
171 BEGIN_DECLARE_EVENT_TYPES()
172  DECLARE_EXPORTED_EVENT_TYPE(NCBI_GUIWIDGETS_SEQ_EXPORT, wxEVT_COMMAND_REMOVE_MARKER, 523)
173 END_DECLARE_EVENT_TYPES()
174 
175 typedef void (wxEvtHandler::*CSeqMarkerEventFunction)(CSeqMarkerEvent&);
176 
177 #define CSeqMarkerEventHandler(func) \
178  (wxObjectEventFunction)(wxEventFunction)wxStaticCastEvent(CSeqMarkerEventFunction, &func)
179 
180 #define EVT_REMOVE_MARKER(id, fn) \
181  wx__DECLARE_EVT1(wxEVT_COMMAND_REMOVE_MARKER, id, CSeqMarkerEventHandler(fn))
182 
183 
185 
186 #endif
187  // _WX_MARKER_INFO_PANEL_H_
void SetMarkerId(const string &str)
CSeqMarkerEvent(wxEventType commandType=wxEVT_NULL, int id=0)
const string & GetMarkerId() const
wxIcon GetIconResource(const wxString &name)
void UpdateMarker(const SMarkerInfo &marker_info)
bool Create(wxWindow *parent, wxWindowID id=10047, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxDefaultSize, long style=wxTAB_TRAVERSAL)
void OnRemoveButtonClick(wxCommandEvent &event)
wxBitmap GetBitmapResource(const wxString &name)
DECLARE_EXPORTED_EVENT_TYPE(, wxEVT_COMMAND_UPDATE_FEATLIST, wxCommandEvent)
static const char * str(char *buf, int n)
Definition: stats.c:84
string
Definition: cgiapp.hpp:687
#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_SEQ_EXPORT
Definition: gui_export.h:539
const struct ncbi::grid::netcache::search::fields::SIZE size
SMarkerCoordVec m_CoordVec
#define SYMBOL_CWXMARKERINFOPANEL_SIZE
void(wxEvtHandler::* CSeqMarkerEventFunction)(CSeqMarkerEvent &)
#define SYMBOL_CWXMARKERINFOPANEL_STYLE
vector< SMarkerCoord > SMarkerCoordVec
#define SYMBOL_CWXMARKERINFOPANEL_IDNAME
#define SYMBOL_CWXMARKERINFOPANEL_POSITION
Modified on Mon Apr 22 04:03:34 2024 by modify_doxy.py rev. 669887