本文整理汇总了C++中EndUpdate函数的典型用法代码示例。如果您正苦于以下问题:C++ EndUpdate函数的具体用法?C++ EndUpdate怎么用?C++ EndUpdate使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了EndUpdate函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetPort
void GBWindow::Update(bool running) {
#if MAC
GrafPtr savePort;
GetPort(&savePort);
SetPort(GetWindowPort(window));
if ( view->NeedsResize() )
ResizeSelf();
if ( view->NeedsRedraw(running) ) {
BeginUpdate(window);
EndUpdate(window);
if ( showGrowBox ) DrawGrowIcon(window);
view->DoDraw();
} else {
BeginUpdate(window);
if ( showGrowBox ) DrawGrowIcon(window);
view->DoDraw();
EndUpdate(window);
}
SetPort(savePort);
#elif WINDOWS
PAINTSTRUCT paint;
HDC dc = BeginPaint(win, &paint);
GBGraphics graphics(dc);
view->SetGraphics(&graphics);
view->DoDraw();
EndPaint(win, &paint);
#endif
}
示例2: EndUpdate
void CTexture::ClampImageToSurfaceS()
{
if( !m_bClampedS && m_dwWidth < m_dwCreatedTextureWidth )
{
DrawInfo di;
if( StartUpdate(&di) )
{
if( m_dwTextureFmt == TEXTURE_FMT_A8R8G8B8 )
{
for( uint32_t y = 0; y<m_dwHeight; y++ )
{
uint32_t* line = (uint32_t*)((uint8_t*)di.lpSurface+di.lPitch*y);
uint32_t val = line[m_dwWidth-1];
for( uint32_t x=m_dwWidth; x<m_dwCreatedTextureWidth; x++ )
line[x] = val;
}
}
else
{
for( uint32_t y = 0; y<m_dwHeight; y++ )
{
uint16_t* line = (uint16_t*)((uint8_t*)di.lpSurface+di.lPitch*y);
uint16_t val = line[m_dwWidth-1];
for( uint32_t x=m_dwWidth; x<m_dwCreatedTextureWidth; x++ )
line[x] = val;
}
}
EndUpdate(&di);
}
}
m_bClampedS = true;
}
示例3: 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);
}
示例4: BeginUpdate
void Objects::Delete(Object* thisobject) {
if(thisobject) {
BeginUpdate();
objects.erase(thisobject->bufferlocation);
EndUpdate();
}
}
示例5: mac_updatelicence
static void mac_updatelicence(WindowPtr window)
{
Handle h;
int len;
long fondsize;
Rect textrect;
SetPort((GrafPtr)GetWindowPort(window));
BeginUpdate(window);
fondsize = GetScriptVariable(smRoman, smScriptSmallFondSize);
TextFont(HiWord(fondsize));
TextSize(LoWord(fondsize));
h = Get1Resource('TEXT', wLicence);
len = GetResourceSizeOnDisk(h);
#if TARGET_API_MAC_CARBON
GetPortBounds(GetWindowPort(window), &textrect);
#else
textrect = window->portRect;
#endif
if (h != NULL) {
HLock(h);
TETextBox(*h, len, &textrect, teFlushDefault);
HUnlock(h);
}
EndUpdate(window);
}
示例6: DoWindowUpdate
void DoWindowUpdate(WindowPtr whichWindow)
{
BeginUpdate(whichWindow);
if(whichWindow == nesWind) {
NES_ScrnUpdate(false);
}
if(whichWindow == wpWind) {
WP_Update();
}
if(whichWindow == srchWind) {
Srch_Update();
}
#ifdef GB_DEBUG
if(whichWindow == statWind) {
Stat_Update();
}
if(whichWindow == patWind) {
NES_PatUpdate();
}
if(whichWindow == namWind) {
NES_NamUpdate();
}
if(whichWindow == palWind) {
NES_PalUpdate();
}
#endif
EndUpdate(whichWindow);
}
示例7: EndUpdate
void CTexture::RestoreAlphaChannel(void)
{
DrawInfo di;
if ( StartUpdate(&di) )
{
uint32 *pSrc = (uint32 *)di.lpSurface;
int lPitch = di.lPitch;
for (uint32 y = 0; y < m_dwHeight; y++)
{
uint32 * dwSrc = (uint32 *)((uint8 *)pSrc + y*lPitch);
for (uint32 x = 0; x < m_dwWidth; x++)
{
uint32 dw = dwSrc[x];
uint32 dwRed = (uint8)((dw & 0x00FF0000)>>16);
uint32 dwGreen = (uint8)((dw & 0x0000FF00)>>8 );
uint32 dwBlue = (uint8)((dw & 0x000000FF) );
uint32 dwAlpha = (dwRed+dwGreen+dwBlue)/3;
dw &= 0x00FFFFFF;
dw |= (dwAlpha<<24);
/*
uint32 dw = dwSrc[x];
if( (dw&0x00FFFFFF) > 0 )
dw |= 0xFF000000;
else
dw &= 0x00FFFFFF;
*/
}
}
EndUpdate(&di);
}
示例8: BeginUpdate
void TStrings::SetTextStr(const UnicodeString & Text)
{
BeginUpdate();
SCOPE_EXIT
{
EndUpdate();
};
{
Clear();
const wchar_t * P = Text.c_str();
if (P != nullptr)
{
while (*P != 0x00)
{
const wchar_t * Start = P;
while (!((*P == 0x00) || (*P == 0x0A) || (*P == 0x0D)))
{
P++;
}
UnicodeString S;
S.SetLength(P - Start);
memmove(const_cast<wchar_t *>(S.c_str()), Start, (P - Start) * sizeof(wchar_t));
Add(S);
if (*P == 0x0D) { P++; }
if (*P == 0x0A) { P++; }
}
}
}
}
示例9: MacIdle
void MacIdle(void)
{
extern logical anywarns;
static long time = 0;
EventRecord myEvent;
WindowPtr whichWindow;
#if TARGET_API_MAC_CARBON
Rect tempRect;
#endif
char theChar;
if (TickCount()<time) return;
if (mac_quit_now) {
anywarns = FALSE; /* kludge so that window doesn't sit around */
my_exit(1);
}
#if !TARGET_API_MAC_CARBON
SystemTask();
#endif
if (WaitNextEvent(everyEvent, &myEvent, 1, nil)) {
if (!SIOUXHandleOneEvent(&myEvent)) switch (myEvent.what) {
case mouseDown:
switch (FindWindow(myEvent.where,&whichWindow)) {
case inMenuBar:
MenuSelect(myEvent.where);
break;
#if !TARGET_API_MAC_CARBON
case inSysWindow:
SystemClick(&myEvent,whichWindow);
break;
#endif
case inContent:
SelectWindow(whichWindow);
break;
case inDrag:
#if TARGET_API_MAC_CARBON
GetRegionBounds(GetGrayRgn(),&tempRect);
DragWindow(whichWindow,myEvent.where,&tempRect);
#else
DragWindow(whichWindow,myEvent.where,&qd.screenBits.bounds);
#endif
break;
}
break;
case keyDown:
theChar = myEvent.message & charCodeMask;
break;
case updateEvt:
BeginUpdate((WindowPtr) myEvent.message);
EndUpdate((WindowPtr) myEvent.message);
break;
}
}
time=TickCount()+20;
}
示例10: doEventLoop
void doEventLoop()
{
EventRecord event;
WindowPtr window;
short clickArea;
Rect screenRect;
RgnHandle rgnHandle = NewRgn();
for (;;)
{
if (WaitNextEvent( everyEvent, &event, 0, nil ))
{
if (event.what == mouseDown)
{
clickArea = FindWindow( event.where, &window );
if (clickArea == inDrag)
{
//screenRect = (**GetGrayRgn ()).rgnBBox;
GetRegionBounds(GetGrayRgn(), &screenRect);
DragWindow( window, event.where, &screenRect );
}
else if (clickArea == inContent)
{
if (window != FrontWindow())
SelectWindow( window );
}
else if (clickArea == inGoAway)
if (TrackGoAway( window, event.where ))
return;
}
else if (event.what == updateEvt)
{
window = (WindowPtr)event.message;
//SetPort( window );
SetPortWindowPort( window );
BeginUpdate( window );
drawPixelImageData();
EndUpdate( window );
QDFlushPortBuffer(GetWindowPort(window), GetPortVisibleRegion(GetWindowPort(window), rgnHandle));
}
else if (event.what == activateEvt)
{
/*if (event.modifiers & activeFlag) {
window = (WindowPtr)event.message;
SetPortWindowPort(window);
drawPixelImageData();
QDFlushPortBuffer(GetWindowPort(window), GetPortVisibleRegion(GetWindowPort(window), rgnHandle));
}*/
/*if (event.modifiers & activeFlag)
PostEvent(updateEvt, (unsigned long)gWindow);*/
}
}
}
DisposeRgn(rgnHandle);
}
示例11: update_window
static void update_window(
WindowPtr wp)
{
BeginUpdate(wp);
draw_window_contents(wp);
EndUpdate(wp);
return;
}
示例12: doEventLoop
void doEventLoop()
{
EventRecord anEvent;
WindowPtr evtWind;
short clickArea;
Rect screenRect;
Point thePoint;
Rect zoomFrom, zoomTo;
zoomFrom.top = zoomTo.top = -1;
while (!gDone)
{
if (WaitNextEvent( everyEvent, &anEvent, 0, nil ))
{
if (anEvent.what == mouseDown)
{
clickArea = FindWindow( anEvent.where, &evtWind );
if (clickArea == inDrag)
{
GetRegionBounds( GetGrayRgn(), &screenRect );
DragWindow( evtWind, anEvent.where, &screenRect );
}
else if (clickArea == inContent)
{
if (evtWind != FrontWindow())
SelectWindow( evtWind );
else
{
thePoint = anEvent.where;
GlobalToLocal( &thePoint );
//Handle click in window content here
GetRect(&zoomFrom, &zoomTo);
}
}
else if (clickArea == inGoAway)
if (TrackGoAway( evtWind, anEvent.where ))
gDone = true;
}
else if (anEvent.what == updateEvt)
{
evtWind = (WindowPtr)anEvent.message;
SetPortWindowPort( evtWind );
BeginUpdate( evtWind );
//Call Draw Function here....
if (zoomFrom.top != -1)
FrameRect(&zoomFrom);
if (zoomTo.top != -1)
FrameRect(&zoomTo);
EndUpdate (evtWind);
}
}
}
}
示例13: SeqGrabberModalFilterUPP
//----------------------------------------
// osx needs this for modal dialogs.
Boolean SeqGrabberModalFilterUPP (DialogPtr theDialog, const EventRecord *theEvent, short *itemHit, long refCon){
#pragma unused(theDialog, itemHit)
Boolean handled = false;
if ((theEvent->what == updateEvt) &&
((WindowPtr) theEvent->message == (WindowPtr) refCon))
{
BeginUpdate ((WindowPtr) refCon);
EndUpdate ((WindowPtr) refCon);
handled = true;
}
return (handled);
}
示例14: DrawWindow
void DrawWindow(WindowRef window)
{
GrafPtr curPort;
GetPort(&curPort);
SetPort(GetWindowPort(window));
BeginUpdate(window);
DrawControls(window);
DrawGrowIcon(window);
EndUpdate(window);
SetPort(curPort);
}
示例15: DoDialogUpdate
static void DoDialogUpdate(DialogPtr dlog)
{
GrafPtr oldPort;
GetPort(&oldPort); SetPort(dlog);
BeginUpdate(dlog);
UpdateDialog(dlog,dlog->visRgn);
FrameDefault(dlog,BUT1_OK,TRUE);
EndUpdate(dlog);
SetPort(oldPort);
}