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

Go to the SVN repository for this file.

1 /* $Id: gbqualdirection_panel.cpp 25028 2012-01-12 17:26:13Z 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: Colleen Bollin
27  */
28 
29 
30 #include <ncbi_pch.hpp>
32 ////@begin includes
33 ////@end includes
34 
36 
37 ////@begin XPM images
38 ////@end XPM images
39 
41 
42 /*!
43  * CGBQualDirectionPanel type definition
44  */
45 
46 IMPLEMENT_DYNAMIC_CLASS( CGBQualDirectionPanel, CFormattedQualPanel )
47 
48 
49 /*!
50  * CGBQualDirectionPanel event table definition
51  */
52 
53 BEGIN_EVENT_TABLE( CGBQualDirectionPanel, CFormattedQualPanel )
54 
55 ////@begin CGBQualDirectionPanel event table entries
56 ////@end CGBQualDirectionPanel event table entries
57 
59 
60 
61 /*!
62  * CGBQualDirectionPanel constructors
63  */
64 
66 {
67  Init();
68 }
69 
70 CGBQualDirectionPanel::CGBQualDirectionPanel( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
71 {
72  Init();
73  Create(parent, id, caption, pos, size, style);
74 }
75 
76 
77 /*!
78  * CGBQualDirectionPanel creator
79  */
80 
81 bool CGBQualDirectionPanel::Create( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
82 {
83 ////@begin CGBQualDirectionPanel creation
84  SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
85  CFormattedQualPanel::Create( parent, id, pos, size, style );
86 
88  if (GetSizer())
89  {
90  GetSizer()->SetSizeHints(this);
91  }
92  Centre();
93 ////@end CGBQualDirectionPanel creation
94  return true;
95 }
96 
97 
98 /*!
99  * CGBQualDirectionPanel destructor
100  */
101 
103 {
104 ////@begin CGBQualDirectionPanel destruction
105 ////@end CGBQualDirectionPanel destruction
106 }
107 
108 
109 /*!
110  * Member initialisation
111  */
112 
114 {
115 ////@begin CGBQualDirectionPanel member initialisation
117 ////@end CGBQualDirectionPanel member initialisation
118 }
119 
120 
121 /*!
122  * Control creation for CGBQualDirectionPanel
123  */
124 
126 {
127 ////@begin CGBQualDirectionPanel content construction
128  CGBQualDirectionPanel* itemCFormattedQualPanel1 = this;
129 
130  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
131  itemCFormattedQualPanel1->SetSizer(itemBoxSizer2);
132 
133  wxArrayString m_DirectionCtrlStrings;
134  m_DirectionCtrlStrings.Add(wxEmptyString);
135  m_DirectionCtrlStrings.Add(_("LEFT"));
136  m_DirectionCtrlStrings.Add(_("RIGHT"));
137  m_DirectionCtrlStrings.Add(_("BOTH"));
138  m_DirectionCtrl = new wxChoice( itemCFormattedQualPanel1, ID_CHOICE4, wxDefaultPosition, wxDefaultSize, m_DirectionCtrlStrings, 0 );
139  itemBoxSizer2->Add(m_DirectionCtrl, 0, wxALIGN_LEFT|wxALL, 5);
140 
141 ////@end CGBQualDirectionPanel content construction
142 }
143 
144 
146 {
147  string tmp = NStr::ToUpper(val);
148  if (!m_DirectionCtrl->SetStringSelection (ToWxString(tmp))) {
149  m_DirectionCtrl->Append(ToWxString(val));
150  m_DirectionCtrl->SetStringSelection (ToWxString(val));
151  }
152 }
153 
154 
156 {
157  string val = ToStdString(m_DirectionCtrl->GetStringSelection());
158  return val;
159 }
160 
161 
162 /*!
163  * Should we show tooltips?
164  */
165 
167 {
168  return true;
169 }
170 
171 /*!
172  * Get bitmap resources
173  */
174 
175 wxBitmap CGBQualDirectionPanel::GetBitmapResource( const wxString& name )
176 {
177  // Bitmap retrieval
178 ////@begin CGBQualDirectionPanel bitmap retrieval
179  wxUnusedVar(name);
180  return wxNullBitmap;
181 ////@end CGBQualDirectionPanel bitmap retrieval
182 }
183 
184 /*!
185  * Get icon resources
186  */
187 
188 wxIcon CGBQualDirectionPanel::GetIconResource( const wxString& name )
189 {
190  // Icon retrieval
191 ////@begin CGBQualDirectionPanel icon retrieval
192  wxUnusedVar(name);
193  return wxNullIcon;
194 ////@end CGBQualDirectionPanel icon retrieval
195 }
196 
static bool ShowToolTips()
Should we show tooltips?
CGBQualDirectionPanel()
Constructors.
void CreateControls()
Creates the controls and sizers.
virtual void SetValue(string val)
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
void Init()
Initialises member variables.
bool Create(wxWindow *parent, wxWindowID id=ID_CGBQUALDIRECTIONPANEL, const wxString &caption=_("GBQualDirectionPanel"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
#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
static string & ToUpper(string &str)
Convert string to upper case – string& version.
Definition: ncbistr.cpp:424
END_EVENT_TABLE()
const struct ncbi::grid::netcache::search::fields::SIZE size
static char tmp[2048]
Definition: utf8.c:42
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:12:26 2024 by modify_doxy.py rev. 669887