1 // $Id: ProxyPasswordDialog.cpp 455 2010-01-30 03:26:11Z felfert $
2 //
3 // Copyright (C) 2010 The OpenNX team
4 // Author: Fritz Elfert
5 //
6 // This program is free software; you can redistribute it and/or modify
7 // it under the terms of the GNU Library General Public License as
8 // published by the Free Software Foundation; either version 2 of the
9 // License, or (at your option) any later version.
10 //
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14 // GNU General Public License for more details.
15 //
16 // You should have received a copy of the GNU Library General Public
17 // License along with this program; if not, write to the
18 // Free Software Foundation, Inc.,
19 // 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
20 //
21 
22 #ifdef HAVE_CONFIG_H
23 #include "config.h"
24 #endif
25 
26 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
27 #pragma implementation "ProxyPasswordDialog.h"
28 #endif
29 
30 // For compilers that support precompilation, includes "wx/wx.h".
31 #include "wx/wxprec.h"
32 
33 #ifdef __BORLANDC__
34 #pragma hdrstop
35 #endif
36 
37 #ifndef WX_PRECOMP
38 #include "wx/wx.h"
39 #endif
40 
41 ////@begin includes
42 ////@end includes
43 
44 #include "ProxyPasswordDialog.h"
45 
46 ////@begin XPM images
47 ////@end XPM images
48 
49 
50 /*!
51  * ProxyPasswordDialog type definition
52  */
53 
IMPLEMENT_DYNAMIC_CLASS(ProxyPasswordDialog,wxDialog)54 IMPLEMENT_DYNAMIC_CLASS( ProxyPasswordDialog, wxDialog )
55 
56 
57 /*!
58  * ProxyPasswordDialog event table definition
59  */
60 
61 BEGIN_EVENT_TABLE( ProxyPasswordDialog, wxDialog )
62 
63 ////@begin ProxyPasswordDialog event table entries
64 ////@end ProxyPasswordDialog event table entries
65 
66 END_EVENT_TABLE()
67 
68 
69 /*!
70  * ProxyPasswordDialog constructors
71  */
72 
73 ProxyPasswordDialog::ProxyPasswordDialog()
74 {
75     Init();
76 }
77 
ProxyPasswordDialog(wxWindow * parent,wxWindowID id,const wxString & caption,const wxPoint & pos,const wxSize & size,long style)78 ProxyPasswordDialog::ProxyPasswordDialog( wxWindow* parent, wxWindowID id, const wxString& caption, const wxPoint& pos, const wxSize& size, long style )
79 {
80     Init();
81     Create(parent, id, caption, pos, size, style);
82 }
83 
84 
85 /*!
86  * ProxyPasswordDialog creator
87  */
88 
Create(wxWindow * parent,wxWindowID WXUNUSED (id),const wxString & WXUNUSED (caption),const wxPoint & WXUNUSED (pos),const wxSize & WXUNUSED (size),long WXUNUSED (style))89 bool ProxyPasswordDialog::Create( wxWindow* parent, wxWindowID WXUNUSED(id), const wxString& WXUNUSED(caption), const wxPoint& WXUNUSED(pos), const wxSize& WXUNUSED(size), long WXUNUSED(style) )
90 {
91 ////@begin ProxyPasswordDialog creation
92     SetExtraStyle(wxWS_EX_VALIDATE_RECURSIVELY|wxWS_EX_BLOCK_EVENTS);
93     SetParent(parent);
94     CreateControls();
95     SetIcon(GetIconResource(wxT("res/nx.png")));
96     if (GetSizer())
97     {
98         GetSizer()->SetSizeHints(this);
99     }
100     Centre();
101 ////@end ProxyPasswordDialog creation
102     return true;
103 }
104 
105 
106 /*!
107  * ProxyPasswordDialog destructor
108  */
109 
~ProxyPasswordDialog()110 ProxyPasswordDialog::~ProxyPasswordDialog()
111 {
112 ////@begin ProxyPasswordDialog destruction
113 ////@end ProxyPasswordDialog destruction
114 }
115 
116 
117 /*!
118  * Member initialisation
119  */
120 
Init()121 void ProxyPasswordDialog::Init()
122 {
123 ////@begin ProxyPasswordDialog member initialisation
124 ////@end ProxyPasswordDialog member initialisation
125 }
126 
127 
128 /*!
129  * Control creation for ProxyPasswordDialog
130  */
131 
CreateControls()132 void ProxyPasswordDialog::CreateControls()
133 {
134 ////@begin ProxyPasswordDialog content construction
135     if (!wxXmlResource::Get()->LoadDialog(this, GetParent(), _T("ID_PROXYPASSWORDDIALOG")))
136         wxLogError(wxT("Missing wxXmlResource::Get()->Load() in OnInit()?"));
137     // Set validators
138     if (FindWindow(XRCID("ID_TEXTCTRL_PROXYPASS2")))
139         FindWindow(XRCID("ID_TEXTCTRL_PROXYPASS2"))->SetValidator( wxTextValidator(wxFILTER_NONE, & m_sPassword) );
140 ////@end ProxyPasswordDialog content construction
141 
142     // Create custom windows not generated automatically here.
143     if (FindWindow(XRCID("ID_TEXTCTRL_PROXYPASS2")))
144         FindWindow(XRCID("ID_TEXTCTRL_PROXYPASS2"))->SetFocus();
145 }
146 
147 
148 /*!
149  * Should we show tooltips?
150  */
151 
ShowToolTips()152 bool ProxyPasswordDialog::ShowToolTips()
153 {
154     return true;
155 }
156 
157 /*!
158  * Get bitmap resources
159  */
160 
GetBitmapResource(const wxString & name)161 wxBitmap ProxyPasswordDialog::GetBitmapResource( const wxString& name )
162 {
163     // Bitmap retrieval
164 ////@begin ProxyPasswordDialog bitmap retrieval
165     wxUnusedVar(name);
166     return wxNullBitmap;
167 ////@end ProxyPasswordDialog bitmap retrieval
168 }
169 
170 /*!
171  * Get icon resources
172  */
173 
GetIconResource(const wxString & name)174 wxIcon ProxyPasswordDialog::GetIconResource( const wxString& name )
175 {
176     // Icon retrieval
177 ////@begin ProxyPasswordDialog icon retrieval
178     wxUnusedVar(name);
179     return wxNullIcon;
180 ////@end ProxyPasswordDialog icon retrieval
181 }
182