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


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

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


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

示例1: noFlash


//.........这里部分代码省略.........
		
		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);
		{
			StApplicationContext appContext;
			tempStr += LStr255(STR_PrintoutStrings, str_DateTimeSeparator);
		}
		::TimeString(dateTime, false, tempStr2, nil);
		tempStr += tempStr2;
		
		fDateField->SetDescriptor(tempStr);
		
		// Print it.

#if PP_Target_Carbon
		StClipRgnState noFlash(nil);
#else
		StVisRgn noFlash(ourWindow->GetMacPort());
#endif
		thePrintout->DoPrintJob();
		delete thePrintout;
		
	}

	catch(...) {
		if (thePrintout)
			delete thePrintout;
	}

	// Make sure printed pane is redrawn properly.

	printedPane->Refresh();
	if (printedTitleBar != nil)
		printedTitleBar->Refresh();

}
开发者ID:mbert,项目名称:mulberry-main,代码行数:101,代码来源:CAPrintingAttachment.cpp


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