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


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

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


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

示例1:

void
PIInspectorTable::FinishCreateSelf()
{

	// Validate pointers.

	ValidateThis_();

	// Do inherited initialization.

	OVTable::FinishCreateSelf();
	
	// Set up default column widths.
	
	InsertCols(2, 0, nil, 0, false);
	SetColWidth(130, 1, 1);
	SetColWidth(150, 2, 2);
	
	// Find inspected object caption.
	
	LWindow* window = LWindow::FetchWindowObject(GetWindowFromPort(GetMacPort()));
	ValidateObject_(window);
	
	mInspectedObjectCaption = dynamic_cast<LStaticText*>(window->FindPaneByID(Pane_InspectedObject));
	if (mInspectedObjectCaption != nil)
		ValidateObject_(mInspectedObjectCaption);
	
	// Find detach selection button.
	
	mDetachPIButton = (dynamic_cast<LBevelButton*>(window->FindPaneByID('DTCH')));
	if (mDetachPIButton != nil) {
		ValidateObject_(mDetachPIButton);
		mDetachPIButton->AddListener(this);
	}

	// Listen to the grow zone.
	
	LGrowZone* growZone = LGrowZone::GetGrowZone();
	ThrowIfNil_(growZone);
	
	growZone->AddListener(this);

}
开发者ID:MaddTheSane,项目名称:tntbasic,代码行数:43,代码来源:PIInspectorTable.cpp

示例2: DoNewProfileDialog

Boolean CProfileManager::DoNewProfileDialog(char *outName, UInt32 bufSize)
{
    Boolean confirmed;
    StDialogHandler	theHandler(dlog_NewProfile, LCommander::GetTopCommander());
    LWindow			 *theDialog = theHandler.GetDialog();
    
    ThrowIfNil_(theDialog);
    LEditText *responseText = dynamic_cast<LEditText*>(theDialog->FindPaneByID('Name'));
    ThrowIfNil_(responseText);
    theDialog->SetLatentSub(responseText);

    theDialog->Show();
    theDialog->Select();
	
  	while (true)  // This is our modal dialog event loop
  	{				
  		MessageT	hitMessage = theHandler.DoDialog();
  		
  		if (hitMessage == msg_OK)
  		{
  		    Str255 pStr;
  		    UInt32 outLen;
  		    
 		    responseText->GetDescriptor(pStr);
 		    outLen = pStr[0] >= bufSize ? bufSize - 1 : pStr[0];
 		    memcpy(outName, &pStr[1], outLen);
 		    outName[outLen] = '\0'; 
            confirmed = PR_TRUE;
     		break;
   		}
   		else if (hitMessage == msg_Cancel)
   		{
   		    confirmed = PR_FALSE;
   		    break;
   		}
  	}
  	return confirmed;
}
开发者ID:rn10950,项目名称:RetroZilla,代码行数:38,代码来源:CProfileManager.cpp

示例3: DoSizeDialog

/*=================================
	DoSizeDialog
==================================*/
Boolean PTFontSizeDialog::DoSizeDialog( SInt16 inSize, SInt16 *outSize )
{
	try
	{
		/***************************
			ensure that the window is created properly (Window Mgr bug)
		****************************/
		StSaveGWorld		aSaver;
		::SetGDevice( ::GetMainDevice() );
		
		/***************************
			create the dialog
		****************************/
		StApplicationContext 	appContext;				// must load from application file
		StDialogHandler			theHandler( PPob_TextSizeDialog, LCommander::GetTopCommander() );
		LWindow	*				theWindow = theHandler.GetDialog();
		LEditText *			sizeField =  dynamic_cast<LEditText*> (theWindow->FindPaneByID( PaneID_Size ));
		
		ThrowIf_( !sizeField );
		
		/********************************************
			initialize the values & show the window
		********************************************/
		sizeField->SetValue( inSize );
		theWindow->Show();
		
		/********************************************
			go into an event loop
		********************************************/
		Boolean 	done = false;
		MessageT	theMessage;
		SInt16		newSize;
		
		while( !done )
		{
			theMessage = theHandler.DoDialog();
			
			if ( theMessage == msg_Cancel )
				done = true;
			else if ( theMessage == msg_OK )
			{
				newSize = sizeField->GetValue();

				if ( (newSize < 4) || (newSize > 512) )
				{
					theWindow->SwitchTarget( sizeField );
					sizeField->SelectAll();
					SUErrors::DisplayError( err_BadFontSize );
				}
				else
					done = true;
			}
		};
		
		/********************************************
			return values to the caller
		********************************************/
		if ( theMessage == msg_OK )
		{
			*outSize = newSize;
			return( true );
		}
		else
			return( false );
	}
	catch( ... )
	{
		SUErrors::DisplayError( err_Generic );
		return( false );	
	}
}
开发者ID:MaddTheSane,项目名称:tntbasic,代码行数:74,代码来源:PTFontSizeDialog.cpp

