// SetSize.cpp : implementation file // #include "stdafx.h" #include "ylgl.h" #include "SetSize.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif ///////////////////////////////////////////////////////////////////////////// // SetSize dialog SetSize::SetSize(CWnd* pParent /*=NULL*/) : CDialog(SetSize::IDD, pParent) { //{{AFX_DATA_INIT(SetSize) m_name = _T(""); m_width = 0; m_height = 0; //}}AFX_DATA_INIT } void SetSize::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(SetSize) DDX_Control(pDX, IDC_LIST1, m_List1); DDX_Text(pDX, IDC_EDITname, m_name); DDX_Text(pDX, IDC_EDITwidth, m_width); DDX_Text(pDX, IDC_EDITheight, m_height); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(SetSize, CDialog) //{{AFX_MSG_MAP(SetSize) ON_LBN_SELCHANGE(IDC_LIST1, OnSelchangeList1) ON_BN_CLICKED(IDC_BUTadd, OnBUTadd) ON_BN_CLICKED(IDC_BUTdel, OnBUTdel) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // SetSize message handlers BOOL SetSize::OnInitDialog() { CDialog::OnInitDialog(); // TODO: Add extra initialization here g_sendhead.bsql=0; g_sendhead.code[0]=174; g_sendhead.tabcount=1; g_pMainWnd->ProcessChatMessageRequest2(6); if(g_bSendOK==0) { CDialog::OnCancel (); return 0; } DataToArray(&g_List1array); CenterWindow(); for(int i=0; iProcessChatMessageRequest2(sql);if(g_bSendOK==0)return; namearray.Add (m_name); widtharray.Add (m_width); heightarray.Add (m_height); CString str; str.Format (_T("%s 宽:%d 高:%d"), m_name, m_width, m_height); m_List1.AddString(str); } void SetSize::OnBUTdel() { // TODO: Add your control notification handler code here int pos=m_List1.GetCurSel (); if(pos==-1) { AfxMessageBox("请选中您要删除的项目!" , MB_ICONINFORMATION); return; } if(AfxMessageBox("确认删除吗?", MB_ICONINFORMATION|MB_YESNO)!=IDYES)return; CString sql; CString name=namearray.ElementAt (pos); sql.Format ("delete from framesize where name='%s' ", name); g_sendhead.bsql=1; g_pMainWnd->ProcessChatMessageRequest2(sql);if(g_bSendOK==0)return; m_List1.DeleteString (pos); namearray.RemoveAt(pos); widtharray.RemoveAt(pos); heightarray.RemoveAt(pos); } void SetSize::SaveToFile() { }