0
|
1 // Filename : auth.h
|
5
|
2 // Last Change: 2018-10-22 ŒŽ 08:41:38.
|
0
|
3 //
|
|
4
|
|
5 #ifndef __AUTH_H__
|
|
6 #define __AUTH_H__
|
|
7
|
|
8 #include <wx/gdicmn.h>
|
|
9 #include <wx/font.h>
|
|
10 #include <wx/colour.h>
|
|
11 #include <wx/settings.h>
|
3
|
12 #include <wx/button.h>
|
0
|
13 #include <wx/textctrl.h>
|
|
14 #include <wx/sizer.h>
|
|
15 #include <wx/stattext.h>
|
3
|
16 #include <wx/textfile.h>
|
0
|
17 #include <wx/dialog.h>
|
|
18 #include <wx/msgdlg.h>
|
|
19
|
|
20 class AuthDialog : public wxDialog
|
|
21 {
|
|
22 DECLARE_EVENT_TABLE()
|
|
23 private:
|
3
|
24 bool m_load = false;
|
|
25 wxString m_server;
|
|
26 wxString m_user;
|
|
27 wxArrayString m_users;
|
0
|
28
|
|
29 protected:
|
|
30 enum {
|
|
31 ID_UID = wxID_HIGHEST + 200,
|
|
32 ID_PW,
|
|
33 };
|
|
34
|
|
35 wxStaticText* m_staticTextId;
|
|
36 wxTextCtrl* m_textCtrlId;
|
|
37 wxStaticText* m_staticTextIdmsg;
|
|
38 wxStaticText* m_staticTextPw;
|
|
39 wxTextCtrl* m_textCtrlPw;
|
|
40 wxStaticText* m_staticTextPwmsg;
|
3
|
41 wxButton* m_buttonLogin;
|
|
42 wxButton* m_buttonCancel;
|
0
|
43
|
|
44 public:
|
|
45 AuthDialog( wxWindow* parent, wxWindowID id = wxID_ANY, const wxString& title = wxEmptyString, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_DIALOG_STYLE );
|
|
46 ~AuthDialog();
|
3
|
47
|
|
48 void SetServer( wxString server ) { m_server = server; };
|
|
49 void CreateControls( void );
|
5
|
50 bool LoadDB( void );
|
3
|
51 bool IsValidUser( void );
|
|
52 wxString GetUser( void ) { return m_user; };
|
|
53 void InDevelop( bool );
|
|
54
|
|
55 void OnShow( wxShowEvent& event );
|
|
56 void OnEnter( wxCommandEvent& event );
|
0
|
57 void OnCheckUserID( wxCommandEvent& event );
|
|
58 void OnCheckPassword( wxCommandEvent& event );
|
|
59 };
|
|
60
|
|
61 #endif //__AUTH_H__
|
|
62
|