static void _Paint(FRAMEWIN_Obj* pObj) { WM_HWIN hWin = WM_GetActiveWindow(); int xsize = WM_GetWindowSizeX(hWin); int ysize = WM_GetWindowSizeY(hWin); int FrameSize = pObj->FrameSize; GUI_RECT rClient; GUI_GetClientRect(&rClient); GUI_SetFont(pObj->pFont); /* Draw Title */ GUI_SetBkColor((pObj->Widget.State & WIDGET_STATE_CHILD_HAS_FOCUS) ? pObj->BarColor[1] : pObj->BarColor[0]); GUI_SetColor (pObj->TextColor); GUI_SetTextAlign(pObj->TextAlign); GUI_ClearRect(FrameSize,FrameSize, xsize-1-FrameSize, FrameSize+pObj->rClient.y0-1); GUI_DispStringAt( pObj->pText, FrameSize+pObj->XOff, FrameSize+pObj->YOff); /* Draw Frame */ GUI_SetColor (FRAMEWIN_FRAMECOLOR_DEFAULT); /* pObj->BarColor[1]*/ GUI_FillRect (0, 0, xsize-1, FrameSize-1); GUI_FillRect (0, 0, pObj->rClient.x0-1, ysize-1); GUI_FillRect (pObj->rClient.x1+1, 0, xsize-1, ysize-1); GUI_FillRect (0, pObj->rClient.y1+1, xsize-1, ysize-1); GUI_FillRect (0, pObj->TitleHeight+FrameSize, xsize-1, pObj->TitleHeight+2*FrameSize-1); /* Draw Client area */ WM_SetUserClipArea(&pObj->rClient); /*GUI_SetBkColor(pObj->ClientColor); GUI_Clear();*/ WM_SetUserClipArea(NULL); /* Draw the 3D effect (if configured) */ #if FRAMEWIN_USE_3D WIDGET_EFFECT_3D_DrawUp(); #endif }
/********************************************************************* * * _Draw */ static void _Draw(void) { FRAMEWIN_Obj* pObj; WM_HWIN hWin; hWin = WM_GetActiveWindow(); hWin = WM_GetParent(hWin); pObj = FRAMEWIN_H2P(hWin); if (pObj->Flags & FRAMEWIN_SF_MAXIMIZED) { _DrawRestore(); } else { _DrawMax(); } }
/********************************************************************* * * _GetDefaultWin When drawing, we have to start at the bottom window ! */ static WM_HWIN _GetDefaultWin(WM_HWIN hWin) { if (!hWin) hWin = WM_GetActiveWindow(); return hWin; }