BOOL CStationDlg::OnInitDialog(void) { CDialog::OnInitDialog(); VERIFY(mdlbmp.SubclassDlgItem(IDC_PICT, this)); VERIFY(imdlbmp.SubclassDlgItem(IDC_PICTI, this)); CComboBox *cbach = (CComboBox *)GetDlgItem(IDC_ACHULL); CComboBox *cbashld = (CComboBox *)GetDlgItem(IDC_ACSHLD); cbach->ResetContent(); cbashld->ResetContent(); for (int i=0;i<IGCACMAX;i++) { cbach->AddString(IGCArmorClasses[i]); cbashld->AddString(IGCArmorClasses[i]); } cbtype = (CComboBox *) CWnd::GetDlgItem(IDC_STATIONTYPE); for (int i=0;i<IGCSTATION_TYPE_NBVALS;i++) { int idx = cbtype->AddString(IGCStationTypeNames[i]); cbtype->SetItemData(idx,i); } ((CEdit *)GetDlgItem(IDC_DESCR))->SetLimitText(IGC_DESCRIPTIONMAX); ((CEdit *)GetDlgItem(IDC_NAME))->SetLimitText(IGC_NAMEMAX); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
BOOL wing_editor::Create() { BOOL r; int i; CComboBox *box; r = CDialog::Create(IDD, Fred_main_wnd); box = (CComboBox *) GetDlgItem(IDC_ARRIVAL_LOCATION); box->ResetContent(); for (i=0; i<MAX_ARRIVAL_NAMES; i++) box->AddString(Arrival_location_names[i]); box = (CComboBox *) GetDlgItem(IDC_DEPARTURE_LOCATION); box->ResetContent(); for (i=0; i<MAX_DEPARTURE_NAMES; i++) box->AddString(Departure_location_names[i]); m_hotkey = 0; m_waves_spin.SetRange(1, 99); m_arrival_tree.link_modified(&modified); // provide way to indicate trees are modified in dialog m_arrival_tree.setup((CEdit *) GetDlgItem(IDC_HELP_BOX)); m_departure_tree.link_modified(&modified); m_departure_tree.setup(); m_arrival_delay_spin.SetRange(0, 999); m_departure_delay_spin.SetRange(0, 999); initialize_data(1); return r; }
BOOL CoptimizerDlg::OnInitDialog() { CSliderCtrl *Slider = (CSliderCtrl *)GetDlgItem(IDC_SLIDER_CUSTOM); CComboBox *CBox = (CComboBox *)GetDlgItem(IDC_COMBO_PRESET); CProgressCtrl *ProgressBar = (CProgressCtrl*)GetDlgItem(IDC_PROGRESS); CString buf; CDialog::OnInitDialog(); SetIcon(m_hIcon, TRUE); SetIcon(m_hIcon, FALSE); CheckRadioButton(IDC_RADIO_PRESET, IDC_RADIO_CUSTOM, IDC_RADIO_PRESET); Slider->SetRange(1000, 10000); Slider->SetTicFreq(1000); CBox->ResetContent(); for(int i = 0; i < NUMSTRINGS; i++) { buf.LoadString(IDS_STRING1 + i); CBox->AddString(buf); } CBox->SetCurSel(2); SetSlider(Slider, 2); ProgressBar->SetRange(0, 100); return TRUE; }
// 查找串口 void CPMSRSet::FindComPort() { HKEY hKey; st_CommPara.usCommNum = 0; // 串口数量 if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("Hardware\\DeviceMap\\SerialComm"), NULL, KEY_READ, &hKey) == ERROR_SUCCESS) { TCHAR szPortName[256], szComName[256]; DWORD dwLong, dwSize; int nCount = 0; CComboBox* pCombo = (CComboBox*)GetDlgItem(IDC_COMBO1); pCombo->ResetContent(); while (true) { dwLong = dwSize = 256; if (RegEnumValue(hKey, nCount, szPortName, &dwLong, NULL, NULL, (PUCHAR)szComName, &dwSize) == ERROR_NO_MORE_ITEMS) break; pCombo->InsertString(nCount, szComName); nCount++; st_CommPara.usCommNum++; } RegCloseKey(hKey); pCombo->SetCurSel(0); } }
void CInstrumentEditorDPCM::BuildSampleList() { CString Text; CComboBox *pSampleBox = reinterpret_cast<CComboBox*>(GetDlgItem(IDC_SAMPLES)); m_pSampleListCtrl = reinterpret_cast<CListCtrl*>(GetDlgItem(IDC_SAMPLE_LIST)); m_pSampleListCtrl->DeleteAllItems(); pSampleBox->ResetContent(); unsigned int Size(0), Index(0); pSampleBox->AddString(_T("(no sample)")); for (int i = 0; i < MAX_DSAMPLES; ++i) { CDSample *pDSample = GetDocument()->GetDSample(i); if (pDSample->SampleSize > 0) { Text.Format(_T("%i"), i); m_pSampleListCtrl->InsertItem(Index, Text); Text.Format(_T("%s"), pDSample->Name); m_pSampleListCtrl->SetItemText(Index, 1, Text); Text.Format(_T("%i"), pDSample->SampleSize); m_pSampleListCtrl->SetItemText(Index, 2, Text); Text.Format(_T("%02i - %s"), i, pDSample->Name); pSampleBox->AddString(Text); Size += pDSample->SampleSize; ++Index; } } Text.Format(IDS_DPCM_SPACE_FORMAT, Size / 0x400, (MAX_SAMPLE_SPACE - Size) / 0x400, MAX_SAMPLE_SPACE / 0x400); SetDlgItemText(IDC_SPACE, Text); }
// 查找串口 void CSerialPort::FindComPort(CComboBox& m_PortNO) { HKEY hKey; UINT i; for (i = 0; i<MaxSerialPortNum; i++)///存放串口号的数组初始化 { m_ComArray[i] = -1; } if (RegOpenKeyEx(HKEY_LOCAL_MACHINE, _T("Hardware\\DeviceMap\\SerialComm"), NULL, KEY_READ, &hKey) == ERROR_SUCCESS) { TCHAR szPortName[256], szComName[256]; DWORD dwLong, dwSize; m_ComCount = 0; m_PortNO.ResetContent();///刷新时,清空下拉列表内容 while (true) { dwLong = dwSize = 256; if (RegEnumValue(hKey, m_ComCount, szPortName, &dwLong, NULL, NULL, (PUCHAR)szComName, &dwSize) == ERROR_NO_MORE_ITEMS) break; m_PortNO.InsertString(m_ComCount, szComName); m_ComArray[m_ComCount] = atoi((char*)(szComName + 3)); m_ComCount++; } RegCloseKey(hKey); m_PortNO.SetCurSel(0); } }
void CNetworkControllView::initTimeServerList() { m_szServers.clear(); CComboBox* pCbx = (CComboBox*)GetDlgItem(IDC_COMBO_TIMESERVERLIST); pCbx->ResetContent(); pCbx->Clear(); for (int i = 0 ; i < 5; i++) { m_szServers.push_back(c_strTimeserverList[i]); } CString strIndex; CString strValue; for (int i = 6; i <= 10; i++) { strIndex.Format(_T("server%d"), i); if(LoadTimeServerFromRegister(strIndex, strValue)) { m_szServers.push_back(strValue); } else { break; } } for (UINT n = 0; n < m_szServers.size(); n++) { pCbx->AddString(m_szServers[n]); } pCbx->SetCurSel(0); }
LRESULT RecipePanel::onInitDialog(UINT/*uMsg*/, WPARAM/*wParam*/, LPARAM/*lParam*/, BOOL&/*bHandled*/) { SetWindowText(_T("Filter View")); updateCharList(); { CComboBox cb = GetDlgItem(IDC_RECIPECOMBO); auto recipes = m_recipeLoader.getRecipes(); cb.ResetContent(); int item = cb.AddString(_T("-")); for (unsigned int i = 0; i < recipes.size(); i++) { std::tstring name = recipes[i]; if ((item = cb.AddString(name.c_str())) != CB_ERR) { cb.SetItemData(item, i); } } cb.SetCurSel(0); } signalSettingsChanged(); return 0; }
void wing_editor::OnSelchangeDepartureLocation() { CComboBox *box; box = (CComboBox *)GetDlgItem(IDC_DEPARTURE_TARGET); UpdateData(); if (m_departure_location) { GetDlgItem(IDC_DEPARTURE_TARGET)->EnableWindow(TRUE); if (m_departure_target < 0) { m_departure_target = 0; } // we need to build up the list box content based on the departure type. When // from a docking bay, only show ships in the list which have them. Show all ships otherwise if ( m_departure_location == DEPART_AT_DOCK_BAY ) { management_add_ships_to_combo( box, SHIPS_2_COMBO_DOCKING_BAY_ONLY ); } else { // I think that this section is currently illegal Int3(); } } else { box->ResetContent(); box->EnableWindow(TRUE); if ( m_departure_target < 0 ) m_departure_target = -1; m_departure_target = 0; box->AddString("None"); for (int i=0; i<Num_jump_nodes; i++) box->AddString(Jumppoint_lists[i].name); //GetDlgItem(IDC_DEPARTURE_TARGET)->EnableWindow(FALSE); } UpdateData(FALSE); }
//----------------------------- FUNCTION -------------------------------------* BOOL PropGSDModule::OnSetActive() { // TODO: Add your specialized code here and/or call the base class CComboBox* pUsedModules = (CComboBox*)GetDlgItem(IDC_COMBO_USED_MODULES); if (pUsedModules != NULL) { arModules.RemoveAll(); pUsedModules->ResetContent(); m_pModule->GetUsedModules(&arModules); for (int i = 0; i < arModules.GetSize(); i++) { CDP_Module* pModule = (CDP_Module*)arModules.GetAt(i); if (pModule->GetUserPrmLen() != 0) { CString szName; szName.Format(_T("%d: "), i+1); szName += pModule->GetModuleName(); int index = pUsedModules->AddString(szName); pUsedModules->SetItemData(index, (DWORD)pModule); } } pUsedModules->SetCurSel(0); m_pSelModule = NULL; } OnSelchangeUsedModules(); CreateExtUserParams(); return CPropertyPage::OnSetActive(); }
void CaIngresExportHeaderRowItemData::EditValueDbf(CuListCtrlDoubleUpper* pListCtrl, int iItem, int iSubItem, CRect rcCell) { CString strItem; CaColumnExport* pCol = m_arrayColumn[iSubItem]; switch (iItem) { case 0: // Column Name strItem = pListCtrl->GetItemText (iItem, iSubItem); pListCtrl->SetEditText (iItem, iSubItem, rcCell, strItem); break; case 1: // Source Format // Not editable. break; case 2: // Export Format #if defined (_CHOICE_DBF_DATATYPE) { int j; const int nMaxType = 4; TCHAR tchType[nMaxType][32]= { _T("C"), _T("D"), _T("N"), _T("L") }; strItem = pListCtrl->GetItemText (iItem, iSubItem); pListCtrl->COMBO_SetEditableMode(FALSE); CComboBox* pCombo = pListCtrl->GetComboBox(); ASSERT (pCombo); if (!pCombo) break; if (!IsWindow (pCombo->m_hWnd)) break; pCombo->ResetContent(); for (j=0; j<nMaxType; j++) { pCombo->AddString (tchType[j]); } pListCtrl->SetComboBox (iItem, iSubItem, rcCell, strItem); } #endif break; case 3: // Exported Length: #if defined (_CHOICE_DBF_DATATYPE) strItem = pListCtrl->GetItemText (iItem, iSubItem); pListCtrl->SetEditText (iItem, iSubItem, rcCell, strItem); #endif break; case 4: // Null Exported as: strItem = pListCtrl->GetItemText (iItem, iSubItem); pListCtrl->SetEditText (iItem, iSubItem, rcCell, strItem); break; default: break; } }
BOOL CServiceManage::OnInitDialog() { CDialog::OnInitDialog(); CComboBox *cbStartup = (CComboBox *)GetDlgItem(IDC_COMBO_STARTUP); if (cbStartup) { cbStartup->ResetContent(); cbStartup->AddString(_T("SERVICE_BOOT_START")); cbStartup->AddString(_T("SERVICE_SYSTEM_START")); cbStartup->AddString(_T("SERVICE_AUTO_START")); cbStartup->AddString(_T("SERVICE_DEMAND_START")); cbStartup->AddString(_T("SERVICE_DISABLED")); cbStartup->SetCurSel(m_nStartmode); } CComboBox *cbCodepage = (CComboBox *)GetDlgItem(IDC_COMBO_CODEPAGE); if (cbCodepage) { int i = 0, j = -1; cbCodepage->ResetContent(); while (gCodepages[i]) { cbCodepage->AddString(gCodepages[i]); if (!m_Codepage.IsEmpty()) { CHAR *buffer = m_Codepage.GetBuffer(CODEPAGE_MAXLEN); if (_stricmp(buffer, gCodepages[i]) == 0) { j = i; } } i++; } if (j == -1) { m_Codepage = "default"; } } if (m_bReadonly) { m_bExt3Writable = FALSE; } SET_WIN(IDC_EXT3_WRITABLE, !m_bReadonly); SET_WIN(IDC_START_SERVICE, !m_bStarted); UpdateData(FALSE); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
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 shield_sys_dlg::OnInitDialog() { int i, z; int teams[MAX_IFFS]; int types[MAX_SHIP_CLASSES]; CComboBox *box; for (i=0; i<MAX_IFFS; i++) teams[i] = 0; for (i=0; i<MAX_SHIP_CLASSES; 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 (auto it = Ship_info.cbegin(); it != Ship_info.cend(); ++it) box->AddString(it->name); box = (CComboBox *) GetDlgItem(IDC_TEAM); box->ResetContent(); for (i=0; i<Num_iffs; i++) box->AddString(Iff_info[i].iff_name); CDialog::OnInitDialog(); set_team(); set_type(); return TRUE; }
void CMainFrmDlgBar::ListStyles() { CComboBox* pCombo = (CComboBox*) GetDlgItem (IDC_COMBO_MFR_STYLE); pCombo->ResetContent (); CStringArray& arr = ((CCdCoverCreator2App*) AfxGetApp ())->GetTemplates ().GetTemplates (); for (int i = 0; i < arr.GetSize (); i++) pCombo->AddString (arr.GetAt (i)); }
void CInstrumentEditorN163Wave::FillPosBox(int size) { CComboBox *pPosBox = static_cast<CComboBox*>(GetDlgItem(IDC_WAVE_POS)); pPosBox->ResetContent(); for (int i = 0; i <= WAVE_SIZE_AVAILABLE - size; i += size) { // // // prevent reading non-wave n163 registers pPosBox->AddString(MakeIntString(i)); } }
BOOL CWallTool::OnInitDialog () { static char* pszWallTypes [] = { "Normal", "Blastable", "Door", "Illusion", "Open", "Close", "Overlay", "Cloaked", "Transparent" }; GetMine (); CComboBox *pcb; CTexToolDlg::OnInitDialog (); InitCBWallNo (); pcb = CBType (); pcb->ResetContent (); int h, i, j = sizeof (pszWallTypes) / sizeof (*pszWallTypes); for (i = 0; i < j; i++) { h = pcb->AddString (pszWallTypes [i]); pcb->SetItemData (h, i); } pcb = CBClipNo (); pcb->ResetContent (); j = (file_type != RDL_FILE) ? D2_NUM_OF_CLIPS : NUM_OF_CLIPS; for (i = 0; i < j; i++) { sprintf (m_szMsg, i ? "door%02d" : "wall%02d", clip_door_number [i]); pcb->AddString (m_szMsg); } InitSlider (IDC_WALL_TRANSPARENCY, 0, 10); for (i = 0; i <= 10; i++) SlCtrl (IDC_WALL_TRANSPARENCY)->SetTic (i); *m_szMsg = '\0'; m_bInited = true; return TRUE; }
void WINAPI addAMTKListByType(CComboBox &cList, WORD wAccessType) { int i; cList.ResetContent(); for (i = 0; i < AMTK_ITEM_ALL_NUM; i++) { if (l_tAMTKItems[i].wType & wAccessType) { cList.SetItemData(cList.AddString(l_tAMTKItems[i].lpcszName), i); } } }
void CMainFrame::OnDropDown() { CString FileName; CMFCToolBarComboBoxButton* pComboButton = (CMFCToolBarComboBoxButton*) m_wndLoadFileBar.GetButton(1); CComboBox* pLoadFile = pComboButton->GetComboBox(); pLoadFile->GetWindowText(FileName); pLoadFile->ResetContent(); pLoadFile->Dir(DDL_READWRITE,"*.*"); pLoadFile->SetWindowText(FileName); }
void CWallTool::InitCBWallNo () { if (!GetMine ()) return; CComboBox *pcb = CBWallNo (); pcb->ResetContent (); int i; for (i = 0; i < m_mine->GameInfo ().walls.count; i++) pcb->AddString (itoa (i, message, 10)); pcb->SetCurSel (m_nWall [0]); }
void CInstrumentEditorN163Wave::FillPosBox(int size) { CComboBox *pPosBox = (CComboBox*)GetDlgItem(IDC_WAVE_POS); pPosBox->ResetContent(); CString str; for (int i = 0; i < 128; i += size) { str.Format(_T("%i"), i); pPosBox->AddString(str); } }
void KG3DAnimationContainer::FillAnimationComboBox(CComboBox& ComboBox) { ComboBox.ResetContent(); LPCTSTR pszAniName = NULL; for (int i = 0; i < static_cast<int>(m_Clips.size()); i++) { m_Clips[i]->GetName(&pszAniName); ComboBox.InsertString(i, pszAniName); ComboBox.SetItemData(i, reinterpret_cast<DWORD_PTR>(m_Clips[i])); } }
BOOL CCubeTool::OnInitDialog () { static char* pszCubeTypes [] = { "Normal", "Fuel Center", "Repair Center", "Reactor", "Robot Maker", "Blue Goal", "Red Goal", "Water", "Lava", "Blue Team", "Red Team", "Speed Boost", "Blocked", "No Damage", "Sky Box", "Equip Maker", "Outdoors" }; CToolDlg::OnInitDialog (); CComboBox *pcb = CBType (); pcb->ResetContent (); int h, i, j; for (j = sizeof (pszCubeTypes) / sizeof (*pszCubeTypes), i = 0; i < j; i++) { h = pcb->AddString (pszCubeTypes [i]); pcb->SetItemData (h, i); } pcb = CBOwner (); pcb->ResetContent (); pcb->AddString ("Neutral"); pcb->AddString ("Unowned"); pcb->AddString ("Blue Team"); pcb->AddString ("Red Team"); m_bInited = TRUE; return TRUE; }
void CCgxDlg::OnCbnSetfocusScriptList() { CFileFind find; BOOL isWorking = find.FindFile(TEXT("script/*.txt")); CComboBox* scriptList = (CComboBox *)GetDlgItem(IDC_SCRIPT_LIST); scriptList->ResetContent(); while(isWorking) { isWorking = find.FindNextFile(); scriptList->AddString(find.GetFileName()); } }
VOID CBindTypePage::UpdateControls (UINT32 nType) { CComboBox ctlComboBox; ctlComboBox.Attach(GetDlgItem(IDC_COMBO_DISKCOUNT)); ctlComboBox.ResetContent(); CString strDesc; switch(nType) { case NMT_AGGREGATE : ctlComboBox.InsertString(-1, _T("2")); ctlComboBox.InsertString(-1, _T("3")); ctlComboBox.InsertString(-1, _T("4")); ctlComboBox.InsertString(-1, _T("5")); ctlComboBox.InsertString(-1, _T("6")); ctlComboBox.InsertString(-1, _T("7")); ctlComboBox.InsertString(-1, _T("8")); strDesc.LoadString(IDS_BNZ_DESC_AGGREGATION); break; case NMT_RAID0 : ctlComboBox.InsertString(-1, _T("2")); ctlComboBox.InsertString(-1, _T("4")); ctlComboBox.InsertString(-1, _T("8")); strDesc.LoadString(IDS_BNZ_DESC_RAID0); break; case NMT_RAID1R3 : ctlComboBox.InsertString(-1, _T("2")); strDesc.LoadString(IDS_BNZ_DESC_RAID1); break; case NMT_RAID4R3 : ctlComboBox.InsertString(-1, _T("3")); ctlComboBox.InsertString(-1, _T("5")); ctlComboBox.InsertString(-1, _T("9")); strDesc.LoadString(IDS_BNZ_DESC_RAID4); break; case NMT_RAID5 : ctlComboBox.InsertString(-1, _T("3")); ctlComboBox.InsertString(-1, _T("5")); ctlComboBox.InsertString(-1, _T("9")); strDesc.LoadString(IDS_BNZ_DESC_RAID5); break; default: break; } ctlComboBox.SetCurSel(0); CStatic ctlStatic; ctlStatic.Attach(GetDlgItem(IDC_BIND_TYPE_DESCRIPTION)); ctlStatic.SetWindowText(strDesc); }
void vPopulateDiagnosticStandardComboBox(STANDARD_COMB sg_asInterface[], int nSize, CComboBox& omComboBox) { omComboBox.ResetContent(); for (int i = 0, nIncr = 0; i < nSize; i++) { if (sg_asInterface[i].mo_bShow) { omComboBox.InsertString(nIncr++, sg_asInterface[i].m_omStandard); } } }
VOID CWHCalendarWhenPage::update_week_selection() { CComboBox *list; if ((list = (CComboBox *)GetDlgItem(IDC_CALWHEN_WEEK)) != NULL) { if (m_type == WEEKLY) { SHORT week_save = m_week; UpdateData(TRUE); m_week = week_save; SHORT month = m_month; SHORT year = m_year; /* This is a weekly calendar. Build the weeks for this month. */ list->ResetContent(); SHORT weekday = first_day_of_a_month(year, (MONTH)month); SHORT days = days_in_a_month(year, month); for (SHORT day = 0; day < days; ) { day++; SHORT last_day = day + (6 - weekday); if (last_day > days) { last_day = days; } CHAR buffer[45]; sprintf(buffer, "%d%s to %d%s", day, suffix_for_day(day), last_day, suffix_for_day(last_day)); list->AddString(buffer); weekday = 0; day = last_day; } /* Set the current selection. */ if (m_week == -1) { m_week = 0; } list->SetCurSel(m_week); } } }
void vPopulateMsgTypeComboBox(SCONFIGDATA_COMB asConfigData[], int nSize, CComboBox& omComboBox) { omComboBox.ResetContent(); for (int i = 0, nIncr = 0; i < nSize; i++) { if (asConfigData[i].m_bShow) { omComboBox.InsertString(nIncr++, asConfigData[i].m_omTypeName); } } }
void CFilterWaveletDlg::SetupWaveletPar() { GetDlgItem(IDC_WAVELET_PAR)->EnableWindow(m_nWaveletType>=2 && m_nWaveletType!=5); CComboBox* p = (CComboBox*)GetDlgItem(IDC_WAVELET_PAR); p->ResetContent(); CString sTemp; switch(m_nWaveletType) { case 5: // Vaidyanathan case 0: // Haar case 1: // Beylkin p->AddString("..."); break; case 2: { // Coiflet for(int i=1; i<=5; i++) { sTemp.Format("%d", i); p->AddString(sTemp); } } break; case 3: { // Daubechies for(int i=4; i<=20; i+=2) { sTemp.Format("%d", i); p->AddString(sTemp); } } break; case 4: { // Symmlet for(int i=4; i<=10; i++) { sTemp.Format("%d", i); p->AddString(sTemp); } } break; case 6: { // Battle-Lemarie for(int i=1; i<=5; i+=2) { sTemp.Format("%d", i); p->AddString(sTemp); } } break; default: // Undefined cerr << "Undefined wavelet type (" << m_nWaveletType << ").\n"; return; } // try to set the new wavelet parameter setting to be the same as the old one sTemp.Format("%d", m_nWaveletPar); m_nWaveletPar = p->FindStringExact(-1,sTemp); if(m_nWaveletPar == CB_ERR) m_nWaveletPar = 0; p->SetCurSel(m_nWaveletPar); }
void vPopulateInterfaceComboBox(INTERFACE_COMB sg_asInterface[], int nSize, CComboBox& omComboBox) { omComboBox.ResetContent(); for (int i = 0, nIncr = 0; i < nSize; i++) { if (sg_asInterface[i].m_bShow) { omComboBox.InsertString(nIncr++, sg_asInterface[i].m_omTypeName); } } }