// SetStyle.cpp : implementation file // #include "stdafx.h" #include "LYFZIPManage.h" #include "SetStyle.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // SetStyle dialog SetStyle::SetStyle(CWnd* pParent /*=NULL*/) : CDialog(SetStyle::IDD, pParent) { //{{AFX_DATA_INIT(SetStyle) // NOTE: the ClassWizard will add member initialization here //}}AFX_DATA_INIT m_style=""; } void SetStyle::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(SetStyle) // NOTE: the ClassWizard will add DDX and DDV calls here //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(SetStyle, CDialog) //{{AFX_MSG_MAP(SetStyle) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // SetStyle message handlers void SetStyle::OnOK() { // TODO: Add extra validation here m_style=GetRights(); CDialog::OnOK(); } BOOL SetStyle::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here CStringArray strarray; strarray.Add("复古典雅"); strarray.Add("温文尔雅"); strarray.Add("豪华艳丽"); strarray.Add("传统大方"); strarray.Add("新潮个性"); strarray.Add("浪漫奔放"); strarray.Add("简单素雅"); strarray.Add("活泼俏丽"); strarray.Add("妩媚温馨"); strarray.Add("温柔贤惠"); strarray.Add("成熟感性"); strarray.Add("清纯可爱"); for(int i=0; i<12; i++) { SetDlgItemText(IDC_CHECK1+i, strarray.ElementAt (i)); } SetRights(m_style); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } CString SetStyle::GetRights() { CString ret,temp; for(int i=0; i<12; i++) { temp.Format ("%d",((CButton*)GetDlgItem(IDC_CHECK1+i))->GetCheck()); ret+=temp; } return ret; } void SetStyle::SetRights(CString rights) { for(int i=0; i=12)break; ((CButton*)GetDlgItem(IDC_CHECK1+i))->SetCheck(rights.GetAt (i)=='1'); } }