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

Go to the SVN repository for this file.

1 /* $Id: locus_tag_euk_dlg.cpp 43444 2019-07-01 15:47:55Z filippov $
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: Igor Filippov
27  */
28 
29 
30 #include <ncbi_pch.hpp>
32 
33 #include <wx/sizer.h>
34 #include <wx/stattext.h>
35 #include <wx/button.h>
36 
37 
38 
40 /*!
41  * CLocusTagEukDlg type definition
42  */
43 
44 IMPLEMENT_DYNAMIC_CLASS( CLocusTagEukDlg, wxDialog )
45 
46 
47 /*!
48  * CLocusTagEukDlg event table definition
49  */
50 
51 BEGIN_EVENT_TABLE( CLocusTagEukDlg, wxDialog )
52 
53 ////@begin CLocusTagEukDlg event table entries
54 
55 ////@end CLocusTagEukDlg event table entries
56 
58 
59 
60 /*!
61  * CLocusTagEukDlg constructors
62  */
63 
65 {
66  Init();
67 }
68 
69 CLocusTagEukDlg::CLocusTagEukDlg( wxWindow* parent, const string &locus_tag,
70  wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style)
71  : m_locus_tag_value(locus_tag)
72 {
73  Init();
74  Create(parent, id, caption, pos, size, style);
75 }
76 
77 
78 /*!
79  * CLocusTagEukDlg creator
80  */
81 
82 bool CLocusTagEukDlg::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
83 {
84 ////@begin CLocusTagEukDlg creation
85  SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
86  wxDialog::Create( parent, id, caption, pos, size, style );
87 
89  if (GetSizer())
90  {
91  GetSizer()->SetSizeHints(this);
92  }
93  Centre();
94 ////@end CLocusTagEukDlg creation
95  return true;
96 }
97 
98 
99 /*!
100  * CLocusTagEukDlg destructor
101  */
102 
104 {
105 ////@begin CLocusTagEukDlg destruction
106 ////@end CLocusTagEukDlg destruction
107 }
108 
109 
110 /*!
111  * Member initialisation
112  */
113 
115 {
116 ////@begin CLocusTagEukDlg member initialisation
117  m_LocusTag = nullptr;
118  m_Euk = nullptr;
119 ////@end CLocusTagEukDlg member initialisation
120 }
121 
122 /*!
123  * Control creation for CLocusTagEukDlg
124  */
125 
126 
128 {
129 ////@begin CLocusTagEukDlg content construction
130  CLocusTagEukDlg* itemDialog1 = this;
131 
132  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
133  itemDialog1->SetSizer(itemBoxSizer2);
134 
135  wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
136  itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_LEFT|wxALL, 2);
137 
138  wxStaticText* itemStaticText3 = new wxStaticText( itemDialog1, wxID_STATIC, _("Locus-tag"), wxDefaultPosition, wxDefaultSize, 0 );
139  itemBoxSizer3->Add(itemStaticText3, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
140 
141  m_LocusTag = new wxTextCtrl( itemDialog1, ID_LOCUS_TAG_EUK_TXT, wxString(m_locus_tag_value), wxDefaultPosition, wxDefaultSize, 0 );
142  itemBoxSizer3->Add(m_LocusTag, 0, wxALIGN_CENTER_VERTICAL|wxALL, 2);
143  if (!m_locus_tag_value.empty())
144  m_LocusTag->Disable();
145 
146  wxArrayString EukProkTypes;
147  EukProkTypes.Add(_("Eukaryotes"));
148  EukProkTypes.Add(_("Prokaryotes"));
149  m_Euk = new wxRadioBox(itemDialog1, ID_LOCUS_TAG_EUK_CHK, wxEmptyString, wxDefaultPosition, wxDefaultSize, EukProkTypes, 1, wxRA_SPECIFY_ROWS);
150  m_Euk->SetSelection(0);
151  itemBoxSizer2->Add(m_Euk, 0, wxALIGN_CENTER_HORIZONTAL | wxLEFT | wxRIGHT, 5);
152 
153  wxBoxSizer* itemBoxSizer18 = new wxBoxSizer(wxHORIZONTAL);
154  itemBoxSizer2->Add(itemBoxSizer18, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 2);
155 
156  wxButton* itemButton19 = new wxButton( itemDialog1, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 );
157  itemBoxSizer18->Add(itemButton19, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
158 
159  wxButton* itemButton20 = new wxButton( itemDialog1, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
160  itemBoxSizer18->Add(itemButton20, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
161 
162 ////@end CLocusTagEukDlg content construction
163 }
164 
165 
166 /*!
167  * Should we show tooltips?
168  */
169 
171 {
172  return true;
173 }
174 
175 /*!
176  * Get bitmap resources
177  */
178 
179 wxBitmap CLocusTagEukDlg::GetBitmapResource( const wxString& name )
180 {
181  // Bitmap retrieval
182 ////@begin CLocusTagEukDlg bitmap retrieval
183  wxUnusedVar(name);
184  return wxNullBitmap;
185 ////@end CLocusTagEukDlg bitmap retrieval
186 }
187 
188 /*!
189  * Get icon resources
190  */
191 
192 wxIcon CLocusTagEukDlg::GetIconResource( const wxString& name )
193 {
194  // Icon retrieval
195 ////@begin CLocusTagEukDlg icon retrieval
196  wxUnusedVar(name);
197  return wxNullIcon;
198 ////@end CLocusTagEukDlg icon retrieval
199 }
200 
202 {
203  if (m_LocusTag->IsEnabled())
204  return m_LocusTag->GetValue().ToStdString();
205 
206  return kEmptyStr;
207 }
208 
210 
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
static bool ShowToolTips()
Should we show tooltips?
void Init()
Initialises member variables.
bool Create(wxWindow *parent, wxWindowID id=ID_LOCUS_TAG_EUK_DLG, const wxString &caption=_("Locus Tag, Euk/Prok"), 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.
CLocusTagEukDlg()
Constructors.
void CreateControls()
Creates the controls and sizers.
~CLocusTagEukDlg()
Destructor.
wxTextCtrl * m_LocusTag
#define _(proto)
Definition: ct_nlmzip_i.h:78
static void Init(void)
Definition: cursor6.c:76
#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 kEmptyStr
Definition: ncbistr.hpp:123
END_EVENT_TABLE()
const struct ncbi::grid::netcache::search::fields::SIZE size
Modified on Thu Nov 30 04:52:23 2023 by modify_doxy.py rev. 669887