00001
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033 #include "stdafx.h"
00034 #include "ldapauth_plus.h"
00035 #include "ConfigureDialog.h"
00036 #include "Resource.h"
00037 #include ".\configuredialog.h"
00038
00039
00040
00041
00042 IMPLEMENT_DYNAMIC(CConfigureDialog, CDialog)
00043 CConfigureDialog::CConfigureDialog(CWnd* pParent )
00044 : CDialog(CConfigureDialog::IDD, pParent)
00045 {
00046 }
00047
00048 CConfigureDialog::~CConfigureDialog()
00049 {
00050 }
00051
00052 void CConfigureDialog::DoDataExchange(CDataExchange* pDX)
00053 {
00054 CDialog::DoDataExchange(pDX);
00055 DDX_Control(pDX, IDC_CONFIG_TAB, m_tabMyTabCtrl);
00056 }
00057
00058
00059 BEGIN_MESSAGE_MAP(CConfigureDialog, CDialog)
00060 ON_WM_SYSCOMMAND()
00061 ON_WM_PAINT()
00062 ON_BN_CLICKED(IDOK, OnSave)
00063 END_MESSAGE_MAP()
00064
00065
00066
00067 BOOL CConfigureDialog::OnInitDialog()
00068 {
00069 CDialog::OnInitDialog();
00070
00071
00072
00073
00074
00075
00076
00077 CMenu* pSysMenu = GetSystemMenu(FALSE);
00078 if (pSysMenu != NULL)
00079 {
00080 CString strAboutMenu;
00081
00082 if (!strAboutMenu.IsEmpty())
00083 {
00084 pSysMenu->AppendMenu(MF_SEPARATOR);
00085
00086 }
00087 }
00088
00089 m_tabMyTabCtrl.InsertItem(0, _T("LDAP Configuration"));
00090 m_tabMyTabCtrl.InsertItem(1, _T("User Configuration"));
00091 m_tabMyTabCtrl.InsertItem(2, _T("Password Configuration"));
00092 m_tabMyTabCtrl.InsertItem(3, _T("Hook Configuration"));
00093 m_tabMyTabCtrl.InsertItem(4, _T("About"));
00094
00095 m_tabMyTabCtrl.Init();
00096
00097 return TRUE;
00098 }
00099
00100 void CConfigureDialog::OnSysCommand(UINT nID, LPARAM lParam)
00101 {
00102
00103
00104
00105
00106
00107
00108
00109 CDialog::OnSysCommand(nID, lParam);
00110
00111 }
00112
00113
00114
00115
00116
00117 void CConfigureDialog::OnPaint()
00118 {
00119 if (IsIconic())
00120 {
00121 CPaintDC dc(this);
00122
00123 SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
00124
00125
00126 int cxIcon = GetSystemMetrics(SM_CXICON);
00127 int cyIcon = GetSystemMetrics(SM_CYICON);
00128 CRect rect;
00129 GetClientRect(&rect);
00130 int x = (rect.Width() - cxIcon + 1) / 2;
00131 int y = (rect.Height() - cyIcon + 1) / 2;
00132 }
00133 else
00134 {
00135 CDialog::OnPaint();
00136 }
00137 }
00138
00139
00140 void CConfigureDialog::OnSave()
00141 {
00142
00143 m_tabMyTabCtrl.OnSave();
00144 MessageBox(TEXT("Settings Saved"),TEXT("LDAPAuth"), MB_ICONINFORMATION | MB_OK);
00145 OnOK();
00146 }