当前位置: 首页>>代码示例>>C++>>正文


C++ COptionTreeItem::SetInfoText方法代码示例

本文整理汇总了C++中COptionTreeItem::SetInfoText方法的典型用法代码示例。如果您正苦于以下问题:C++ COptionTreeItem::SetInfoText方法的具体用法?C++ COptionTreeItem::SetInfoText怎么用?C++ COptionTreeItem::SetInfoText使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在COptionTreeItem的用法示例。


在下文中一共展示了COptionTreeItem::SetInfoText方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: OnInitDialog

BOOL CReportLabelProperties::OnInitDialog() 

{
	CDialog::OnInitDialog();

	COptionTreeItem *otiRoot = NULL;
	COptionTreeItem *otiItem = NULL;

	CRect rcClient;
	DWORD dwStyle, dwOptions;
	LOGFONT lfFont, lfDefaultFont;

	// Get log fonts
	GetFont()->GetLogFont(&lfFont);
	GetFont()->GetLogFont(&lfDefaultFont);
	//strcpy(lfDefaultFont.lfFaceName, _T("Arial"));#OBSOLETE
	strcpy_s(lfDefaultFont.lfFaceName,sizeof(lfDefaultFont.lfFaceName), _T("Arial"));

	// Get the clients rectangle
	GetClientRect(rcClient);

	// Setup the window style
	dwStyle = WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN;

	// Setup the tree options 
	// OT_OPTIONS_SHOWINFOWINDOW
	dwOptions = OT_OPTIONS_SHADEEXPANDCOLUMN | OT_OPTIONS_SHADEROOTITEMS | OT_OPTIONS_SHOWINFOWINDOW;

	int  trBot=rcClient.bottom;
	if (GetDlgItem(IDOK))
	{
		CRect rrrr;
		GetDlgItem(IDOK)->GetWindowRect(rrrr);
		ScreenToClient(rrrr);
		trBot = rrrr.top -4;
	}
	// Create tree options
	CRect trR = rcClient;
	trR.bottom = trBot;
	if (m_otTree.Create(dwStyle, trR, this, dwOptions, 1004) == FALSE)
	{
		TRACE0("Failed to create options control.\r\n");
		return FALSE;
	}

	// Want to be notified
	m_otTree.SetNotify(TRUE, this);

	CString resStr;

	// -- Edit Items
	otiRoot = m_otTree.InsertItem(new COptionTreeItem());
	resStr.LoadString(IDS_REP_LAB);
	otiRoot->SetLabelText(resStr);
	resStr.LoadString(IDS_REP_FULL_LAB);
	otiRoot->SetInfoText(resStr);

	CClientDC	dc( this );
	int inch = dc.GetDeviceCaps( LOGPIXELSX );
	double pt = static_cast< double >( inch ) / 72;

	m_otiFont = (COptionTreeItemFont*)m_otTree.InsertItem(new COptionTreeItemFont(), otiRoot);
	resStr.LoadString(IDS_REP_LAB_FONT);
	m_otiFont->SetLabelText(resStr);
	resStr.LoadString(IDS_REP_LAB_FULL_FONT);
	m_otiFont->SetInfoText(resStr);
	if (m_otiFont->CreateFontItem(&m_lf,pt))
	{
		m_otiFont->SetColor(m_color);
	}
	m_text_edit = (COptionTreeItemEdit*) m_otTree.InsertItem(new COptionTreeItemEdit(), otiRoot);
	resStr.LoadString(IDS_REP_LAB);
	m_text_edit->SetLabelText(resStr);
	m_text_edit->SetInfoText(resStr);
	if (m_text_edit->CreateEditItem(/*OT_EDIT_MULTILINE*/NULL, ES_WANTRETURN | ES_AUTOVSCROLL | ES_AUTOHSCROLL) == TRUE)
	{
		m_text_edit->SetWindowText(_T("Label"));
	}

	m_otiAngle_radio = (COptionTreeItemRadio*)m_otTree.InsertItem(new COptionTreeItemRadio(), otiRoot);
	resStr.LoadString(IDS_REPORT_TEXT_ANG);
	m_otiAngle_radio->SetLabelText(resStr);
	resStr.LoadString(IDS_REPORT_FULL_TEXT_ANG);
	m_otiAngle_radio->SetInfoText(resStr);
	if (m_otiAngle_radio->CreateRadioItem() == TRUE)
	{
		resStr.LoadString(IDS_REPORT_0_ANG);
		m_otiAngle_radio->InsertNewRadio(resStr, FALSE);
		resStr.LoadString(IDS_REPORT_90_ANG);
		m_otiAngle_radio->InsertNewRadio(resStr, FALSE);
		resStr.LoadString(IDS_REPORT_M90_ANG);
		m_otiAngle_radio->InsertNewRadio(resStr, FALSE);
		resStr.LoadString(IDS_REPORT_180_ANG);
		m_otiAngle_radio->InsertNewRadio(resStr, FALSE);
	}

	m_otiAlign_radio = (COptionTreeItemRadio*)m_otTree.InsertItem(new COptionTreeItemRadio(), otiRoot);
	resStr.LoadString(IDS_REP_LAB_ALIGN);
	m_otiAlign_radio->SetLabelText(resStr);
	resStr.LoadString(IDS_REP_LAB_FULL_ALIGN);
//.........这里部分代码省略.........
开发者ID:AnthonyNystrom,项目名称:GenXSource,代码行数:101,代码来源:ReportLabelProperties.cpp

示例2: OnInitDialog

BOOL CReportPictureProperties::OnInitDialog() 
/* ============================================================
	Function :		CReportPictureProperties::OnInitDialog
	Description :	Handler for the "WM_INITDIALOG" messag
	Access :		Protected

	Return :		BOOL	-	Always "TRUE"
	Parameters :	none

	Usage :			Called from MFC

   ============================================================*/
{
	CDialog::OnInitDialog();

	COptionTreeItem *otiRoot = NULL;
	COptionTreeItem *otiItem = NULL;

	CRect rcClient;
	DWORD dwStyle, dwOptions;
	LOGFONT lfFont, lfDefaultFont;

	// Get log fonts
	GetFont()->GetLogFont(&lfFont);
	GetFont()->GetLogFont(&lfDefaultFont);
	//strcpy(lfDefaultFont.lfFaceName, _T("Arial"));#OBSOLETE
	strcpy_s(lfDefaultFont.lfFaceName,sizeof(lfDefaultFont.lfFaceName), _T("Arial"));

	// Get the clients rectangle
	GetClientRect(rcClient);

	// Setup the window style
	dwStyle = WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN;

	// Setup the tree options 
	// OT_OPTIONS_SHOWINFOWINDOW
	dwOptions = OT_OPTIONS_SHADEEXPANDCOLUMN | OT_OPTIONS_SHADEROOTITEMS | OT_OPTIONS_SHOWINFOWINDOW;

	int  trBot=rcClient.bottom;
	if (GetDlgItem(IDOK))
	{
		CRect rrrr;
		GetDlgItem(IDOK)->GetWindowRect(rrrr);
		ScreenToClient(rrrr);
		trBot = rrrr.top -4;
	}
	// Create tree options
	CRect trR = rcClient;
	trR.bottom = trBot;
	if (m_otTree.Create(dwStyle, trR, this, dwOptions, 1004) == FALSE)
	{
		TRACE0("Failed to create options control.\r\n");
		return FALSE;
	}

	// Want to be notified
	m_otTree.SetNotify(TRUE, this);

	// -- Edit Items
	CString resStr;
	otiRoot = m_otTree.InsertItem(new COptionTreeItem());
	resStr.LoadString(IDS_REP_COMMON_PROPS);
	otiRoot->SetLabelText(resStr);
	resStr.LoadString(IDS_REP_FULL_COMMON_PROPS);
	otiRoot->SetInfoText(resStr);

	m_otiFile = (COptionTreeItemFile*)m_otTree.InsertItem(new COptionTreeItemFile(), otiRoot);
	resStr.LoadString(IDS_REP_PR_FILE);
	m_otiFile->SetLabelText(resStr);
	resStr.LoadString(IDS_REP_PR_FULL_FILE);
	m_otiFile->SetInfoText(resStr);
	if (m_otiFile->CreateFileItem("",GetExtFromType(0).Mid(2,3),GetFileTypes(TRUE),
							OT_FILE_OPENDIALOG | OT_FILE_SHOWFULLPATH, 
							OFN_OVERWRITEPROMPT|OFN_HIDEREADONLY | OFN_FILEMUSTEXIST) == TRUE)
	{
	}

	otiRoot->Expand();

	otiRoot = m_otTree.InsertItem(new COptionTreeItem());
	resStr.LoadString(IDS_REP_PR_DL_FRAME);
	otiRoot->SetLabelText(resStr);
	resStr.LoadString(IDS_REP_PR_DL_FULL_FRAME);
	otiRoot->SetInfoText(resStr);

	CString yesS;
	yesS.LoadString(IDS_YES);
	CString noS;
	noS.LoadString(IDS_NO);

	m_otiExistLeft = (COptionTreeItemCheckBox*)m_otTree.InsertItem(new COptionTreeItemCheckBox(), otiRoot);
	resStr.LoadString(IDS_REP_PR_DL_LEFT);
	m_otiExistLeft->SetLabelText(resStr);
	resStr.LoadString(IDS_REP_PR_DL_FULL_LEFT);
	m_otiExistLeft->SetInfoText(resStr);
	if (m_otiExistLeft->CreateCheckBoxItem(m_borderStyle&DIAGRAM_FRAME_STYLE_LEFT, OT_CHECKBOX_SHOWCHECK) == TRUE)
	{
		m_otiExistLeft->SetCheckText(yesS, noS);
	}
	m_otiExistRight = (COptionTreeItemCheckBox*)m_otTree.InsertItem(new COptionTreeItemCheckBox(), otiRoot);
//.........这里部分代码省略.........
开发者ID:AnthonyNystrom,项目名称:GenXSource,代码行数:101,代码来源:ReportPictureProperties.cpp


注:本文中的COptionTreeItem::SetInfoText方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。