// SetNetwork.cpp : 実装ファイル // #include "stdafx.h" #include "SLKinect.h" #include "SetNetwork.h" // CSetNetwork ダイアログ IMPLEMENT_DYNAMIC(CSetNetwork, CDialog) CSetNetwork::CSetNetwork(CParameterSet prm, BOOL login, CWnd* pParent /*=NULL*/) : CDialog(CSetNetwork::IDD, pParent) { param = prm; isLogin = login; outputMemoryButton = NULL; outputNetworkButton = NULL; fastNetworkButton = NULL; animServerEBox = NULL; serverPortEBox = NULL; clientPortEBox = NULL; groupKeyEBox = NULL; } void CSetNetwork::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); } BEGIN_MESSAGE_MAP(CSetNetwork, CDialog) END_MESSAGE_MAP() // CSetNetwork メッセージ ハンドラ BOOL CSetNetwork::OnInitDialog() { char buf[LNAME]; CDialog::OnInitDialog(); outputMemoryButton = (CButton*)GetDlgItem(IDC_RADIO_SMEMORY); outputNetworkButton = (CButton*)GetDlgItem(IDC_RADIO_NETWORK); fastNetworkButton = (CButton*)GetDlgItem(IDC_CHECK_FASTNETWORK); animServerEBox = (CEdit*)GetDlgItem(IDC_EDIT_SERVER_NAME); serverPortEBox = (CEdit*)GetDlgItem(IDC_EDIT_SERVER_PORT); clientPortEBox = (CEdit*)GetDlgItem(IDC_EDIT_CLIENT_PORT); groupKeyEBox = (CEdit*)GetDlgItem(IDC_EDIT_GROUP_KEY); if (param.netOutMode==NETandLOCAL) { outputMemoryButton->SetCheck(1); outputNetworkButton->SetCheck(0); } else { outputMemoryButton->SetCheck(0); outputNetworkButton->SetCheck(1); } if (param.netFastMode) fastNetworkButton->SetCheck(1); else fastNetworkButton->SetCheck(0); memset(buf, 0, LNAME); snprintf(buf, LNAME-1, "%d", param.clientPort); clientPortEBox->SetWindowText(buf); animServerEBox->SetWindowText((LPCSTR)param.animationSrvr); memset(buf, 0, LNAME); snprintf(buf, LNAME-1, "%d", param.serverPort); serverPortEBox->SetWindowText(buf); groupKeyEBox->SetWindowText((LPCSTR)param.groupID); if (isLogin) { animServerEBox->EnableWindow(FALSE); serverPortEBox->EnableWindow(FALSE); clientPortEBox->EnableWindow(FALSE); groupKeyEBox->EnableWindow(FALSE); } return TRUE; // return TRUE unless you set the focus to a control } void CSetNetwork::OnOK() { char buf[LNAME]; if (outputNetworkButton->GetCheck()) param.netOutMode = NETonly; else param.netOutMode = NETandLOCAL; if (fastNetworkButton->GetCheck()) param.netFastMode = TRUE; else param.netFastMode = FALSE; memset(buf, 0, LNAME); animServerEBox->GetWindowText(buf, LNAME); param.animationSrvr.SetString(buf); memset(buf, 0, LNAME); clientPortEBox->GetWindowText(buf, LNAME); param.clientPort = atoi(buf); memset(buf, 0, LNAME); serverPortEBox->GetWindowText(buf, LNAME); param.serverPort = atoi(buf); memset(buf, 0, LNAME); groupKeyEBox->GetWindowText(buf, LNAME); memset(buf+ANM_COM_LEN_IDKEY, 0, LNAME-ANM_COM_LEN_IDKEY); param.groupID.SetString(buf); CDialog::OnOK(); }