MRESULT mainwmControl( HWND hwnd, MPARAM mp1, MPARAM mp2 ) { switch (SHORT1FROMMP(mp1)) { case ID_HEF1: switch (SHORT2FROMMP(mp1)) { case HEN_KILLFOCUS: break; case HEN_SETFOCUS: break; case HEN_CHANGE: WinInvalidateRect(hwnd,NULL,FALSE); break; default: break; } // switch Notification break; case ID_HEF2: switch (SHORT2FROMMP(mp1)) { case HEN_CHANGE: WinInvalidateRect(hwnd,NULL,FALSE); break; } } // switch Control return MRFROMLONG(0L); }
void Window::repaint( Rect *rect, BOOL children ) { if( rect == NULL ) WinInvalidateRect( hWndClient, NULL, children ); else { RECTL orect = { rect->x, rect->y, rect->x + rect->width, rect->y + rect->height }; WinInvalidateRect( hWndClient, &orect, children ); } }
/*--------------------------------------------------------------------------- CmdMarkFind ---------------------------------------------------------------------------*/ void CmdMarkFind( WNDATTR *wndattr ) { LPELEM *current; int offset; WinDlgBox( HWND_DESKTOP, wndattr->Client, FindWndProc, NULLHANDLE, ID_FINDDLG, NULL ); if (strlen( FindDat.text )) { current = wndattr->list; offset = FindIt( wndattr->list, current, FNEXT ); while (offset) { current = LPElemTrack( wndattr->list, current, offset ); if (current != wndattr->list) LPElemMark( wndattr->list, current ); offset = FindIt( wndattr->list, current, FNEXT ); } WinInvalidateRect( wndattr->Client, NULL, TRUE ); } return; }
void SelectMetaFile( PluginInstance *This, HMF hmf ) { if ( This->hmf ) GpiDeleteMetaFile( This->hmf ); This->hmf=hmf; HAB hab=WinQueryAnchorBlock( This->hWnd ); HPS hps=This->hps; if ( !hps ) { pprintf( szPPR, "No hps ???\n\r" ); return; } //calculate bounds HDC hdc = WinQueryWindowDC( This->hWnd ); if ( !hdc ) hdc = WinOpenWindowDC( This->hWnd ); GpiResetBoundaryData( hps ); if ( GpiAssociate( hps, NULL ) ) { GpiSetDrawControl( hps, DCTL_BOUNDARY, DCTL_ON ); Draw( This, hps, FALSE, FALSE ); if ( GpiQueryBoundaryData( hps, &This->rclMeta ) && (This->rclMeta.xLeft<This->rclMeta.xRight) ) { if ( !GpiAssociate( hps, hdc ) ) pprintf( szPPR, "GpfAssociate( hps, hdc ) failed\n\r" ); GpiSetDrawControl( hps, DCTL_BOUNDARY, DCTL_OFF ); GpiResetPS( hps, GRES_ALL); SetTransform( This, hps, &This->rclWnd ); } else { pprintf( szPPR, "GpiQueryBoundaryData failed, Err=%x\n\r", WinGetLastError( hab ) ); } } else pprintf( szPPR, "GpfAssociate( hps, NULL ) failed\n\r" ); // invalidate window to ensure a redraw WinInvalidateRect( This->hWnd, 0, TRUE ); }
/********************************************************************* * * FUNCTION NAME: ShowFrameControls * * DESCRIPTION: * * * INPUT PARAMETERS: * None. * * OUTPUT PARAMETERS: * None. * *********************************************************************/ VOID ShowFrameControls (VOID) { RECTL rclTitlebar, rclMenu; /* Increase the height of the frame now and titlebar are back */ WinQueryWindowRect (hwndMenu, &rclMenu); WinQueryWindowRect (hwndTitlebar, &rclTitlebar); gsFrameHeight += (SHORT)((rclTitlebar.yTop - rclMenu.yBottom) + (rclMenu.yTop - rclMenu.yBottom)); WinSetWindowPos (hwndDefFrame, HWND_TOP, 0, 0, gsFrameWidth, gsFrameHeight, SWP_SIZE); /* Make the parent of the windows the frame to reenable them */ WinSetParent (hwndTitlebar, hwndDefFrame, FALSE); WinSetParent (hwndSysmenu, hwndDefFrame, FALSE); WinSetParent (hwndMinmax, hwndDefFrame, FALSE); WinSetParent (hwndMenu, hwndDefFrame, FALSE); WinSendMsg (hwndDefFrame, WM_UPDATEFRAME, MPFROMLONG(FCF_TITLEBAR | FCF_SYSMENU | FCF_MINMAX | FCF_MENU), MPVOID); WinInvalidateRect (hwndDefFrame, NULL, TRUE); }
static void refresh_rectangle( grPMSurface* surface, int x, int y, int w, int h ) { LOG(( "Os2PM: refresh_rectangle( %08lx, %d, %d, %d, %d )\n", (long)surface, x, y, w, h )); (void)x; (void)y; (void)w; (void)h; /* convert_rectangle( surface, x, y, w, h ); */ LOCK( surface->image_lock ); GpiSetBitmapBits( surface->image_ps, 0, surface->root.bitmap.rows, surface->root.bitmap.buffer, surface->bitmap_header ); UNLOCK( surface->image_lock ); WinInvalidateRect( surface->client_window, NULL, FALSE ); WinUpdateWindow( surface->frame_window ); }
/*-------------------------------------------------- * Adds the whole window to a window's update region *-------------------------------------------------*/ PMWindow& PMWindow::invalidate() { if( !WinInvalidateRect( handle(), NULL, TRUE )) PM_THROW_GUIERROR(); return *this; }
int icqskin_autoSize(HWND hwnd, short x, short y, short cx, short cy, short baseCy) { RECTL rcl; WinQueryWindowRect( WinQueryWindow(hwnd, QW_OWNER), &rcl); if(cx < 0) cx = rcl.xRight + cx; if( ((USHORT) cy) == 0xFFFF) cy = baseCy; else if(cy < 0) cy = rcl.yTop + cy; if(x < 0) x = (rcl.xRight + x) - cx; if(y < 0) y = (rcl.yTop + y) - cy; if( cx != (rcl.xLeft - rcl.xRight) || cy != (rcl.yTop - rcl.yBottom)) { WinSetWindowPos(hwnd, 0, x, y, cx, cy, SWP_SIZE|SWP_MOVE); WinInvalidateRect(hwnd,NULL,FALSE); return TRUE; } return FALSE; }
MRESULT mainwmControl( HWND hwnd, MPARAM mp1, MPARAM mp2 ) { switch (SHORT1FROMMP(mp1)) { case ID_HMLE: switch (SHORT2FROMMP(mp1)) { case HMLN_KILLFOCUS: break; case HMLN_SETFOCUS: break; case HMLN_CHANGED: WinInvalidateRect(hwnd,NULL,FALSE); break; case HMLN_OVERFLOW: printf("Overflow!\n"); break; default: break; } // switch Notification break; } // switch Control return MRFROMLONG(0L); }
static void setValue(HWND hwnd, ULONG vlr) { SLIDERDATA *cfg = WinQueryWindowPtr(hwnd,0); cfg->selVal = vlr; ajustLimits(cfg); WinInvalidateRect(hwnd, 0, TRUE); }
static void mouseMove(HWND hwnd, short x, short y) { SLIDERDATA *cfg = WinQueryWindowPtr(hwnd,0); SWP sz; int pos; int fator; WinQueryWindowPos(hwnd,&sz); if(y < 0) pos = sz.cy; else if(y > sz.cy) pos = 0; else pos = sz.cy - y; fator = cfg->maxVal - cfg->minVal; /* newVal ................ fator pos ................ sz.cy newVal = (pos * fator) / sz.cy */ cfg->selVal = (pos * fator) / sz.cy; ajustLimits(cfg); WinInvalidateRect(hwnd, 0, TRUE); if(cfg->hConnect) WinPostMsg(cfg->hConnect,cfg->mConnect,MPFROMSHORT(cfg->selVal),0); }
MRESULT EXPENTRY ClientWndProc (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) { static BOOL fFlipFlop ; HPS hps ; RECTL rcl ; switch (msg) { case WM_TIMER: WinAlarm (HWND_DESKTOP, WA_NOTE) ; fFlipFlop = !fFlipFlop ; WinInvalidateRect (hwnd, NULL, FALSE) ; return 0 ; case WM_PAINT: hps = WinBeginPaint (hwnd, NULLHANDLE, NULL) ; WinQueryWindowRect (hwnd, &rcl) ; WinFillRect (hps, &rcl, fFlipFlop ? CLR_BLUE : CLR_RED) ; WinEndPaint (hps) ; return 0 ; } return WinDefWindowProc (hwnd, msg, mp1, mp2) ; }
void wxWindowPalm::Refresh(bool eraseBack, const wxRect *rect) { WinHandle handle = (WinHandle)GetHWND(); if(handle) { #ifdef __WXPALMOS6__ if(rect) { RectangleType dirtyRect; dirtyRect.topLeft.x = rect->GetX() - 1; dirtyRect.topLeft.y = rect->GetY() - 1; dirtyRect.extent.x = rect->GetWidth() + 1; dirtyRect.extent.y = rect->GetHeight() + 1; WinInvalidateRect(handle, &dirtyRect); } else { WinInvalidateWindow(handle); } #else // __WXPALMOS5__ WinSetActiveWindow (handle); #endif } }
static MRESULT EXPENTRY kstProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) { KSTPTR p ; // HPS hps ; // RECTL rct ; // UCHAR buf[2] ; p = (KSTPTR) WinQueryWindowPtr(hwnd, 0) ; #ifdef DEBUG TRACE("keyst %08x\n", msg) ; #endif switch (msg) { case WM_CREATE : WinSetWindowPtr(hwnd, 0, (PVOID) mp1) ; return (MRESULT) 0 ; case WM_PAINT : kstDraw(hwnd, p) ; return (MRESULT) 0 ; case WM_SINGLESELECT : kstSend(hwnd, p, IDM_KEYTGL) ; return (MRESULT) 0 ; case WM_CONTEXTMENU : kstMenu(hwnd, p) ; return (MRESULT) 0 ; case WM_COMMAND : kstSend(hwnd, p, SHORT1FROMMP(mp1)) ; return (MRESULT) 0 ; case WM_KST_UPDATE : WinInvalidateRect(hwnd, NULL, FALSE) ; return (MRESULT) 0 ; case WM_KST_KEYDN : case WM_KST_KEYUP : p->keyDown = (msg == WM_KST_KEYDN) ? TRUE : FALSE ; WinInvalidateRect(hwnd, NULL, FALSE) ; return (MRESULT) 0 ; } return WinDefWindowProc(hwnd, msg, mp1, mp2) ; }
void ErrorNotify(THREAD *pstThd,CHAR szMessage[]) { if (pstThd->stCfg.bErrorOut) { strcpy(szErrorMessage,szMessage); WinInvalidateRect(pstThd->hwndStatus,(PRECTL)NULL,FALSE); } }
VOID ClientPaint(HWND hwnd) { POINTL pt; HPS hps; RECTL rcl; LONG lLen; LONG lCenter; WinInvalidateRect(hwnd,(PRECTL)NULL,FALSE); hps = WinBeginPaint(hwnd,(HPS)NULL,&rcl ); // if (bShowingProgress) // rcl.yBottom = 60L; WinFillRect(hps,&rcl,CLR_WHITE); lCenter = (INITWIDTH / 2); if (bDebug) { GpiSetBackColor(hps,CLR_WHITE); GpiSetBackMix(hps,BM_OVERPAINT); GpiCreateLogFont(hps,NULL,3,&fattMsgFont); GpiSetColor(hps,CLR_BLACK); GpiSetCharSet(hps,3); pt.x = 10; if (szDebugLineOne[0] != 0) { pt.y = 82L; GpiCharStringAt(hps,&pt,strlen(szDebugLineOne),szDebugLineOne); } if (szDebugLineTwo[0] != 0) { pt.y = 62L; GpiCharStringAt(hps,&pt,strlen(szDebugLineTwo),szDebugLineTwo); } } else { GpiSetColor(hps,CLR_CYAN); GpiSetBackColor(hps,CLR_WHITE); GpiSetBackMix(hps,BM_OVERPAINT); GpiCreateLogFont(hps, NULL, 2, &fattBigFont); GpiSetCharSet(hps,2); pt.x = (lCenter - (10 * stBigCell.cx)); pt.y = 60L; GpiCharStringAt(hps,&pt,21,"OS/tools Installation"); } if (!bShowingProgress) PrintBanners(szBannerOne,szBannerTwo); WinEndPaint(hps); }
MRESULT EXPENTRY icqChatWindow(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) { switch(msg) { case WM_CHAR: ((ICQMSGDIALOG *) WinQueryWindowPtr(hwnd,0))->idleSeconds = 0; return icqFrameWindow(hwnd, msg, mp1, mp2); case WM_CREATE: icqskin_cfgWindow(hwnd,ICQMSGDIALOG,0); break; case WMICQ_CREATECHILDS: CHKPoint(); icqskin_setMsgWindowChilds(hwnd,childlist); CHKPoint(); break; case WMICQ_LOADSKIN: icqFrameWindow(hwnd, msg, mp1, mp2); WinSendMsg(hwnd,WMICQ_SKINCHILDS,mp1,mp2); break; case WM_CONTROL: control(hwnd,SHORT1FROMMP(mp1),SHORT2FROMMP(mp1),mp2); break; case WM_SIZE: resize(hwnd,SHORT1FROMMP(mp2),SHORT2FROMMP(mp2)); return icqFrameWindow(hwnd, msg, mp1, mp2); case WM_DESTROY: destroy(hwnd); return icqFrameWindow(hwnd, msg, mp1, mp2); case WM_USER+10: WinInvalidateRect(hwnd,NULL,TRUE); break; case WMICQ_SETMSGCHILD: configure(hwnd, (const MSGCHILD *) mp1, SHORT1FROMMP(mp2)); break; case WMICQ_SIZEMSGBOX: return (MRESULT) resizeUserInfo(hwnd,SHORT1FROMMP(mp1),SHORT2FROMMP(mp1)); case WMICQ_SIZEBUTTONS: return (MRESULT) sizeButtonBar(hwnd,SHORT1FROMMP(mp1),SHORT2FROMMP(mp1),(const USHORT *) mp2); default: return icqFrameWindow(hwnd, msg, mp1, mp2); } return 0; }
MRESULT EXPENTRY ClientWndProc(HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) { HPS hps; RECTL rcl; static ULONG i = 1; ULONG ulMem; char szBuf[200]; switch (msg) { case WM_CREATE: /* use smaller text */ WinSetPresParam(hwnd, PP_FONTNAMESIZE, 7, (PVOID)"8.Helv"); /* start the timer (ticks each 0.5 sec.) */ AddFloat(WinQueryWindow(hwnd, QW_PARENT)); WinStartTimer(hab, hwnd, ID_TIMER, 500); break; /* make window always stay on top (if desired) */ case WM_VRNENABLED: if (bFloat) WinSetWindowPos(hwndFrame, HWND_TOP, 0, 0, 0, 0, SWP_ZORDER); break; case WM_COMMAND: /* why doesn't WM_SYSCOMMAND work? */ if (LOUSHORT(mp1) == IDM_FLOAT) { bFloat = !bFloat; WinCheckMenuItem(hwndSysSubmenu, IDM_FLOAT, bFloat); } break; case WM_TIMER: if (++i > 13) i = 1; WinInvalidateRect(hwnd, NULL, FALSE); return FALSE; case WM_PAINT: hps = WinBeginPaint(hwnd, NULLHANDLE, &rcl); /* necessary to avoid incorrectly repainting window */ WinQueryWindowRect(hwnd, &rcl); /* sprintf(szBuf, " Current use %dK Maximum ever used %dK Errors %d", meminfo->used / 1024, meminfo->maxused / 1024, meminfo->num_err);*/ sprintf(szBuf, " Current use %dB Maximum ever used %dK Errors %d", meminfo->used, meminfo->maxused / 1024, meminfo->num_err); WinDrawText(hps, -1, szBuf, &rcl, CLR_BLACK, CLR_WHITE, DT_CENTER | DT_VCENTER | DT_ERASERECT); WinEndPaint(hps); break; } return WinDefWindowProc(hwnd, msg, mp1, mp2); }
static void moveCursor(HWND hwnd, LONG step) { SLIDERDATA *cfg = WinQueryWindowPtr(hwnd,0); cfg->selVal += step; ajustLimits(cfg); WinInvalidateRect(hwnd, 0, TRUE); if(cfg->hConnect) WinPostMsg(cfg->hConnect,cfg->mConnect,MPFROMSHORT(cfg->selVal),0); }
void toLink( HWND hwnd ) { linkData *ld; detectBrowser(); ld = (linkData *)malloc( sizeof( linkData ) ); memset( ld, 0, sizeof( linkData ) ); ld->labelProc = WinSubclassWindow( hwnd, LinkLabelProc ); WinSetWindowULong( hwnd, QWL_USER, (ULONG)ld ); WinInvalidateRect( hwnd, NULL, FALSE ); }
SOM_Scope bool SOMLINK VRIconButtonInstance_vrSet_Pushed(VRIconButton *somSelf, BOOL on) { VRIconButtonData *somThis = VRIconButtonGetData(somSelf); VRIconButtonMethodDebug("VRIconButton","VRIconButtonInstance_vrSet_Pushed"); _fDown = on; WinInvalidateRect( _vrGetWindowHandle( somSelf ), NULL, TRUE ); return TRUE; }
static void resize(HWND hwnd, short cx, short cy) { #ifdef SKINNED_GUI ICQFRAME *cfg = WinQueryWindowPtr(hwnd,0); if(cfg) cfg->bg = icqskin_createFrameBackground(hwnd,cfg->bg, cx, cy, cfg->img, cfg->msk); #endif WinInvalidateRect(hwnd,NULL,TRUE); }
// // Here is a sample subclass function. // MRESULT APIENTRY SubClassFunc( HWND hWnd, ULONG Message, MPARAM wParam, MPARAM lParam) { PluginInstance *This = GetInstance(hWnd); switch(Message) { case WM_REALIZEPALETTE: WinInvalidateRect(hWnd, 0, TRUE); WinUpdateWindow(hWnd); return 0; break; case WM_PAINT: { RECTL rcl; WinQueryWindowRect( This->hWnd, &rcl ); pprintf( szPPR, "Rect (hmf %x) : ( %d, %d ) - ( %d, %d )\n\r", This->hmf, rcl.xLeft, rcl.yBottom, rcl.xRight, rcl.yTop ); WinInvalidateRect(hWnd, 0, TRUE); RECTL invalidRect; WinBeginPaint( hWnd, This->hps, &invalidRect ); /* draw using common drawing routine */ Draw( This, This->hps, FALSE, TRUE ); WinEndPaint( This->hps ); return (MRESULT)0; } break; default: break; } return ((PFNWP)This->lpfnOldWndProc)( hWnd, Message, wParam, lParam ); }
SOM_Scope bool SOMLINK VRIconButtonInstance_vrSet_ResizePicture(VRIconButton *somSelf, BOOL on) { VRIconButtonData *somThis = VRIconButtonGetData(somSelf); VRIconButtonMethodDebug("VRIconButton","VRIconButtonInstance_vrSet_ResizePicture"); _fResize = on; WinInvalidateRect( _vrGetWindowHandle( somSelf ), NULL, TRUE ); if ( _fAutosize ) SetAutoSize( somSelf ); return TRUE; }
static void setLimits(HWND hwnd, ULONG min, ULONG max) { SLIDERDATA *cfg = WinQueryWindowPtr(hwnd,0); cfg->minVal = min; cfg->maxVal = max; ajustLimits(cfg); WinInvalidateRect(hwnd, 0, TRUE); }
/*-------------------------------------------------- * Adds a region to a window's update region *-------------------------------------------------*/ PMWindow& PMWindow::invalidate( const SHAPE& rect ) { // Invalidation must use inclusive-exclusive rectangles RECTL os2_rect = { rect.x, rect.y, rect.x+rect.cx, rect.y+rect.cy }; if( !WinInvalidateRect( handle(), &os2_rect, TRUE )) PM_THROW_GUIERROR(); return *this; }
//---------------------------------------------------------------------------- // NPP_StreamAsFile: //---------------------------------------------------------------------------- void NP_LOADDS NPP_StreamAsFile(NPP instance, NPStream *stream, const char* fname) { if (instance == 0 ) return; PluginInstance* This = (PluginInstance*) instance->pdata; // invalidate window to ensure a redraw WinInvalidateRect(This->hWnd, 0, TRUE); }
void Window::scrollVert( int delta, int bottom, int top ) { RECTL scrollRect = { 0, bottom, width, top }; RECTL invalidated; WinScrollWindow( hWndClient, 0, delta, &scrollRect, &scrollRect, NULLHANDLE, &invalidated, NULL ); // Why do I have to do this? I don't know!!! SW_INVALIDATEREGION doesn't // work if several WinScrollWindows are done in a row. The below line should // do the same thing, but apparently it doesn't WinInvalidateRect( hWndClient, &invalidated, FALSE ); }
/* * Empty Client window of messages */ VOID MainPurgeWindow() { sVscrollMax = 0; sVscrollPos = 0; WinSendMsg (hwndVscroll, SBM_SETSCROLLBAR, MPFROM2SHORT (sVscrollPos, 0), MPFROM2SHORT (0, sVscrollMax)) ; WinEnableWindow (hwndVscroll, FALSE) ; WinInvalidateRect(hwndMain, NULL, FALSE); }
void Container::setTextOnlyMode(void) { CNRINFO ccinfo; memset (&ccinfo, 0, sizeof ccinfo); ccinfo.cb = sizeof(CNRINFO); ccinfo.flWindowAttr = CV_TEXT; // WinSendMsg (WinWindowFromID(dialog,id),CM_SETCNRINFO, &ccinfo,MPFROMLONG(CMA_FLWINDOWATTR)); WinSendMsg (cont,CM_SETCNRINFO, &ccinfo,MPFROMLONG(CMA_FLWINDOWATTR)); // WinInvalidateRect (WinWindowFromID(dialog,id), 0, 0); WinInvalidateRect (cont, 0, 0); }