void CModifyDlg::IsShowCtrl() { CComboBox* combo = (CComboBox*)GetDlgItem(IDC_COMBOX1); int selItem = combo->GetCurSel()+1; switch(selItem) { case TP_TIME: IsShowTimeTP(TRUE); IsShowProblemTP(FALSE); IsShowInterfaceTP(FALSE); IsShowDirectCustomerTP(FALSE); //IsShowExTP(FALSE); break; case TP_PROBLEM: IsShowTimeTP(FALSE); IsShowProblemTP(TRUE); IsShowInterfaceTP(FALSE); IsShowDirectCustomerTP(FALSE); //IsShowExTP(FALSE); break; case TP_INTERFACE: IsShowTimeTP(FALSE); IsShowProblemTP(FALSE); IsShowInterfaceTP(TRUE); IsShowDirectCustomerTP(FALSE); //IsShowExTP(FALSE); break; case TP_CUSTOMERSERVICE: IsShowTimeTP(FALSE); IsShowProblemTP(FALSE); IsShowInterfaceTP(FALSE); IsShowDirectCustomerTP(TRUE); //IsShowExTP(FALSE); break; case TP_OTHER: IsShowTimeTP(FALSE); IsShowProblemTP(FALSE); IsShowInterfaceTP(FALSE); IsShowDirectCustomerTP(FALSE); //IsShowExTP(TRUE); break; default: break; } }
BOOL CQuoteTesterDlg::OnInitDialog() { CDialogEx::OnInitDialog(); // 設定此對話方塊的圖示。當應用程式的主視窗不是對話方塊時, // 框架會自動從事此作業 SetIcon(m_hIcon, TRUE); // 設定大圖示 SetIcon(m_hIcon, FALSE); // 設定小圖示 // TODO: 在此加入額外的初始設定 CComboBox *pComboBox = (CComboBox *)GetDlgItem(IDC_COMBO_KLine); pComboBox->AddString(_T("1分鐘線")); pComboBox->AddString(_T("5分鐘線")); pComboBox->AddString(_T("30分鐘線")); pComboBox->AddString(_T("日線228天")); pComboBox->AddString(_T("完整日線")); pComboBox->AddString(_T("週線")); pComboBox->AddString(_T("月線")); pComboBox->SetCurSel(0); return TRUE; // 傳回 TRUE,除非您對控制項設定焦點 }
BOOL shield_sys_dlg::OnInitDialog() { int i, z; int teams[MAX_TEAM_NAMES]; int types[MAX_SHIP_TYPES]; CComboBox *box; for (i=0; i<MAX_TEAM_NAMES; i++) teams[i] = 0; for (i=0; i<MAX_SHIP_TYPES; i++) types[i] = 0; for (i=0; i<MAX_SHIPS; i++) if (Ships[i].objnum >= 0) { z = (Objects[Ships[i].objnum].flags & OF_NO_SHIELDS) ? 1 : 0; if (!teams[Ships[i].team]) Shield_sys_teams[Ships[i].team] = z; else if (Shield_sys_teams[Ships[i].team] != z) Shield_sys_teams[Ships[i].team] = 2; if (!types[Ships[i].ship_info_index]) Shield_sys_types[Ships[i].ship_info_index] = z; else if (Shield_sys_types[Ships[i].ship_info_index] != z) Shield_sys_types[Ships[i].ship_info_index] = 2; teams[Ships[i].team]++; types[Ships[i].ship_info_index]++; } box = (CComboBox *) GetDlgItem(IDC_TYPE); box->ResetContent(); for (i=0; i<Num_ship_types; i++) box->AddString(Ship_info[i].name); box = (CComboBox *) GetDlgItem(IDC_TEAM); box->ResetContent(); for (i=0; i<Num_team_names; i++) box->AddString(Team_names[i]); CDialog::OnInitDialog(); set_team(); set_type(); return TRUE; }
BOOL CSummonDlg::OnInitDialog() { CDialog::OnInitDialog(); SetIcon(m_hIcon, TRUE); // 设置大图标 SetIcon(m_hIcon, FALSE); // 设置小图标 m_SummonLame_Progress.SetRange( 0, 100 ); m_SummonLame_Progress.SetPos(0); CComboBox *cBox; cBox=(CComboBox *)GetDlgItem( IDC_COMBO_SUMMON_OUTPUT_MPEG_VERSION); //init AAC cBox->AddString((LPCTSTR)"MPEG4"); cBox->AddString((LPCTSTR)"MPEG2"); cBox->SetCurSel(1); cBox=(CComboBox *)GetDlgItem( IDC_COMBO_SUMMON_OUTPUT_AAC_VERSION); cBox->AddString((LPCTSTR)"Main"); cBox->AddString((LPCTSTR)"Low Complexity"); cBox->AddString((LPCTSTR)"LTP"); cBox->SetCurSel(1); m_ScrollBar_Summon_Mp3_ABR.EnableScrollBar(ESB_ENABLE_BOTH ); m_ScrollBar_Summon_Mp3_ABR.ShowScrollBar(TRUE); m_ScrollBar_Summon_Mp3_ABR.SetScrollRange(8,310,TRUE); return TRUE; }
BOOL NetCfg::OnInitDialog() { CComboBox *hCombo; CEdit *hEdit; hCombo = (CComboBox*)GetDlgItem(IDC_COMBO_THREAD); hCombo->InsertString(-1,"1"); // hCombo->InsertString(-1,"2"); // hCombo->InsertString(-1,"3"); // hCombo->InsertString(-1,"4"); hCombo->SetCurSel(0); hCombo = (CComboBox*)GetDlgItem(IDC_COMBO_TICK); hCombo->InsertString(-1,"10"); hCombo->InsertString(-1,"100"); hCombo->InsertString(-1,"500"); hCombo->InsertString(-1,"1000"); hCombo->SetCurSel(3); hEdit = (CEdit*)GetDlgItem(IDC_EDIT_TICK); hEdit->SetWindowText("10"); CIPAddressCtrl *hip; hip = (CIPAddressCtrl *)GetDlgItem(IDC_IP_TARGET); hip->SetWindowText(m_ini.ip); hEdit = (CEdit*)GetDlgItem(IDC_EDIT_BROWSE); hEdit->SetWindowText(m_ini.def_file); GetDlgItem(IDC_BTN_TRANSFER)->EnableWindow(FALSE); return TRUE; }
LRESULT SpeedPage::onSpeedChanged(WORD wNotifyCode, WORD wID, HWND hWndCtl, BOOL& /*bHandled*/) { tstring speed; speed.resize(1024); speed.resize(GetDlgItemText(wID, &speed[0], 1024)); if (!speed.empty() && wNotifyCode != CBN_SELENDOK) { boost::wregex reg; if(speed[speed.size() -1] == '.') reg.assign(_T("(\\d+\\.)")); else reg.assign(_T("(\\d+(\\.\\d+)?)")); if (!regex_match(speed, reg)) { CComboBox tmp; tmp.Attach(hWndCtl); DWORD dwSel; if ((dwSel = tmp.GetEditSel()) != CB_ERR) { tstring::iterator it = speed.begin() + HIWORD(dwSel)-1; speed.erase(it); tmp.SetEditSel(0,-1); tmp.SetWindowText(speed.c_str()); tmp.SetEditSel(HIWORD(dwSel)-1, HIWORD(dwSel)-1); tmp.Detach(); } } } updateValues(wNotifyCode); validateMCNLimits(wNotifyCode); return TRUE; }
void CNetworkControllView::AddNewTimeServer(const CString& strTimeServer) { BOOL bFind = FALSE; UINT i =0; for (i = 0; i < m_szServers.size(); i++) { if (strTimeServer.CompareNoCase(m_szServers[i]) == 0) { bFind = TRUE; } } if (!bFind) // new time server { CComboBox* pCbx = (CComboBox*)GetDlgItem(IDC_COMBO_TIMESERVERLIST); if(m_szServers.size() >= 10) { for (UINT j =5; j < 9; j++) { m_szServers[j] = m_szServers[j+1]; } m_szServers[9]=strTimeServer; pCbx->DeleteString(5); } else { m_szServers.push_back(strTimeServer); } // // write to register for (UINT i = 5; i < m_szServers.size(); i++) { CString strIndex; int nsize = m_szServers.size(); strIndex.Format(_T("server%d"), i+1); SaveTimeServerToRegister(m_szServers[i], strIndex); } pCbx->AddString(strTimeServer); } }
void CTextureTool::SetBrightness (int nBrightness) { static BOOL bSemaphore = FALSE; if (!bSemaphore) { bSemaphore = TRUE; CComboBox *pcb = (m_bUse2nd && !m_bUse1st) ? CBTexture2 () : CBTexture1 (); int index = pcb->GetCurSel (); INT16 texture = (INT16) pcb->GetItemData (index); if (texture >= 0) { m_nBrightness = nBrightness; lightMap [texture] = ((nBrightness == 100) ? MAX_BRIGHTNESS : nBrightness * (MAX_BRIGHTNESS / 100)); } bSemaphore = FALSE; } }
void CStockPropPage::OnSelchangePropname(CComboBox& combo) { int iPropNameNew = combo.GetCurSel(); if (iPropNameNew != m_iPropName) { UpdateData(TRUE); if (iPropNameNew != CB_ERR) combo.GetLBText(iPropNameNew, m_strPropName); else m_strPropName = _T(""); m_iPropName = iPropNameNew; UpdateData(FALSE); SetModifiedFlag(FALSE); } }
int CPolyDlg::FindDupCrnr( Vector3D crnr, CComboBox& combo ) { //06/20/03 don't allow duplicate points int numsegs = combo.GetCount() ; for (int i = 0; i < numsegs; i++ ) { CString csInstr; combo.GetLBText(i, csInstr ); int nCornerNum = GetItemNum( csInstr ) ; Vector3D v = GetCnrVector( csInstr ) ; if (v.x == crnr.x && v.y == crnr.y )//Matching coordinate set found { //If match found, return corner number return nCornerNum ; } } return -1 ; //no match found }
void CAntiVirus::Enum(CComboBox& wndAntiVirus) { if ( ! ::IsWindow( wndAntiVirus.GetSafeHwnd() ) ) return; wndAntiVirus.ResetContent(); // No anti-virus int nAntiVirus = wndAntiVirus.AddString( _T("") ); wndAntiVirus.SetItemDataPtr( nAntiVirus, (LPVOID)new CString() ); // Enum available anti-viruses CComPtr< ICatInformation > pInfo; HRESULT hr = pInfo.CoCreateInstance( CLSID_StdComponentCategoriesMgr ); if ( SUCCEEDED( hr ) ) { const CATID IDs[ 1 ] = { CATID_MSOfficeAntiVirus }; CComPtr< IEnumCLSID > pEnum; hr = pInfo->EnumClassesOfCategories( 1, IDs, 0, NULL, &pEnum ); if ( SUCCEEDED( hr ) ) { CLSID clsid; while ( pEnum->Next( 1, &clsid, NULL ) == S_OK ) { const CString sCLSID = Hashes::toGuid( clsid, true ); HKEY hClass = NULL; if ( ERROR_SUCCESS == RegOpenKeyEx( HKEY_CLASSES_ROOT, _T("CLSID\\") + sCLSID, 0, KEY_READ, &hClass ) ) { // Get it name TCHAR szValue[ MAX_PATH ] = {}; DWORD nValue = MAX_PATH, nType = REG_SZ; if ( ERROR_SUCCESS == RegQueryValueEx( hClass, NULL, NULL, &nType, (LPBYTE)szValue, &nValue ) ) { const int nIndex = wndAntiVirus.AddString( szValue ); wndAntiVirus.SetItemDataPtr( nIndex, (LPVOID)new CString( sCLSID ) ); if ( Settings.General.AntiVirus.CompareNoCase( sCLSID ) == 0 ) { nAntiVirus = nIndex; } } RegCloseKey( hClass ); } } } } wndAntiVirus.SetCurSel( nAntiVirus ); wndAntiVirus.EnableWindow( wndAntiVirus.GetCount() > 1 ); }
BOOL SoundEnvironment::OnInitDialog() { m_play_bm.LoadBitmap(IDB_PLAY); ((CButton *) GetDlgItem(IDC_PLAY)) -> SetBitmap(m_play_bm); // fill environment list ... CComboBox *box = (CComboBox *) GetDlgItem(IDC_SOUND_ENVIRONMENT); // add empty default string (for no environment set) box->AddString(""); for (size_t i = 0; i < EFX_presets.size(); i++) { box->AddString(EFX_presets[i].name.c_str()); } // set values ... sound_env *m_env = &The_mission.sound_environment; // make sure we are set by default to mission values if (m_env->id >= 0) { m_environment = m_env->id + 1; m_volume = m_env->volume; m_damping = m_env->damping; m_decay_time = m_env->decay; // make it active sound_env_set(m_env); } else { m_environment = 0; m_volume = 0.0f; m_damping = 0.1f; m_decay_time = 0.1f; sound_env_disable(); } CDialog::OnInitDialog(); UpdateData(FALSE); return TRUE; }
void CInstrumentEditorN163Wave::SelectInstrument(int Instrument) { m_pInstrument = (CInstrumentN163*)GetDocument()->GetInstrument(Instrument); CComboBox *pSizeBox = (CComboBox*)GetDlgItem(IDC_WAVE_SIZE); CComboBox *pPosBox = (CComboBox*)GetDlgItem(IDC_WAVE_POS); CString SizeStr; SizeStr.Format(_T("%i"), m_pInstrument->GetWaveSize()); pSizeBox->SelectString(0, SizeStr); FillPosBox(m_pInstrument->GetWaveSize()); CString PosStr; PosStr.Format(_T("%i"), m_pInstrument->GetWavePos()); pPosBox->SetWindowText(PosStr); /* if (m_pInstrument->GetAutoWavePos()) { CheckDlgButton(IDC_POSITION, 1); GetDlgItem(IDC_WAVE_POS)->EnableWindow(FALSE); } else { CheckDlgButton(IDC_POSITION, 0); GetDlgItem(IDC_WAVE_POS)->EnableWindow(TRUE); } */ if (m_pWaveEditor) { m_pWaveEditor->SetInstrument(m_pInstrument); m_pWaveEditor->SetLength(m_pInstrument->GetWaveSize()); } CSpinButtonCtrl *pIndexSpin = (CSpinButtonCtrl*)GetDlgItem(IDC_INDEX_SPIN); CSpinButtonCtrl *pWavesSpin = (CSpinButtonCtrl*)GetDlgItem(IDC_WAVES_SPIN); int WaveCount = m_pInstrument->GetWaveCount(); pIndexSpin->SetRange(0, WaveCount - 1); pIndexSpin->SetPos(0); pWavesSpin->SetPos(WaveCount - 1); m_iWaveIndex = 0; }
BOOL CConfigAppearance::OnInitDialog() { CPropertyPage::OnInitDialog(); const CSettings *pSettings = theApp.GetSettings(); m_strFont = pSettings->Appearance.strFont; // // // CDC *pDC = GetDC(); if (pDC != NULL) { LOGFONTW LogFont = { }; // // // LogFont.lfCharSet = ANSI_CHARSET; EnumFontFamiliesExW(pDC->m_hDC, &LogFont, (FONTENUMPROC)EnumFontFamExProc, (LPARAM)this, 0); ReleaseDC(pDC); } CComboBox *pFontSizeList = static_cast<CComboBox*>(GetDlgItem(IDC_FONT_SIZE)); CComboBox *pItemsBox = static_cast<CComboBox*>(GetDlgItem(IDC_COL_ITEM)); for (int i = 0; i < COLOR_ITEM_COUNT; ++i) { pItemsBox->AddString(conv::to_wide(COLOR_ITEMS[i]).data()); } pItemsBox->SelectString(0, conv::to_wide(COLOR_ITEMS[0]).data()); m_iSelectedItem = 0; m_iColors[COL_BACKGROUND] = pSettings->Appearance.iColBackground; m_iColors[COL_BACKGROUND_HILITE] = pSettings->Appearance.iColBackgroundHilite; m_iColors[COL_BACKGROUND_HILITE2] = pSettings->Appearance.iColBackgroundHilite2; m_iColors[COL_PATTERN_TEXT] = pSettings->Appearance.iColPatternText; m_iColors[COL_PATTERN_TEXT_HILITE] = pSettings->Appearance.iColPatternTextHilite; m_iColors[COL_PATTERN_TEXT_HILITE2] = pSettings->Appearance.iColPatternTextHilite2; m_iColors[COL_PATTERN_INSTRUMENT] = pSettings->Appearance.iColPatternInstrument; m_iColors[COL_PATTERN_VOLUME] = pSettings->Appearance.iColPatternVolume; m_iColors[COL_PATTERN_EFF_NUM] = pSettings->Appearance.iColPatternEffect; m_iColors[COL_SELECTION] = pSettings->Appearance.iColSelection; m_iColors[COL_CURSOR] = pSettings->Appearance.iColCursor; m_iColors[COL_CURRENT_ROW_NORMAL] = pSettings->Appearance.iColCurrentRowNormal; // // // m_iColors[COL_CURRENT_ROW_EDIT] = pSettings->Appearance.iColCurrentRowEdit; m_iColors[COL_CURRENT_ROW_PLAYING] = pSettings->Appearance.iColCurrentRowPlaying; m_iFontSize = pSettings->Appearance.iFontSize; // // // m_bPatternColors = pSettings->Appearance.bPatternColor; // // // m_bDisplayFlats = pSettings->Appearance.bDisplayFlats; // // // pItemsBox = static_cast<CComboBox*>(GetDlgItem(IDC_SCHEME)); for (auto *scheme : COLOR_SCHEMES) pItemsBox->AddString(scheme->NAME); for (int pt : FONT_SIZES) // // // pFontSizeList->AddString(conv::to_wide(conv::from_int(pt)).data()); pFontSizeList->SetWindowTextW(conv::to_wide(conv::from_int(m_iFontSize)).data()); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
int CChannelConfigurationDlg::nUpdateLinSettings() { CComboBox* pomCombo = (CComboBox*)GetDlgItem(IDC_COMBO_LIN_PROTOCOL); if ( pomCombo != nullptr ) { for ( int i = 0 ; i < ( sizeof(sg_LINPROTOCOL_BAUD)/ sizeof(sg_LINPROTOCOL_BAUD[0])); i++ ) { pomCombo->InsertString(i, sg_LINPROTOCOL_BAUD[i].m_strProtocol.c_str()); } pomCombo->SetCurSel(0); } m_nLinBaudRate = 1900; UpdateData(FALSE); OnOverwriteCheckBoxClick(); return 0; }
void CDlgRename::OnOK() { // Si le mode est format prédéfini et que la séléction est correcte // la variable m_bValidFormat est à TRUE, sinon il faut utiliser le // nom plutôt que le format. m_bValidFormat = FALSE; if( GetMode() == FORMAT_PREDEFINED ) { CComboBox* pCBox = (CComboBox *) GetDlgItem( IDC_CMB_FORMATS ); int nIndex = pCBox->GetCurSel(); if( nIndex != CB_ERR ) { m_format.Copy( (CFormat *) pCBox->GetItemData( nIndex )); m_bValidFormat = TRUE; } } CDialog::OnOK(); }
BOOL CBerkeleyView::OnInitDialog() { CDialogEx::OnInitDialog(); // TODO: Add extra initialization here CComboBox* pBox = (CComboBox*)GetDlgItem(IDC_DATA_TYPE); pBox->AddString(_T("String")); pBox->SetItemData(0, DataDecoder::eDTString); pBox->AddString(_T("Bitmap")); pBox->SetItemData(0, DataDecoder::eDTBitmap); pBox->AddString(_T("LZ")); pBox->SetItemData(0, DataDecoder::eDTLZ); pBox->AddString(_T("RLE")); pBox->SetItemData(0, DataDecoder::eDTRLE); pBox->SelectString(0, _T("String")); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
void CXTPCalendarEventRecurrenceDlg::InitMonthCBs(CComboBox& wndCB) { for (int nMonth = 0; nMonth < 12; nMonth++) { _AddLocaleString(wndCB, LOCALE_SMONTHNAME1 + nMonth, nMonth + 1); } COleDateTime dtNow(COleDateTime::GetCurrentTime()); wndCB.SetCurSel(dtNow.GetMonth() - 1); }
//初始化函数 BOOL CSetChip::OnInitDialog() { __super::OnInitDialog(); //设置标题 SetWindowText(TEXT("压注")); //计算押注 LONG lChipsArray[SET_CHIP_COUNT] ; //数据验证 ASSERT( m_wMaxChip > 0 ) ; if ( m_wMaxChip <= 0 ) return TRUE ; for ( BYTE cbChipIndex = 0; cbChipIndex < SET_CHIP_COUNT; ++cbChipIndex ) { lChipsArray[cbChipIndex] = LONG ( ( cbChipIndex + 1.0 ) / SET_CHIP_COUNT * m_wMaxChip ) ; //整百处理 if ( lChipsArray[cbChipIndex] > 100 ) { LONG lHundredCount = lChipsArray[cbChipIndex] / 100 ; lChipsArray[cbChipIndex] = lHundredCount * 100 ; } } //插入押注 CComboBox *pChipComBox = ( CComboBox* ) GetDlgItem( IDC_SETCHIP ) ; CString strChip ; for ( BYTE cbChipIndex = 0; cbChipIndex < SET_CHIP_COUNT; ++cbChipIndex ) { strChip.Format( TEXT( "%ld" ), lChipsArray[cbChipIndex] ) ; pChipComBox->InsertString( cbChipIndex, strChip ) ; } pChipComBox->SetCurSel( 0 ) ; pChipComBox->SetFocus() ; m_nChip = lChipsArray[0] ; return TRUE; }
void CDlgForEach::RenameParam( LPCTSTR strOld, LPCTSTR strNew ) { BOOL bSelectParam = FALSE; CComboBox* pBox; CString str; int n; pBox = (CComboBox*)GetDlgItem(IDC_COMBO_PARAM); n = pBox->GetCurSel(); if(n != -1) { pBox->GetLBText(n, str); if(str == strOld) bSelectParam = TRUE; } DeleteStringFromComboBox(pBox, strOld); AddStringToComboBox(pBox, strNew); if(bSelectParam) SelectStringFromComboBox(pBox, strNew); for(int i = 0; i < (int)m_vpComboBox.size(); i++) { BOOL bSelect = FALSE; pBox = m_vpComboBox[i]; n = pBox->GetCurSel(); if(n != -1) { pBox->GetLBText(n, str); if(str == strOld) bSelect = TRUE; } DeleteStringFromComboBox(pBox, strOld); AddStringToComboBox(pBox, strNew); if(bSelect) SelectStringFromComboBox(pBox, strNew); } }
BOOL CPageStart::OnInitDialog() { CPropertyPage::OnInitDialog(); CComboBox* pCombo; CBitmap bmp; CRect rectWnd; CRect rectTemp; m_pSheet = (CNewTaskDlg*)GetParent(); m_ilState.Create(16, 16, ILC_COLORDDB|ILC_MASK, 0, 1); bmp.LoadBitmap(IDB_STATES); int i = m_ilState.Add(&bmp, RGB(255, 0, 255)); bmp.DeleteObject(); rectWnd.SetRectEmpty(); ::ImageList_GetIconSize(m_ilState, (int*)&rectWnd.right, (int*)&rectWnd.bottom); for (BYTE nCS = 0; nCS < MAX_CS; nCS++) { GetDlgItem(IDC_LABLE_CE0 + nCS)->GetWindowRect(rectTemp); ScreenToClient(rectTemp); rectWnd.MoveToXY(rectTemp.right+1, rectTemp.top-1); m_pStateCS[nCS] = new CStatic; m_pStateCS[nCS]->Create(_T(""), WS_CHILD|WS_VISIBLE|SS_ICON, rectWnd, this); } pCombo = (CComboBox*)GetDlgItem(IDC_COMBO_VCC); for (BYTE i = 0; i < CountPower; i++) { pCombo->SetItemData(pCombo->AddString(CFlashRecord::GetStringPower(i)), i); } SetSelection(pCombo, Power_1_8); GetDlgItem(IDC_LABEL_RECORDS)->GetWindowRect(rectWnd); ScreenToClient(rectWnd); m_FlashParametersDlg.Create(this, rectWnd.TopLeft()); m_FlashRecordsDlg.Create(this, rectWnd.TopLeft()); m_bCheckSuccess = FALSE; m_bConnected = m_pSheet->m_pOwner->IsConnected(); m_nSelectID = m_bConnected ? IDC_SELECT_CHECK : IDC_SELECT_BASE; ((CButton*)GetDlgItem(IDC_SELECT_CHECK))->EnableWindow(m_bConnected); ((CButton*)GetDlgItem(m_nSelectID))->SetCheck(BST_CHECKED); m_bCheckSuccess = FALSE; m_nSignature = NO_FILTER_ID; SetCheckControls(); return TRUE; }
void CMainFrame::OnUpdateFontName(CCmdUI* /*pCmdUI*/) { CComboBox *pCombo = (CComboBox*)GetFontNameCombo(); ASSERT_VALID(pCombo); //If Source View, don't display the font name combobox if(m_dwCurrentView == ID_VIEW_SOURCE) { pCombo->EnableWindow(FALSE); return; } else { if(m_pWebView->QueryStatus(IDM_BLOCKFMT) & OLECMDF_ENABLED) pCombo->EnableWindow(); else pCombo->EnableWindow(FALSE); } }
//================================================= // Helper Functions //================================================= CString CMainDlg::GetOutputFileName() { CString strFile = _T(""); GetControlValues(); switch(m_iNamingOpt) { case 0: // Use entered prefix { strFile = m_strImageName; break; } case 1: // Always ask for prefix { CGetDataDlg dlg; dlg.SetTitle(_T("Enter File Prefix")); if(dlg.DoModal() == IDOK) strFile = dlg.GetData(); break; } case 2: // No prefix break; } if(strFile.GetLength() > 0) strFile += _T("_"); // Add time stamp COleDateTime dtNow = COleDateTime::GetCurrentTime(); CString strDT = dtNow.Format(_T("%d-%m-%y_%H-%M-%S")); strFile += strDT; // Add file extension //strFile += _T(".jpg"); CComboBox* pCombo = NULL; VERIFY(pCombo = (CComboBox*)GetDlgItem(IDC_IMAGE_EXT)); strFile += _T("."); CString strExt = _T(""); pCombo->GetWindowText(strExt); strFile += strExt; return strFile; }
void CSTWSelectTmplPage::OnSelchangeComboTemplate() { CString s; CComboBox* pCmb = (CComboBox*) GetDlgItem (IDC_COMBO_TEMPLATE); pCmb->GetLBText (pCmb->GetCurSel (), s); // Check whether template has been modified // and if so, ask user whether to safe template CStyleTemplateWizard* pWiz = (CStyleTemplateWizard*) GetParent (); CStyleTemplates& tmpl = ((CCdCoverCreator2App*) AfxGetApp ())->GetTemplates (); if (pWiz->m_pTemplate != NULL) { CStyleTemplate t; if (tmpl.LoadTemplate (pWiz->m_pTemplate->GetName (), &t)) if (*pWiz->m_pTemplate != t) if (AfxMessageBox (IDS_SAVETEMPLATE, MB_ICONQUESTION | MB_YESNO) == IDYES) { tmpl.StoreTemplate (*pWiz->m_pTemplate); if (t.GetName ().IsEmpty ()) { // name is empty: a new template has been created // insert name into combo box pCmb->AddString (pWiz->m_pTemplate->GetName ()); pCmb->SelectString (-1, s); } } } // switch to newly selected template if (!s.IsEmpty ()) { if (pWiz->m_pTemplate == NULL) pWiz->m_pTemplate = new CStyleTemplate (); tmpl.LoadTemplate (s, pWiz->m_pTemplate); if (::IsWindow (pWiz->m_wndPreview.GetSafeHwnd ())) pWiz->m_wndPreview.InvalidateRect (NULL); } }
void CInstrumentEditorDPCM::OnNMRClickTable(NMHDR *pNMHDR, LRESULT *pResult) { LPNMITEMACTIVATE pNMItemActivate = reinterpret_cast<LPNMITEMACTIVATE>(pNMHDR); // Create a popup menu for key list with samples CDSample *pDSample; CMenu PopupMenu; CPoint point; m_pTableListCtrl = reinterpret_cast<CListCtrl*>(GetDlgItem(IDC_TABLE)); m_iSelectedKey = m_pTableListCtrl->GetSelectionMark(); GetCursorPos(&point); PopupMenu.CreatePopupMenu(); PopupMenu.AppendMenu(MF_STRING, 1, _T("(no sample)")); // Fill menu for (int i = 0; i < MAX_DSAMPLES; i++) { pDSample = GetDocument()->GetDSample(i); if (pDSample->SampleSize > 0) { PopupMenu.AppendMenu(MF_STRING, i + 2, A2T(pDSample->Name)); } } UINT Result = PopupMenu.TrackPopupMenu(TPM_RIGHTBUTTON | TPM_RETURNCMD, point.x, point.y, this); if (Result == 1) { // Remove sample m_pInstrument->SetSample(m_iOctave, m_iSelectedKey, 0); UpdateKey(m_iSelectedKey); } else if (Result > 1) { // Add sample CComboBox *pPitchBox = reinterpret_cast<CComboBox*>(GetDlgItem(IDC_PITCH)); int Pitch = pPitchBox->GetCurSel(); m_pInstrument->SetSample(m_iOctave, m_iSelectedKey, Result - 1); m_pInstrument->SetSamplePitch(m_iOctave, m_iSelectedKey, Pitch); UpdateKey(m_iSelectedKey); } *pResult = 0; }
// CGeneralSettings message handlers BOOL CGeneralSettingsDlg::OnInitDialog() { CDialog::OnInitDialog(); m_LocalLang.TreeControls(m_hWnd,m_Configs.bDebug?TRUE:FALSE,this->IDD,false); ((CButton*)GetDlgItem(IDC_CHECK_AUTO ))->SetCheck(m_Configs.bAutoTest ?BST_CHECKED:BST_UNCHECKED); ((CButton*)GetDlgItem(IDC_CHECK_ONLYAT ))->SetCheck(m_Configs.bOnlyAt ?BST_CHECKED:BST_UNCHECKED); ((CButton*)GetDlgItem(IDC_CHECK_FUSE ))->SetCheck(m_Configs.bFuse ?BST_CHECKED:BST_UNCHECKED); ((CButton*)GetDlgItem(IDC_CHECK_WV ))->SetCheck(m_Configs.bWideVine ?BST_CHECKED:BST_UNCHECKED); ((CButton*)GetDlgItem(IDC_CHECK_WVREAD ))->SetCheck(m_Configs.bWideVineRead?BST_CHECKED:BST_UNCHECKED); ((CButton*)GetDlgItem(IDC_CHECK_USEDB ))->SetCheck(m_Configs.bUseDB ?BST_CHECKED:BST_UNCHECKED); ((CButton*)GetDlgItem(IDC_CHECK_FORCEWRITE ))->SetCheck(m_Configs.bForceWrite ?BST_CHECKED:BST_UNCHECKED); ((CButton*)GetDlgItem(IDC_CHECK_REBOOT ))->SetCheck(m_Configs.bReboot ?BST_CHECKED:BST_UNCHECKED); ((CButton*)GetDlgItem(IDC_CHECK_READ_FUSE ))->SetCheck(m_Configs.bFuseRead ?BST_CHECKED:BST_UNCHECKED); ((CButton*)GetDlgItem(IDC_CHECK_SCRIPT_BIN ))->SetCheck(m_Configs.bIsBinScript ?BST_CHECKED:BST_UNCHECKED); /*set mode **/ CComboBox* hCtl = (CComboBox*)GetDlgItem(IDC_COMBO_MODE); INT CurSel = -1; for(int i = 0 ; i < dim(RebootMode); i ++ ) { hCtl->AddString(RebootMode[i].strMode); if(m_Configs.nMode == RebootMode[i].type) { CurSel = i; } } if(-1 != CurSel) { hCtl->SetCurSel(CurSel); } /*set mode end ***/ if( m_Configs.bIsBin) { ((CButton*)GetDlgItem(IDC_CHECK_BIN))->SetCheck(BST_CHECKED); ((CButton*)GetDlgItem(IDC_CHECK_XML))->SetCheck(BST_UNCHECKED); } else { ((CButton*)GetDlgItem(IDC_CHECK_BIN))->SetCheck(BST_UNCHECKED); ((CButton*)GetDlgItem(IDC_CHECK_XML))->SetCheck(BST_CHECKED); } InitCtrl(); return TRUE; }
// This is simply hard-coded for convenience. Should be good enough for // The Guide. The user can always edit it anyway. void FillFontSizes(CComboBox& cb) { const static TCHAR *szFontSizes[] = { _T("8"), _T("9"), _T("10"), _T("11"), _T("12"), _T("14"), _T("16"), _T("18"), _T("20"), _T("22"), _T("24"), _T("26"), _T("28"), _T("36"), _T("48"), _T("72") }; for (int i=0; i<sizeof(szFontSizes)/sizeof(*szFontSizes); ++i) cb.AddString(szFontSizes[i]); }
BOOL CComboBoxEx2::SelectItemDataStringA(LPCSTR pszText) { CComboBox* pctrlCB = GetComboBoxCtrl(); if (pctrlCB != NULL) { int iCount = pctrlCB->GetCount(); for (int i = 0; i < iCount; i++) { void* pvItemData = GetItemDataPtr(i); if (pvItemData && strcmp((LPCSTR)pvItemData, pszText) == 0) { SetCurSel(i); GetParent()->SendMessage(WM_COMMAND, MAKELONG((WORD)GetWindowLong(m_hWnd, GWL_ID), CBN_SELCHANGE), (LPARAM)m_hWnd); return TRUE; } } } return FALSE; }
bool CALLBACK DSEnumProc(LPGUID lpGUID, LPCTSTR lpszDesc, LPCTSTR lpszDrvName, LPVOID lpContext) { CComboBox* pCombo = (CComboBox*)lpContext; ASSERT(pCombo); LPGUID lpTemp = NULL; if (lpGUID != NULL) { // NULL only for "Primary Sound Driver". if ((lpTemp = (LPGUID)malloc(sizeof(GUID))) == NULL) { return TRUE; } memcpy(lpTemp, lpGUID, sizeof(GUID)); } pCombo->AddString(lpszDesc); free(lpTemp); return TRUE; }
void CXTPCalendarEventRecurrenceDlg::InitWhichDayCBs(CComboBox& wndCB) { _AddString(wndCB, XTP_IDS_CALENDAR_FIRST, xtpCalendarWeekFirst); _AddString(wndCB, XTP_IDS_CALENDAR_SECOND, xtpCalendarWeekSecond); _AddString(wndCB, XTP_IDS_CALENDAR_THIRD, xtpCalendarWeekThird); _AddString(wndCB, XTP_IDS_CALENDAR_FOURTH, xtpCalendarWeekFourth); _AddString(wndCB, XTP_IDS_CALENDAR_LAST, xtpCalendarWeekLast); wndCB.SetCurSel(0); }