示例#1
0
void
ShowNavButtons(unsigned char* backTitle, unsigned char* nextTitle)
{
    Boolean bDefault = true;
    	
	gControls->backB = GetNewControl( rBackBtn, gWPtr);
	gControls->nextB = GetNewControl( rNextBtn, gWPtr);

	if( gControls->backB != NULL)
	{
		SetControlTitle( gControls->backB, backTitle); 
		ShowControl( gControls->backB);

		if (gCurrWin==kWelcomeID || gCurrWin==kSetupTypeID)
			HiliteControl(gControls->backB, kDisableControl);
	}
	
	if ( gControls->nextB != NULL)
	{
		SetControlTitle( gControls->nextB, nextTitle);
		ShowControl( gControls->nextB);

        SetControlData(gControls->nextB, kControlNoPart, 
            kControlPushButtonDefaultTag, sizeof(bDefault),(Ptr) &bDefault);
	}
	
    ShowCancelButton();
}
示例#2
0
文件: ugView.c 项目: rolk/ug
static int CreateApplicationWindow (AWindowRecord *wr, char *fname, short h, short v, short dh, short dv)
{
  Rect r;
  GrafPtr myPort;
  PaletteHandle myPalette;
  char name[80];

  /* init AWindowRecord */
  wr->theWindow = (WindowPtr) wr;

  /* read in resources */
  if (GetNewCWindow(appWinId,(Ptr)wr,(WindowPtr) -1)==NULL)
  {
    return(1);
  }
  myPalette = GetNewPalette(defaultPaletteId);
  SetPalette(wr->theWindow,myPalette,false);

  /* move and size window */
  myPort = (GrafPtr) wr->theWindow;
  SetPort(myPort);
  MoveWindow(wr->theWindow,h,v,false);
  SizeWindow(wr->theWindow,dh+15,dv+15,false);
  strcpy(name,fname);
  SetWTitle(wr->theWindow,c2pstr(name));
  ShowWindow(wr->theWindow);
  SelectWindow(wr->theWindow);
  DrawGrowIcon(wr->theWindow);
  r = myPort->portRect;

  TextFont(kFontIDMonaco);

  /* get the scroll bars */
  wr->vScrollBar = GetNewControl(vScrollBarId,wr->theWindow);
  wr->hScrollBar = GetNewControl(hScrollBarId,wr->theWindow);

  /* set correct size of the scroll bars */
  MoveControl(wr->vScrollBar,r.right-15,-1);
  SizeControl(wr->vScrollBar,16,r.bottom-13);
  SetControlMinimum(wr->vScrollBar,0);
  SetControlMaximum(wr->vScrollBar,0);
  SetControlValue(wr->vScrollBar,0);
  ShowControl(wr->vScrollBar);
  MoveControl(wr->hScrollBar,-1,r.bottom-15);
  SizeControl(wr->hScrollBar,r.right-13,16);
  SetControlMinimum(wr->hScrollBar,0);
  SetControlMaximum(wr->hScrollBar,0);
  SetControlValue(wr->hScrollBar,0);
  ShowControl(wr->hScrollBar);
  DrawControls(wr->theWindow);

  SetRect(&(wr->usableRect),0,0,dh,dv);

  return(0);
}
示例#3
0
void
ShowLicenseWin(void)
{
	Str255 		accept;
	Str255 		decline;
	Rect 		sbRect;
	int 		sbWidth;
	
	GrafPtr	oldPort;
	GetPort(&oldPort);
	
	SetPort(gWPtr);

	gCurrWin = kLicenseID; 
	/* gControls->lw = (LicWin *) NewPtrClear(sizeof(LicWin)); */
	
	GetResourcedString(accept, rInstList, sAcceptBtn);
	GetResourcedString(decline, rInstList, sDeclineBtn);
	
	gControls->lw->scrollBar = GetNewControl( rLicScrollBar, gWPtr);
	gControls->lw->licBox = GetNewControl( rLicBox, gWPtr);

	if(gControls->lw->scrollBar && gControls->lw->licBox)
	{
		HLock( (Handle) gControls->lw->scrollBar);
		sbRect = (*(gControls->lw->licBox))->contrlRect;
				
		sbWidth = (*(gControls->lw->scrollBar))->contrlRect.right -
				  (*(gControls->lw->scrollBar))->contrlRect.left;
		
		(*(gControls->lw->scrollBar))->contrlRect.right = sbRect.right + kScrollBarPad;
		(*(gControls->lw->scrollBar))->contrlRect.left = sbRect.right + kScrollBarPad - 
														 sbWidth;
		(*(gControls->lw->scrollBar))->contrlRect.top = sbRect.top - kScrollBarPad;
		(*(gControls->lw->scrollBar))->contrlRect.bottom = sbRect.bottom + kScrollBarPad;
		HUnlock( (Handle) gControls->lw->scrollBar);
	}
	else
	{
		ErrorHandler(eParam, nil);
		return;
	}
	InitLicTxt();

	ShowNavButtons( decline, accept);
	ShowControl( gControls->lw->scrollBar);
	ShowControl( gControls->lw->licBox);
	ShowTxt();
	InitScrollBar( gControls->lw->scrollBar);
	ShowLogo(false);
	
	SetPort(oldPort);
}
示例#4
0
/*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	Name:	MyPDEInitialize

	Input Parameters:
		context				:	The plugins context
		parentUserPane		:	the user pane to your your controls into
		ref					:	the reference to this PDE
		printSession		:	this holds the PM tickets

	Output Parameters:
		flags				:	feature flags that are supported by this PDE
		err					:	returns the error status

	Description:
		Initializes client interface. Creates controls and sets initial values



	Change History (most recent first):
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~*/
static
OSStatus MyPDEInitialize(	PMPDEContext	context,
                            PMPDEFlags*		flags,
                            PMPDERef		ref,
                            ControlRef		parentUserPane,
                            PMPrintSession	printSession)
{
    OSStatus err = noErr;
    PrintDialogPDEOnlyContextPtr myContext = NULL;	// Pointer to our context data.

    DebugMessage("PrintDialogPDE MyPDEInitialize called\n");

    myContext = (PrintDialogPDEOnlyContextPtr) context;

    if ((myContext != NULL) && (printSession != NULL))
    {
        WindowRef theWindow = NULL;
        short savedResFile = CurResFile();
        UseResFile(myContext->theResFile);
        theWindow = GetControlOwner(parentUserPane);	// get the windowref from the user pane

        // the user panes rect is the rect we should use to draw our
        // controls into. The printing system calculates the user pane
        // size based on the maxh and maxv sizes returned from the
        // Prologue function

        // Note that we are using the AutoToggleProc variant of the Radio Button control
        // This allows a hit on this control to be automatically processed by the ControlMgr

        // get controls
        myContext->thePrintSelTextOnlyControlRef = GetNewControl(kPrintDialogPDEControlID, theWindow);

        // embed controls
        EmbedControl(myContext->thePrintSelTextOnlyControlRef, parentUserPane);

        // set controls as visible
        SetControlVisibility(myContext->thePrintSelTextOnlyControlRef, true, false);

        // Set default value
        SetControlValue(myContext->thePrintSelTextOnlyControlRef, 0);

        // Set flags
        *flags = kPMPDENoFlags;

        // Initialize this plugins controls based on the information in the
        // PageSetup or PrintSettings ticket.
        err = MyPDESync(context, printSession, kSyncDirectionSetUserInterface);
        if (err == kPMKeyNotFound)
            err = noErr;

        UseResFile(savedResFile);
    }
    else
        err = kPMInvalidPDEContext;

    DebugPrintErr(err, "PrintDialogPDE Error from MyPDEInitialize returned %d\n");

    return (err);
}
示例#5
0
void
ShowLogo(Boolean bEraseRect)
{
	short 		reserr;
	Rect 		derefd, logoRect;
	PicHandle 	logoPicH;
	Handle		logoRectH; 

	/* draw the image well */
    ControlHandle imgWellH = GetNewControl(rLogoImgWell, gWPtr);
    if (!imgWellH)
    {
        ErrorHandler(eMem, nil);
        return;
	}

	/* initialize Netscape logo */
	logoPicH = GetPicture(rNSLogo);  
	reserr = ResError();
	
	if (reserr == noErr)
	{
		/* draw Netscape logo */
		if (logoPicH != nil)
		{		
			logoRectH = GetResource('RECT', rNSLogoBox);
			reserr = ResError();
			if (reserr == noErr && logoRectH)
			{
				HLock(logoRectH);
				derefd = (Rect) **((Rect**)logoRectH);
				SetRect(&logoRect, derefd.left, derefd.top, derefd.right, derefd.bottom);
				HUnlock(logoRectH);
				reserr = ResError();
				if (reserr == noErr)
				{
					if (bEraseRect)
					{
						EraseRect(&logoRect);
						InvalRect(&logoRect);
					}
					DrawPicture(logoPicH, &logoRect);
					ReleaseResource((Handle)logoPicH);
				}
				
				ReleaseResource((Handle)logoRectH);
			}
		}
	}
	
	if (reserr != noErr)
		ErrorHandler(reserr, nil);
}
示例#6
0
pascal ControlHandle SafeGetNewControl(short ctrlID, WindowPtr window)
{
	StAcroResourceContext resContext;

	return GetNewControl(ctrlID, window);
}
示例#7
0
void
ShowAdditionsWin(void)
{
	Str255		next, back;
	Str255		compDescTitle;
	StringPtr	selCompMsg;
	Handle		listBoxRect;
	Rect 		dataBounds, listBoxFrame, viewRect;
	short		reserr;
	int			totalRows = 0, i, instChoice;
	Point		cSize;
	Boolean		bCellSelected;
	GrafPtr		oldPort;
	GetPort(&oldPort);
		
	SetPort(gWPtr);
	
	gCurrWin = kAdditionsID; 
	/* gControls->aw = (CompWin *) NewPtrClear(sizeof(CompWin)); */
	
	GetResourcedString(next, rInstList, sNextBtn);
	GetResourcedString(back, rInstList, sBackBtn);

	// get controls
	listBoxRect = Get1Resource('RECT', rCompListBox);
	reserr = ResError(); 
	if (reserr == noErr && listBoxRect != NULL)
	{
		HLock((Handle)listBoxRect);
		SetRect(&gControls->aw->compListBox, 	((Rect*)*listBoxRect)->left,
												((Rect*)*listBoxRect)->top,
												((Rect*)*listBoxRect)->right,
												((Rect*)*listBoxRect)->bottom);
		HUnlock((Handle)listBoxRect);
	}
	else
	{
		ErrorHandler(reserr, nil);
		return;
	}
	gControls->aw->compDescBox = NULL;
	gControls->aw->compDescBox = GetNewControl(rCompDescBox, gWPtr);
	if (!gControls->aw->compDescBox)
	{
		ErrorHandler(eMem, nil);
		return;
	}

	gControls->aw->compListBox.right -= kScrollBarWidth;
	instChoice = gControls->opt->instChoice-1;
	for (i=0; i<kMaxComponents; i++)
	{
		if (totalRows >= gControls->cfg->numComps)
			break;
		if (!gControls->cfg->comp[i].invisible && gControls->cfg->comp[i].additional &&
			(gControls->cfg->st[instChoice].comp[i] == kInSetupType))
			totalRows++;
	}
		
	SetRect(&dataBounds, 0, 0, 1, totalRows);
	SetPt( &cSize, 0, 0);
	gControls->aw->compList = LNew((const Rect*)&gControls->aw->compListBox, (const Rect*)&dataBounds,
									cSize, rCheckboxLDEF, gWPtr, true, false, false, true);
	(*gControls->aw->compList)->selFlags = lExtendDrag + lUseSense + lDoVAutoscroll;
	
	HLock((Handle)gControls->aw->compDescBox);
	SetRect(&viewRect, (*gControls->aw->compDescBox)->contrlRect.left,
					   (*gControls->aw->compDescBox)->contrlRect.top,
					   (*gControls->aw->compDescBox)->contrlRect.right,
					   (*gControls->aw->compDescBox)->contrlRect.bottom);
	HUnlock((Handle)gControls->aw->compDescBox);
	viewRect.top += kInterWidgetPad;
	SetRect(&viewRect, viewRect.left + kTxtRectPad,
						viewRect.top + kTxtRectPad,
						viewRect.right - kTxtRectPad,
						viewRect.bottom - kTxtRectPad);
	TextFont(applFont);
	TextSize(9);
	gControls->aw->compDescTxt = TENew(&viewRect, &viewRect);
	TextFont(systemFont);
	TextSize(12);
	
	// populate controls
	bCellSelected = AddPopulateCompInfo();
	
	// show controls
	GetResourcedString(compDescTitle, rInstList, sCompDescTitle);
	SetControlTitle(gControls->aw->compDescBox, compDescTitle);
	
	MoveTo( gControls->aw->compListBox.left, gControls->aw->compListBox.top - kInterWidgetPad);
	HLock(gControls->cfg->selCompMsg);
	selCompMsg = CToPascal(*gControls->cfg->selAddMsg);
	if (selCompMsg)
		DrawString( selCompMsg );
	HUnlock(gControls->cfg->selCompMsg);
	SetRect(&listBoxFrame, gControls->aw->compListBox.left, 
						 --gControls->aw->compListBox.top,
						   gControls->aw->compListBox.right + kScrollBarWidth,
						 ++gControls->aw->compListBox.bottom);
	FrameRect(&listBoxFrame);
	ShowNavButtons( back, next );
	if (bCellSelected)
		AddSetOptInfo(true);
	else
		DrawDiskSpaceMsgs( gControls->opt->vRefNum );

	// default highlight first row
	AddInitRowHighlight(0);

#if 0	    
	RGBColor backColorOld;
    Rect adjustedRect, *clRect = &gControls->aw->compListBox;
    SetRect(&adjustedRect, clRect->left, clRect->top+1, clRect->right, clRect->bottom-1);
    GetBackColor(&backColorOld);
    BackColor(whiteColor);
    EraseRect(&adjustedRect);
    RGBBackColor(&backColorOld);
#endif
    
	SetPort(oldPort);
}
示例#8
0
void 
ShowTerminalWin(void)
{
	Str255		next, back;
	Handle		rectH;
	Rect		viewRect;
	short		reserr;
	MenuHandle 			popupMenu;
	PopupPrivateData ** pvtDataHdl;
	unsigned char *		currMenuItem;
	short 				i, vRefNum;
	long 				cwdDirID, dirID;
	Boolean				isDir = false;
	Str255				pModulesDir;
	OSErr 				err = noErr;
	GrafPtr		oldPort;
	GetPort(&oldPort);

	if (gWPtr != NULL)
	{
		SetPort(gWPtr);
	
		gCurrWin = kTerminalID; 
		/* gControls->tw = (TermWin*) NewPtrClear(sizeof(TermWin)); */
	
		GetResourcedString(next, rInstList, sInstallBtn);
		GetResourcedString(back, rInstList, sBackBtn);
	
		// malloc and get control
		rectH = Get1Resource('RECT', rStartMsgBox);
		reserr = ResError();
		if (reserr == noErr && rectH != NULL)
		{
			viewRect = (Rect) **((Rect **)rectH);
			ReleaseResource(rectH);
        }
		else
		{
			ErrorHandler(reserr, nil);
			return;
		}
		
		gControls->tw->siteSelector = NULL;
		gControls->tw->saveBitsCheckbox = NULL;
		
		gControls->tw->startMsgBox = viewRect;
	
		gControls->tw->startMsg = TENew(&viewRect, &viewRect);
        if (gControls->tw->startMsg == NULL)
        {
        	ErrorHandler(eMem, nil);
        	return;
        }
    
		// save bits after download and install
	
		/* get the "Installer Modules" relative subdir */
		ERR_CHECK(GetCWD(&cwdDirID, &vRefNum));
		GetIndString(pModulesDir, rStringList, sInstModules);
		GetDirectoryID(vRefNum, cwdDirID, pModulesDir, &dirID, &isDir);
		if (isDir)
		{
			if (!ExistArchives(vRefNum, dirID))  // going to download
			{			    
        		if (gControls->cfg->numSites > 0)
        		{
                    // download settings groupbox
                    Str255 dlSettingsGBTitle;
                    gControls->tw->dlSettingsGB = GetNewControl(rDLSettingsGB, gWPtr);
                    if (gControls->tw->dlSettingsGB)
                    {
                        GetResourcedString(dlSettingsGBTitle, rInstList, sDLSettings);
                        SetControlTitle(gControls->tw->dlSettingsGB, dlSettingsGBTitle);
                        ShowControl(gControls->tw->dlSettingsGB);
                    }
                    
                    // site selector label
                    Str255 siteSelMsgStr;
                    gControls->tw->siteSelMsg = GetNewControl(rSiteSelMsg, gWPtr);
                    if (gControls->tw->siteSelMsg)
                    {
                        GetResourcedString(siteSelMsgStr, rInstList, sSiteSelMsg);
                        SetControlData(gControls->tw->siteSelMsg, kControlNoPart, 
                            kControlStaticTextTextTag, siteSelMsgStr[0], (Ptr)&siteSelMsgStr[1]); 
                        ShowControl(gControls->tw->siteSelMsg);
                    }
                    
    		        // site selector
        			gControls->tw->siteSelector = GetNewControl( rSiteSelector, gWPtr );
        			if (!gControls->tw->siteSelector)
        			{
        				ErrorHandler(eMem, nil);
        				return;
        			}
        			
        			// populate popup button menus
        			HLock((Handle)gControls->tw->siteSelector);
        			pvtDataHdl = (PopupPrivateData **) (*(gControls->tw->siteSelector))->contrlData;
        			HLock((Handle)pvtDataHdl);
        			popupMenu = (MenuHandle) (**pvtDataHdl).mHandle;
        			for (i=0; i<gControls->cfg->numSites; i++)
        			{
        				HLock(gControls->cfg->site[i].desc);
        				currMenuItem = CToPascal(*gControls->cfg->site[i].desc);		
        				HUnlock(gControls->cfg->site[i].desc);
        				InsertMenuItem( popupMenu, currMenuItem, i );
        			}
        			HUnlock((Handle)pvtDataHdl);
        			HUnlock((Handle)gControls->tw->siteSelector);
        			SetControlMaximum(gControls->tw->siteSelector, gControls->cfg->numSites);
        			SetControlValue(gControls->tw->siteSelector, gControls->opt->siteChoice);
        			ShowControl(gControls->tw->siteSelector);
        		}
		
				// show check box and message
				gControls->tw->saveBitsCheckbox = GetNewControl( rSaveCheckbox, gWPtr );
				if (!gControls->tw->saveBitsCheckbox)
				{
					ErrorHandler(eMem, nil);
					return;
				}
				if (gControls->opt->saveBits)
				    SetControlValue(gControls->tw->saveBitsCheckbox, 1);
				ShowControl(gControls->tw->saveBitsCheckbox);
				
				// get rect for save bits message
				rectH = Get1Resource('RECT', rSaveBitsMsgBox);
				reserr = ResError();
				if (reserr == noErr && rectH != NULL)
				{
					 gControls->tw->saveBitsMsgBox  = (Rect) **((Rect **)rectH);
					 DisposeHandle(rectH);
			    }
				else
				{
					ErrorHandler(reserr, nil);
					return;
				}
				
				// get text edit record for save bits message
				gControls->tw->saveBitsMsg = TENew(&gControls->tw->saveBitsMsgBox,
												   &gControls->tw->saveBitsMsgBox );
			    if (gControls->tw->saveBitsMsg == NULL)
			    {
			    	ErrorHandler(eMem, nil);
			    	return;
			    }
			    HLock(gControls->cfg->saveBitsMsg);
				TESetText(*gControls->cfg->saveBitsMsg, strlen(*gControls->cfg->saveBitsMsg),
					gControls->tw->saveBitsMsg);
				HUnlock(gControls->cfg->saveBitsMsg);
				
				// show save bits msg
				TEUpdate(&gControls->tw->saveBitsMsgBox, gControls->tw->saveBitsMsg);
				
				// proxy settings button
				gControls->tw->proxySettingsBtn = GetNewControl(rProxySettgBtn, gWPtr);
				if (!gControls->tw->proxySettingsBtn)
				{
					ErrorHandler(eMem, nil);
					return;
				}
				Str255 proxySettingsTitle;
				GetResourcedString(proxySettingsTitle, rInstList, sProxySettings);
				SetControlTitle(gControls->tw->proxySettingsBtn, proxySettingsTitle);
				ShowControl(gControls->tw->proxySettingsBtn);
            }
		}
				
		// populate control
		HLock(gControls->cfg->startMsg);
		TESetText(*gControls->cfg->startMsg, strlen(*gControls->cfg->startMsg), 
					gControls->tw->startMsg);
		HUnlock(gControls->cfg->startMsg);
	
		// show controls
		TEUpdate(&viewRect, gControls->tw->startMsg);
		ShowNavButtons( back, next );
	}
	
	SetPort(oldPort);
}
示例#9
0
// --------------------------------------------------------------------------------------
void OpenPrefsWindow(void)
{
    OSStatus error;
    SInt16 windowResourceID, visibleUserPaneResourceID, invisibleUserPaneResourceID, pixelDepth;
    WindowRef window;
    ControlRef containerControl, embeddedControl;
    short iconListBottom;
    Rect iconListRect;
    Boolean isColorDevice;
    ListHandle iconList;
    EventTypeSpec windowEvents[] = {
        {kEventClassWindow, kEventWindowActivated},
        {kEventClassWindow, kEventWindowDeactivated},
        {kEventClassWindow, kEventWindowHandleContentClick},
        {kEventClassWindow, kEventWindowGetMinimumSize},
        {kEventClassWindow, kEventWindowResizeCompleted},
        {kEventClassWindow, kEventWindowClose},
        {kEventClassWindow, kEventWindowDrawContent},
        {kEventClassWindow, kEventWindowContextualMenuSelect},
        {kEventClassControl, kEventControlClick},
        {kEventClassMouse, kEventMouseWheelMoved},
        {kEventClassTextInput, kEventTextInputUnicodeForKeyEvent}
    };

    if (!RunningInMacOSX())
    {
        windowResourceID = rPrefsWindowPlatinum;
        visibleUserPaneResourceID = cPlatinumWindowUserPaneVisible;
        invisibleUserPaneResourceID = cPlatinumWindowUserPaneInvisible;

        gPrefsWindowHeight = kPrefsWindowPlatinumHeight;
        gPrefsWindowWidth = kPrefsWindowPlatinumWidth;
        gMinimumSpacing = kPlatinumMinimumSpacing;
        gWindowEdgeSpacing = kPlatinumWindowEdgeSpacing;
    }
    else
    {
        windowResourceID = rPrefsWindowAqua;
        visibleUserPaneResourceID = cAquaWindowUserPaneVisible;
        invisibleUserPaneResourceID = cAquaWindowUserPaneInvisible;

        gPrefsWindowHeight = kPrefsWindowAquaHeight;
        gPrefsWindowWidth = kPrefsWindowAquaWidth;
        gMinimumSpacing = kAquaMinimumSpacing;
        gWindowEdgeSpacing = kAquaWindowEdgeSpacing;
    }

    error = CreateWindowFromResource(windowResourceID, &window);
    if (error != noErr)
        ExitToShell();
    RepositionWindow(window, NULL, kWindowCascadeOnMainScreen);		// CreateWindowFromResource
    // doesn't call this for you like GetNewCWindow does
#if TARGET_API_MAC_CARBON	// we would just set the standard handler attribute in the Carbon 
    // Platinum 'wind' resource but that makes it not work under CarbonLib for some reason
    ChangeWindowAttributes(window, kWindowStandardHandlerAttribute, kWindowNoAttributes);
#endif

    SetPortWindowPort(window);

    SetThemeWindowBackground(window, kThemeBrushModelessDialogBackgroundActive, true);

    CreateRootControl(window, &containerControl);

    /* Get each user pane and embed each preference panel's controls (for the
       demonstration there is only some static text identifying each panel number).
       We could just as easily have used AutoEmbedControl but why make the system
       figure out which control to use as the embedder when we already know? */
    containerControl = GetNewControl(visibleUserPaneResourceID, window);
    embeddedControl = GetNewControl(cStaticText, window);
    EmbedControl(embeddedControl, containerControl);
    SetControlData(embeddedControl, kControlEntireControl, kControlStaticTextTextTag, 7,
                   "Panel 1");

    containerControl = GetNewControl(invisibleUserPaneResourceID, window);
    embeddedControl = GetNewControl(cStaticText, window);
    EmbedControl(embeddedControl, containerControl);
    SetControlData(embeddedControl, kControlEntireControl, kControlStaticTextTextTag, 7,
                   "Panel 2");

    containerControl = GetNewControl(invisibleUserPaneResourceID, window);
    embeddedControl = GetNewControl(cStaticText, window);
    EmbedControl(embeddedControl, containerControl);
    SetControlData(embeddedControl, kControlEntireControl, kControlStaticTextTextTag, 7,
                   "Panel 3");

    containerControl = GetNewControl(invisibleUserPaneResourceID, window);
    embeddedControl = GetNewControl(cStaticText, window);
    EmbedControl(embeddedControl, containerControl);
    SetControlData(embeddedControl, kControlEntireControl, kControlStaticTextTextTag, 7,
                   "Panel 4");

    containerControl = GetNewControl(invisibleUserPaneResourceID, window);
    embeddedControl = GetNewControl(cStaticText, window);
    EmbedControl(embeddedControl, containerControl);
    SetControlData(embeddedControl, kControlEntireControl, kControlStaticTextTextTag, 7,
                   "Panel 5");

    containerControl = GetNewControl(invisibleUserPaneResourceID, window);
    embeddedControl = GetNewControl(cStaticText, window);
    EmbedControl(embeddedControl, containerControl);
    SetControlData(embeddedControl, kControlEntireControl, kControlStaticTextTextTag, 7,
                   "Panel 6");

    containerControl = GetNewControl(invisibleUserPaneResourceID, window);
    embeddedControl = GetNewControl(cStaticText, window);
    EmbedControl(embeddedControl, containerControl);
    SetControlData(embeddedControl, kControlEntireControl, kControlStaticTextTextTag, 7,
                   "Panel 7");

    containerControl = GetNewControl(invisibleUserPaneResourceID, window);
    embeddedControl = GetNewControl(cStaticText, window);
    EmbedControl(embeddedControl, containerControl);
    SetControlData(embeddedControl, kControlEntireControl, kControlStaticTextTextTag, 7,
                   "Panel 8");

    containerControl = GetNewControl(invisibleUserPaneResourceID, window);
    embeddedControl = GetNewControl(cStaticText, window);
    EmbedControl(embeddedControl, containerControl);
    SetControlData(embeddedControl, kControlEntireControl, kControlStaticTextTextTag, 7,
                   "Panel 9");

    containerControl = GetNewControl(invisibleUserPaneResourceID, window);
    embeddedControl = GetNewControl(cStaticText, window);
    EmbedControl(embeddedControl, containerControl);
    SetControlData(embeddedControl, kControlEntireControl, kControlStaticTextTextTag, 8,
                   "Panel 10");

    gPanelNumber = 1;

    GetWindowDeviceDepthAndColor(window, &pixelDepth, &isColorDevice);	// draw the list with a
    SetThemeBackground(kThemeBrushWhite, pixelDepth, isColorDevice);	// white background
    // get the bottom-most
    iconListBottom = gPrefsWindowHeight - gWindowEdgeSpacing;	// coordinate we can use
    iconListBottom -= (gPrefsWindowHeight - gWindowEdgeSpacing - gWindowEdgeSpacing) %
                      kCellHeight;	// then subtract out the partial cell height that would
    // be drawn on the bottom so that it's not actually drawn
    SetRect(&iconListRect, gWindowEdgeSpacing, gWindowEdgeSpacing,
            gWindowEdgeSpacing + kListWidth, iconListBottom);
    iconList = createIconList(window, iconListRect);
    SetWindowProperty(window, kAppSignature, kIconListTag, sizeof(ListHandle), &iconList);

#if TARGET_API_MAC_OS8
    CalculateBalloonHelpRects(window);
#else
    gWindowEventHandler = NewEventHandlerUPP(windowEventHandler);
    InstallWindowEventHandler(window, gWindowEventHandler, GetEventTypeCount(windowEvents),
                              windowEvents, NULL, NULL);
    InstallPrefsWindowHelpTags(window);
#endif

    DisableMenuItem(GetMenuRef(mDemonstration), iPrefsWindow);
    EnableMenuItem(GetMenuRef(mFile), iClose);

    ShowWindow(window);
} // OpenPrefsWindow