Back to index

lightning-sunbird  0.9+nobinonly
SrchDlg.cpp
Go to the documentation of this file.
00001 // SrchDlg.cpp : implementation file
00002 //
00003 
00004 #include "stdafx.h"
00005 #include "ldap.h"
00006 #include "winldap.h"
00007 #include "SrchDlg.h"
00008 
00009 #ifdef _DEBUG
00010 #ifdef _WIN32
00011 #define new DEBUG_NEW
00012 #endif
00013 #undef THIS_FILE
00014 static char THIS_FILE[] = __FILE__;
00015 #endif
00016 
00018 // SearchDlg dialog
00019 
00020 
00021 SearchDlg::SearchDlg(CWnd* pParent /*=NULL*/)
00022        : CDialog(SearchDlg::IDD, pParent)
00023 {
00024        //{{AFX_DATA_INIT(SearchDlg)
00025        m_searchBase = _T("");
00026        m_searchFilter = _T("");
00027        //}}AFX_DATA_INIT
00028 }
00029 
00030 
00031 void SearchDlg::DoDataExchange(CDataExchange* pDX)
00032 {
00033        CDialog::DoDataExchange(pDX);
00034        //{{AFX_DATA_MAP(SearchDlg)
00035        DDX_Text(pDX, IDC_SEARCH_BASE, m_searchBase);
00036        DDX_Text(pDX, IDC_SEARCH_FILTER, m_searchFilter);
00037        //}}AFX_DATA_MAP
00038 }
00039 
00040 
00041 BEGIN_MESSAGE_MAP(SearchDlg, CDialog)
00042        //{{AFX_MSG_MAP(SearchDlg)
00043        ON_BN_CLICKED(IDC_SCOPE_BASE, OnScopeBase)
00044        ON_BN_DOUBLECLICKED(IDC_SCOPE_BASE, OnScopeBase)
00045        ON_BN_CLICKED(IDC_SCOPE_ONE, OnScopeOne)
00046        ON_BN_DOUBLECLICKED(IDC_SCOPE_ONE, OnScopeOne)
00047        ON_BN_CLICKED(IDC_SCOPE_SUB, OnScopeSub)
00048        ON_BN_DOUBLECLICKED(IDC_SCOPE_SUB, OnScopeSub)
00049        //}}AFX_MSG_MAP
00050 END_MESSAGE_MAP()
00051 
00053 // SearchDlg message handlers
00054 
00055 BOOL SearchDlg::OnInitDialog() 
00056 {
00057        CDialog::OnInitDialog();
00058 
00059        switch( m_scope )
00060        {
00061               case LDAP_SCOPE_SUBTREE:
00062                      ((CButton *)GetDlgItem( IDC_SCOPE_SUB ))->SetCheck( 1 );
00063                      break;
00064               case LDAP_SCOPE_BASE:
00065                      ((CButton *)GetDlgItem( IDC_SCOPE_BASE ))->SetCheck( 1 );
00066                      break;
00067               case LDAP_SCOPE_ONELEVEL:
00068                      ((CButton *)GetDlgItem( IDC_SCOPE_ONE ))->SetCheck( 1 );
00069                      break;
00070        }
00071        
00072        return TRUE;  // return TRUE unless you set the focus to a control
00073                      // EXCEPTION: OCX Property Pages should return FALSE
00074 }
00075 
00076 void SearchDlg::OnScopeBase() 
00077 {
00078        m_scope = LDAP_SCOPE_BASE;
00079 }
00080 
00081 void SearchDlg::OnScopeOne() 
00082 {
00083        m_scope = LDAP_SCOPE_ONELEVEL;
00084 }
00085 
00086 void SearchDlg::OnScopeSub() 
00087 {
00088        m_scope = LDAP_SCOPE_SUBTREE;
00089 }