Esempio n. 1
0
void CModifyDlg::CreateCtrl()
{
	CRect rcClient;
	GetClientRect(&rcClient);
	int top = rcClient.top + TOPINCREMENT;
	int Left = rcClient.left + LEFTINCREMENT;
	CRect CTRRECT;

	if (PUBLIC == m_tableType || INCODE == m_tableType){
		for (int i = 0;i < m_vHead.size();i++){
			CStatic *Static = new CStatic;
			CTRRECT = SetCtrlPos(Left,top,88,CTRLHEIGHT);
			Static->Create(m_vHead[i],WS_CHILD|WS_VISIBLE,CTRRECT,this);
			Static->SetFont(GetFont());
			Left += 88 + HINCREMENT;
			CEdit *Edit = new CEdit;
			CTRRECT = SetCtrlPos(Left,top - 3,380,EDITHEIGHT);
			Edit->Create(WS_CHILD|WS_VISIBLE|WS_TABSTOP|WS_BORDER|ES_MULTILINE|ES_AUTOVSCROLL,CTRRECT,this,IDC_MODIFY_EDIT);
			Edit->SetFont(GetFont());
			Edit->SetWindowText(m_vData[i]);
			top += VINCREMENT + CTRLHEIGHT ;
			Left = rcClient.left + LEFTINCREMENT;

			if (i == 0){
				Static->EnableWindow(FALSE);
				Edit->EnableWindow(FALSE);
			}
			if (i == m_vHead.size()-1 && INCODE == m_tableType)
			{
				CStatic *Static1 = new CStatic;
				CTRRECT = SetCtrlPos(Left,top,450,CTRLHEIGHT);
				Static1->Create("调度规则 1:最大空闲时间调度 2:最短会话时间调度 3:最高优先级调度",WS_CHILD|WS_VISIBLE,CTRRECT,this);
				Static1->SetFont(GetFont());
				m_StaticObject.push_back(Static1);
			}
			m_StaticObject.push_back(Static);
			m_EidtObject.push_back(Edit);
		}
	}
	if (TP == m_tableType) SetTPRuleCtrl();
}
	void CModelInputDlg::SetModelInput(CModelInput& modelInput, bool bDefault)
	{
		ASSERT(m_titleCtrlArray.GetSize() == m_varCtrlArray.GetSize());
		ASSERT(m_titleCtrlArray.GetSize() == (int)m_variables.size());

		m_modelInput = modelInput;
		m_bDefault = bDefault;

		for (int i = 0, ii = 0; i < m_variables.size(); i++)
		{
			CStatic* pStatic = (CStatic*)m_titleCtrlArray[i];
			pStatic->EnableWindow(!m_bDefault);

			if (ii < modelInput.size())
			{
				switch (m_variables[i].GetType())
				{
				case CModelInputParameterDef::kMVBool:
				{
					CComboBox* pCombo = (CComboBox*)m_varCtrlArray[i];
					pCombo->SetCurSel(modelInput[ii++].GetBool() ? 0 : 1);
					pCombo->EnableWindow(!m_bDefault);
					break;
				}

				case CModelInputParameterDef::kMVInt:
				case CModelInputParameterDef::kMVReal:
				case CModelInputParameterDef::kMVString:
				case CModelInputParameterDef::kMVFile:
				{
					CCFLEdit* pEdit = (CCFLEdit*)m_varCtrlArray[i];
					pEdit->SetString(modelInput[ii++].GetStr());
					pEdit->EnableWindow(!m_bDefault);
					break;
				}

				case CModelInputParameterDef::kMVListByPos:
				{
					CCFLComboBox* pCombo = (CCFLComboBox*)m_varCtrlArray[i];
					pCombo->SelectFromItemData(modelInput[ii++].GetListIndex());
					pCombo->EnableWindow(!m_bDefault);
					break;
				}

				case CModelInputParameterDef::kMVListByString:
				case CModelInputParameterDef::kMVListByCSV:
				{
					CCFLComboBox* pCombo = (CCFLComboBox*)m_varCtrlArray[i];
					pCombo->SelectStringExact(-1, modelInput[ii++].GetStr());
					pCombo->EnableWindow(!m_bDefault);
					break;
				}

				case CModelInputParameterDef::kMVTitle:
				case CModelInputParameterDef::kMVLine:
				case CModelInputParameterDef::kMVStaticText:
				{
					CStatic* pStatic = (CStatic*)m_varCtrlArray[i];
					pStatic->EnableWindow(!m_bDefault);
					break;
				}

				default: ASSERT(false);
				}
			}
		}
	}
