本文整理匯總了C++中EraseRect函數的典型用法代碼示例。如果您正苦於以下問題:C++ EraseRect函數的具體用法?C++ EraseRect怎麽用?C++ EraseRect使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了EraseRect函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: ClearDownloadSettings
void
ClearDownloadSettings(void)
{
GrafPtr oldPort;
GetPort(&oldPort);
if (gWPtr)
{
SetPort(gWPtr);
if (gControls->tw->dlSettingsGB)
DisposeControl(gControls->tw->dlSettingsGB);
if (gControls->tw->startMsg)
EraseRect(&gControls->tw->startMsgBox);
if (gControls->tw->siteSelector)
DisposeControl(gControls->tw->siteSelector);
if (gControls->tw->siteSelMsg)
DisposeControl(gControls->tw->siteSelMsg);
if (gControls->tw->saveBitsMsg)
EraseRect(&gControls->tw->saveBitsMsgBox);
if (gControls->tw->saveBitsCheckbox)
DisposeControl(gControls->tw->saveBitsCheckbox);
if (gControls->tw->proxySettingsBtn)
DisposeControl(gControls->tw->proxySettingsBtn);
}
SetPort(oldPort);
}
示例2: draw_window_contents
static void draw_window_contents(
WindowPtr wp)
{
GrafPtr old_port;
GetPort(&old_port);
SetPortWindowPort(wp);
/* Any specific updating stuff.... */
#ifdef OP_PLATFORM_MAC_CARBON_FLAG
{
Rect windowBounds;
GetWindowPortBounds(wp, &windowBounds);
EraseRect(&windowBounds);
}
#else
EraseRect(&wp->portRect);
#endif
update_log(wp);
SetPort(old_port);
return;
}
示例3: MCRegionCalculateMask
bool MCRegionCalculateMask(MCRegionRef self, int32_t w, int32_t h, MCBitmap*& r_mask)
{
// Create a pixmap
Pixmap t_image;
t_image = MCscreen -> createpixmap(w, h, 1, False);
// Draw into the pixmap's port
CGrafPtr t_old_port;
GDHandle t_old_device;
GetGWorld(&t_old_port, &t_old_device);
SetGWorld((CGrafPtr)t_image -> handle . pixmap, NULL);
BackColor(whiteColor);
ForeColor(blackColor);
Rect t_rect;
SetRect(&t_rect, 0, 0, w, h);
EraseRect(&t_rect);
PaintRgn((RgnHandle)self);
SetGWorld(t_old_port, t_old_device);
// Fetch the pixmap as a bitmap
MCBitmap *t_bitmap;
t_bitmap = MCscreen -> getimage(t_image, 0, 0, w, h, False);
// Discard the pixmap
MCscreen -> freepixmap(t_image);
r_mask = t_bitmap;
return true;
}
示例4: DrawRect
//__________________________________________________________________
void _HYGraphicPane::DrawInfoBox (_HYRect theBox, _String boxName)
{
long stringWidth,
avWidth = theBox.right-theBox.left-20;
theBox.width = 1;
DrawRect (theBox);
if (boxName.sLength)
{
stringWidth = GetVisibleStringWidth (boxName, font);
while (stringWidth>avWidth && boxName.sLength)
{
boxName.Trim (0, boxName.sLength-2);
stringWidth = GetVisibleStringWidth (boxName, font);
}
// measure string length
_HYRect textRect = theBox;
textRect.left += 8;
textRect.right = textRect.left+stringWidth+4;
textRect.top-=6;
textRect.bottom = textRect.top+9;
EraseRect (textRect);
DisplayText (boxName, textRect.bottom, textRect.left+2, true);
}
}
示例5: MyDrawString
void MyDrawString(/*short dir,*/ short h, short v, char *s,Boolean framed,short selectMode)
{
Rect r;
if(sharedPrinting)selectMode = POINTDRAWFLAG;
if(strlen(s) >0)
{
GetTextOffsets(/*dir,*/s,&h,&v);
GetStringRect(s,h,v,&r);
if(selectMode == BADPOINTDRAWFLAG)selectMode = POINTDRAWFLAG;
if(selectMode == POINTDRAWFLAG)
{
EraseRect(&r);
MyMoveTo(h,v);
drawstring(s);
}
if(framed)
{
if(selectMode != POINTDRAWFLAG)
{
PenMode(patXor);PaintRect(&r);
}
PenMode(patCopy);
MyFrameRect(&r);
}
}
}
示例6: QTApp_Draw
void QTApp_Draw (WindowReference theWindow)
{
GrafPtr mySavedPort = NULL;
GrafPtr myWindowPort = NULL;
WindowPtr myWindow = NULL;
Rect myRect;
GetPort(&mySavedPort);
myWindowPort = QTFrame_GetPortFromWindowReference(theWindow);
myWindow = QTFrame_GetWindowFromWindowReference(theWindow);
if (myWindowPort == NULL)
return;
MacSetPort(myWindowPort);
#if TARGET_API_MAC_CARBON
GetPortBounds(myWindowPort, &myRect);
#else
myRect = myWindowPort->portRect;
#endif
BeginUpdate(myWindow);
// erase any part of a movie window that hasn't already been updated
// by the movie controller
if (QTFrame_IsMovieWindow(theWindow))
EraseRect(&myRect);
// ***insert application-specific drawing here***
EndUpdate(myWindow);
MacSetPort(mySavedPort);
}
示例7: ShowTxt
void
ShowTxt(void)
{
switch (gCurrWin)
{
case kLicenseID:
if(gControls->lw->licTxt)
{
RGBColor backColorOld;
Rect textRect;
// get back color
GetBackColor(&backColorOld);
// set to white
BackColor(whiteColor);
// erase rect and update
textRect = (**(gControls->lw->licTxt)).viewRect;
EraseRect(&textRect);
TEUpdate(&textRect, gControls->lw->licTxt);
// restore back color
RGBBackColor(&backColorOld);
}
break;
default:
break;
}
}
示例8: erase_window
// Erase a window interior
void erase_window(struct Window *window)
{
EraseRect(window->RPort,
window->BorderLeft,
window->BorderTop,
window->Width-window->BorderRight-1,
window->Height-window->BorderBottom-1);
}
示例9: EraseRect
void Icon::Paint( const Rect &cUpdateRect )
{
EraseRect( cUpdateRect );
if( m_bSelected )
{
Rect cUpdateFrame = GetBounds();
cUpdateFrame.top += 2;
cUpdateFrame.left += 2;
/* XXXKV: This is a hack; why is the height from GetBounds() so large? */
cUpdateFrame.right = m_cSize.x - 2;
cUpdateFrame.bottom = m_cSize.y - 2;
FillRect( cUpdateFrame, m_sHighlightColor );
/* Round edges */
SetDrawingMode( DM_COPY );
SetFgColor( m_sHighlightColor );
DrawLine( os::Point( cUpdateFrame.left + 2, cUpdateFrame.top - 2 ),
os::Point( cUpdateFrame.right - 2, cUpdateFrame.top - 2 ) );
DrawLine( os::Point( cUpdateFrame.left, cUpdateFrame.top - 1 ),
os::Point( cUpdateFrame.right, cUpdateFrame.top - 1 ) );
DrawLine( os::Point( cUpdateFrame.left - 2, cUpdateFrame.top + 2 ),
os::Point( cUpdateFrame.left - 2, cUpdateFrame.bottom - 2 ) );
DrawLine( os::Point( cUpdateFrame.left - 1, cUpdateFrame.top ),
os::Point( cUpdateFrame.left - 1, cUpdateFrame.bottom ) );
DrawLine( os::Point( cUpdateFrame.left + 2, cUpdateFrame.bottom + 2 ),
os::Point( cUpdateFrame.right - 2, cUpdateFrame.bottom + 2 ) );
DrawLine( os::Point( cUpdateFrame.left, cUpdateFrame.bottom + 1 ),
os::Point( cUpdateFrame.right, cUpdateFrame.bottom + 1 ) );
DrawLine( os::Point( cUpdateFrame.right + 2, cUpdateFrame.top + 2 ),
os::Point( cUpdateFrame.right + 2, cUpdateFrame.bottom - 2 ) );
DrawLine( os::Point( cUpdateFrame.right + 1, cUpdateFrame.top ),
os::Point( cUpdateFrame.right + 1, cUpdateFrame.bottom ) );
SetFgColor( m_sFgColor );
}
SetDrawingMode( DM_BLEND );
/* XXXKV: Will only work with BitmapImage; should use RTTI to find
type and handle accordingly */
BitmapImage *pcImage = static_cast<BitmapImage*>( m_pcImage );
Bitmap *pcBitmap = pcImage->LockBitmap();
DrawBitmap( pcBitmap, pcImage->GetBounds(), m_cImageFrame );
pcImage->UnlockBitmap();
/* Draw the icon name */
SetDrawingMode( DM_OVER );
MovePenTo( m_cNamePos );
DrawString( m_cName );
}
示例10: UpdateAdditionsWin
void
UpdateAdditionsWin(void)
{
Rect r;
Cell c;
int i;
GrafPtr oldPort;
GetPort(&oldPort);
SetPort(gWPtr);
MoveTo( gControls->aw->compListBox.left, gControls->aw->compListBox.top - kInterWidgetPad + 1);
HLock(gControls->cfg->selAddMsg);
DrawString( CToPascal(*gControls->cfg->selAddMsg));
HUnlock(gControls->cfg->selAddMsg);
#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
LUpdate( (*gControls->aw->compList)->port->visRgn, gControls->aw->compList);
SetRect(&r, gControls->aw->compListBox.left, gControls->aw->compListBox.top,
gControls->aw->compListBox.right + 1, gControls->aw->compListBox.bottom);
FrameRect(&r);
SetPt(&c, 0, 0);
if (LGetSelect(true, &c, gControls->aw->compList))
{
HLock((Handle)gControls->aw->compDescTxt);
SetRect(&r, (*gControls->aw->compDescTxt)->viewRect.left,
(*gControls->aw->compDescTxt)->viewRect.top,
(*gControls->aw->compDescTxt)->viewRect.right,
(*gControls->aw->compDescTxt)->viewRect.bottom);
HUnlock((Handle)gControls->aw->compDescTxt);
TEUpdate(&r, gControls->aw->compDescTxt);
}
DrawDiskSpaceMsgs( gControls->opt->vRefNum );
for (i = 0; i < numRows; i++)
{
if (gControls->cfg->comp[rowToComp[i]].highlighted)
{
AddInitRowHighlight(i);
break;
}
}
SetPort(oldPort);
}
示例11: draw_device_area
static void draw_device_area(
GDSpecPtr device_spec,
GDHandle selected_device,
Rect *frame)
{
Point offset;
GDHandle device;
get_device_area_offset(frame, &offset);
EraseRect(frame);
FrameRect(frame);
for (device= GetDeviceList(); device; device= GetNextDevice(device))
{
if (TestDeviceAttribute(device, screenDevice) && TestDeviceAttribute(device, screenActive))
{
GDSpec spec;
Rect bounds;
BuildExplicitGDSpec(&spec, device, device_spec->flags, device_spec->bit_depth, 0, 0);
get_device_area_frame(device, &bounds, offset);
RGBForeColor(HasDepthGDSpec(&spec) ? &rgb_dark_gray : &rgb_white);
PaintRect(&bounds);
RGBForeColor(&rgb_black);
if (device==selected_device) PenSize(2, 2);
FrameRect(&bounds);
PenSize(1, 1);
if (device==GetMainDevice())
{
bounds.bottom= bounds.top + DEVICE_AREA_MENU_BAR_HEIGHT;
EraseRect(&bounds);
FrameRect(&bounds);
}
}
}
return;
}
示例12: LCD_clear_area
void LCD_clear_area(Lcd *x) /* erase the area occupied by the LCD */
{
Rect r;
r = x->lcd_oldRect;
InsetRect(&r,1,1);
EraseRect(&r);
x->lcd_row = 0;
x->lcd_col = 0;
}
示例13: draw_scope
static void draw_scope(double *values)
{
static int32 call_cnt;
int offset, expose,i;
RGBColor pixels[SCOPE_HEIGHT];
double work[SCOPE_HEIGHT];
int nze;
Rect righthalf={0,SCOPE_WIDTH - SCROLL_THRESHOLD,
SCOPE_HEIGHT, SCOPE_WIDTH },
lefthalf={0,0,
SCOPE_HEIGHT, SCOPE_WIDTH - SCROLL_THRESHOLD-1 };
nze = 0;
make_logspectrogram(values, work);
if( win.show ){
set_draw_pixel(work, pixels);
expose = 0;
SetPortWindowPort(win.ref);
offset = call_cnt % SCROLL_THRESHOLD;
if(offset == 0)
{ //scroll the window
EraseRect(&lefthalf);
ScrollRect(&win.ref->portRect,
-(SCOPE_WIDTH - SCROLL_THRESHOLD), 0, 0);
EraseRect(&righthalf);
}
//draw
for( i=0; i<SCOPE_HEIGHT; i++ ){
RGBForeColor(&pixels[i]);
MoveTo(SCOPE_WIDTH - SCROLL_THRESHOLD + offset,i);
Line(0,0);
}
}
if( skin_need_speana ){
skin_draw_spectrum(work);
//ctl->cmsg(CMSG_ERROR, VERB_NORMAL, "." );
}
if(nze)
initialize_exp_hz_table(soundspec_zoom - 4 * nze);
call_cnt++;
}
示例14: MacClearViewPort
static void MacClearViewPort (void)
{
Rect PlotRgnRect;
PlotRgnRect.left = currgw->Local_LL[0];
PlotRgnRect.bottom = currgw->Local_LL[1];
PlotRgnRect.right = currgw->Local_UR[0];
PlotRgnRect.top = currgw->Local_UR[1];
EraseRect(&PlotRgnRect);
}
示例15: EraseRect
void
SimplePluginInstance::DoDraw(void)
{
Rect drawRect;
drawRect.top = 0;
drawRect.left = 0;
drawRect.bottom = drawRect.top + fWindow->height;
drawRect.right = drawRect.left + fWindow->width;
EraseRect( &drawRect );
MoveTo( 2, 12 );
DrawString("\pHello, World!");
}