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

Go to the SVN repository for this file.

1 /* $Id: gbqualtext_panel.cpp 35729 2016-06-15 20:31:00Z 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: Colleen Bollin
27  */
28 
29 
30 #include <ncbi_pch.hpp>
32 
33 ////@begin includes
34 ////@end includes
35 
36 #include "gbqualtext_panel.hpp"
37 
38 ////@begin XPM images
39 ////@end XPM images
40 
42 
43 /*!
44  * CGBQualTextPanel type definition
45  */
46 
47 IMPLEMENT_DYNAMIC_CLASS( CGBQualTextPanel, CFormattedQualPanel )
48 
49 
50 /*!
51  * CGBQualTextPanel event table definition
52  */
53 
54 BEGIN_EVENT_TABLE( CGBQualTextPanel, CFormattedQualPanel )
55 
56 ////@begin CGBQualTextPanel event table entries
57 ////@end CGBQualTextPanel event table entries
58 
60 
61 
62 /*!
63  * CGBQualTextPanel constructors
64  */
65 
67 {
68  Init();
69 }
70 
71 CGBQualTextPanel::CGBQualTextPanel( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
72 {
73  Init();
74  Create(parent, id, caption, pos, size, style);
75 }
76 
77 
78 /*!
79  * CGBQualTextPanel creator
80  */
81 
82 bool CGBQualTextPanel::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
83 {
84 ////@begin CGBQualTextPanel creation
85  SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
86  CFormattedQualPanel::Create( parent, id, pos, size, style );
87 
89  if (GetSizer())
90  {
91  GetSizer()->SetSizeHints(this);
92  }
93  Centre();
94 ////@end CGBQualTextPanel creation
95  return true;
96 }
97 
98 
99 /*!
100  * CGBQualTextPanel destructor
101  */
102 
104 {
105 ////@begin CGBQualTextPanel destruction
106 ////@end CGBQualTextPanel destruction
107 }
108 
109 
110 /*!
111  * Member initialisation
112  */
113 
115 {
116 ////@begin CGBQualTextPanel member initialisation
117  m_theValue = NULL;
118 ////@end CGBQualTextPanel member initialisation
119 }
120 
121 
122 /*!
123  * Control creation for CGBQualTextPanel
124  */
125 
127 {
128 ////@begin CGBQualTextPanel content construction
129  CGBQualTextPanel* itemCFormattedQualPanel1 = this;
130 
131  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
132  itemCFormattedQualPanel1->SetSizer(itemBoxSizer2);
133 
134  m_theValue = new wxTextCtrl( itemCFormattedQualPanel1, ID_TEXTCTRL, wxEmptyString, wxDefaultPosition, wxSize(280, -1), 0 );
135  itemBoxSizer2->Add(m_theValue, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 0);
136 
137 ////@end CGBQualTextPanel content construction
138 }
139 
140 
142 {
143  m_theValue->SetValue (ncbi::ToWxString(val));
144 }
145 
146 
148 {
149  string val = ncbi::ToStdString(m_theValue->GetValue());
150  return val;
151 }
152 
153 
154 /*!
155  * Should we show tooltips?
156  */
157 
159 {
160  return true;
161 }
162 
163 /*!
164  * Get bitmap resources
165  */
166 
167 wxBitmap CGBQualTextPanel::GetBitmapResource( const wxString& name )
168 {
169  // Bitmap retrieval
170 ////@begin CGBQualTextPanel bitmap retrieval
171  wxUnusedVar(name);
172  return wxNullBitmap;
173 ////@end CGBQualTextPanel bitmap retrieval
174 }
175 
176 /*!
177  * Get icon resources
178  */
179 
180 wxIcon CGBQualTextPanel::GetIconResource( const wxString& name )
181 {
182  // Icon retrieval
183 ////@begin CGBQualTextPanel icon retrieval
184  wxUnusedVar(name);
185  return wxNullIcon;
186 ////@end CGBQualTextPanel icon retrieval
187 }
188 
190 
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
~CGBQualTextPanel()
Destructor.
CGBQualTextPanel()
Constructors.
void Init()
Initialises member variables.
wxTextCtrl * m_theValue
virtual string GetValue()
virtual void SetValue(string val)
bool Create(wxWindow *parent, wxWindowID id=ID_CGBQUALTEXTPANEL, const wxString &caption=_("GBQualText Panel"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, -1), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
void CreateControls()
Creates the controls and sizers.
static bool ShowToolTips()
Should we show tooltips?
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
wxString ToWxString(const string &s)
Definition: wx_utils.hpp:173
string ToStdString(const wxString &s)
Definition: wx_utils.hpp:161
Modified on Sun Mar 03 03:11:56 2024 by modify_doxy.py rev. 669887