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


C++ LWindow::GetDescriptor方法代码示例

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


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

示例1: noFlash

void
CAPrintingAttachment::DoPrintJob()
{

	// Validate pointers.
	
	ValidateThis_();
	
	// Find the view that will be installed in the printout.
	
	LWindow* ourWindow = (dynamic_cast<LWindow*>(mOwnerHost));
	ValidateObject_(ourWindow);
	
	LPane* printedPane = nil;
	if (mPrintedPaneID != 0)
		printedPane = ourWindow->FindPaneByID(mPrintedPaneID);
	
	LPane* printedTitleBar = nil;
	if (mPrintedTitleBarID != 0)
		printedTitleBar = ourWindow->FindPaneByID(mPrintedTitleBarID);

	LPrintout* thePrintout = nil;

	try {
	
		// Create the printout view.

		{
			StApplicationContext appContext;
			thePrintout = LPrintout::CreatePrintout(mPrintoutPPobID);
			ValidateObject_(thePrintout);
		}
		
		thePrintout->SetPrintSpec(sPrintRecordSpec);

		// Move the printed pane to the printout.

		LPlaceHolder* thePlaceHolder =
				(dynamic_cast<LPlaceHolder*>(thePrintout->FindPaneByID(mPrintoutPlaceholderID)));
		ValidateObject_(thePlaceHolder);
		thePlaceHolder->InstallOccupant(printedPane);
	
		// Move the title bar to the printout (if any).

		if (printedTitleBar != nil) {
			LPlaceHolder* theTBarHolder =
					(dynamic_cast<LPlaceHolder*>(thePrintout->FindPaneByID(mPrintoutTbarPlaceholderID)));
			ValidateObject_(theTBarHolder);
			theTBarHolder->InstallOccupant(printedTitleBar);
		}
	
		// Add document and window titles to printout header.
		
		LCaption* fDocumentName = (LCaption*) thePrintout->FindPaneByID(Pane_DocumentName);
		ValidateObject_(fDocumentName);
		
		LCaption* fResourceID = (LCaption*) thePrintout->FindPaneByID(Pane_ResourceID);
		ValidateObject_(fResourceID);

		LDocument* document = nil;
		LCommander* commander = ourWindow;
		
		while (commander != nil) {
//			ValidateObject_(commander);				// can't validate, since commander might be stack-based (application)
			document = (dynamic_cast<LDocument*>(commander));
			if (document != nil)
				break;
			commander = commander->GetSuperCommander();
		}

		LStr255 windowName;
		ourWindow->GetDescriptor(windowName);
		
		LStr255 docName;
		if (document != nil) {
			ValidateObject_(document);
			document->GetDescriptor(docName);
		}
		
		if (docName.Length() == 0)
			docName = windowName;
		
		if (windowName == docName)
			windowName[(UInt8)0] = 0;
		
		fDocumentName->SetDescriptor(docName);
		fResourceID->SetDescriptor(windowName);
		
		// Add date and time to printout header.
	
		LCaption* fDateField = (LCaption*) thePrintout->FindPaneByID(Pane_DateField);
		ValidateObject_(fDateField);

		LStr255 tempStr;
		LStr255 tempStr2;

		unsigned long dateTime;							// set date & time
		::GetDateTime(&dateTime);
		::DateString(dateTime, abbrevDate, tempStr, nil);
		{
//.........这里部分代码省略.........
开发者ID:mbert,项目名称:mulberry-main,代码行数:101,代码来源:CAPrintingAttachment.cpp


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