Пример #1
0
// 連携プログラム設定ボタン
void CRsfSimpleForm::OnButtonPrg() 
{
	// TODO: この位置にコントロール通知ハンドラ用のコードを追加してください
	CString str;

	UpdateData(TRUE);	// DDX更新

	// 連携プログラムID
	CString strPrgId = m_aryPrgId.GetAt(m_idxPrg);

	/// プログラムCSVファイルの特定
	CTPsetup tps(theApp.m_strDataFolder);
	tps.SetCallerId(m_strSenderId);
	CString strFile = tps.RsfPrgFileName(_T("$$$$"), strPrgId);

	/// 画面の表示
	CComboBox *pcmb;
    pcmb = (CComboBox*)GetDlgItem(IDC_CMB_PRG);
	pcmb->GetLBText(m_idxPrg, str);
	CRsfPrgDialog dlg(this, str);
	dlg.SetFile(strFile);
	if (dlg.DoModal() == IDOK) {
		/// RSFファイルの更新
		if (!UpdateFile()) return;
		/// 画面の更新
		UpdateForm();
	}
}
Пример #2
0
void CDGProp::OnCloseupDgname() 
{
	UpdateData(TRUE);	
	CComboBox* box = (CComboBox*)GetDlgItem(IDC_DGNAME);
	int i = box->GetCurSel();
	box->GetLBText(i, m_dgName);
}
Пример #3
0
LRESULT FindView::onDimensionSelection(WORD/*wNotifyCode*/, WORD/*wID*/, HWND/*hWndCtl*/, BOOL&/*bHandled*/)
{
    CComboBox cb = GetDlgItem(IDC_DIMENSION_COMBO);
    unsigned int dimension_id = 0;
    int item = -1;
    if ((item = cb.GetCurSel()) != CB_ERR)
    {
        dimension_id = (unsigned int)cb.GetItemData(item);
        TCHAR buffer[256];
        cb.GetLBText(item, buffer);
        m_settings->setValue(_T("DefaultDimension"), buffer);
    }

    updateCharList(dimension_id);
    CComboBox toon_combo = GetDlgItem(IDC_CHARCOMBO);
    if (toon_combo.GetCount() > 0)
    {
        toon_combo.SetCurSel(0);
    }

    if (dimension_id != m_lastQueryDimension)
    {
        UpdateFindQuery();
    }

    return 0;
}
Пример #4
0
void CConfigAppearance::OnCbnSelchangeFont()
{
	CComboBox *pFontList = static_cast<CComboBox*>(GetDlgItem(IDC_FONT));
	pFontList->GetLBText(pFontList->GetCurSel(), m_strFont.data());
	RedrawWindow();
	SetModified();
}
Пример #5
0
void CCgxDlg::OnCbnSelchangeScriptList()
{
	TCHAR fileName[MAX_PATH] = {0};
	TCHAR path[MAX_PATH] = {0};
	CComboBox* scriptList = (CComboBox *)GetDlgItem(IDC_SCRIPT_LIST);
	CEdit* script = (CEdit *)GetDlgItem(IDC_SCRIPT);
	int idx = scriptList->GetCurSel();
	scriptList->GetLBText(idx, fileName);
	swprintf(path, sizeof(TCHAR)*MAX_PATH, TEXT("script\\%s"), fileName);
	CFile file;
	file.Open(path, CFile::modeRead);
	if(file.GetLength() < 1)
	{
		return;
	}
	ULONGLONG fileSize = file.GetLength();
	char* buff = new char[fileSize];
	file.Read(buff, fileSize);
	
	int size = MultiByteToWideChar(CP_ACP, NULL, buff, fileSize, NULL, 0);
	TCHAR* text = new TCHAR[size+1];
	MultiByteToWideChar(CP_ACP, NULL, buff, fileSize, text, size);
	text[size] = '\0';
	script->SetWindowTextW(text);
	//TRACE(text);
	delete[] buff;
	delete[] text;
	file.Close();
}
Пример #6
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;
}
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);

}
Пример #8
0
void CUrlBar::OnSelchangeUrl() 
{
	// TODO: Add your control notification handler code here
#if 0
   CString strText;
	CString strItem;
	CComboBox* pCBox = (CComboBox*)GetDlgItem(IDC_URL);
	int nIndex = pCBox->GetCurSel();
	if (nIndex == CB_ERR)
		return;
	pCBox->GetLBText(nIndex, strItem);
	//AfxFormatString1(strText, IDS_SELECTED_PROMPT, (LPCTSTR)strItem);
   
   TRACE("On Sel Change URL %s \n",(const char *) strItem);
#endif
  
   CString url;   

   int nIndex = m_url.GetCurSel();
   if (nIndex == CB_ERR) 
         return;
   
   m_url.m_curSel = nIndex;
   m_url.GetText(nIndex,url);

   CMyglView* pView = ((CMyglApp *) AfxGetApp())->GetActiveView();
   if (pView) { pView->ReadUrl( url); }




//	SetMessageText(strItem);

   
}
Пример #9
0
bool CPPageBase::FillComboToolTip(CComboBox& comboBox, TOOLTIPTEXT* pTTT)
{
    bool bNeedTooltip = false;

    CDC* pDC = comboBox.GetDC();
    CFont* pFont = comboBox.GetFont();
    CFont* pOldFont = pDC->SelectObject(pFont);

    TEXTMETRIC tm;
    pDC->GetTextMetrics(&tm);

    CRect comboBoxRect;
    comboBox.GetWindowRect(comboBoxRect);
    comboBoxRect.right -= GetSystemMetrics(SM_CXVSCROLL) + 2 * GetSystemMetrics(SM_CXEDGE);

    int i = comboBox.GetCurSel();
    CString str;
    comboBox.GetLBText(i, str);
    CSize textSize;
    textSize = pDC->GetTextExtent(str);
    pDC->SelectObject(pOldFont);
    comboBox.ReleaseDC(pDC);
    textSize.cx += tm.tmAveCharWidth;

    if (textSize.cx > comboBoxRect.Width()) {
        bNeedTooltip = true;
        if (str.GetLength() > _countof(pTTT->szText) - 1) {
            str.Truncate(_countof(pTTT->szText) - 1);
        }
        _tcscpy_s(pTTT->szText, str);
        pTTT->hinst = nullptr;
    }

    return bNeedTooltip;
}
Пример #10
0
//确定交易场次
void CHorseRaceMainDlg::OnBnClickedButton3()
{
	// TODO: 在此添加控件通知处理程序代码
	CComboBox* pcombox = (CComboBox*)(GetDlgItem(IDC_COMBO2));
	pcombox->GetLBText(pcombox->GetCurSel(),m_TradeRace);
	TRACE(m_TradeRace);
	return ;
}
Пример #11
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);
}
Пример #12
0
    void OnxxxSelChange(UINT /*uNotifyCode*/, int /*nID*/, CWindow /*wndCtl*/)
    {
        CString strText;

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

        SetItemText(101, strText);

        return;
    }
