73 lines
1.9 KiB
C++
73 lines
1.9 KiB
C++
// ColGridStyle.cpp : implementation file
|
|
//
|
|
|
|
#include "stdafx.h"
|
|
#include "resource.h"
|
|
#include "ColGridStyle.h"
|
|
|
|
#ifdef _DEBUG
|
|
#define new DEBUG_NEW
|
|
#undef THIS_FILE
|
|
static char THIS_FILE[] = __FILE__;
|
|
#endif
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CColGridStylePage property page
|
|
|
|
IMPLEMENT_DYNCREATE(CColGridStylePage, CGridStylePage)
|
|
|
|
CColGridStylePage::CColGridStylePage() : CGridStylePage(CColGridStylePage::IDD)
|
|
{
|
|
//{{AFX_DATA_INIT(CColGridStylePage)
|
|
m_csColWidth = _T("");
|
|
m_bAllowSizing = TRUE;
|
|
m_bApplyDescend = FALSE;
|
|
//}}AFX_DATA_INIT
|
|
}
|
|
|
|
CColGridStylePage::~CColGridStylePage()
|
|
{
|
|
}
|
|
|
|
void CColGridStylePage::DoDataExchange(CDataExchange* pDX)
|
|
{
|
|
CGridStylePage::DoDataExchange(pDX);
|
|
//{{AFX_DATA_MAP(CColGridStylePage)
|
|
DDX_Text(pDX, IDC_COLWIDTH, m_csColWidth);
|
|
DDX_Check(pDX, IDC_ALLOW_SIZING, m_bAllowSizing);
|
|
DDX_Check(pDX, IDC_APPLY_DESCEND, m_bApplyDescend);
|
|
//}}AFX_DATA_MAP
|
|
if(pDX->m_bSaveAndValidate) {
|
|
if(_tstof(m_csColWidth)<1.0E-3)
|
|
pDX->Fail();
|
|
}
|
|
}
|
|
|
|
|
|
BEGIN_MESSAGE_MAP(CColGridStylePage, CGridStylePage)
|
|
//{{AFX_MSG_MAP(CColGridStylePage)
|
|
// NOTE: the ClassWizard will add message map macros here
|
|
//}}AFX_MSG_MAP
|
|
END_MESSAGE_MAP()
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CColGridStylePage message handlers
|
|
|
|
void CColGridStylePage::Obj2Dlg(const TSheetColumn &col, const TGridStyle &styleParent)
|
|
{
|
|
const TGridStyle &styleLocal=col.GetGridStyle();
|
|
CGridStylePage::Obj2Dlg(styleLocal, styleParent);
|
|
m_csColWidth.Format(_T("%.1f"), col.GetWidth());
|
|
m_bAllowSizing=col.AllowSizing();
|
|
}
|
|
|
|
void CColGridStylePage::Dlg2Obj(TSheetColumn &col, const TGridStyle &styleParent) const
|
|
{
|
|
TGridStyle &styleLocal=col.GetGridStyle();
|
|
CGridStylePage::Dlg2Obj(styleLocal, styleParent);
|
|
double nColWidth=_tstof(m_csColWidth);
|
|
if(nColWidth>1.0E-3)
|
|
col.SetWidth(nColWidth);
|
|
col.SetAllowSizing(m_bAllowSizing);
|
|
}
|