本文整理汇总了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);
{
//.........这里部分代码省略.........