Main Page | Class List | File List | Class Members | File Members

ConfigureDialog.cpp

Go to the documentation of this file.
00001 
00005 /*
00006 pGina ldapAuth code - based upon skeleton code for pGina plugin development
00007 Copyright (C) 2002 Micah Cooper
00008 
00009 This program is free software; you can redistribute it and/or
00010 modify it under the terms of the GNU General Public License
00011 as published by the Free Software Foundation; either version 2
00012 of the License, or (at your option) any later version.
00013 
00014 This program is distributed in the hope that it will be useful,
00015 but WITHOUT ANY WARRANTY; without even the implied warranty of
00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017 GNU General Public License for more details.
00018 
00019 You should have received a copy of the GNU General Public License
00020 along with this program; if not, write to the Free Software
00021 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00022 
00023 Email: coopermj@muohio.edu
00024 Snail Mail:
00025         Micah Cooper
00026         212A Kreger Hall
00027         Miami University
00028         Oxford OH  45056
00029 */
00030 // ConfigureDialog.cpp : implementation file
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 // CConfigureDialog dialog
00041 
00042 IMPLEMENT_DYNAMIC(CConfigureDialog, CDialog)
00043 CConfigureDialog::CConfigureDialog(CWnd* pParent /*=NULL*/)
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 // CConfigureDialog message handlers
00067 BOOL CConfigureDialog::OnInitDialog()
00068 {
00069         CDialog::OnInitDialog();
00070 
00071         // Add "About..." menu item to system menu.
00072 
00073         // IDM_ABOUTBOX must be in the system command range.
00074         //ASSERT((IDM_ABOUTBOX & 0xFFF0) == IDM_ABOUTBOX);
00075         //ASSERT(IDM_ABOUTBOX < 0xF000);
00076 
00077         CMenu* pSysMenu = GetSystemMenu(FALSE);
00078         if (pSysMenu != NULL)
00079         {
00080                 CString strAboutMenu;
00081                 //strAboutMenu.LoadString(IDS_ABOUTBOX);
00082                 if (!strAboutMenu.IsEmpty())
00083                 {
00084                         pSysMenu->AppendMenu(MF_SEPARATOR);
00085                         //pSysMenu->AppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu);
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;  // return TRUE  unless you set the focus to a control
00098 }
00099 
00100 void CConfigureDialog::OnSysCommand(UINT nID, LPARAM lParam)
00101 {
00102         //if ((nID & 0xFFF0) == IDM_ABOUTBOX)
00103         //{
00104         //      CAboutDlg dlgAbout;
00105         //      dlgAbout.DoModal();
00106         //}
00107         //else
00108         //{
00109                 CDialog::OnSysCommand(nID, lParam);
00110         //}
00111 }
00112 
00113 // If you add a minimize button to your dialog, you will need the code below
00114 //  to draw the icon.  For MFC applications using the document/view model,
00115 //  this is automatically done for you by the framework.
00116 
00117 void CConfigureDialog::OnPaint() 
00118 {
00119         if (IsIconic())
00120         {
00121                 CPaintDC dc(this); // device context for painting
00122 
00123                 SendMessage(WM_ICONERASEBKGND, (WPARAM) dc.GetSafeHdc(), 0);
00124 
00125                 // Center icon in client rectangle
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         // TODO: Add your control notification handler code here
00143         m_tabMyTabCtrl.OnSave();
00144         MessageBox(TEXT("Settings Saved"),TEXT("LDAPAuth"), MB_ICONINFORMATION | MB_OK);
00145         OnOK();
00146 }

Generated on Fri Feb 20 12:03:40 2004 for ldapauth plugin for pGina by doxygen 1.3.5