// -------------------------------------------------------------------------------------- void HandleDrawContent(WindowRef prefsWindow) { RgnHandle visibleRegion; ListHandle iconList; GetWindowProperty(prefsWindow, kAppSignature, kIconListTag, sizeof(ListHandle), NULL, &iconList); visibleRegion = NewRgn(); GetPortVisibleRegion(GetWindowPort(prefsWindow), visibleRegion); if (visibleRegion != NULL) { Boolean active = IsWindowHilited(prefsWindow); SInt16 pixelDepth; Boolean isColorDevice; if (active) SetThemeWindowBackground(prefsWindow, kThemeBrushModelessDialogBackgroundActive, false); else SetThemeWindowBackground(prefsWindow, kThemeBrushModelessDialogBackgroundInactive, false); EraseRgn(visibleRegion); UpdateControls(prefsWindow, visibleRegion); GetWindowDeviceDepthAndColor(prefsWindow, &pixelDepth, &isColorDevice); SetThemeBackground(kThemeBrushWhite, pixelDepth, isColorDevice); LUpdate(visibleRegion, iconList); drawFrameAndFocus(iconList, active, prefsWindow); DisposeRgn(visibleRegion); } }
Boolean drawWindowCollapseBox(WindowRef window, Boolean hilite) { /*------------------------------------------------------ This function draws the collapse box. If hilite is true it draws the hiliting as well. --------------------------------------------------------*/ RgnHandle collapseBoxRegion=NewRgn(); getWindowCollapseBoxRegion(window,collapseBoxRegion); EraseRgn(collapseBoxRegion);//clear away old stuff if(hilite){ //do hilighting } DisposeRgn(collapseBoxRegion); return hilite; }
/*===================================== EraseAreaUnderSelection ======================================*/ void PTPaintView::EraseAreaUnderSelection() { if ( !mCurrentSelection->IsEmpty() ) { StSaveGWorld aSaver; mCurrentImage->BeginDrawing(); StColorPenState aPenState; aPenState.Normalize(); //PmBackColor( mBackColor ); mCurrentImage->SetBackColor( mBackColor ); EraseRgn( mCurrentSelection->GetRegion() ); mCurrentImage->EndDrawing(); } }
Boolean drawWindowZoomBox(WindowRef window, Boolean hilite) { /*------------------------------------------------------ This function draws the zoom box. If hilite is true it draws the hiliting as well. --------------------------------------------------------*/ RgnHandle zoomBoxRegion=NewRgn(); getWindowZoomBoxRegion(window,zoomBoxRegion); EraseRgn(zoomBoxRegion);//clear away old //draw zoom Box if(hilite) { //do hilighting } DisposeRgn(zoomBoxRegion); return hilite; }