Ejemplo n.º 1
0
void CMy20140903View::OnPropertysheet() 
{
	// TODO: Add your command handler code here
	CPropSheet propSheet("属性表单程序");
	propSheet.SetWizardMode();
	if(ID_WIZFINISH == propSheet.DoModal()){
		m_iOccupation = propSheet.m_prop1.m_occupation;
		m_strWorkAddr = propSheet.m_prop1.m_workAddr;
		m_bLike[0] = propSheet.m_prop2.m_football;
		m_bLike[1] = propSheet.m_prop2.m_basketball;
		m_bLike[2] = propSheet.m_prop2.m_volleyball;
		m_bLike[3] = propSheet.m_prop2.m_swimming;
		m_strSalary = propSheet.m_prop3.m_strSalary;
		Invalidate();
	}
}
Ejemplo n.º 2
0
void CMainFrame::ShowOptions(int nPage)
{
	// Create "Customize" page:
	CMFCRibbonCustomizePropertyPage pageCustomize(&m_wndRibbonBar);

	// Add "popular" items:
	CList<UINT, UINT> lstPopular;

	lstPopular.AddTail(ID_FILE_NEW);
	lstPopular.AddTail(ID_FILE_OPEN);
	lstPopular.AddTail(ID_FILE_SAVE);
	lstPopular.AddTail(ID_FILE_PRINT_PREVIEW);
	lstPopular.AddTail(ID_FILE_PRINT_DIRECT);
	lstPopular.AddTail(ID_EDIT_UNDO);

	pageCustomize.AddCustomCategory(_T("Popular Commands"), lstPopular);

	// Add hidden commands:
	CList<UINT,UINT> lstHidden;
	m_wndRibbonBar.GetItemIDsList(lstHidden, TRUE);

	pageCustomize.AddCustomCategory(_T("Commands not in the Ribbon"), lstHidden);

	// Add all commands:
	CList<UINT,UINT> lstAll;
	m_wndRibbonBar.GetItemIDsList(lstAll);

	pageCustomize.AddCustomCategory(_T("All Commands"), lstAll);

	// Create property sheet:
	CMFCPropertySheet propSheet(_T("Options"), this, nPage);
	propSheet.m_psh.dwFlags |= PSH_NOAPPLYNOW;

	propSheet.SetLook(CMFCPropertySheet::PropSheetLook_List, 124 /* List width */);

	propSheet.AddPage(&pageCustomize);

	if (propSheet.DoModal() != IDOK)
	{
		return;
	}
}
Ejemplo n.º 3
0
void CuDlgMain::OnRestore()
{
	// TODO: The property sheet attached to your project
	// via this function is not hooked up to any message
	// handler.  In order to actually use the property sheet,
	// you will need to associate this function with a control
	// in your project such as a menu item or tool bar button.
	POSITION pos = m_listDifference.GetHeadPosition();
	while (pos != NULL)
	{
		CaCdaDifference* pDiff = m_listDifference.GetNext(pos);
		if (pDiff->GetType() != CDA_GENERAL)
			break;
		if (pDiff->GetName().CompareNoCase(_T("VERSION")) == 0)
		{
			CString strMsg = _T("");
			CString strV1,strV2;
			int iPos1,iPos2;
			int iePos1,iePos2;
			iPos1 = pDiff->GetValue1().Find(_T('('));
			iPos2 = pDiff->GetValue2().Find(_T('('));
			iePos1 = pDiff->GetValue1().Find(_T('/'));
			iePos2 = pDiff->GetValue2().Find(_T('/'));
			if (iPos1!=-1 && (iePos1 > iPos1))
				strV1 = pDiff->GetValue1().Mid(iPos1,(iePos1-iPos1));
			else
				strV1 = pDiff->GetValue1();

			if (iPos2!=-1 && (iePos2 > iPos2))
				strV2 = pDiff->GetValue2().Mid(iPos2,(iePos2-iPos2));
			else
				strV2 = pDiff->GetValue2();

			strV1.TrimLeft();
			strV1.TrimRight();
			strV2.TrimLeft();
			strV2.TrimRight();
			if (strV1.CompareNoCase(strV2) != 0)
			{
				AfxFormatString2(strMsg, IDS_MSG_DIFF_PLATFORM, (LPCTSTR)strV1, (LPCTSTR)strV2);
				AfxMessageBox (strMsg);
				return;
			}
		}
	}

	CxPSheetRestore propSheet(m_listDifference, NULL);
	propSheet.m_Page3.SetSnapshot(m_strSnapshot2);

	CaRestoreParam& data = propSheet.GetData();
	data.m_plg1 = &m_lg1;
	data.m_plg2 = &m_lg2;
	data.m_plc1 = &m_lc1;
	data.m_plc2 = &m_lc2;
	data.m_ples1= &m_les1;
	data.m_ples2= &m_les2;
	data.m_pleu1= &m_leu1;
	data.m_pleu2= &m_leu2;
	data.m_plvn1= &m_lvn1;
	data.m_plvn2= &m_lvn2;
	data.m_plOtherhost1= &m_lOtherhost1;
	data.m_plOtherhost2= &m_lOtherhost2;
	data.m_plistDifference = &m_listDifference;
	data.m_pIngresVariable = &m_ingresVariable;

	int nAnswer = propSheet.DoModal();

	// This is where you would retrieve information from the property
	// sheet if propSheet.DoModal() returned IDOK.  We aren't doing
	// anything for simplicity.
	if (nAnswer != IDCANCEL)
	{
		CuVcdaCtrl* pParent = (CuVcdaCtrl*)GetParent();
		if (!pParent)
			return;
		pParent->DoCompare();
	}
}