Ejemplo n.º 1
1
void CEasyClientDlg::OnCbnSelchangeComboSource()
{
	CComboBox* pComboxMediaSource = (CComboBox*)GetDlgItem(IDC_COMBO_SOURCE);
	CComboBox* pVideoCombo = (CComboBox*)GetDlgItem(IDC_COMBO_CAMERA) ;
	CComboBox* pComboxAudioSource = (CComboBox*)GetDlgItem(IDC_COMBO_MIC) ;
	CEdit* pEdtRtspSource = (CEdit*)GetDlgItem(IDC_EDIT_SREAM_URL);

	if (NULL == pComboxMediaSource)		return;

	int iCount = pComboxMediaSource->GetCount();
	int iSel = pComboxMediaSource->GetCurSel();
	if (iSel == 0)
	{
		pVideoCombo->EnableWindow(TRUE);
		pComboxAudioSource->EnableWindow(TRUE);
		pEdtRtspSource->SetReadOnly(TRUE);
	} 
	else
	{
		pVideoCombo->EnableWindow(FALSE);
		pComboxAudioSource->EnableWindow(FALSE);
		pEdtRtspSource->SetReadOnly(FALSE);
	}

// 	if (NULL != pComboxAudioSource)	pComboxAudioSource->ShowWindow(iSel == iCount-1?SW_HIDE:SW_SHOW);
// 	if (NULL != pEdtRtspSource)	pEdtRtspSource->ShowWindow(iSel == iCount-1?SW_SHOW:SW_HIDE);
// 
}
Ejemplo n.º 2
0
void WeaponPage::OnCbnSelchangeWield()
{
	// TODO: 在此加入控制項告知處理常式程式碼
	CComboBox* pTB = (CComboBox*) GetDlgItem(IDC_Wield);

	m_pCW->m_wield = ((WeaponWieldType) pTB->GetCurSel());
}
Ejemplo n.º 3
0
void CDGProp::OnCloseupDgname() 
{
	UpdateData(TRUE);	
	CComboBox* box = (CComboBox*)GetDlgItem(IDC_DGNAME);
	int i = box->GetCurSel();
	box->GetLBText(i, m_dgName);
}
Ejemplo n.º 4
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;
}
Ejemplo n.º 5
0
void CInstrumentEditorDPCM::OnBnClickedAdd()
{
	// Add sample to key list	
	CComboBox *pPitchBox = reinterpret_cast<CComboBox*>(GetDlgItem(IDC_PITCH));

	int Pitch = pPitchBox->GetCurSel();

	if (GetDocument()->GetSampleSize(m_iSelectedSample) > 0) {
		m_pInstrument->SetSample(m_iOctave, m_iSelectedKey, m_iSelectedSample + 1);
		m_pInstrument->SetSamplePitch(m_iOctave, m_iSelectedKey, Pitch);
		UpdateKey(m_iSelectedKey);
	}

	m_pSampleListCtrl = reinterpret_cast<CListCtrl*>(GetDlgItem(IDC_SAMPLE_LIST));
	m_pTableListCtrl = reinterpret_cast<CListCtrl*>(GetDlgItem(IDC_TABLE));

	if (m_iSelectedKey < 12 && m_iSelectedSample < MAX_DSAMPLES) {
		m_pSampleListCtrl->SetItemState(m_iSelectedSample, 0, LVIS_FOCUSED | LVIS_SELECTED);
		m_pTableListCtrl->SetItemState(m_iSelectedKey, 0, LVIS_FOCUSED | LVIS_SELECTED);
		if (m_iSelectedSample < m_pSampleListCtrl->GetItemCount() - 1)
			m_iSelectedSample++;
		m_iSelectedKey++;
		m_pSampleListCtrl->SetSelectionMark(m_iSelectedSample);
		m_pTableListCtrl->SetSelectionMark(m_iSelectedKey);
		m_pSampleListCtrl->SetItemState(m_iSelectedSample, LVIS_FOCUSED | LVIS_SELECTED, LVIS_FOCUSED | LVIS_SELECTED);
		m_pTableListCtrl->SetItemState(m_iSelectedKey, LVIS_FOCUSED | LVIS_SELECTED, LVIS_FOCUSED | LVIS_SELECTED);
	}
}
Ejemplo n.º 6
0
void CInstrumentEditorDPCM::OnCbnSelchangeSamples()
{
	CComboBox *m_pSampleBox = reinterpret_cast<CComboBox*>(GetDlgItem(IDC_SAMPLES));
	CComboBox *pPitchBox = reinterpret_cast<CComboBox*>(GetDlgItem(IDC_PITCH));
	
	int PrevSample = m_pInstrument->GetSample(m_iOctave, m_iSelectedKey);
	int Sample = m_pSampleBox->GetCurSel();

	if (Sample > 0) {
		char Name[256];
		m_pSampleBox->GetLBText(Sample, Name);
		
		Name[2] = 0;
		if (Name[0] == _T('0')) {
			Name[0] = Name[1];
			Name[1] = 0;
		}

		Sample = atoi(Name);
		Sample++;

		if (PrevSample == 0) {
			int Pitch = pPitchBox->GetCurSel();
			m_pInstrument->SetSamplePitch(m_iOctave, m_iSelectedKey, Pitch);
		}
	}

	m_pInstrument->SetSample(m_iOctave, m_iSelectedKey, Sample);

	UpdateKey(m_iSelectedKey);
}
Ejemplo n.º 7
0
void CConfigAppearance::OnCbnSelchangeFont()
{
	CComboBox *pFontList = static_cast<CComboBox*>(GetDlgItem(IDC_FONT));
	pFontList->GetLBText(pFontList->GetCurSel(), m_strFont.data());
	RedrawWindow();
	SetModified();
}
void CDisplayResolutionPane::OnSelchangeCombo1() {
	char str[32];
	CComboBox* pCB = (CComboBox*) GetDlgItem(IDC_COMBO1);

	pCB->GetLBText(pCB->GetCurSel(), str);

	VisualGraphics* theVisualGraphics = VisualGraphics::getInstance();
	UInt16 horizontalPixels;
	UInt16 verticalPixels;
	UInt16 bitsPerPixel;
	UInt16 refreshRate;
	theVisualGraphics->matchDisplayResolutionShowStrWithPrefs(str, horizontalPixels, verticalPixels, bitsPerPixel, refreshRate);

	VisualDataStore::setPreferenceValueInt(VisualConfiguration::kFullscreenWidth, horizontalPixels);
	VisualDataStore::setPreferenceValueInt(VisualConfiguration::kFullscreenHeight, verticalPixels);
	VisualDataStore::setPreferenceValueInt(VisualConfiguration::kFullscreenBitsPerPixel, bitsPerPixel);
	VisualDataStore::setPreferenceValueInt(VisualConfiguration::kFullscreenRefreshRate, refreshRate);
	
	VisualDataStore::storePreferences();
	
	UInt16 minBitsPerPixel = 24;
	UInt16 maxBitsPerPixel = 32;
	VisualDataStore::setPreferredDisplayResolution(minBitsPerPixel, maxBitsPerPixel, bitsPerPixel, horizontalPixels, verticalPixels);

}
Ejemplo n.º 9
0
void CID3v2Page1::OnSelchangeCmbRating() 
{
	CComboBox *pCBox = (CComboBox*) GetDlgItem(IDC_LIST_RATING);
	int nIndex = pCBox->GetCurSel();
	m_nRating = pCBox->GetItemData( nIndex );
	
}
Ejemplo n.º 10
0
void WeaponPage::OnCbnSelchangeQuality()
{
	// TODO: 在此加入控制項告知處理常式程式碼
	CComboBox* pTB = (CComboBox*) GetDlgItem(IDC_Quality);

	m_pCW->setQuality((EquipQuality) pTB->GetCurSel());
}
Ejemplo n.º 11
0
//===========================================================================
void CFAVReaderDlg::OnCbnSelchangeReaderMembankData()
//===========================================================================
{
	// TODO: Add your control notification handler code here
	UpdateData(TRUE);
	CComboBox* pCbox = (CComboBox*)GetDlgItem(IDC_READER_MEMBANK_DATA);
	CEdit* pEditAddress = (CEdit*)GetDlgItem(IDC_READER_ADDRESS_DATA);
	CEdit* pEditLength = (CEdit*)GetDlgItem(IDC_READER_LENGTH_DATA);

	switch (pCbox->GetCurSel()){
	case 0:
		pEditAddress->SetWindowText(_T("0"));
		pEditLength->SetWindowText(_T("4"));
		break;//0
	case 1:
		pEditAddress->SetWindowText(_T("2"));
		pEditLength->SetWindowText(_T("6"));
		break;//1
	case 2:
		pEditAddress->SetWindowText(_T("0"));
		pEditLength->SetWindowText(_T("4"));
		break;//2
	case 3:
		pEditAddress->SetWindowText(_T("0"));
		pEditLength->SetWindowText(_T("1"));
		break;//3
	}
}
	void CModelInputDlg::GetModelInput(CModelInput& modelInput)
	{
		ASSERT(m_titleCtrlArray.GetSize() == m_varCtrlArray.GetSize());
		ASSERT(m_titleCtrlArray.GetSize() == (int)m_variables.size());
		ASSERT(m_bDefault == false);

		modelInput = m_modelInput;
		modelInput.clear();

		for (int i = 0; i < m_varCtrlArray.GetSize(); i++)
		{
			int type = m_variables[i].GetType();

			if (type != CModelInputParameterDef::kMVTitle &&
				type != CModelInputParameterDef::kMVLine && 
				type != CModelInputParameterDef::kMVStaticText)
			{
				string value;
				switch (type)
				{
				case CModelInputParameterDef::kMVBool:
				{
					CComboBox* pCombo = (CComboBox*)m_varCtrlArray[i];
					value = WBSF::ToString(pCombo->GetCurSel() == 0);
					break;
				}

				case CModelInputParameterDef::kMVInt:
				case CModelInputParameterDef::kMVReal:
				case CModelInputParameterDef::kMVString:
				case CModelInputParameterDef::kMVFile:
				{
					CCFLEdit* pEdit = (CCFLEdit*)m_varCtrlArray[i];
					value = pEdit->GetString();
					break;
				}

				case CModelInputParameterDef::kMVListByPos:
				{
					CCFLComboBox* pCombo = (CCFLComboBox*)m_varCtrlArray[i];
					value = WBSF::ToString(pCombo->GetCurItemData());
					break;
				}

				case CModelInputParameterDef::kMVListByString:
				case CModelInputParameterDef::kMVListByCSV:
				{
					CCFLComboBox* pCombo = (CCFLComboBox*)m_varCtrlArray[i];
					value = pCombo->GetString();
					break;
				}

				default: ASSERT(false);
				}

				modelInput.push_back(CModelInputParam(m_variables[i].GetName(),/* m_variables[i].GetType(),*/ value));
			}
		}
	}
