Example #1
0
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;
}
Example #2
0
BOOL CDAuditWizard::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	CComboBox* pcbProcName;

	pcbProcName = (CComboBox*) GetDlgItem(IDC_COMBO_PROCESS);
	if (pcbProcName != NULL)
	{
		CStringList pr_list;
		CEnumProcess Enum(&pr_list);
		Enum.EnumProcesses();
		pr_list.AddTail("*");
		
		POSITION pos;

		
		for(pos = pr_list.GetHeadPosition(); pos != NULL;)
		{
			pcbProcName->AddString(pr_list.GetNext(pos));
		}
		pcbProcName->SetCurSel(0);
	}

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
Example #3
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;
}
Example #4
0
BOOL CHMIRunDlg::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	// TODO: Add extra initialization here
	int number = gCfgFile.GetTowerNumber();
	CComboBox *pCombo = (CComboBox *)GetDlgItem(IDC_COMBO_RUN);

	int row;
	CString str;
	for(row=0; row<number; row++)
	{
		str.Format("风机%d", row + 1);
		pCombo->InsertString(row, str);
	}
	pCombo->InsertString(row, "机舱");
	pCombo->SetCurSel(0);
	
	CIPAddressCtrl *pIPAddr = (CIPAddressCtrl *)GetDlgItem(IDC_IPADDRESS_RUN);
	pIPAddr->SetAddress(gCfgFile.GetTowerIP(0));

	CHMIDlg *pDlg = (CHMIDlg *)(GetParent()->GetParent());
	pDlg->SetTipString(__T("加载配置文件成功!"));

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}
BOOL CDisplayResolutionPane::OnInitDialog() {

	CPropertyPage::OnInitDialog();

	UInt8 isSelected;

	CComboBox* pCB = (CComboBox*) GetDlgItem(IDC_COMBO1);

	VisualGraphics* theVisualGraphics;
	theVisualGraphics = VisualGraphics::getInstance();
	theVisualGraphics->evaluateFullscreenDisplayResolution();
	//theVisualGraphics->gatherAvailableDisplayResolutions();

	//theVisualGraphics->resetDisplayResolutionIterIndex();
	char showStr[32];
	UInt16 count = 0;
	UInt16 selIdx = 0;
	while(theVisualGraphics->getNextAvailableDisplayResolution(showStr, &isSelected)) {
		if (isSelected == 1) {
			selIdx = count;
		}
		if (pCB->AddString(showStr) == CB_ERR) {
			AfxMessageBox("AnError occurred while adding mon res item to combo list.");
		}
		count++;
	}

	pCB->SetCurSel(selIdx);
	
	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX-Eigenschaftenseiten sollten FALSE zurückgeben
}
Example #6
0
LRESULT FavHubGeneralPage::OnTextChanged(WORD /*wNotifyCode*/, WORD wID, HWND /*hWndCtl*/, BOOL& /*bHandled*/) {
	if (loading)
		return 0;

	if (wID == IDC_HUBADDR) {
		CComboBox combo;
		combo.Attach(GetDlgItem(IDC_ENCODING));
		tstring address;
		address.resize(1024);
		address.resize(GetDlgItemText(IDC_HUBADDR, &address[0], 1024));

		if (AirUtil::isAdcHub(Text::fromT(address))) {
			if (!hideShare)
				ctrlProfile.EnableWindow(true);
			combo.SetCurSel(4); // select UTF-8 for ADC hubs
			combo.EnableWindow(false);
		}
		else {
			ctrlProfile.EnableWindow(false);
			combo.EnableWindow(true);
		}
		combo.Detach();
	}

	return TRUE;
}
LRESULT CPrefsConnectionDlg::OnInitDialog(UINT uMsg, WPARAM wParam, LPARAM lParam, BOOL& bHandled)
{
	CComboBox speed = GetDlgItem(IDC_CONNECTION_SPEED);

	speed.AddString("28.8 Kbps");
	speed.AddString("33.6 Kbps");
	speed.AddString("56.6 Kbps");
	speed.AddString("Single ISDN (64 Kbps)");
	speed.AddString("Dual ISDN (128 Kbps)");
	speed.AddString("DSL/Cable (256 Kbps)");
	speed.AddString("DSL/Cable (384 Kbps)");
	speed.AddString("DSL/Cable (512 Kbps)");
	speed.AddString("DSL/Cable (768 Kbps)");
	speed.AddString("1 Mbps Cable");
	speed.AddString("T1 (1.5 Mbps)");
	speed.AddString("Office LAN (10 Mbps and above)");

	for (int i = 0; i < NUMBITRATES; i++)
	{
		if (m_pPrefs->m_systemBitrate <= BitRates[i])
		{
			speed.SetCurSel(i);
			break;
		}
	}

	return 1;  // Let the system set the focus
}
Example #8
0
//===========================================================================
void CFAVConnectDlg::OnBnClickedConnectCheck()
//===========================================================================
{
	// TODO: Add your control notification handler code here
	CArray<CString,CString> strArrayCOM;
	UINT	uPortCount;
	CComboBox* pCbox = (CComboBox*)GetDlgItem(IDC_CONNECT_COMSEL);
	CString strCOMPORT;
	if(m_bCOMSel){
		GetDlgItem(IDC_CONNECT_COMSEL)->EnableWindow(FALSE);
		m_bGetSerialPort = FALSE;
		for(UINT i = pCbox->GetCount(); i > 0; i--){
			pCbox->DeleteString(i-1);
		}
		m_bCOMSel = FALSE;
	}
	else{
		if(!m_bGetSerialPort){
			m_bGetSerialPort = TRUE;
			uPortCount = m_UARTComm.GetSerialPort(TRUE, strArrayCOM);
			for(UINT i = 0; i < uPortCount; i++){
				strCOMPORT = strArrayCOM.GetAt(m_UARTComm.GetCOMIndex(i));
				pCbox->InsertString(i,strCOMPORT);
			}
			pCbox->SetCurSel(0);
		}
		GetDlgItem(IDC_CONNECT_COMSEL)->EnableWindow(TRUE);
		m_bCOMSel = TRUE;
	}
}
void CFirstFollowDlg::OnBnClickedButtonExecute()
{
	// TODO: 在此添加控件通知处理程序代码
	this->grammar = new Grammar();
	if(this->productionList.size() == 0) 
		return;
	StreamHelper::formateStream(this->productionList);
	this->grammar->createGrammar(this->productionList);
	this->grammar->initGrammar();

	vector<char> nonTermSymbols;
	this->grammar->getAllNonTermSymbols(nonTermSymbols);

	CComboBox *combobox = (CComboBox*) GetDlgItem(IDC_COMBO_NONTERM);
	for (size_t i=0;i<nonTermSymbols.size();i++)
	{
		string s;
		s.push_back(nonTermSymbols[i]);
		combobox->AddString(s.c_str());
	}

	//获取全部非终结符的first and follow gather
	this->grammar->getAllFirstGather(this->allFirstGather);
	this->grammar->getAllFollowGather(this->allFollowGather);

	combobox->SetCurSel(0);
	this->OnCbnSelchangeComboNonterm();
}
Example #10
0
void ViewFilesDialog::OnFviewFmtBest(void)
{
    CComboBox* pCombo = (CComboBox*) GetDlgItem(IDC_FVIEW_FORMATSEL);
    pCombo->SetCurSel(0);       // best is always at the top
    OnFormatSelChange();
    pCombo->SetFocus();
}
Example #11
0
// 查找串口
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);
	}

}
int FindReplDlg::GetFindText(CComboBox& wnd, bsString& text)
{
	int len;
	char *tp;
	int sel = wnd.GetCurSel();
	if (sel == -1)
	{
		len = wnd.GetWindowTextLength()+1;
		tp = new char[len];
		wnd.GetWindowText(tp, len);
		sel = wnd.FindStringExact(-1, tp);
		if (sel == -1)
		{
			sel = wnd.InsertString(0, tp);
			wnd.SetCurSel(sel);
		}
		int cnt;
		while ((cnt = wnd.GetCount()) >= 20)
			wnd.DeleteString(cnt-1);
	}
	else
	{
		len = wnd.GetLBTextLen(sel)+1;
		tp = new char[len];
		wnd.GetLBText(sel, tp);
	}
	text.Attach(tp);
	return sel;
}
static void AddHelper(CComboBox& combobox, STRING_VECTOR& availableHelpers, const CString& helper, const CString& selected = L"")
{
	availableHelpers.push_back(helper);
	int idx = combobox.AddString(helper);
	if (selected == helper)
		combobox.SetCurSel(idx);
}
Example #14
0
BOOL CNewTextureDlg::OnInitDialog()
{
    CDialog::OnInitDialog();

    CComboBox *pComboBox = (CComboBox*) GetDlgItem(IDC_D3DFMT_COMBO);
    TCHAR strFmtLabel[MAX_PATH] = {0};

    for( int i = 0; i < fmtInfoArraySize; i++ )
    {
        // Construct the texture label
        StringCchPrintf( strFmtLabel, MAX_PATH, TEXT("%s %i-bit: %s"),
                         fmtInfoArray[i].strType,
                         fmtInfoArray[i].nBitsPerTexel,
                         fmtInfoArray[i].strName );

        // Add the label to the combo box
        pComboBox->AddString(strFmtLabel);

        // Set default selection to A8R8G8B8
        if( fmtInfoArray[i].fmt == D3DFMT_A8R8G8B8 )
            pComboBox->SetCurSel( i );
    }

    OnChangeTextureType();
    OnChangeFormat();

    return TRUE;  // return TRUE unless you set the focus to a control
    // EXCEPTION: OCX Property Pages should return FALSE
}
BOOL CEnterOptionsNameDlg::OnInitDialog() {
  __super::OnInitDialog();

  CComboBox *cb = getNameCombo();
  const StringArray names = Options::getExistingNames();
  for(size_t i = 0; i < names.size(); i++) {
    cb->AddString(names[i].cstr());
  }
  cb->SetFocus();
  if((cb->GetCount() == 0) || (m_name.GetLength() == 0)) {
    cb->SetCurSel(0);
  } else {
    cb->SetCurSel((int)names.getFirstIndex((LPCTSTR)m_name));
  }
  return false;
}
Example #16
0
// the sub-class can call this method to fill out a combo box with the values stored in
//  the recently used list.
void CAutoConfigDlg::EnumRecentlyUsed(CComboBox& cbRecentlyUsed)
{
	cbRecentlyUsed.Clear();
	CRegKey keyRecentConverterIDs;
	CString strRegKey = GetRegKey();
	if( keyRecentConverterIDs.Open(HKEY_CURRENT_USER, strRegKey) == ERROR_SUCCESS )
	{
		DWORD dwIndex = 0;
		BOOL bStop = false;
		do
		{
			DWORD dwValueType = 0, cbName = _MAX_PATH;
			TCHAR lpName[_MAX_PATH];    lpName[0] = 0;
			LONG lVal = RegEnumValue(keyRecentConverterIDs,dwIndex++,lpName,&cbName,0,&dwValueType,0,0);
			if( (lVal == ERROR_SUCCESS) || (lVal == ERROR_MORE_DATA) )
			{
				// skip the default value
				if( _tcslen(lpName) > 0 )
				{
					TRACE(_T("Found: (%s)"), lpName);
					if( cbRecentlyUsed.FindStringExact(0,lpName) < 0 )
						cbRecentlyUsed.AddString(lpName);
				}
			}
			else
				bStop = true;
		} while( !bStop );

		// select the first one so there's something in it.
		cbRecentlyUsed.SetCurSel(0);
	}
}
Example #17
0
BOOL VoiceActingManager::OnInitDialog()
{
	CComboBox *box = ((CComboBox *) GetDlgItem(IDC_SUFFIX));
	box->AddString(".WAV");
	box->AddString(".OGG");
	box->SetCurSel(0);

	// load saved data for file names
	m_abbrev_briefing = _T(Voice_abbrev_briefing);
	m_abbrev_campaign = _T(Voice_abbrev_campaign);
	m_abbrev_command_briefing = _T(Voice_abbrev_command_briefing);
	m_abbrev_debriefing = _T(Voice_abbrev_debriefing);
	m_abbrev_message = _T(Voice_abbrev_message);
	m_abbrev_mission = _T(Voice_abbrev_mission);
	m_no_replace = Voice_no_replace_filenames;

	// load saved data for script
	m_script_entry_format = _T(Voice_script_entry_format);
	m_export_everything = m_export_command_briefings = m_export_briefings = m_export_debriefings = m_export_messages = FALSE;
	if (Voice_export_selection == 1)
		m_export_command_briefings = TRUE;
	else if (Voice_export_selection == 2)
		m_export_briefings = TRUE;
	else if (Voice_export_selection == 3)
		m_export_debriefings = TRUE;
	else if (Voice_export_selection == 4)
		m_export_messages = TRUE;
	else
		m_export_everything = TRUE;

	UpdateData(FALSE);

	return TRUE;
}
Example #18
0
void CPitchPage::InitCombos()
{
	CComboBox *pWndCombo = 0;
	
	pWndCombo = (CComboBox*)GetDlgItem(IDC_COMBO_PITCH_LIST);
	AddAllNotesToCombo(pWndCombo);
	pWndCombo->SetCurSel(66);

	pWndCombo = (CComboBox*)GetDlgItem(IDC_COMBO_PITCH_MIN);
	AddAllNotesToCombo(pWndCombo);
	pWndCombo->SetCurSel(60);

	pWndCombo = (CComboBox*)GetDlgItem(IDC_COMBO_PITCH_MAX);
	AddAllNotesToCombo(pWndCombo);
	pWndCombo->SetCurSel(71);
}
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);
}
Example #20
0
void CTxMsgWndJ1939::vInitializeNmFields(void)
{
    //Set the properties of the field first
    m_omCurAddress.vSetBase(BASE_HEXADECIMAL);
    m_omCurAddress.vSetSigned(false);
    m_omCurAddress.LimitText(2);

    m_omEcuName.vSetBase(BASE_HEXADECIMAL);
    m_omEcuName.vSetSigned(false);
    m_omEcuName.LimitText(16);

    m_omDLCEdit.LimitText(4);

    m_bNM = TRUE;
    CButton* pButton = (CButton*) GetDlgItem(IDC_RADIO_NM);
    pButton->SetCheck(BST_CHECKED);
    //Populate the values

    pButton = (CButton*)GetDlgItem(IDC_RQST_ADDRESS);
    pButton->SetCheck(BST_UNCHECKED);
    pButton = (CButton*)GetDlgItem(IDC_CMD_ADDRESS);
    pButton->SetCheck(BST_UNCHECKED);
    pButton = (CButton*)GetDlgItem(IDC_CLAIM_ADDRESS);
    pButton->SetCheck(BST_CHECKED);

    CComboBox* pComboBox = (CComboBox*)GetDlgItem(IDC_COMBO_NODE);

    int nIndex = pComboBox->AddString(m_sClientParams.m_acName);
    pComboBox->SetItemData(nIndex, m_sClientParams.m_byAddress);
    pComboBox->SetCurSel(nIndex);
    m_omEcuName.vSetValue(m_sClientParams.m_unEcuName);
    m_omCurAddress.vSetValue(m_sClientParams.m_byAddress);

    UpdateData(TRUE);
}
Example #21
0
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,除非您對控制項設定焦點
}
Example #22
0
void WeaponPage::initPage(CWeaponInfo* pInfo)
{
	m_pCW = pInfo;
	CComboBox* pTB = (CComboBox*) GetDlgItem (IDC_Quality);	//宣告ComboBox變數
	pTB->SetCurSel(pInfo->getQuality());					//顯示品質

	pTB = (CComboBox*) GetDlgItem (IDC_Wield);				//宣告ComboBox變數
	pTB->SetCurSel(pInfo->getWield());						//顯示哪手裝備

	pTB = (CComboBox*) GetDlgItem (IDC_AttrType);			//宣告ComboBox變數
	AttrType = BASE_ATTR;
	pTB->SetCurSel(AttrType);								//預設顯示基本屬性

	SetDlgItemText(IDC_MeshName, pInfo->getMeshName().c_str());

	AttrTypeShow();
}
BOOL CSplitKeyboardDlg::OnInitDialog()
{
	CComboBox *pCombo;
	const auto pDoc = CFamiTrackerDoc::GetDoc();

	pCombo = static_cast<CComboBox*>(GetDlgItem(IDC_COMBO_SPLIT_NOTE));
	for (auto n : KEY_NAME)
		pCombo->AddString(conv::to_wide(n).data());
	pCombo->SetCurSel(m_iSplitNote != -1 ? (value_cast(ft0cc::doc::pitch_from_midi(m_iSplitNote)) - 1) : 0);

	pCombo = static_cast<CComboBox*>(GetDlgItem(IDC_COMBO_SPLIT_OCTAVE));
	for (int i = 0; i < OCTAVE_RANGE; ++i)
		pCombo->AddString(conv::to_wide(conv::from_int(i)).data());
	pCombo->SetCurSel(m_iSplitNote != -1 ? ft0cc::doc::oct_from_midi(m_iSplitNote) : 3);

	pCombo = static_cast<CComboBox*>(GetDlgItem(IDC_COMBO_SPLIT_CHAN));
	pCombo->AddString(KEEP_INST_STRING);
	pCombo->SetCurSel(0);
	auto *pSCS = FTEnv.GetSoundChipService();
	int i = 0;
	pDoc->GetModule()->GetChannelOrder().ForeachChannel([&] (stChannelID ch) {
		pCombo->AddString(conv::to_wide(pSCS->GetChannelFullName(ch)).data());
		if (m_iSplitChannel == ch)
			pCombo->SetCurSel(i + 1);
		++i;
	});

	pCombo = static_cast<CComboBox*>(GetDlgItem(IDC_COMBO_SPLIT_INST));
	pCombo->AddString(KEEP_INST_STRING);
	pDoc->GetModule()->GetInstrumentManager()->VisitInstruments([&] (const CInstrument &, std::size_t i) {
		pCombo->AddString(conv::to_wide(conv::from_int_hex(i, 2)).data());
	});
	if (pCombo->SelectString(-1, FormattedW(L"%02X", m_iSplitInstrument)) == CB_ERR)
		pCombo->SelectString(-1, KEEP_INST_STRING);

	pCombo = static_cast<CComboBox*>(GetDlgItem(IDC_COMBO_SPLIT_TRSP));
	for (int j = -MAX_TRANSPOSE; j <= MAX_TRANSPOSE; ++j)
		pCombo->AddString(FormattedW(L"%+d", j));
	pCombo->SelectString(-1, FormattedW(L"%+d", m_iSplitTranspose));

	CheckDlgButton(IDC_CHECK_SPLIT_ENABLE, m_bSplitEnable ? BST_CHECKED : BST_UNCHECKED);
	OnBnClickedCheckSplitEnable();

	return CDialog::OnInitDialog();
}
BOOL CHostBaseDownloadDlg::OnInitDialog()
{
	CDialog::OnInitDialog();
	CComboBox* baudrateCombo = (CComboBox*)GetDlgItem(IDC_BAUDRATE_IDX);
	CComboBox* bufferCombo = (CComboBox*)GetDlgItem(IDC_BUFFER_IDX);

	if(_V8_SUPPORT)
	{
		baudrateCombo->ResetContent();
		for(int i=0; i<9; ++i)
		{
			CString strIdx;
			strIdx.Format("%d", CSerial::BaudrateTable[i]);
			baudrateCombo->AddString(strIdx);
		}
	}
	baudrateCombo->AddString("SPI");

	CRegistry reg;
	reg.SetRootKey(HKEY_CURRENT_USER);
	if(reg.SetKey("Software\\GNSSViewer\\GPS", true))
	{
		m_nBaudrateIdx = reg.ReadInt("hb_baudrate", g_setting.boostBaudIndex);
		m_strPath = reg.ReadString("hb_firmware", "");
		m_nBufferIdx = reg.ReadInt("hb_buffer", 0);
	}
	else
	{
		m_nBaudrateIdx = BAUDRATE_DEFAULT;
	}

	if(m_strPath.IsEmpty())
	{
		m_strPath = theApp.GetCurrrentDir();
		m_strPath += "\\host.bin";
	}

	baudrateCombo->SetCurSel(m_nBaudrateIdx);
	GetDlgItem(IDC_IMG_PATH)->SetWindowText(m_strPath);
	bufferCombo->SetCurSel(m_nBufferIdx);

	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX 屬性頁應傳回 FALSE
}
Example #25
0
BOOL CConfigSound::OnInitDialog()
{
	CPropertyPage::OnInitDialog();

	CComboBox *pSampleRate	= static_cast<CComboBox*>(GetDlgItem(IDC_SAMPLE_RATE));
	CComboBox *pSampleSize	= static_cast<CComboBox*>(GetDlgItem(IDC_SAMPLE_SIZE));
	CComboBox *pDevices		= static_cast<CComboBox*>(GetDlgItem(IDC_DEVICES));
	
	CSliderCtrl *pBufSlider			  = static_cast<CSliderCtrl*>(GetDlgItem(IDC_BUF_LENGTH));
	CSliderCtrl *pBassSlider		  = static_cast<CSliderCtrl*>(GetDlgItem(IDC_BASS_FREQ));
	CSliderCtrl *pTrebleSliderFreq	  = static_cast<CSliderCtrl*>(GetDlgItem(IDC_TREBLE_FREQ));
	CSliderCtrl *pTrebleSliderDamping = static_cast<CSliderCtrl*>(GetDlgItem(IDC_TREBLE_DAMP));
	CSliderCtrl *pVolumeSlider		  = static_cast<CSliderCtrl*>(GetDlgItem(IDC_VOLUME));

	// Set ranges
	pBufSlider->SetRange(1, MAX_BUFFER_LEN);
	pBassSlider->SetRange(16, 4000);
	pTrebleSliderFreq->SetRange(20, 20000);
	pTrebleSliderDamping->SetRange(0, 90);
	pVolumeSlider->SetRange(0, 100);

	CSettings *pSettings = theApp.GetSettings();

	// Read settings
	switch (pSettings->Sound.iSampleRate) {
		case 11025: pSampleRate->SelectString(0, _T("11 025 Hz")); break;
		case 22050: pSampleRate->SelectString(0, _T("22 050 Hz")); break;
		case 44100: pSampleRate->SelectString(0, _T("44 100 Hz")); break;
		case 48000: pSampleRate->SelectString(0, _T("48 000 Hz")); break;
		case 96000: pSampleRate->SelectString(0, _T("96 000 Hz")); break;
	}

	switch (pSettings->Sound.iSampleSize) {
		case 16: pSampleSize->SelectString(0, _T("16 bit")); break;
		case 8:	 pSampleSize->SelectString(0, _T("8 bit")); break;
	}

	pBufSlider->SetPos(pSettings->Sound.iBufferLength);
	pBassSlider->SetPos(pSettings->Sound.iBassFilter);
	pTrebleSliderFreq->SetPos(pSettings->Sound.iTrebleFilter);
	pTrebleSliderDamping->SetPos(pSettings->Sound.iTrebleDamping);
	pVolumeSlider->SetPos(pSettings->Sound.iMixVolume);

	UpdateTexts();

	CDSound *pDSound = theApp.GetSoundGenerator()->GetSoundInterface();
	const int iCount = pDSound->GetDeviceCount();

	for (int i = 0; i < iCount; ++i)
		pDevices->AddString(pDSound->GetDeviceName(i));

	pDevices->SetCurSel(pSettings->Sound.iDevice);

	return TRUE;  // return TRUE unless you set the focus to a control
	// EXCEPTION: OCX Property Pages should return FALSE
}
void CDebugMemorySearch::AddAlignmentOptions(CComboBox  & ctrl)
{
    int Index = ctrl.AddString("32 bits (aligned)");
    ctrl.SetItemData(Index, _32Bit);
    Index = ctrl.AddString("16bits (aligned)");
    ctrl.SetItemData(Index, _16Bit);
    Index = ctrl.AddString("8bits");
    ctrl.SetCurSel(Index);
    ctrl.SetItemData(Index, _8Bit);
}
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);
}
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);
}
Example #29
0
void ViewFilesDialog::OnFviewFmtRaw(void)
{
    CComboBox* pCombo = (CComboBox*) GetDlgItem(IDC_FVIEW_FORMATSEL);
    int sel = FindByVal(pCombo, ReformatHolder::kReformatRaw);
    if (sel < 0)
        sel = 0;
    pCombo->SetCurSel(sel);
    OnFormatSelChange();
    pCombo->SetFocus();
}
Example #30
0
BOOL CDlgRename::OnInitDialog() 
{
	CDialog::OnInitDialog();
	
	CComboBox* pCBox = (CComboBox *) GetDlgItem( IDC_CMB_FORMATS );
	int nDefaultIndex;
	theApp.m_nFormatCount;

	if( theApp.m_nFormatCount != 0 )
	{
		for( int i = 0 ; i < theApp.m_nFormatCount ; i++ )
		{
			CFormat* pFormat = new CFormat();
			pFormat->Load( i + 1 );
			if( i == theApp.m_nDefaultFormat )
			{
				nDefaultIndex = i;
			}
			int nIndex = pCBox->AddString( pFormat->m_strName );
			pCBox->SetItemData( nIndex , (DWORD) pFormat );
		}
		pCBox->SetCurSel( nDefaultIndex );
		if( m_bSingleFile )
		{
			SetMode( FORMAT_FREE );
		}
		else
		{
			// Griser le mode Nom libre
			GetDlgItem( IDC_FORMAT_FREE )->EnableWindow( FALSE );
			SetMode( FORMAT_PREDEFINED );
		}

	}
	else
	{
		if( m_bSingleFile )
		{
			// Disable the combo
			GetDlgItem( IDC_CMB_FORMATS )->EnableWindow( FALSE );
			GetDlgItem( IDC_FORMAT_PREDEFINED )->EnableWindow( FALSE );
			SetMode( FORMAT_FREE );
		}
		else
		{
			// No format availbale => can't rename
			CString strMsg = theApp.LoadTranslatedString( "IdsErrorFormatNotAvailable" );
			MessageBox( strMsg , NULL, MB_ICONWARNING ); 
			EndDialog(FALSE);
		}
	}

	return TRUE;  // return TRUE unless you set the focus to a control
	              // EXCEPTION: OCX Property Pages should return FALSE
}