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

Go to the SVN repository for this file.

1 /* $Id: dbxref_name_panel.cpp 33539 2015-08-11 16:07:13Z 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>
33 #include <wx/sizer.h>
34 #include <wx/stattext.h>
35 #include <wx/textctrl.h>
36 
38 
39 /*!
40  * CDbxrefNamePanel type definition
41  */
42 
43 IMPLEMENT_DYNAMIC_CLASS( CDbxrefNamePanel, CFieldNamePanel )
44 
45 
46 /*!
47  * CDbxrefNamePanel event table definition
48  */
49 
50 BEGIN_EVENT_TABLE( CDbxrefNamePanel, CFieldNamePanel )
51 
52 ////@begin CDbxrefNamePanel event table entries
53 ////@end CDbxrefNamePanel event table entries
54 
56 
57 
58 /*!
59  * CDbxrefNamePanel constructors
60  */
61 
63 {
64  Init();
65 }
66 
67 CDbxrefNamePanel::CDbxrefNamePanel( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
68 {
69  Init();
70  Create(parent, id, pos, size, style);
71 }
72 
73 
74 /*!
75  * CDbxrefNamePanel creator
76  */
77 
78 bool CDbxrefNamePanel::Create( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
79 {
80 ////@begin CDbxrefNamePanel creation
81  CFieldNamePanel::Create( parent, id, pos, size, style );
82 
84  if (GetSizer())
85  {
86  GetSizer()->SetSizeHints(this);
87  }
88  Centre();
89 ////@end CDbxrefNamePanel creation
90  return true;
91 }
92 
93 
94 /*!
95  * CDbxrefNamePanel destructor
96  */
97 
99 {
100 ////@begin CDbxrefNamePanel destruction
101 ////@end CDbxrefNamePanel destruction
102 }
103 
104 
105 /*!
106  * Member initialisation
107  */
108 
110 {
111 ////@begin CDbxrefNamePanel member initialisation
112  m_DbName = NULL;
113 ////@end CDbxrefNamePanel member initialisation
114 }
115 
116 
117 /*!
118  * Control creation for CDbxrefNamePanel
119  */
120 
122 {
123 ////@begin CDbxrefNamePanel content construction
124  CDbxrefNamePanel* itemCFieldNamePanel1 = this;
125 
126  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
127  itemCFieldNamePanel1->SetSizer(itemBoxSizer2);
128 
129  wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
130  itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
131 
132  wxStaticText* itemStaticText4 = new wxStaticText( itemCFieldNamePanel1, wxID_STATIC, _("Db:"), wxDefaultPosition, wxDefaultSize, 0 );
133  itemBoxSizer3->Add(itemStaticText4, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
134 
135  m_DbName = new wxTextCtrl( itemCFieldNamePanel1, ID_TXTCTRl_DBXREF, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
136  itemBoxSizer3->Add(m_DbName, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
137 
138 ////@end CDbxrefNamePanel content construction
139 }
140 
141 
142 /*!
143  * Should we show tooltips?
144  */
145 
147 {
148  return true;
149 }
150 
151 /*!
152  * Get bitmap resources
153  */
154 
155 wxBitmap CDbxrefNamePanel::GetBitmapResource( const wxString& name )
156 {
157  // Bitmap retrieval
158 ////@begin CDbxrefNamePanel bitmap retrieval
159  wxUnusedVar(name);
160  return wxNullBitmap;
161 ////@end CDbxrefNamePanel bitmap retrieval
162 }
163 
164 /*!
165  * Get icon resources
166  */
167 
168 wxIcon CDbxrefNamePanel::GetIconResource( const wxString& name )
169 {
170  // Icon retrieval
171 ////@begin CDbxrefNamePanel icon retrieval
172  wxUnusedVar(name);
173  return wxNullIcon;
174 ////@end CDbxrefNamePanel icon retrieval
175 }
176 
177 string CDbxrefNamePanel::GetFieldName(const bool subfield)
178 {
179  return "Dbxref " + ToStdString(m_DbName->GetValue());
180 }
181 
182 
183 bool CDbxrefNamePanel::SetFieldName(const string& field)
184 {
185  return true;
186 }
187 
188 
virtual string GetFieldName(const bool subfield=false)
Returns the name of the field as selected in the panel.
void Init()
Initialises member variables.
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
CDbxrefNamePanel()
Constructors.
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
static bool ShowToolTips()
Should we show tooltips?
void CreateControls()
Creates the controls and sizers.
virtual bool SetFieldName(const string &field)
bool Create(wxWindow *parent, wxWindowID id=ID_CDBXREFNAMEPANEL, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxTAB_TRAVERSAL)
Creation.
~CDbxrefNamePanel()
Destructor.
#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()
const struct ncbi::grid::netcache::search::fields::SIZE size
string ToStdString(const wxString &s)
Definition: wx_utils.hpp:161
Modified on Fri Mar 01 10:07:18 2024 by modify_doxy.py rev. 669887