Ejemplo n.º 13
0
void CServiceManage::OnOK() 
{
    BOOL rc;

	// TODO: Add extra validation here
    UpdateData(TRUE);

	CComboBox   *cbStartup = (CComboBox *)GetDlgItem(IDC_COMBO_STARTUP);
    if (cbStartup) {
        m_nStartmode = cbStartup->GetCurSel();
    } else {
        m_nStartmode = CB_ERR;
    }

    if (m_nStartmode == CB_ERR) {
        AfxMessageBox("Invalid startup mode !", MB_OK|MB_ICONWARNING);
        return;
    }

    if (m_Codepage.IsEmpty()) {
        AfxMessageBox("You must select a codepage type.", MB_OK|MB_ICONWARNING);
        return;
    }

    CComboBox   *cbCodepage = (CComboBox *)GetDlgItem(IDC_COMBO_CODEPAGE);
    if (cbCodepage) {
        int rc = cbCodepage->FindStringExact(-1, m_Codepage);
        if (rc == CB_ERR) {
            AfxMessageBox("Invalid codepage type: "+m_Codepage, MB_OK|MB_ICONWARNING);
            return;
        }
    }

    if (AfxMessageBox("Current service settings will be overwritten,\ndo you want continue ?",
                      MB_YESNO | MB_ICONQUESTION) != IDYES) {
        return;
    }

    rc = Ext2SetGlobalProperty(
            m_nStartmode,
            (BOOLEAN)m_bReadonly,
            (BOOLEAN)m_bExt3Writable,
            m_Codepage.GetBuffer(CODEPAGE_MAXLEN),
            m_sPrefix.GetBuffer(HIDINGPAT_LEN),
            m_sSuffix.GetBuffer(HIDINGPAT_LEN),
            (BOOLEAN)m_bAutoMount
            );

    if (rc) {
/*
        AfxMessageBox("Ext2 service settings updated successfully !",
                      MB_OK | MB_ICONINFORMATION);
*/
      	CDialog::OnOK();
    } else {
        AfxMessageBox("Failed to save the service settings !",
                      MB_OK | MB_ICONWARNING);
    }
}
Ejemplo n.º 14
0
void CMainDlg::OnCbnSelchangeImageExt()
{
	CComboBox* pCombo = NULL;
	VERIFY(pCombo = (CComboBox*)GetDlgItem(IDC_IMAGE_EXT));
	int iSel = pCombo->GetCurSel();
	ASSERT(iSel != -1);
	m_clsidImgType = *(CLSID*)pCombo->GetItemData(iSel);
}
Ejemplo n.º 15
0
CString COptsAudioDlg::GetSelectedDeviceName(CComboBox& Combo, const CDSDeviceInfoArray& DevInfo)
{
	CString	name;
	int	iSelDev = Combo.GetCurSel();
	if (iSelDev >= 0 && iSelDev < DevInfo.GetSize())	// if valid selection
		name = DevInfo[iSelDev].m_Description;
	return(name);
}
Ejemplo n.º 16
0
//确定交易场次
void CHorseRaceMainDlg::OnBnClickedButton3()
{
	// TODO: 在此添加控件通知处理程序代码
	CComboBox* pcombox = (CComboBox*)(GetDlgItem(IDC_COMBO2));
	pcombox->GetLBText(pcombox->GetCurSel(),m_TradeRace);
	TRACE(m_TradeRace);
	return ;
}
Ejemplo n.º 17
0
void CSpellBaseParmDlg::OnSelchangeAnimspeed() 
{
	CComboBox *pBox = (CComboBox *)GetDlgItem(IDC_ANIMSPEED);
	int nCurSel = pBox->GetCurSel();
	if (nCurSel == CB_ERR) return;

	m_pSpell->SetCastSpeed(nCurSel);
}
Ejemplo n.º 18
0
void CSpellBaseParmDlg::OnSelChangeSpellType() 
{
	CComboBox *pBox = (CComboBox *)GetDlgItem(IDC_TYPE);
	int nCurSel = pBox->GetCurSel();
	if (nCurSel == CB_ERR) return;

	m_pSpell->SetType(nCurSel);
}
Ejemplo n.º 19
0
void CConfigAppearance::OnCbnSelchangeScheme()
{
	CComboBox *pList = static_cast<CComboBox*>(GetDlgItem(IDC_SCHEME));

	SelectColorScheme(COLOR_SCHEMES[pList->GetCurSel()]);

	SetModified();
	RedrawWindow();
}
Ejemplo n.º 20
0
int GetItemData(CComboBox& wnd, BOOL* pError)
{
    int nCur = wnd.GetCurSel();
    if(pError)
        *pError = nCur>=0;
    if(nCur>=0)
        return wnd.GetItemData(nCur);
    return 0;
}
Ejemplo n.º 21
0
//确认显示记录场次
void CHorseRaceMainDlg::OnBnClickedButton6()
{
	// TODO: 在此添加控件通知处理程序代码
	CComboBox* pcombox = (CComboBox*)(GetDlgItem(IDC_COMBO1));
	pcombox->GetLBText(pcombox->GetCurSel(),m_RcordRace);
	m_TradeRecord.DeleteAllItems();
	m_bTradeRecord = FALSE;
	TRACE(m_TradeRace);
}
Ejemplo n.º 22
0
void CoptimizerDlg::OnCbnSelchangeComboPreset()
{
	CSliderCtrl *Slider = (CSliderCtrl *)GetDlgItem(IDC_SLIDER_CUSTOM);
	CComboBox *CBox = (CComboBox *)GetDlgItem(IDC_COMBO_PRESET);
	int Sel;

	Sel = CBox->GetCurSel();
	SetSlider(Slider, Sel);
}
Ejemplo n.º 23
0
    void OnxxxSelChange(UINT /*uNotifyCode*/, int /*nID*/, CWindow /*wndCtl*/)
    {
        CString strText;

        m_wndCboxxx.GetLBText(m_wndCboxxx.GetCurSel(), strText);

        SetItemText(101, strText);

        return;
    }