示例4: 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

示例5: DoManageProfilesDialog

void CProfileManager::DoManageProfilesDialog()
{
    nsresult rv;
    StDialogHandler	theHandler(dlog_ManageProfiles, LCommander::GetTopCommander());
    LWindow			 *theDialog = theHandler.GetDialog();

    nsCOMPtr<nsIProfile> profileService = 
             do_GetService(NS_PROFILE_CONTRACTID, &rv);
    ThrowIfNil_(profileService);
        
    // Set up the dialog by filling the list of current profiles
    LTextTableView *table = (LTextTableView*) theDialog->FindPaneByID('List');    
    ThrowIfNil_(table);
    LPushButton *deleteButton = (LPushButton *) theDialog->FindPaneByID('Dele');
    ThrowIfNil_(deleteButton);
    
    //Str255 pascalStr;
    nsAutoString unicodeStr;
    nsCAutoString cStr;
    char dataBuf[256];
    UInt32 dataSize;
    
    // PowerPlant stuff to set up the list view
    STableCell selectedCell(1, 1);
    SDimension16 tableSize;
    TableIndexT rows, cols;

    table->GetFrameSize(tableSize);
	table->SetTableGeometry(new LTableMonoGeometry(table, tableSize.width, 16));
	table->SetTableStorage(new LTableArrayStorage(table, 0UL));
	table->SetTableSelector(new LTableSingleSelector(table));
	table->InsertCols(1, 0);

    // Get the name of the current profile so we can select it
    nsXPIDLString   currProfileName;
    profileService->GetCurrentProfile(getter_Copies(currProfileName));
    
    // Get the list of profile names and add them to the list
    PRUint32 listLen;
    PRUnichar **profileList;
    rv = profileService->GetProfileList(&listLen, &profileList);
    ThrowIfError_(rv);
    
    for (PRUint32 index = 0; index < listLen; index++)
    {
          CPlatformUCSConversion::GetInstance()->UCSToPlatform(nsDependentString(profileList[index]), cStr);
          table->InsertRows(1, LONG_MAX, cStr.get(), cStr.Length(), true);
          
          if (nsCRT::strcmp(profileList[index], currProfileName.get()) == 0)
            selectedCell.row = index + 1;
    }
    
    PRInt32 numProfiles;
    rv = profileService->GetProfileCount(&numProfiles);
    ThrowIfError_(rv);    
    (numProfiles > 1) ? deleteButton->Enable() : deleteButton->Disable();
    table->SelectCell(selectedCell);


    // Handle the "Ask At StartUp" checkbox    
    LCheckBox *showAtStartCheck = (LCheckBox*) theDialog->FindPaneByID('Show');
    ThrowIfNil_(showAtStartCheck);
    PRBool showIt;
    rv = GetShowDialogOnStart(&showIt);
    if (NS_FAILED(rv))
        showIt = PR_TRUE;
    showAtStartCheck->SetValue(showIt);

    
    theDialog->Show();
    theDialog->Select();
	
  	while (true)  // This is our modal dialog event loop
  	{				
  		MessageT	hitMessage = theHandler.DoDialog();
  		
  		if (hitMessage == msg_OK)
  		{
  		    theDialog->Hide();
            SetShowDialogOnStart(showAtStartCheck->GetValue());
   		    selectedCell = table->GetFirstSelectedCell();
   		    if (selectedCell.row > 0)
   		    {
   		        dataSize = sizeof(dataBuf) - 1;
   		        table->GetCellData(selectedCell, dataBuf, dataSize);
   		        dataBuf[dataSize] = '\0';
                CPlatformUCSConversion::GetInstance()->PlatformToUCS(nsDependentCString(dataBuf), unicodeStr);
   		        rv = profileService->SetCurrentProfile(unicodeStr.get());
            }
  		    break;
  		}
        else if (hitMessage == msg_Cancel)
        {
           	break;
        }
        else if (hitMessage == msg_OnNewProfile)
   		{
   		    if (DoNewProfileDialog(dataBuf, sizeof(dataBuf)))
   		    {
   		        CPlatformUCSConversion::GetInstance()->PlatformToUCS(nsDependentCString(dataBuf), unicodeStr);
//.........这里部分代码省略.........
开发者ID:rn10950,项目名称:RetroZilla,代码行数:101,代码来源:CProfileManager.cpp


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