123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120 |
- // SetStyle.cpp : implementation file
- //
- #include "stdafx.h"
- #include "ylgl.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;
- g_sendhead.bsql=0;
- g_sendhead.code[0]=77;
- g_sendhead.tabcount=1;
- int g_nYearposTemp=g_nYearpos;
- g_nYearpos=-1;
- g_pMainWnd->ProcessChatMessageRequest2(1);
- g_nYearpos=g_nYearposTemp;
- if(g_bSendOK==0)
- {
- CDialog::OnCancel();
- return 1;
- }
- DataToArray(&g_List1array);
- if(g_List1array.GetSize ()==12)
- {
- for(int i=0; i<12; i++)
- strarray.Add (g_List1array.ElementAt (i).ElementAt (0));
- }
- else
- {
- 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);
- CenterWindow();
- 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<rights.GetLength (); i++)
- {
- if(i>=12)break;
- ((CButton*)GetDlgItem(IDC_CHECK1+i))->SetCheck(rights.GetAt (i)=='1');
- }
- }
|