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

Go to the SVN repository for this file.

1 /* $Id: inpressref_panel.cpp 42780 2019-04-11 16:35:17Z 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>
32 
33 #include <wx/sizer.h>
34 #include <wx/textctrl.h>
35 #include <wx/stattext.h>
36 #include <wx/button.h>
37 #include <wx/icon.h>
38 
40 
41 /*
42  * CInPressRefPanel type definition
43  */
44 
45 IMPLEMENT_DYNAMIC_CLASS( CInPressRefPanel, wxPanel )
46 
47 
48 /*
49  * CInPressRefPanel event table definition
50  */
51 
52 BEGIN_EVENT_TABLE( CInPressRefPanel, wxPanel )
53 
54 ////@begin CInPressRefPanel event table entries
55  EVT_BUTTON( ID_PMIDLOOKBTN, CInPressRefPanel::OnLookupClick )
56 ////@end CInPressRefPanel event table entries
57 
59 
60 
61 /*
62  * CInPressRefPanel constructors
63  */
64 
66 {
67  Init();
68 }
69 
70 CInPressRefPanel::CInPressRefPanel( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
71 {
72  Init();
73  Create(parent, id, pos, size, style);
74 }
75 
76 
77 /*
78  * CInPressRefPanel creator
79  */
80 
81 bool CInPressRefPanel::Create( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
82 {
83 ////@begin CInPressRefPanel creation
84  SetExtraStyle(wxWS_EX_VALIDATE_RECURSIVELY);
85  wxPanel::Create( parent, id, pos, size, style );
86 
88  if (GetSizer())
89  {
90  GetSizer()->SetSizeHints(this);
91  }
92  Centre();
93 ////@end CInPressRefPanel creation
94  return true;
95 }
96 
97 
98 /*
99  * CInPressRefPanel destructor
100  */
101 
103 {
104 ////@begin CInPressRefPanel destruction
105 ////@end CInPressRefPanel destruction
106 }
107 
108 
109 /*
110  * Member initialisation
111  */
112 
114 {
115 ////@begin CInPressRefPanel member initialisation
116  m_PubMedID = NULL;
119  m_YearCtrl = NULL;
120  m_VolCtrl = NULL;
121  m_IssueCtrl = NULL;
124 ////@end CInPressRefPanel member initialisation
125 }
126 
127 
128 /*
129  * Control creation for CInPressRefPanel
130  */
131 
133 {
134 ////@begin CInPressRefPanel content construction
135  CInPressRefPanel* itemPanel1 = this;
136 
137  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
138  itemPanel1->SetSizer(itemBoxSizer2);
139 
140  wxBoxSizer* itemBoxSizer1 = new wxBoxSizer(wxHORIZONTAL);
141  itemBoxSizer2->Add(itemBoxSizer1, 0, wxALIGN_LEFT|wxALL, 0);
142 
143  wxStaticText* itemStaticText2 = new wxStaticText( itemPanel1, wxID_STATIC, _("PubMed ID"), wxDefaultPosition, wxDefaultSize, 0 );
144  itemBoxSizer1->Add(itemStaticText2, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5);
145 
146  m_PubMedID = new wxTextCtrl( itemPanel1, ID_PMIDTEXTCTRL, wxEmptyString, wxDefaultPosition, wxSize(100, -1), 0 );
147  itemBoxSizer1->Add(m_PubMedID, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5);
148 
149  wxButton* itemButton4 = new wxButton( itemPanel1, ID_PMIDLOOKBTN, _("Lookup"), wxDefaultPosition, wxDefaultSize, 0 );
150  itemBoxSizer1->Add(itemButton4, 0, wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5);
151 
152  wxFlexGridSizer* itemFlexGridSizer1 = new wxFlexGridSizer(0, 2, 0, 0);
153  itemBoxSizer2->Add(itemFlexGridSizer1, 0, wxGROW|wxALL, 0);
154 
155  wxStaticText* itemStaticText3 = new wxStaticText( itemPanel1, wxID_STATIC, _("Reference title*"), wxDefaultPosition, wxDefaultSize, 0 );
156  itemFlexGridSizer1->Add(itemStaticText3, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5);
157 
158  wxStaticText* itemStaticText4 = new wxStaticText( itemPanel1, wxID_STATIC, _("Journal title*"), wxDefaultPosition, wxDefaultSize, 0 );
159  itemFlexGridSizer1->Add(itemStaticText4, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5);
160 
161  m_ReferenceTitle = new wxTextCtrl( itemPanel1, ID_INPREFTITLE, wxEmptyString, wxDefaultPosition, wxSize(200, -1), 0 );
162  itemFlexGridSizer1->Add(m_ReferenceTitle, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5);
163 
164  m_JournalTitle = new wxTextCtrl( itemPanel1, ID_INPJOURNAL, wxEmptyString, wxDefaultPosition, wxSize(200, -1), 0 );
165  itemFlexGridSizer1->Add(m_JournalTitle, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5);
166 
167  wxFlexGridSizer* itemFlexGridSizer2 = new wxFlexGridSizer(0, 5, 0, 0);
168  itemBoxSizer2->Add(itemFlexGridSizer2, 0, wxGROW|wxALL, 0);
169 
170  wxStaticText* itemStaticText5 = new wxStaticText( itemPanel1, wxID_STATIC, _("Year*"), wxDefaultPosition, wxDefaultSize, 0 );
171  itemFlexGridSizer2->Add(itemStaticText5, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5);
172 
173  wxStaticText* itemStaticText6 = new wxStaticText( itemPanel1, wxID_STATIC, _("Volume"), wxDefaultPosition, wxDefaultSize, 0 );
174  itemFlexGridSizer2->Add(itemStaticText6, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5);
175 
176  wxStaticText* itemStaticText7 = new wxStaticText( itemPanel1, wxID_STATIC, _("Issue"), wxDefaultPosition, wxDefaultSize, 0 );
177  itemFlexGridSizer2->Add(itemStaticText7, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5);
178 
179  wxStaticText* itemStaticText8 = new wxStaticText( itemPanel1, wxID_STATIC, _("Pages from"), wxDefaultPosition, wxDefaultSize, 0 );
180  itemFlexGridSizer2->Add(itemStaticText8, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5);
181 
182  wxStaticText* itemStaticText9 = new wxStaticText( itemPanel1, wxID_STATIC, _("Pages to"), wxDefaultPosition, wxDefaultSize, 0 );
183  itemFlexGridSizer2->Add(itemStaticText9, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxLEFT|wxRIGHT|wxTOP, 5);
184 
185  m_YearCtrl = new wxTextCtrl( itemPanel1, ID_INPYEAR, wxEmptyString, wxDefaultPosition, wxSize(40, -1), 0 );
186  itemFlexGridSizer2->Add(m_YearCtrl, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
187 
188  m_VolCtrl = new wxTextCtrl( itemPanel1, ID_INPVOL, wxEmptyString, wxDefaultPosition, wxSize(40, -1), 0 );
189  itemFlexGridSizer2->Add(m_VolCtrl, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
190 
191  m_IssueCtrl = new wxTextCtrl( itemPanel1, ID_INPISSUE, wxEmptyString, wxDefaultPosition, wxSize(40, -1), 0 );
192  itemFlexGridSizer2->Add(m_IssueCtrl, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
193 
194  m_PagesFromCtrl = new wxTextCtrl( itemPanel1, ID_INPPAGESFROM, wxEmptyString, wxDefaultPosition, wxSize(40, -1), 0 );
195  itemFlexGridSizer2->Add(m_PagesFromCtrl, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
196 
197  m_PagesToCtrl = new wxTextCtrl( itemPanel1, ID_INPPAGESTO, wxEmptyString, wxDefaultPosition, wxSize(40, -1), 0 );
198  itemFlexGridSizer2->Add(m_PagesToCtrl, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
199 
200 ////@end CInPressRefPanel content construction
201 }
202 
203 
204 /*
205  * Should we show tooltips?
206  */
207 
209 {
210  return true;
211 }
212 
213 /*
214  * Get bitmap resources
215  */
216 
217 wxBitmap CInPressRefPanel::GetBitmapResource( const wxString& name )
218 {
219  // Bitmap retrieval
220 ////@begin CInPressRefPanel bitmap retrieval
221  wxUnusedVar(name);
222  return wxNullBitmap;
223 ////@end CInPressRefPanel bitmap retrieval
224 }
225 
226 /*
227  * Get icon resources
228  */
229 
230 wxIcon CInPressRefPanel::GetIconResource( const wxString& name )
231 {
232  // Icon retrieval
233 ////@begin CInPressRefPanel icon retrieval
234  wxUnusedVar(name);
235  return wxNullIcon;
236 ////@end CInPressRefPanel icon retrieval
237 }
238 
239 /*
240  * wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_PMIDLOOKBTN
241  */
242 
243 void CInPressRefPanel::OnLookupClick( wxCommandEvent& event )
244 {
245 
246 }
247 
249 
wxTextCtrl * m_PagesFromCtrl
void Init()
Initialises member variables.
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
static bool ShowToolTips()
Should we show tooltips?
bool Create(wxWindow *parent, wxWindowID id=ID_CINPRESSREFPANEL, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxTAB_TRAVERSAL)
Creation.
~CInPressRefPanel()
Destructor.
wxTextCtrl * m_ReferenceTitle
wxTextCtrl * m_VolCtrl
void OnLookupClick(wxCommandEvent &event)
wxEVT_COMMAND_BUTTON_CLICKED event handler for ID_PMIDLOOKBTN
wxTextCtrl * m_YearCtrl
CInPressRefPanel()
Constructors.
wxTextCtrl * m_PubMedID
wxTextCtrl * m_IssueCtrl
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
wxTextCtrl * m_JournalTitle
void CreateControls()
Creates the controls and sizers.
wxTextCtrl * m_PagesToCtrl
#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
Modified on Sun Mar 03 03:13:49 2024 by modify_doxy.py rev. 669887