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

Go to the SVN repository for this file.

1 /* $Id: rename_column_dlg.cpp 34945 2016-03-03 20:31:51Z 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: Igor Filippov
27  */
28 
29 
30 #include <ncbi_pch.hpp>
31 
32 ////@begin includes
33 ////@end includes
34 
36 
37 #include <wx/button.h>
38 
39 ////@begin XPM images
40 ////@end XPM images
41 
43 
44 
45 IMPLEMENT_DYNAMIC_CLASS( CRenameColumnDlg, wxDialog )
46 
47 
48 
49 BEGIN_EVENT_TABLE( CRenameColumnDlg, wxDialog )
50 
51 ////@begin CRenameColumnDlg event table entries
52 ////@end CRenameColumnDlg event table entries
53 
55 
56 
57 /*!
58  * CRenameColumnDlg constructors
59  */
60 
62 {
63  Init();
64 }
65 
66 CRenameColumnDlg::CRenameColumnDlg( wxWindow* parent, wxArrayString& srcModNameStrings,
67  wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
68  : m_srcModNameStrings(srcModNameStrings)
69 {
70  Init();
71  Create(parent, id, caption, pos, size, style);
72 }
73 
74 
75 /*!
76  * CRenameColumnDlg creator
77  */
78 
79 bool CRenameColumnDlg::Create( wxWindow* parent,
80  wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
81 {
82 ////@begin CRenameColumnDlg creation
83  SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
84  wxDialog::Create( parent, id, caption, pos, size, style );
85 
87  if (GetSizer())
88  {
89  GetSizer()->SetSizeHints(this);
90  }
91  Centre();
92 ////@end CRenameColumnDlg creation
93 
94  return true;
95 }
96 
97 
98 /*!
99  * CRenameColumnDlg destructor
100  */
101 
103 {
104 ////@begin CRenameColumnDlg destruction
105 ////@end CRenameColumnDlg destruction
106 }
107 
108 
109 /*!
110  * Member initialisation
111  */
112 
114 {
115 ////@begin CRenameColumnDlg member initialisation
116  m_QualList = NULL;
117 ////@end CRenameColumnDlg member initialisation
118 }
119 
120 
121 /*!
122  * Control creation for CRenameColumnDlg
123  */
124 
126 {
127 ////@begin CRenameColumnDlg content construction
128  CRenameColumnDlg* itemDialog1 = this;
129 
130  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
131  itemDialog1->SetSizer(itemBoxSizer2);
132 
133  m_QualList = new wxChoice( itemDialog1, wxID_ANY, wxDefaultPosition, wxDefaultSize, m_srcModNameStrings, 0 );
134  itemBoxSizer2->Add(m_QualList, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
135  if (!m_srcModNameStrings.IsEmpty())
136  m_QualList->SetSelection(0);
137 
138  wxBoxSizer* itemBoxSizer4 = new wxBoxSizer(wxHORIZONTAL);
139  itemBoxSizer2->Add(itemBoxSizer4, 0, wxEXPAND|wxALL, 5);
140 
141  wxButton* itemButton5 = new wxButton( itemDialog1, wxID_OK, _("Accept"), wxDefaultPosition, wxDefaultSize, 0 );
142  itemBoxSizer4->Add(itemButton5, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
143 
144  wxButton* itemButton6 = new wxButton( itemDialog1, wxID_CANCEL, _("Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
145  itemBoxSizer4->Add(itemButton6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
146 
147 ////@end CRenameColumnDlg content construction
148 
149 }
150 
151 
152 /*!
153  * Should we show tooltips?
154  */
155 
157 {
158  return true;
159 }
160 
161 /*!
162  * Get bitmap resources
163  */
164 
165 wxBitmap CRenameColumnDlg::GetBitmapResource( const wxString& name )
166 {
167  // Bitmap retrieval
168 ////@begin CRenameColumnDlg bitmap retrieval
169  wxUnusedVar(name);
170  return wxNullBitmap;
171 ////@end CRenameColumnDlg bitmap retrieval
172 }
173 
174 /*!
175  * Get icon resources
176  */
177 
178 wxIcon CRenameColumnDlg::GetIconResource( const wxString& name )
179 {
180  // Icon retrieval
181 ////@begin CRenameColumnDlg icon retrieval
182  wxUnusedVar(name);
183  return wxNullIcon;
184 ////@end CRenameColumnDlg icon retrieval
185 }
186 
188 {
189  if (m_QualList)
190  return m_QualList->GetStringSelection();
191  else
192  return wxEmptyString;
193 }
194 
void Init()
Initialises member variables.
void CreateControls()
Creates the controls and sizers.
CRenameColumnDlg()
Constructors.
wxIcon GetIconResource(const wxString &name)
Retrieves icon resources.
wxArrayString m_srcModNameStrings
wxBitmap GetBitmapResource(const wxString &name)
Retrieves bitmap resources.
~CRenameColumnDlg()
Destructor.
static bool ShowToolTips()
Should we show tooltips?
bool Create(wxWindow *parent, wxWindowID id=wxID_ANY, const wxString &caption=_("Rename Column Dialog"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(200, 100), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
Creation.
#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
static static static wxID_ANY
Modified on Fri Sep 20 14:57:40 2024 by modify_doxy.py rev. 669887