NCBI C++ ToolKit
loadentrez_seq_dlg.cpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 /* $Id: loadentrez_seq_dlg.cpp 35961 2016-07-19 20:41:20Z 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: Andrea Asztalos
27  */
28 
29 
30 #include <ncbi_pch.hpp>
34 
35 #include <wx/sizer.h>
36 #include <wx/stattext.h>
37 #include <wx/textctrl.h>
38 #include <wx/button.h>
39 
40 
43 /*!
44  * CLoadSeqFromEntrez_dlg type definition
45  */
46 
47 IMPLEMENT_DYNAMIC_CLASS( CLoadSeqFromEntrez_dlg, wxDialog )
48 
49 
50 /*!
51  * CLoadSeqFromEntrez_dlg event table definition
52  */
53 
54 BEGIN_EVENT_TABLE( CLoadSeqFromEntrez_dlg, wxDialog )
55 
56 ////@begin CLoadSeqFromEntrez_dlg event table entries
58  EVT_TEXT_ENTER(ID_LDTEXT, CLoadSeqFromEntrez_dlg::OnTextCtrlEnter)
59 ////@end CLoadSeqFromEntrez_dlg event table entries
60 
62 
63 
64 /*!
65  * CLoadSeqFromEntrez_dlg constructors
66  */
67 
69 {
70  Init();
71 }
72 
73 CLoadSeqFromEntrez_dlg::CLoadSeqFromEntrez_dlg( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
74 {
75  Init();
76  Create(parent, id, caption, pos, size, style);
77 }
78 
79 
80 /*!
81  * CLoadSeqFromEntrez_dlg creator
82  */
83 
84 bool CLoadSeqFromEntrez_dlg::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
85 {
86 ////@begin CLoadSeqFromEntrez_dlg creation
87  SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
88  wxDialog::Create( parent, id, caption, pos, size, style );
89 
91  if (GetSizer())
92  {
93  GetSizer()->SetSizeHints(this);
94  }
95  Centre();
96 ////@end CLoadSeqFromEntrez_dlg creation
97  return true;
98 }
99 
100 
101 /*!
102  * CLoadSeqFromEntrez_dlg destructor
103  */
104 
106 {
107 ////@begin CLoadSeqFromEntrez_dlg destruction
108 ////@end CLoadSeqFromEntrez_dlg destruction
109 }
110 
111 
112 /*!
113  * Member initialisation
114  */
115 
117 {
118 ////@begin CLoadSeqFromEntrez_dlg member initialisation
119  m_Text = NULL;
120 ////@end CLoadSeqFromEntrez_dlg member initialisation
121 }
122 
123 
124 /*!
125  * Control creation for CLoadSeqFromEntrez_dlg
126  */
127 
129 {
130 ////@begin CLoadSeqFromEntrez_dlg content construction
131  CLoadSeqFromEntrez_dlg* itemDialog1 = this;
132 
133  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
134  itemDialog1->SetSizer(itemBoxSizer2);
135 
136  wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
137  itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
138 
139  wxStaticText* itemStaticText4 = new wxStaticText( itemDialog1, wxID_STATIC, _("Accession/GI:"), wxDefaultPosition, wxDefaultSize, 0 );
140  itemBoxSizer3->Add(itemStaticText4, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
141 
142  m_Text = new wxTextCtrl(itemDialog1, ID_LDTEXT, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_PROCESS_ENTER);
143  itemBoxSizer3->Add(m_Text, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5);
144 
145  wxBoxSizer* itemBoxSizer6 = new wxBoxSizer(wxHORIZONTAL);
146  itemBoxSizer2->Add(itemBoxSizer6, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
147 
148  wxButton* itemButton7 = new wxButton( itemDialog1, wxID_OK, _("Retrieve"), wxDefaultPosition, wxDefaultSize, 0 );
149  itemButton7->Enable(false);
150  itemBoxSizer6->Add(itemButton7, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
151 
152  wxButton* itemButton8 = new wxButton( itemDialog1, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
153  itemBoxSizer6->Add(itemButton8, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
154 
155 ////@end CLoadSeqFromEntrez_dlg content construction
156 }
157 
159 {
160  return ToStdString(m_Text->GetValue());
161 }
162 
163 void CLoadSeqFromEntrez_dlg::OnTextChange(wxUpdateUIEvent& event)
164 {
165  bool enable = (m_Text->IsEmpty()) ? false : true;
166  event.Enable(enable);
167 }
168 
169 void CLoadSeqFromEntrez_dlg::OnTextCtrlEnter(wxCommandEvent& event)
170 {
171  EndModal(wxID_OK);
172 }
173 
174 /*!
175  * Should we show tooltips?
176  */
177 
179 {
180  return true;
181 }
182 
183 /*!
184  * Get bitmap resources
185  */
186 
187 wxBitmap CLoadSeqFromEntrez_dlg::GetBitmapResource( const wxString& name )
188 {
189  // Bitmap retrieval
190 ////@begin CLoadSeqFromEntrez_dlg bitmap retrieval
191  wxUnusedVar(name);
192  return wxNullBitmap;
193 ////@end CLoadSeqFromEntrez_dlg bitmap retrieval
194 }
195 
196 /*!
197  * Get icon resources
198  */
199 
200 wxIcon CLoadSeqFromEntrez_dlg::GetIconResource( const wxString& name )
201 {
202  // Icon retrieval
203 ////@begin CLoadSeqFromEntrez_dlg icon retrieval
204  wxUnusedVar(name);
205  return wxNullIcon;
206 ////@end CLoadSeqFromEntrez_dlg icon retrieval
207 }
208 
209 
EVT_UPDATE_UI(eCmdAlnShowMethodsDlg, CAlnMultiWidget::OnUpdateShowMethodDlg) EVT_UPDATE_UI(eCmdMethodProperties
void Init()
Initialises member variables.
void OnTextChange(wxUpdateUIEvent &event)
wxEVT_UPDATE_UI event handler for wxID_OK
bool Create(wxWindow *parent, wxWindowID id=ID_CLOADSEQFROMENTREZ_DLG, const wxString &caption=_("Download From Entrez"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
static bool ShowToolTips()
Should we show tooltips?
void OnTextCtrlEnter(wxCommandEvent &event)
CLoadSeqFromEntrez_dlg()
Constructors.
void CreateControls()
Creates the controls and sizers.
#define _(proto)
Definition: ct_nlmzip_i.h:78
static void Init(void)
Definition: cursor6.c:76
#define NULL
Definition: ncbistd.hpp:225
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
END_EVENT_TABLE()
USING_SCOPE(objects)
const struct ncbi::grid::netcache::search::fields::SIZE size
string ToStdString(const wxString &s)
Definition: wx_utils.hpp:161
Modified on Fri Sep 20 14:58:13 2024 by modify_doxy.py rev. 669887