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

Go to the SVN repository for this file.

1 /* $Id: wx_track_name_dlg.cpp 23952 2011-06-23 19:12:28Z wuliangs $
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:
27  *
28  * File Description:
29  *
30  */
31 #include <ncbi_pch.hpp>////@begin includes
32 ////@end includes
33 
34 #include <wx/bitmap.h>
35 #include <wx/icon.h>
36 #include <wx/textctrl.h>
37 #include <wx/stattext.h>
38 #include <wx/button.h>
39 
40 #include "wx_track_name_dlg.hpp"
41 
42 ////@begin XPM images
43 ////@end XPM images
44 
46 
47 
48 IMPLEMENT_DYNAMIC_CLASS( CwxTrackNameDlg, wxDialog )
49 
50 BEGIN_EVENT_TABLE( CwxTrackNameDlg, wxDialog )
51 
52 ////@begin CwxTrackNameDlg event table entries
53  EVT_BUTTON( wxID_OK, CwxTrackNameDlg::OnOkClick )
54 
55 ////@end CwxTrackNameDlg event table entries
56 
58 
60 {
61  Init();
62 }
63 
64 CwxTrackNameDlg::CwxTrackNameDlg( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
65 {
66  Init();
67  CreateX(parent, id, caption, pos, size, style);
68 }
69 
70 bool CwxTrackNameDlg::CreateX( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
71 {
72 ////@begin CwxTrackNameDlg creation
73  SetExtraStyle(wxWS_EX_BLOCK_EVENTS);
74  wxDialog::Create( parent, id, caption, pos, size, style );
75 
77  if (GetSizer())
78  {
79  GetSizer()->SetSizeHints(this);
80  }
81  Centre();
82 ////@end CwxTrackNameDlg creation
83  return true;
84 }
85 
87 {
88 ////@begin CwxTrackNameDlg destruction
89 ////@end CwxTrackNameDlg destruction
90 }
91 
93 {
94 ////@begin CwxTrackNameDlg member initialisation
95  m_Msg = NULL;
96  m_TrackName = NULL;
97 ////@end CwxTrackNameDlg member initialisation
98 }
99 
101 {
102 ////@begin CwxTrackNameDlg content construction
103  // Generated by DialogBlocks, 10/05/2011 16:07:11 (unregistered)
104 
105  CwxTrackNameDlg* itemDialog1 = this;
106 
107  wxBoxSizer* itemBoxSizer2 = new wxBoxSizer(wxVERTICAL);
108  itemDialog1->SetSizer(itemBoxSizer2);
109 
110  wxBoxSizer* itemBoxSizer3 = new wxBoxSizer(wxHORIZONTAL);
111  itemBoxSizer2->Add(itemBoxSizer3, 0, wxALIGN_CENTER_HORIZONTAL|wxLEFT|wxRIGHT|wxTOP, 5);
112 
113  m_Msg = new wxStaticText( itemDialog1, wxID_STATIC, _("Please input a track title/name"), wxDefaultPosition, wxDefaultSize, 0 );
114  itemBoxSizer3->Add(m_Msg, 0, wxGROW|wxTOP|wxBOTTOM, 0);
115 
116  wxBoxSizer* itemBoxSizer5 = new wxBoxSizer(wxHORIZONTAL);
117  itemBoxSizer2->Add(itemBoxSizer5, 0, wxALIGN_CENTER_HORIZONTAL|wxALL, 5);
118 
119  wxStaticText* itemStaticText6 = new wxStaticText( itemDialog1, wxID_STATIC, _("Track title:"), wxDefaultPosition, wxDefaultSize, 0 );
121  itemStaticText6->SetToolTip(_("Track title/name shown on the track title bar. It doesn't need to be unique, but a unique name may help differentiate it from others."));
122  itemBoxSizer5->Add(itemStaticText6, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
123 
124  m_TrackName = new wxTextCtrl( itemDialog1, ID_TEXTCTRL, wxEmptyString, wxDefaultPosition, wxSize(200, -1), 0 );
126  m_TrackName->SetToolTip(_("Track title/name shown on the track title bar. It doesn't need to be unique, but a unique name may help differentiate it from others."));
127  itemBoxSizer5->Add(m_TrackName, 0, wxALIGN_CENTER_VERTICAL|wxALL, 5);
128 
129  wxStdDialogButtonSizer* itemStdDialogButtonSizer8 = new wxStdDialogButtonSizer;
130 
131  itemBoxSizer2->Add(itemStdDialogButtonSizer8, 0, wxALIGN_RIGHT|wxALL, 5);
132  wxButton* itemButton9 = new wxButton( itemDialog1, wxID_OK, _("&OK"), wxDefaultPosition, wxDefaultSize, 0 );
133  itemButton9->SetDefault();
134  itemStdDialogButtonSizer8->AddButton(itemButton9);
135 
136  wxButton* itemButton10 = new wxButton( itemDialog1, wxID_CANCEL, _("&Cancel"), wxDefaultPosition, wxDefaultSize, 0 );
137  itemStdDialogButtonSizer8->AddButton(itemButton10);
138 
139  itemStdDialogButtonSizer8->Realize();
140 
141 ////@end CwxTrackNameDlg content construction
142 }
143 
145 {
146  return true;
147 }
148 wxBitmap CwxTrackNameDlg::GetBitmapResource( const wxString& name )
149 {
150  // Bitmap retrieval
151 ////@begin CwxTrackNameDlg bitmap retrieval
152  wxUnusedVar(name);
153  return wxNullBitmap;
154 ////@end CwxTrackNameDlg bitmap retrieval
155 }
156 wxIcon CwxTrackNameDlg::GetIconResource( const wxString& name )
157 {
158  // Icon retrieval
159 ////@begin CwxTrackNameDlg icon retrieval
160  wxUnusedVar(name);
161  return wxNullIcon;
162 ////@end CwxTrackNameDlg icon retrieval
163 }
164 
165 void CwxTrackNameDlg::OnOkClick( wxCommandEvent& event )
166 {
167 ////@begin wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK in CwxTrackNameDlg.
168  // Before editing this code, remove the block markers.
169  event.Skip();
170 ////@end wxEVT_COMMAND_BUTTON_CLICKED event handler for wxID_OK in CwxTrackNameDlg.
171 }
172 
173 void CwxTrackNameDlg::SetMsg(const wxString& msg)
174 {
175  m_Msg->SetLabel(msg);
176 }
177 
178 void CwxTrackNameDlg::SetTrackName(const wxString& name)
179 {
180  m_TrackName->SetValue(name);
181 }
182 
184 {
185  return m_TrackName->GetValue();
186 }
187 
void SetTrackName(const wxString &name)
wxString GetTrackName() const
void SetMsg(const wxString &msg)
void OnOkClick(wxCommandEvent &event)
wxStaticText * m_Msg
static bool ShowToolTips()
bool CreateX(wxWindow *parent, wxWindowID id=10019, const wxString &caption=_("New track title"), const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxCAPTION|wxRESIZE_BORDER|wxSYSTEM_MENU|wxCLOSE_BOX|wxTAB_TRAVERSAL)
wxTextCtrl * m_TrackName
wxBitmap GetBitmapResource(const wxString &name)
wxIcon GetIconResource(const wxString &name)
#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
#define ID_TEXTCTRL
Modified on Thu Feb 29 12:17:09 2024 by modify_doxy.py rev. 669887