/**
* 响应上工具条按钮;选择测试类型
* @param void
* @return void
*/
void CSensorGraphChildFrame::OnSelectTestType() 
{
	CSensorGraphView* pView = (CSensorGraphView*)GetActiveView();

	CBCGPToolbarComboBoxButton* pComboButton = NULL;
	pComboButton = (CBCGPToolbarComboBoxButton*)m_oGraphViewTopToolBar.GetButton(9 + m_uiSensorNbCount);
	m_strTestType = pComboButton->GetText();
	m_uiTestType = m_pSiteData->GetTestTypeIDByString(m_strTestType);
	if(40 != m_uiTestType)
	{
		// 得到检波器TestType判据字符串
		m_strTestType = m_pSiteData->GetSensorTestTypeLimitStringByID(m_uiTestType);
	}
	CToolbarGraph* pBNGraph = NULL;
	pBNGraph = (CToolbarGraph*)m_oGraphViewTopToolBar.GetButton(2 + m_uiSensorNbCount);
	pBNGraph->m_iMode = 1;
	if(15 == m_uiTestType)	// 检波器电阻
	{
		pBNGraph->m_iMode = 2;
	}
	pBNGraph->m_strLabel = m_strTestType;
	m_oGraphViewTopToolBar.InvalidateButton(2 + m_uiSensorNbCount);

	pView->RedrawWindow();
}
/**
* 响应上工具条按钮;选择检波器Nb
* @param void
* @return void
*/
void CSensorGraphChildFrame::OnSelectSensorNb() 
{
	CSensorGraphView* pView = (CSensorGraphView*)GetActiveView();

	CBCGPToolbarComboBoxButton* pComboButton = NULL;
	int iCurSel = 0;
	pComboButton = (CBCGPToolbarComboBoxButton*)m_oGraphViewTopToolBar.GetButton(6 + m_uiSensorNbCount);
	iCurSel = pComboButton->GetCurSel();
	m_uiSensorNb = pComboButton->GetItemData(iCurSel);

	pView->RedrawWindow();
}
Ejemplo n.º 3
0
void CMainFrame::SetAddress(LPCTSTR lpszUrl)
{
    // This is called when the browser has completely loaded the new location,
    // so make sure the text in the address bar is up to date and stop the
    // animation.

    CBCGPToolbarComboBoxButton* pAdress = DYNAMIC_DOWNCAST (CBCGPToolbarComboBoxButton,
                                          m_wndAddressBar.GetButton (m_wndAddressBar.CommandToIndex (IDC_ADDRESS)));

    if (pAdress != NULL)
    {
        ASSERT_VALID (pAdress);
        pAdress->SetText (lpszUrl);
    }
//	m_wndAnimate.Stop();
}
afx_msg LRESULT CInstrumentGraphChildFrame::OnToolbarReset(WPARAM wp, LPARAM)
{
	UINT uiToolBarId = (UINT) wp;

	switch (uiToolBarId)
	{
	case IDR_TOOLBAR_MATRIX_GRAPH_BOTTOM:
		m_oGraphViewBottomToolBar.ReplaceButton (ID_BUTTON_MATRIX_GRAPH_LINENAMELABEL, CToolbarLabel (ID_BUTTON_MATRIX_GRAPH_LINENAMELABEL, _T("Line Name:")));
		m_oGraphViewBottomToolBar.ReplaceButton (ID_BUTTON_MATRIX_GRAPH_POINTNBLABEL, CToolbarLabel (ID_BUTTON_MATRIX_GRAPH_POINTNBLABEL, _T("Point Number:")));
		m_oGraphViewBottomToolBar.ReplaceButton (ID_BUTTON_MATRIX_GRAPH_LINENAME, CBCGPToolbarEditBoxButton(ID_BUTTON_MATRIX_GRAPH_LINENAME, -1, WS_CHILD | WS_VISIBLE));
		m_oGraphViewBottomToolBar.ReplaceButton (ID_BUTTON_MATRIX_GRAPH_POINTNB, CBCGPToolbarEditBoxButton(ID_BUTTON_MATRIX_GRAPH_POINTNB, -1, WS_CHILD | WS_VISIBLE));
		break;
	case IDR_TOOLBAR_MATRIX_INSTRUMENT_GRAPH_TOP:
		CBCGPToolbarButton* pBN = NULL;
		pBN = m_oGraphViewTopToolBar.GetButton(0);
		pBN->m_nStyle = TBBS_CHECKBOX | TBBS_CHECKED;
		pBN = m_oGraphViewTopToolBar.GetButton(1);
		pBN->m_nStyle = TBBS_CHECKBOX | TBBS_CHECKED;
		pBN = m_oGraphViewTopToolBar.GetButton(2);
		pBN->m_nStyle = TBBS_CHECKBOX | TBBS_CHECKED;
		pBN = m_oGraphViewTopToolBar.GetButton(3);
		pBN->m_nStyle = TBBS_CHECKBOX | TBBS_CHECKED;
		pBN = m_oGraphViewTopToolBar.GetButton(4);
		pBN->m_nStyle = TBBS_CHECKBOX | TBBS_CHECKED;

		CToolbarGraph oBNGraph (ID_BUTTON_MATRIX_INSTRUMENT_GRAPH_TESTMARKER);
		m_oGraphViewTopToolBar.ReplaceButton (ID_BUTTON_MATRIX_INSTRUMENT_GRAPH_TESTMARKER, oBNGraph);
		CToolbarGraph* pBNGraph = NULL;
		pBNGraph = (CToolbarGraph*)m_oGraphViewTopToolBar.GetButton(7);
		pBNGraph->m_iMode = 1;
		pBNGraph->m_strLabel = m_strTestType;

		m_oGraphViewTopToolBar.ReplaceButton (ID_BUTTON_MATRIX_INSTRUMENT_GRAPH_QCLABEL, CToolbarLabel (ID_BUTTON_MATRIX_INSTRUMENT_GRAPH_QCLABEL, _T("Qc:")));

		CBCGPToolbarComboBoxButton comboButton (ID_BUTTON_MATRIX_INSTRUMENT_GRAPH_QCLIST, -1, CBS_DROPDOWNLIST);
		// 初始化下拉框按钮测试类型下拉框
		InitButtonForTestTyperComboBox(&comboButton);
		comboButton.SelectItem(0);
		m_oGraphViewTopToolBar.ReplaceButton (ID_BUTTON_MATRIX_INSTRUMENT_GRAPH_QCLIST, comboButton);

		m_oGraphViewTopToolBar.ReplaceButton (ID_BUTTON_MATRIX_INSTRUMENT_GRAPH_QCGO, CToolbarLabel (ID_BUTTON_MATRIX_INSTRUMENT_GRAPH_QCGO, "  GO  "));
		break;
	}

	return 0;
}
Ejemplo n.º 5
0
void CMainFrame::OnAddress()
{
    CBCGPToolbarComboBoxButton* pAdress = DYNAMIC_DOWNCAST (CBCGPToolbarComboBoxButton,
                                          m_wndAddressBar.GetButton (m_wndAddressBar.CommandToIndex (IDC_ADDRESS)));

    if (pAdress == NULL)
    {
        return;
    }

    ASSERT_VALID (pAdress);

    CString strAddress = pAdress->GetText ();

    Navigate (strAddress);

    if (pAdress->FindItem (strAddress) < 0)
    {
        pAdress->AddItem (strAddress);
    }
}
/**
* 响应上工具条按钮;选择测试类型
* @param void
* @return void
*/
void CInstrumentGraphChildFrame::OnSelectTestType() 
{
	CInstrumentGraphView* pView = (CInstrumentGraphView*)GetActiveView();

	CBCGPToolbarComboBoxButton* pComboButton = NULL;
	pComboButton = (CBCGPToolbarComboBoxButton*)m_oGraphViewTopToolBar.GetButton(12);
	m_strTestType = pComboButton->GetText();
	m_uiTestType = m_pSiteData->GetTestTypeIDByString(m_strTestType);
	if(30 != m_uiTestType)
	{
		// 得到仪器TestType判据字符串
		m_strTestType = m_pSiteData->GetInsarumentTestTypeLimitStringByID(m_uiTestType);
	}
	CToolbarGraph* pBNGraph = NULL;
	pBNGraph = (CToolbarGraph*)m_oGraphViewTopToolBar.GetButton(7);
	pBNGraph->m_iMode = 1;
	pBNGraph->m_strLabel = m_strTestType;
	m_oGraphViewTopToolBar.InvalidateButton(7);

	pView->RedrawWindow();
}