INT_PTR PAOperatorObjectDlgProc::DlgProc(TimeValue t, IParamMap2* map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { switch(msg) { case WM_INITDIALOG: UpdateDlg(map, hWnd); break; case WM_DESTROY: break; case WM_COMMAND: switch(LOWORD(wParam)) { case IDC_PICKNODE: map->GetParamBlock()->NotifyDependents( FOREVER, 0, kObject_RefMsg_ResetValidatorAction ); break; case IDC_BYLIST: map->GetParamBlock()->NotifyDependents( FOREVER, 0, kObject_RefMsg_ListSelect ); break; case kObject_message_update: UpdateDlg(map, hWnd); break; } break; } return FALSE; }
BOOL PFOperatorSpeedCopyDlgProc::DlgProc(TimeValue t, IParamMap2* map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam) { IParamBlock2* pblock = NULL; switch(msg) { case WM_INITDIALOG: // Send the message to notify the initialization of dialog if (map != NULL) pblock = map->GetParamBlock(); if (pblock != NULL) pblock->NotifyDependents( FOREVER, (PartID)map, kSpeedCopy_RefMsg_InitDlg ); break; case WM_DESTROY: break; case WM_COMMAND: if (map != NULL) pblock = map->GetParamBlock(); switch(LOWORD(wParam)) { case IDC_NEW: if (pblock) pblock->NotifyDependents(FOREVER, PART_OBJ, kSpeedCopy_RefMsg_NewRand); break; case kSpeedCopy_message_update: UpdateDlg( hWnd, pblock); break; } break; } return FALSE; }
INT_PTR PFOperatorMaterialDynamicDlgProc::DlgProc( TimeValue t, IParamMap2 *map, HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam ) { IParamBlock2* pblock; switch ( msg ) { case WM_INITDIALOG: // Send the message to notify the initialization of dialog map->GetParamBlock()->NotifyDependents( FOREVER, (PartID)map, kMaterialDynamic_RefMsg_InitDlg ); break; case WM_DESTROY: break; case WM_COMMAND: switch ( LOWORD( wParam ) ) { case IDC_NEW: map->GetParamBlock()->NotifyDependents( FOREVER, PART_OBJ, kMaterialDynamic_RefMsg_NewRand ); break; case kMaterialDynamic_message_assign: pblock = map->GetParamBlock(); if (pblock != NULL) { UpdateDlg( hWnd, pblock, t); } break; } break; } return FALSE; }
void ZItemCountDlg::Open(ZITEMCOUNTDLG_MODE mode, const char* szItemName, CCBitmap* pIcon, int price, int nMin, int nMax, IItemCountDlgDoneHandler* pHandler ) { m_mode = mode; m_strItemName = szItemName; m_pItemIcon = pIcon; m_nPrice = price; m_nMin = nMin; m_nMax = nMax; m_pDoneHandler = pHandler; if (m_nMin > m_nMax || m_nMin < 0 || m_nMax < 0) { _ASSERT(0); m_nMin = m_nMax = 0; } m_nCurrCount = 1; CCFrame* pFrame = (CCFrame*)GetIDLResource()->FindWidget("TradeCountableItemFrame"); CCLabel* pLabel1 = (CCLabel*)GetIDLResource()->FindWidget("TradeCountableItem_Message"); CCLabel* pLabel2 = (CCLabel*)GetIDLResource()->FindWidget("TradeCountableItem_NullLabel"); CCButton* pBtn = (CCButton*)GetIDLResource()->FindWidget("TradeCountableItem_Ok"); switch (m_mode) { case ZICD_SELL: if (pFrame) pFrame->SetText(ZMsg(MSG_SHOPEQUIP_SELL_ITEM)); if (pLabel1) pLabel1->SetText(ZMsg(MSG_SHOPEQUIP_SELL_COUNT_ASK)); if (pLabel2) pLabel2->SetText(ZMsg(MSG_SHOPEQUIP_SELL_COUNT)); if (pBtn) pBtn->SetText(ZMsg(MSG_SHOPEQUIP_SELL_BUTTON)); break; case ZICD_BUY: if (pFrame) pFrame->SetText(ZMsg(MSG_SHOPEQUIP_BUY_ITEM)); if (pLabel1) pLabel1->SetText(ZMsg(MSG_SHOPEQUIP_BUY_COUNT_ASK)); if (pLabel2) pLabel2->SetText(ZMsg(MSG_SHOPEQUIP_BUY_COUNT)); if (pBtn) pBtn->SetText(ZMsg(MSG_SHOPEQUIP_BUY_BUTTON)); break; case ZICD_SENDACCOUNT: if (pFrame) pFrame->SetText(ZMsg(MSG_SHOPEQUIP_SEND_ITEM)); if (pLabel1) pLabel1->SetText(ZMsg(MSG_SHOPEQUIP_SEND_COUNT_ASK)); if (pLabel2) pLabel2->SetText(ZMsg(MSG_SHOPEQUIP_SEND_COUNT)); if (pBtn) pBtn->SetText(ZMsg(MSG_SHOPEQUIP_SEND_BUTTON)); break; case ZICD_BRINGACCOUNT: if (pFrame) pFrame->SetText(ZMsg(MSG_SHOPEQUIP_BRING_ITEM)); if (pLabel1) pLabel1->SetText(ZMsg(MSG_SHOPEQUIP_BRING_COUNT_ASK)); if (pLabel2) pLabel2->SetText(ZMsg(MSG_SHOPEQUIP_BRING_COUNT)); if (pBtn) pBtn->SetText(ZMsg(MSG_SHOPEQUIP_BRING_BUTTON)); break; } UpdateDlg(); CCWidget* pWidget = GetIDLResource()->FindWidget( "TradeCountableItemFrame"); if ( pWidget) pWidget->Show( true, true); pWidget = GetIDLResource()->FindWidget( "TradeCountableItem_CountNum"); if ( pWidget) pWidget->SetFocus(); }
// From msdn.microsoft.com, various ways to enumerate PixelFormats void CPixForm::OnClickedLastPfd() { COpenGL gl; PIXELFORMATDESCRIPTOR pfd; // // Get the hwnd of the view window. // HWND hwndview = GetViewHwnd(); // // Get a DC associated with the view window. // HDC dc =::GetDC(hwndview); int nID = (m_nNextID > 1) ? m_nNextID-- : 1; // // Get a description of the pixel format. If it is valid, then go and // update the controls in the dialog box, otherwise do nothing. // if (gl.DescribePixelFormat(dc, nID, sizeof (PIXELFORMATDESCRIPTOR), &pfd)) UpdateDlg(&pfd); // // Release the DC. // ::ReleaseDC(hwndview, dc); }
void ZItemCountDlg::OnEditBoxChanged() { CCEdit* pEdit = (CCEdit*)GetIDLResource()->FindWidget( "TradeCountableItem_CountNum"); if ( pEdit) { const char* sz = pEdit->GetText(); int count = atoi(sz); m_nCurrCount = count; } UpdateDlg(); }
void COptionsDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar *pScrollBar) { int nControl = pScrollBar->GetDlgCtrlID(); CSliderCtrl *pCtrl = (CSliderCtrl*)GetDlgItem(nControl); ASSERT(pCtrl != NULL); if (nControl == IDC_SAMPLE_SLIDER) { int nPos2 = min(pCtrl->GetPos(), ELEMENTS(SampleIntervals)); g_nSampleRate = SampleIntervals[nPos2]; theApp.m_wnd.SetTimer(TIMER_ID_WINPROC, g_nSampleRate, NULL); } UpdateDlg(); CPropertyPage::OnHScroll(nSBCode, nPos, pScrollBar); }
BOOL COptionsDlg::OnInitDialog() { CPropertyPage::OnInitDialog(); CSliderCtrl *pSampleSlider = (CSliderCtrl*)GetDlgItem(IDC_SAMPLE_SLIDER); ASSERT(pSampleSlider != NULL); pSampleSlider->SetRange(0, ELEMENTS(SampleIntervals) - 1); // Milliseconds pSampleSlider->SetTicFreq(1); pSampleSlider->SetPageSize(1); pSampleSlider->SetLineSize(1); int nPos = 0; for (int i = 0; i < ELEMENTS(SampleIntervals); i++) { if ((UINT)g_nSampleRate >= SampleIntervals[i]) nPos = i; } pSampleSlider->SetPos(nPos); CSliderCtrl *pWindowSlider = (CSliderCtrl*)GetDlgItem(IDC_AVERAGE_SLIDER); ASSERT(pWindowSlider != NULL); pWindowSlider->SetRange(1, (MAX_SAMPLES - 1) / AVERAGING_MULTIPLIER); // Seconds pWindowSlider->SetTicFreq(1); pWindowSlider->SetPageSize(1); pWindowSlider->SetLineSize(1); pWindowSlider->SetPos(g_nAveragingWindow / AVERAGING_MULTIPLIER); int nID; switch (g_MonitorMode) { case MONITOR_DUN : nID = IDC_USE_DUN; break; case MONITOR_ADAPTER: nID = IDC_MONITOR_ADAPTER; break; case MONITOR_ALL : nID = IDC_USE_SNMP; break; default : ASSERT(false); break; } CheckRadioButton(IDC_USE_SNMP, IDC_MONITOR_ADAPTER, nID); m_Interfaces.EnableWindow(g_MonitorMode == MONITOR_ADAPTER); UpdateDlg(); // Return TRUE unless you set the focus to a control // Exception: OCX Property Pages should return FALSE return TRUE; }
BOOL CALLBACK MainDlg(HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { switch (message) { case WM_INITDIALOG: OnInitDlg(hwnd); return TRUE; case WM_RECORD_BEG: OnRecordBeg(hwnd, lParam); return TRUE; case WM_RECORD_END: OnRecordEnd(hwnd); return TRUE; case WM_BUILD_GMM: // 建立GMM及生成识别阈值 // 先结束录音 OnStopVoice(hwnd); OnBuildGMM(hwnd); DelVoiceFile(); return TRUE; case WM_COMMAND: switch (LOWORD(wParam)) { case IDC_VOICE_STOP: OnStopVoice(hwnd); DelVoiceFile(); return TRUE; case IDC_CLEAR_TEXT: OnClearBtn(hwnd); return TRUE; case IDC_RESET: OnResetBtn(hwnd); return TRUE; case IDC_IMPORT_GMM: OnImportGMMBtn(hwnd); return TRUE; case IDC_EXPORT_GMM: OnExportGMMBtn(hwnd); return TRUE; case IDC_BUILD_GMM: // 提取声纹按钮 UpdateDlg(hwnd, IDC_BUILD_GMM); OnBuildBtn(hwnd); return TRUE; case IDC_IDENTIFY: // 身份验证 UpdateDlg(hwnd, IDC_IDENTIFY); OnIdentifyBtn(hwnd); return TRUE; case IDCANCEL: // 关闭对话框 g_buildGMM = FALSE; my_voiceprint.voice_mdl.gmm.f_FreeGMM(&my_voiceprint.voice_mdl.gmm); QuitMyWindow(); return TRUE; } // switch (LOWORD(wParam)) break; case WM_SYSCOMMAND: switch (LOWORD(wParam)) { case SC_CLOSE: SendMessage(hwnd, WM_COMMAND, IDCANCEL, 0); return TRUE; } break; } return FALSE; }
void EntityEditor::Show(Map::Layer::Entity* ent) { _curEnt = ent; UpdateDlg(); wxDialog::Show(true); }
void ZItemCountDlg::AddCount( int n ) { m_nCurrCount += n; UpdateDlg(); }