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

Go to the SVN repository for this file.

1 /* $Id: book_panel.cpp 24374 2011-09-19 20:45:11Z katargir $
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: Roman Katargin
27  */
28 
29 
30 #include <ncbi_pch.hpp>
32 
34 
35 #include <wx/sizer.h>
36 #include <wx/bitmap.h>
37 #include <wx/icon.h>
38 #include <wx/stattext.h>
39 #include <wx/textctrl.h>
40 
41 ////@begin includes
42 ////@end includes
43 ////@begin includes
44 ////@end includes
45 
46 #include "book_panel.hpp"
47 
50 
51 ////@begin XPM images
52 ////@end XPM images
53 
54 
55 /*
56  * CBookPanel type definition
57  */
58 
59 IMPLEMENT_DYNAMIC_CLASS( CBookPanel, wxPanel )
60 
61 
62 /*
63  * CBookPanel event table definition
64  */
65 
66 BEGIN_EVENT_TABLE( CBookPanel, wxPanel )
67 
68 ////@begin CBookPanel event table entries
69 ////@end CBookPanel event table entries
70 
72 
73 
74 /*
75  * CBookPanel constructors
76  */
77 
79 {
80  Init();
81 }
82 
83 CBookPanel::CBookPanel( wxWindow* parent, CSerialObject& object, objects::CScope& scope,
84  wxWindowID id, const wxPoint& pos, const wxSize& size, long style ) :
85  m_Object(0)
86 {
87  Init();
88  m_Object = dynamic_cast<CSeq_feat*>(&object);
89  Create(parent, id, pos, size, style);
90 }
91 
92 
93 /*
94  * CBookPanel creator
95  */
96 
97 bool CBookPanel::Create( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
98 {
99 ////@begin CBookPanel creation
100  SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
101  wxPanel::Create( parent, id, pos, size, style );
102 
103  CreateControls();
104  if (GetSizer())
105  {
106  GetSizer()->SetSizeHints(this);
107  }
108  Centre();
109 ////@end CBookPanel creation
110  return true;
111 }
112 
113 
114 /*
115  * CBookPanel destructor
116  */
117 
119 {
120 ////@begin CBookPanel destruction
121 ////@end CBookPanel destruction
122 }
123 
124 
125 /*
126  * Member initialisation
127  */
128 
130 {
131 ////@begin CBookPanel member initialisation
132 ////@end CBookPanel member initialisation
133 }
134 
135 
136 /*
137  * Control creation for CBookPanel
138  */
139 
141 {
142 ////@begin CBookPanel content construction
143  CBookPanel* itemPanel1 = this;
144 
145  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
146  itemPanel1->SetSizer(itemBoxSizer2);
147 
148  wxFlexGridSizer* itemFlexGridSizer3 = new wxFlexGridSizer(0, 2, 0, 0);
149  itemBoxSizer2->Add(itemFlexGridSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
150 
151  wxStaticText* itemStaticText4 = new wxStaticText( itemPanel1, wxID_STATIC, _("Book Title"), wxDefaultPosition, wxDefaultSize, 0 );
152  itemFlexGridSizer3->Add(itemStaticText4, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
153 
154  wxTextCtrl* itemTextCtrl5 = new wxTextCtrl( itemPanel1, ID_BOOK_TITLE, wxEmptyString, wxDefaultPosition, wxSize(400, -1), wxTE_MULTILINE );
155  itemFlexGridSizer3->Add(itemTextCtrl5, 0, wxGROW|wxALIGN_CENTER_VERTICAL|wxALL, 5);
156 
157  wxStaticText* itemStaticText6 = new wxStaticText( itemPanel1, wxID_STATIC, _("Publication Year"), wxDefaultPosition, wxDefaultSize, 0 );
158  itemFlexGridSizer3->Add(itemStaticText6, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
159 
160  wxTextCtrl* itemTextCtrl7 = new wxTextCtrl( itemPanel1, ID_BOOK_PUB_YEAR, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
161  itemFlexGridSizer3->Add(itemTextCtrl7, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
162 
163  wxStaticText* itemStaticText8 = new wxStaticText( itemPanel1, wxID_STATIC, _("Copyright Year"), wxDefaultPosition, wxDefaultSize, 0 );
164  itemFlexGridSizer3->Add(itemStaticText8, 0, wxALIGN_RIGHT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
165 
166  wxTextCtrl* itemTextCtrl9 = new wxTextCtrl( itemPanel1, ID_BOOK_COPY_YEAR, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0 );
167  itemFlexGridSizer3->Add(itemTextCtrl9, 0, wxALIGN_LEFT|wxALIGN_CENTER_VERTICAL|wxALL, 5);
168 
169 ////@end CBookPanel content construction
170 }
171 
172 
173 /*
174  * Should we show tooltips?
175  */
176 
178 {
179  return true;
180 }
181 
182 /*
183  * Get bitmap resources
184  */
185 
186 wxBitmap CBookPanel::GetBitmapResource( const wxString& name )
187 {
188  // Bitmap retrieval
189 ////@begin CBookPanel bitmap retrieval
190  wxUnusedVar(name);
191  return wxNullBitmap;
192 ////@end CBookPanel bitmap retrieval
193 }
194 
195 /*
196  * Get icon resources
197  */
198 
199 wxIcon CBookPanel::GetIconResource( const wxString& name )
200 {
201  // Icon retrieval
202 ////@begin CBookPanel icon retrieval
203  wxUnusedVar(name);
204  return wxNullIcon;
205 ////@end CBookPanel icon retrieval
206 }
USING_SCOPE(objects)
#define ID_BOOK_TITLE
Definition: book_panel.hpp:64
#define ID_BOOK_COPY_YEAR
Definition: book_panel.hpp:66
#define ID_BOOK_PUB_YEAR
Definition: book_panel.hpp:65
void Init()
Initialises member variables.
Definition: book_panel.cpp:129
CBookPanel()
Constructors.
Definition: book_panel.cpp:78
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
Definition: book_panel.cpp:186
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
Definition: book_panel.cpp:199
~CBookPanel()
Destructor.
Definition: book_panel.cpp:118
bool Create(wxWindow *parent, wxWindowID id=10055, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxTAB_TRAVERSAL)
Creation.
Definition: book_panel.cpp:97
static bool ShowToolTips()
Should we show tooltips?
Definition: book_panel.cpp:177
void CreateControls()
Creates the controls and sizers.
Definition: book_panel.cpp:140
CSerialObject * m_Object
Definition: book_panel.hpp:120
namespace ncbi::objects::
Definition: Seq_feat.hpp:58
Base class for all serializable objects.
Definition: serialbase.hpp:150
#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
END_EVENT_TABLE()
const struct ncbi::grid::netcache::search::fields::SIZE size
Modified on Sun Mar 03 03:10:02 2024 by modify_doxy.py rev. 669887