Пример #13
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);  // 将字符转换成数字
}
Пример #14
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);
	}

}
Пример #15
0
CString CFcFontBar::GetSelectedFontName() const
{
	CComboBox* pCb = (CComboBox*)GetDlgItem(ID_FORMAT_FONTNAME);
	ASSERT_VALID(pCb);

	CString fontName;
	int selIndex = pCb->GetCurSel();
	if (selIndex != CB_ERR)
		pCb->GetLBText(selIndex, fontName);
	return fontName;
}
Пример #16
0
void CEditListEditor::SelectCombo(LPCTSTR strValue, CComboBox& combo)
{
    for (int i = 0; i < combo.GetCount(); i++) {
        CString strTemp;
        combo.GetLBText(i, strTemp);
        if (strTemp == strValue) {
            combo.SetCurSel(i);
            break;
        }
    }
}
Пример #17
0
CString CFcFontBar::GetSelectedHtmlTag() const
{
	CComboBox* pCb = (CComboBox*)GetDlgItem(ID_FORMAT_BLOCKFORMAT);
	ASSERT_VALID(pCb);

	CString HtmlTag;
	int selIndex = pCb->GetCurSel();
	if (selIndex != CB_ERR)
		pCb->GetLBText(selIndex, HtmlTag);
	return HtmlTag;
}
Пример #18
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();
}
Пример #19
0
CString CComboBox_GetSelectedString(const CComboBox &ctrlComboBox)
{
    ASSERT(ctrlComboBox.GetSafeHwnd() != NULL);

    int nCurSel = ctrlComboBox.GetCurSel();
    CString strSelectedItem;

    if (nCurSel != CB_ERR)
        ctrlComboBox.GetLBText(nCurSel, strSelectedItem);

    return strSelectedItem;
}
Пример #20
0
//widget event handlers
void TextStyleDialog::OnCbnSelchangeFont()
{
	CWnd* cwnd = this->GetFocus();
	CComboBox* p = (CComboBox*)GetDlgItem(IDC_FONT);
	int sel = p->GetCurSel();
TRACE("SEL: %d", sel);
	CString tmp;
	p->GetWindowText(tmp);
	p->GetLBText(sel, tmp);
TRACE(tmp);
	triggerVirtualKeyStroke(p);
}
Пример #21
0
void CMainFrame::OnSelChangePalette()
{
	CString strText;
	CString strItem;
	CComboBox* pCBox = (CComboBox*)m_wndDlgBar.GetDlgItem(IDC_PALETTE);
	int nIndex = pCBox->GetCurSel();
	if (nIndex == CB_ERR)
		return;
	pCBox->GetLBText(nIndex, strItem);
	AfxFormatString1(strText, IDS_SELECTED_PROMPT, (LPCTSTR)strItem);
	SetMessageText(strText);
}
Пример #22
0
void CMainFrame::OnSelChange()
{
	CString FileName;
	CMFCToolBarComboBoxButton* pComboButton = (CMFCToolBarComboBoxButton*) m_wndLoadFileBar.GetButton(1);
	CComboBox* pLoadFile = pComboButton->GetComboBox();

	if(CB_ERR!=pLoadFile->GetCurSel())
	{
		pLoadFile->GetLBText(pLoadFile->GetCurSel(),FileName);
		AfxGetApp()->OpenDocumentFile(FileName);
	}
}
Пример #23
0
// **************************************************************************
// DoDataExchange ()
//
// Description:
//	This method is called by the framework to exchange and validate dialog data.
//
// Parameters:
//  CDataExchange	*pDX	A pointer to a CDataExchange object.
//
// Returns:
//  void
// **************************************************************************
void CKItemPropertiesDlg::DoDataExchange (CDataExchange *pDX)
	{
	// Perform default processing:
	CDialog::DoDataExchange (pDX);

	// Exchange data between controls and associated member variables:
	//{{AFX_DATA_MAP(CKItemPropertiesDlg)
	DDX_Text (pDX, IDC_ACCESSPATH, m_strAccessPath);
	DDX_Check (pDX, IDC_ACTIVE, m_bActive);
	DDX_Text (pDX, IDC_ITEMID, m_strItemID);
	//}}AFX_DATA_MAP

	// Get pointer to data type combo box:
	CComboBox *pCombo = (CComboBox *)GetDlgItem (IDC_DATATYPE);
	CString strType;

	// If not save and validate, use member vaiable value to make
	// data type combo box selection:
	if (!pDX->m_bSaveAndValidate)
		{
		CString strType;

		switch (m_vtDataType & ~VT_ARRAY)
			{
			case VT_BOOL:	strType = _T("Boolean");	break;
			case VT_UI1:	strType = _T("Byte");		break;
			case VT_I1:		strType = _T("Char");		break;
			case VT_UI2:	strType = _T("Word");		break;
			case VT_I2:		strType = _T("Short");		break;
			case VT_UI4:	strType = _T("DWord");		break;
			case VT_I4:		strType = _T("Long");		break;
			case VT_R4:		strType = _T("Float");		break;
			case VT_R8:		strType = _T("Double");		break;
			case VT_BSTR:	strType = _T("String");		break;
			default:		strType = _T("Native");		break;
			}

		// Update array flag data:
		if ((m_vtDataType & VT_ARRAY) != 0)
			strType += _T(" Array");
		
		// Select data type:
		pCombo->SelectString (-1, strType);
		}

	// else transfer data type combo box index to vartype member variable:
	else
		{
		pCombo->GetLBText (pCombo->GetCurSel (), strType);
		m_vtDataType = VartypeFromString (strType);
		}
	}	