Esempio n. 3
0
void CQuickParseView::DoDataExchange(CDataExchange* pDX)
{
	CFormView::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(CQuickParseView)
	DDX_Check(pDX, IDC_CHECKTrace, m_bTrace);
	DDX_Text(pDX, IDC_EDITInput, m_sInput);
	DDX_Text(pDX, IDC_EDITAmpleOutput, m_sOutput);
	DDX_Text(pDX, IDC_EDITTraceMorphs, m_sTraceMorphs);
	DDX_Check(pDX, IDC_CHECKManualParse, m_bManualParse);
	//}}AFX_DATA_MAP

	if(!pDX->m_bSaveAndValidate)
	{
		CEdit* pE = (	CEdit*)GetDlgItem(IDC_EDITTraceMorphs);
		if(pE)
			pE->EnableWindow(m_bTrace);
#ifndef hab218
		CButton* pB = (CButton*)GetDlgItem(IDC_CHECKManualParse);
		if (pB)
			pB->EnableWindow(m_bTrace);
		CStatic* pS = (CStatic*)GetDlgItem(IDC_STATICManualParse);
		if (pS)
			pS->EnableWindow(m_bTrace);
#endif // hab218
	}
		// i removed the button because opening a window with this text
	// will take some more work

	if(!pDX->m_bSaveAndValidate && m_pAmpleProcess)
	{
		//CWnd* pButton = GetDlgItem(IDC_Errors);
		CWnd* pMessage = GetDlgItem(IDC_ErrorStatic);
		CWnd* pMessageNoTrace = GetDlgItem(IDC_ErrorStatic2);
		CWnd* pIcon = GetDlgItem(IDC_ErrorIcon);
		CWnd* pMessageRefreshed = GetDlgItem(IDC_RefreshNotice);


		// jdh 3/14/2000
		if(m_bDidRefresh)
			pMessageRefreshed->ModifyStyle(NULL, WS_VISIBLE);
		else
			pMessageRefreshed->ModifyStyle(WS_VISIBLE,NULL);
		pMessageRefreshed->Invalidate();


		if(/*pButton &&*/ pIcon && m_pAmpleProcess->getLastRunHadError())
		{
			//pButton->ModifyStyle(NULL, WS_VISIBLE);
			pMessage->ModifyStyle(NULL, WS_VISIBLE);
			pMessage->Invalidate();
			if(!m_bTrace)
			{
				pMessageNoTrace->ModifyStyle(NULL, WS_VISIBLE);
				pMessageNoTrace->Invalidate();
			}
			else // trace is on
			{
				pMessageNoTrace->ModifyStyle(WS_VISIBLE, NULL);
				pMessageNoTrace->Invalidate();
			}

			pIcon->ModifyStyle(NULL, WS_VISIBLE);
			pIcon->Invalidate();
		}
		else if(/*pButton &&*/ pIcon)
		{
			//pButton->ModifyStyle(WS_VISIBLE, NULL);
			pMessage->ModifyStyle(WS_VISIBLE, NULL);
			pMessage->Invalidate();
			pMessageNoTrace->ModifyStyle(WS_VISIBLE, NULL);
			pMessageNoTrace->Invalidate();
			pIcon->ModifyStyle(WS_VISIBLE, NULL);
			pIcon->Invalidate();
		}
		this->Invalidate();
	}
}