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

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS_SEQ___SEQ_TEXT_PANEL__HPP
2 #define GUI_WIDGETS_SEQ___SEQ_TEXT_PANEL__HPP
3 
4 /* $Id: seq_text_panel.hpp 36516 2016-10-03 19:16:16Z katargir $
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 
33 #include <corelib/ncbistd.hpp>
34 #include <gui/gui_export.h>
38 
39 #include <wx/panel.h>
40 #include <wx/dialog.h>
41 
42 class wxStaticText;
43 class wxButton;
44 
46 
47 ////@begin forward declarations
48 class CSeqTextWidget;
49 ////@end forward declarations
50 
51 /*!
52  * Control identifiers
53  */
54 
55 ////@begin control identifiers
56 #define SYMBOL_CSEQTEXTPANEL_STYLE wxTAB_TRAVERSAL
57 #define SYMBOL_CSEQTEXTPANEL_TITLE _("Sequence Text Panel")
58 #define SYMBOL_CSEQTEXTPANEL_IDNAME ID_CSEQTEXTPANEL
59 #define SYMBOL_CSEQTEXTPANEL_SIZE wxSize(400, 300)
60 #define SYMBOL_CSEQTEXTPANEL_POSITION wxDefaultPosition
61 ////@end control identifiers
62 
63 
64 /*!
65  * CSeqTextPanel class declaration
66  */
67 
69  public wxPanel,
70  public ISeqTextWidgetHost,
72 {
73  DECLARE_DYNAMIC_CLASS( CSeqTextPanel )
74  DECLARE_EVENT_TABLE()
75 
76 public:
77  /// Constructors
78  CSeqTextPanel();
79  CSeqTextPanel( wxWindow* parent,
80  wxWindowID id = SYMBOL_CSEQTEXTPANEL_IDNAME,
81  const wxPoint& pos = SYMBOL_CSEQTEXTPANEL_POSITION,
82  const wxSize& size = SYMBOL_CSEQTEXTPANEL_SIZE,
83  long style = SYMBOL_CSEQTEXTPANEL_STYLE );
84 
85  /// Creation
86  bool Create( wxWindow* parent,
87  wxWindowID id = SYMBOL_CSEQTEXTPANEL_IDNAME,
88  const wxPoint& pos = SYMBOL_CSEQTEXTPANEL_POSITION,
89  const wxSize& size = SYMBOL_CSEQTEXTPANEL_SIZE,
90  long style = SYMBOL_CSEQTEXTPANEL_STYLE );
91 
92  /// Destructor
93  ~CSeqTextPanel();
94 
95  /// Initialises member variables
96  void Init();
97  bool InitObject(SConstScopedObject& object);
98 
99  /// Creates the controls and sizers
100  void CreateControls();
101 
102  CSeqTextWidget* GetWidget() const { return m_SeqTextWidget; }
103  const CSeqTextDataSource* GetDataSource() const { return m_DataSource.GetPointer(); }
104 
105 ////@begin CSeqTextPanel event handler declarations
106  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON
107  void OnFindBwdClick(wxCommandEvent& event);
108 
109  /// wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_BUTTON1
110  void OnFindFwdClick(wxCommandEvent& event);
111 
112  void OnStopClick(wxCommandEvent& event);
113 
114  /// wxEVT_COMMAND_CHOICE_SELECTED event handler for ID_CHOICE1
115  void OnFeatureTypeSelected(wxCommandEvent& event);
116 
117 ////@end CSeqTextPanel event handler declarations
118 
119 ////@begin CSeqTextPanel member function declarations
120 
121  /// @name CJobAdapter::IJobCallback interface implementation
122  /// @{
123  virtual void OnJobResult(CObject* result, CJobAdapter& adapter);
124  virtual void OnJobFailed(const string&, CJobAdapter& adapter);
125  /// @}
126 
127  /// Retrieves bitmap resources
128  wxBitmap GetBitmapResource( const wxString& name );
129 
130  /// Retrieves icon resources
131  wxIcon GetIconResource( const wxString& name );
132 ////@end CSeqTextPanel member function declarations
133 
134  /// Should we show tooltips?
135  static bool ShowToolTips();
136 
137 ////@begin CSeqTextPanel member variables
138  wxButton* m_BwdButton;
139  wxButton* m_FwdButton;
140  wxButton* m_StopButton;
141  wxStaticText* m_MousePos;
143  /// Control identifiers
144  enum {
145  ID_CSEQTEXTPANEL = 10000,
146  ID_TEXTCTRL1 = 10001,
147  ID_BUTTON = 10002,
148  ID_BUTTON1 = 10003,
149  ID_BUTTON2 = 10004,
150  ID_CHOICE1 = 10005,
151  ID_WINDOW = 10006
152  };
153 ////@end CSeqTextPanel member variables
154 
155 // ISeqTextWidgetHost implemenatation
156  virtual void STWH_ChangeConfig() {}
157  virtual void STWH_ReportMouseOverPos(TSeqPos pos);
158 
159 private:
160  void x_StartSearch(bool forward);
161  void x_RestoreButtonStates();
162 
165 };
166 
168 
169 #endif // GUI_WIDGETS_SEQ___SEQ_TEXT_PANEL__HPP
#define ID_CHOICE1
#define ID_WINDOW
CObject –.
Definition: ncbiobj.hpp:180
CSeqTextDataSource implements Adapter design pattern.
wxButton * m_FwdButton
const CSeqTextDataSource * GetDataSource() const
virtual void STWH_ChangeConfig()
wxButton * m_BwdButton
CSeqTextWidget * m_SeqTextWidget
CRef< CJobAdapter > m_JobAdapter
wxButton * m_StopButton
CRef< CSeqTextDataSource > m_DataSource
CSeqTextWidget * GetWidget() const
wxStaticText * m_MousePos
class CSeqTextWidget
class ISeqTextWidgetHost
virtual void STWH_ReportMouseOverPos(TSeqPos pos)=0
Include a standard set of the NCBI C++ Toolkit most basic headers.
#define ID_BUTTON1
#define ID_BUTTON2
static void Init(void)
Definition: cursor6.c:76
unsigned int TSeqPos
Type for sequence locations and lengths.
Definition: ncbimisc.hpp:875
virtual void OnJobResult(CObject *result, CJobAdapter &adapter)=0
virtual void OnJobFailed(const string &errMsg, CJobAdapter &adapter)=0
#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
Defines to provide correct exporting from DLLs in Windows.
const struct ncbi::grid::netcache::search::fields::SIZE size
#define SYMBOL_CSEQTEXTPANEL_SIZE
#define SYMBOL_CSEQTEXTPANEL_POSITION
#define SYMBOL_CSEQTEXTPANEL_STYLE
#define SYMBOL_CSEQTEXTPANEL_IDNAME
#define ID_TEXTCTRL1
else result
Definition: token2.c:20
#define ID_BUTTON
Modified on Mon Apr 22 04:01:52 2024 by modify_doxy.py rev. 669887