Ejemplo n.º 24
0
void CAntiVirus::UpdateData(CComboBox& wndAntiVirus)
{
	if ( ! ::IsWindow( wndAntiVirus.GetSafeHwnd() ) )
		return;

	if ( wndAntiVirus.IsWindowEnabled() )
	{
		Settings.General.AntiVirus = *(CString*)wndAntiVirus.GetItemDataPtr( wndAntiVirus.GetCurSel() );
	}
}
Ejemplo n.º 25
0
//******************************************************************************************************
void CDialogFlags::OnSelchangeDisplayModeCombo()
{
    CComboBox *cb = (CComboBox *) GetDlgItem(IDC_DISPLAY_MODE_COMBO);
    TEntityDisplayMode displayMode = (TEntityDisplayMode) cb->GetCurSel();
    if (displayMode == LB_ERR) return;
    nlassert(displayMode < EntityDisplayModeCount);
    setCurrentEntityDisplayMode(displayMode);
    updateCtrlGrayedState();
    _Plugin->setEntityDisplayMode((TEntityDisplayMode) displayMode);
}
Ejemplo n.º 26
0
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);
	}

}
Ejemplo n.º 27
0
void CADHistFrm::OnSelchangeCOMBORate() 
{
	// TODO: Add your control notification handler code here
	CADHistDoc* pDoc = (CADHistDoc*)GetActiveDocument();  // 在Frame中取得当前文档指针
	CComboBox* pRate = (CComboBox*)(m_wndSetupBar.GetDlgItem(IDC_COMBO_Rate));	
	CString strRate;
	int Index = pRate->GetCurSel();  // 取得当前选择索引号
	pRate->GetLBText(Index, strRate);   // 根据选择,取得所选择项文本	
	pDoc->m_Rate = wcstol(strRate, NULL, 10);  // 将字符转换成数字
}
Ejemplo n.º 28
0
void DLGSkill::OnCbnSelchangeSkilltargettype()
{
    // TODO: 在此加入控制項告知處理常式程式碼
    CSkillInfo* pInfo = getSkillInfo();
    if(NULL == pInfo)
    {
        return;
    }
    CComboBox* pCB = (CComboBox*) GetDlgItem(IDC_SkillTargetType);
    pInfo->m_target = (AttackTarget) pCB->GetCurSel();
}
Ejemplo n.º 29
0
void DLGSkill::OnCbnSelchangeSkilltype()
{
    // TODO: 在此加入控制項告知處理常式程式碼
    CSkillInfo* pInfo = getSkillInfo();
    if(NULL == pInfo)
    {
        return;
    }
    CComboBox* pCB = (CComboBox*) GetDlgItem(IDC_SkillType);
    pInfo->m_type = (tagSKILL_TYPE) pCB->GetCurSel();
}
Ejemplo n.º 30
0
void CEndDialog::OnOK()
{
	// TODO: Add your specialized code here and/or call the base class
	CComboBox * chComboBox = (CComboBox *)GetDlgItem(IDC_CMB_END_POINT);
	CComboBox * parComboBox = (CComboBox *)GetParent()->GetDlgItem(IDC_CMB_END_POINT);
	int nIndx = chComboBox->GetCurSel();
	CString tmp;
	chComboBox->GetLBText(nIndx, tmp);
	parComboBox->SelectString(nIndx, tmp);
	CDialog::OnOK();
}