92 lines
2.3 KiB
C++
92 lines
2.3 KiB
C++
// CColumnProp.cpp : implementation file
|
|
//
|
|
|
|
#include "stdafx.h"
|
|
#include "resource.h"
|
|
#include "ColumnProp.h"
|
|
|
|
|
|
|
|
#ifdef _DEBUG
|
|
#undef THIS_FILE
|
|
static char BASED_CODE THIS_FILE[] = __FILE__;
|
|
#endif
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CColumnProp
|
|
|
|
IMPLEMENT_DYNAMIC(CColumnProp, CPropertySheet)
|
|
|
|
int CColumnProp::g_nActivePage=0;
|
|
CColumnProp::CColumnProp(CWnd* pWndParent)
|
|
: CPropertySheet(_T("ÁÐÉ趨"), pWndParent)
|
|
{
|
|
// Add all of the property pages here. Note that
|
|
// the order that they appear in here will be
|
|
// the order they appear in on screen. By default,
|
|
// the first page of the set is the active one.
|
|
// One way to make a different property page the
|
|
// active one is to call SetActivePage().
|
|
AddPage(&m_gridStyle);
|
|
AddPage(&m_dividerStyle);
|
|
m_gridStyle.InitDataMember(TRUE);
|
|
|
|
|
|
m_psh.dwFlags=m_psh.dwFlags | PSH_NOAPPLYNOW;
|
|
m_psh.dwFlags=m_psh.dwFlags ^ PSH_HASHELP ;
|
|
m_gridStyle.m_psp.dwFlags=m_gridStyle.m_psp.dwFlags ^ (PSH_HASHELP | PSH_WIZARD) ;
|
|
m_dividerStyle.m_psp.dwFlags=m_dividerStyle.m_psp.dwFlags ^ (PSH_HASHELP | PSH_WIZARD);
|
|
}
|
|
|
|
CColumnProp::~CColumnProp()
|
|
{
|
|
}
|
|
|
|
void CColumnProp::Obj2Dlg(const TDbSheet &sheet, int nCol)
|
|
{
|
|
m_gridStyle.Obj2Dlg(*sheet.GetColumn(nCol), sheet.GetGridStyle());
|
|
m_dividerStyle.Obj2Dlg(*sheet.GetColumn(nCol), sheet.GetColDivider());
|
|
}
|
|
|
|
void CColumnProp::Dlg2Obj(TDbSheet &sheet, int nFrom, int nTo) const
|
|
{
|
|
sheet.assertWriteEnabled();
|
|
for(int i=nFrom; i<=nTo; i++) {
|
|
TSheetColumn &column=*sheet.GetColumn(i);
|
|
m_gridStyle.Dlg2Obj(column, sheet.GetGridStyle());
|
|
if(m_gridStyle.m_bApplyDescend)
|
|
sheet.DescInheritColGridStyle(i);
|
|
|
|
m_dividerStyle.Dlg2Obj(column);
|
|
}
|
|
}
|
|
|
|
BEGIN_MESSAGE_MAP(CColumnProp, CPropertySheet)
|
|
//{{AFX_MSG_MAP(CColumnProp)
|
|
ON_WM_DESTROY()
|
|
//}}AFX_MSG_MAP
|
|
END_MESSAGE_MAP()
|
|
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
// CColumnProp message handlers
|
|
|
|
BOOL CColumnProp::OnInitDialog()
|
|
{
|
|
BOOL bResult = CPropertySheet::OnInitDialog();
|
|
|
|
// TODO: Add your specialized code here
|
|
SetActivePage(g_nActivePage);
|
|
|
|
return bResult;
|
|
}
|
|
|
|
void CColumnProp::OnDestroy()
|
|
{
|
|
g_nActivePage=GetActiveIndex();
|
|
CPropertySheet::OnDestroy();
|
|
|
|
// TODO: Add your message handler code here
|
|
|
|
}
|