]>
git.saurik.com Git - wxWidgets.git/blob - demos/dbbrowse/dlguser.cpp
c3e6dbab177478e452143422e7c6c7f3931d55e9
1 //---------------------------------------------------------------------------
3 // Purpose: Dialog mit Variable Gestaltung durch DlgUser.wxr
4 // Author: Mark Johnson, mj10777@gmx.net
5 // Modified by: 19991105.mj10777
7 // Copyright: (c) Mark Johnson
8 // Licence: wxWindows license
9 //---------------------------------------------------------------------------
10 //-- all #ifdefs that the whole Project needs. ------------------------------
11 //---------------------------------------------------------------------------
13 #pragma implementation
16 //---------------------------------------------------------------------------
17 // For compilers that support precompilation, includes "wx/wx.h".
18 #include "wx/wxprec.h"
19 //---------------------------------------------------------------------------
23 //---------------------------------------------------------------------------
27 //---------------------------------------------------------------------------
28 //-- all #includes that every .cpp needs ----19990807.mj10777 ---
29 //---------------------------------------------------------------------------
31 //---------------------------------------------------------------------------
32 DlgUser::DlgUser(wxWindow
*parent
, const wxString
& title
, const wxPoint
& pos
, const wxSize
& size
, const long WXUNUSED(style
) ) :
33 wxDialog(parent
, ID_DIALOG_DSN
, title
, pos
, size
, wxDEFAULT_DIALOG_STYLE
|wxDIALOG_MODAL
)
35 SetBackgroundColour("wheat");
36 wxButton
*but1
= new wxButton(this, wxID_OK
, "OK", wxPoint(55,110), wxSize(80, 30));
37 wxButton
*but2
= new wxButton(this, wxID_CANCEL
, "Cancel", wxPoint(210,110), wxSize(80, 30));
38 (void)new wxStaticText(this, -1,_("User ID"), wxPoint(20, 40), wxSize(50, 20),wxALIGN_LEFT
);
39 (void)new wxStaticText(this, -1,_("Password"), wxPoint(20, 80), wxSize(50, 20),wxALIGN_LEFT
);
43 void DlgUser::OnInit()
45 wxString Temp
; Temp
.Printf(_(">>> %s <<< "),s_DSN
.c_str());
46 (void)new wxStaticText(this, -1, Temp
, wxPoint(10, 10), wxSize(300, 20),wxALIGN_CENTRE
);
47 tc_User
= new wxTextCtrl(this, ID_USER
, s_User
, wxPoint(75, 35), wxSize(200, 25), 0, wxDefaultValidator
);
48 tc_Password
= new wxTextCtrl(this, ID_PASSWORD
, s_Password
, wxPoint(75, 75), wxSize(200, 25),wxTE_PASSWORD
, wxDefaultValidator
);
51 //---------------------------------------------------------------------------
52 BEGIN_EVENT_TABLE(DlgUser
, wxDialog
)
53 EVT_BUTTON(wxID_OK
, DlgUser::OnOk
)
54 EVT_BUTTON(wxID_CANCEL
, DlgUser::OnCancel
)
56 //---------------------------------------------------------------------------
57 void DlgUser::OnOk(wxCommandEvent
& WXUNUSED(event
) )
60 s_User
= tc_User
->GetValue();
61 s_Password
= tc_Password
->GetValue();
64 //---------------------------------------------------------------------------
65 void DlgUser::OnCancel(wxCommandEvent
& WXUNUSED(event
) )
68 EndModal(wxID_CANCEL
);
70 //---------------------------------------------------------------------------