home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2003 June
/
PCWorld_2003-06_cd.bin
/
KOMUNIK
/
MIRRORIT
/
SRC
/
SESSIONPROPERTIESLIMITPAGE.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1998-01-04
|
4KB
|
115 lines
// SessionPropertiesLimitPage.cpp : implementation file
//
#include "stdafx.h"
#include "MirrorIt.h"
#include "SessionPropertiesLimitPage.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CSessionPropertiesLimitPage property page
IMPLEMENT_DYNCREATE(CSessionPropertiesLimitPage, CPropertyPage)
CSessionPropertiesLimitPage::CSessionPropertiesLimitPage() : CPropertyPage(CSessionPropertiesLimitPage::IDD)
{
//{{AFX_DATA_INIT(CSessionPropertiesLimitPage)
m_NumberOfFiles = 0;
m_BNumberOfFiles = FALSE;
m_BNumberOfLevels = FALSE;
m_NumberOfLevels = 0;
m_BNumberOfKBytes = FALSE;
m_NumberOfKBytes = 0;
m_KB = -1;
//}}AFX_DATA_INIT
}
CSessionPropertiesLimitPage::~CSessionPropertiesLimitPage()
{
}
void CSessionPropertiesLimitPage::DoDataExchange(CDataExchange* pDX)
{
CPropertyPage::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CSessionPropertiesLimitPage)
DDX_Text(pDX, IDC_NUMBEROFFILES, m_NumberOfFiles);
DDV_MinMaxUInt(pDX, m_NumberOfFiles, 1, 32767);
DDX_Check(pDX, IDC_BNUMBEROFFILES, m_BNumberOfFiles);
DDX_Check(pDX, IDC_BNUMBEROFLEVELS, m_BNumberOfLevels);
DDX_Text(pDX, IDC_NUMBEROFLEVELS, m_NumberOfLevels);
DDV_MinMaxUInt(pDX, m_NumberOfLevels, 1, 32767);
DDX_Check(pDX, IDC_BNUMBEROFKBYTES, m_BNumberOfKBytes);
DDX_Text(pDX, IDC_NUMBEROFKBYTES, m_NumberOfKBytes);
DDV_MinMaxUInt(pDX, m_NumberOfKBytes, 1, 32767);
DDX_CBIndex(pDX, IDC_KB, m_KB);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CSessionPropertiesLimitPage, CPropertyPage)
//{{AFX_MSG_MAP(CSessionPropertiesLimitPage)
ON_BN_CLICKED(IDC_BNUMBEROFFILES, OnBnumberoffiles)
ON_BN_CLICKED(IDC_BNUMBEROFLEVELS, OnBnumberoflevels)
ON_BN_CLICKED(IDC_BNUMBEROFKBYTES, OnBnumberofkbytes)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSessionPropertiesLimitPage message handlers
void CSessionPropertiesLimitPage::OnBnumberoffiles()
{
SetNumberOfFiles(((CButton *)GetDlgItem(IDC_BNUMBEROFFILES)) -> GetCheck() ? TRUE : FALSE);
}
void CSessionPropertiesLimitPage::SetNumberOfFiles(BOOL b)
{
GetDlgItem(IDC_NUMBEROFFILES) -> EnableWindow(b);
GetDlgItem(IDC_SNUMBEROFFILES) -> EnableWindow(b);
}
BOOL CSessionPropertiesLimitPage::OnInitDialog()
{
CPropertyPage::OnInitDialog();
((CSpinButtonCtrl *)GetDlgItem(IDC_SNUMBEROFFILES)) -> SetRange(0, UD_MAXVAL);
((CSpinButtonCtrl *)GetDlgItem(IDC_SNUMBEROFLEVELS)) -> SetRange(0, UD_MAXVAL);
((CSpinButtonCtrl *)GetDlgItem(IDC_SNUMBEROFKBYTES)) -> SetRange(0, UD_MAXVAL);
SetNumberOfFiles(m_BNumberOfFiles);
SetNumberOfLevels(m_BNumberOfLevels);
SetNumberOfKBytes(m_BNumberOfKBytes);
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CSessionPropertiesLimitPage::OnBnumberoflevels()
{
SetNumberOfLevels(((CButton *)GetDlgItem(IDC_BNUMBEROFLEVELS)) -> GetCheck() ? TRUE : FALSE);
}
void CSessionPropertiesLimitPage::SetNumberOfLevels(BOOL b)
{
GetDlgItem(IDC_NUMBEROFLEVELS) -> EnableWindow(b);
GetDlgItem(IDC_SNUMBEROFLEVELS) -> EnableWindow(b);
}
void CSessionPropertiesLimitPage::OnBnumberofkbytes()
{
SetNumberOfKBytes(((CButton *)GetDlgItem(IDC_BNUMBEROFKBYTES)) -> GetCheck() ? TRUE : FALSE);
}
void CSessionPropertiesLimitPage::SetNumberOfKBytes(BOOL b)
{
GetDlgItem(IDC_NUMBEROFKBYTES) -> EnableWindow(b);
GetDlgItem(IDC_SNUMBEROFKBYTES) -> EnableWindow(b);
GetDlgItem(IDC_KB) -> EnableWindow(b);
}