Пример #24
0
void CConfigAppearance::OnCbnSelchangeFontSize()
{
	CStringW str;
	CComboBox *pFontSizeList = static_cast<CComboBox*>(GetDlgItem(IDC_FONT_SIZE));
	pFontSizeList->GetLBText(pFontSizeList->GetCurSel(), str);
	if (auto newSize = conv::to_int(str)) {
		if (*newSize < 5 || *newSize > 30)
			return; // arbitrary
		m_iFontSize = *newSize;
		RedrawWindow();
		SetModified();
	}
}
Пример #25
0
void CInstrumentEditorN163Wave::OnWavePosSelChange()
{
	CString str;
	CComboBox *pPosBox = (CComboBox*)GetDlgItem(IDC_WAVE_POS);
	pPosBox->GetLBText(pPosBox->GetCurSel(), str);

   int pos = _ttoi(str);

	if (pos > 255)
		pos = 255;
	if (pos < 0)
		pos = 0;

	m_pInstrument->SetWavePos(pos);
}
void CMainFrmDlgBar::OnSelchangeComboStyle ()
{
	CComboBox* pCombo = (CComboBox*) GetDlgItem (IDC_COMBO_MFR_STYLE);
	CString s;

	pCombo->GetLBText (pCombo->GetCurSel (), s);
	CMDIChildWnd* pChild = ((CMDIFrameWnd*) AfxGetMainWnd ())->MDIGetActive ();
	if (pChild != NULL)
	{
		CCdCoverCreator2Doc* pDoc = (CCdCoverCreator2Doc*) pChild->GetActiveDocument ();

		if (pDoc != NULL)
			pDoc->SetStyle (s);
	}
}
Пример #27
0
void CComboBox_CopyTo(const CComboBox &ctrlComboBox, CStringArray &arrstrItems)
{
    ASSERT(ctrlComboBox.GetSafeHwnd() != NULL);

    arrstrItems.RemoveAll();
    arrstrItems.SetSize(ctrlComboBox.GetCount());

    CString strItem;

    for (int i = 0; i < ctrlComboBox.GetCount(); ++i)
    {
        ctrlComboBox.GetLBText(i, strItem);
        arrstrItems[i] = strItem;
    }
}
Пример #28
0
void CProjEdit::OnSelchangeType() 
{
  CString tmpstr;
  int idx;
  CComboBox *ce;

  ce=(CComboBox *) GetDlgItem(IDC_TYPE);
  idx=ce->GetCurSel();
  if(idx>=0)
  {
    ce->GetLBText(idx,tmpstr);
    the_projectile.header.type=(short) strtonum(tmpstr);
	  UpdateData(UD_DISPLAY);
  }
}
Пример #29
0
void CSetChip::OnBnClickedOk()
{
	//获取变量
	UpdateData(TRUE) ;

	//得到押注
	CComboBox *pChipComBox = ( CComboBox* ) GetDlgItem( IDC_SETCHIP ) ;
	CString strChip ;

	int nCurSel = pChipComBox->GetCurSel() ;
	pChipComBox->GetLBText( nCurSel, strChip ) ;

	m_nChip = atoi( strChip ) ;

	OnOK();
}
Пример #30
0
void CMainFrame::OnSelChangeUrl()
{
	CString strText;
	CString strItem;
	CComboBox* pCBox = (CComboBox*)m_wndUrlBar.GetDlgItem(IDW_URL);
	int nIndex = pCBox->GetCurSel();
	if (nIndex == CB_ERR)
		return;
	pCBox->GetLBText(nIndex, strItem);

   //AfxFormatString1(strText, IDS_SELECTED_PROMPT, (LPCTSTR)strItem);
   
   // TRACE("On Sel Change URL %s \n",(const char *) strItem);

	SetMessageText(strItem);
}