Hello!
I tried out the following code from an example. What I can see is first a white background, than it switches to the blue-black gradient bkg at once. No movement of the window can be seen. Could you tell me what could be the problem?
Display All
I tried out the following code from an example. What I can see is first a white background, than it switches to the blue-black gradient bkg at once. No movement of the window can be seen. Could you tell me what could be the problem?
C Source Code
- static void _cbIntro(WM_MESSAGE * pMsg) {
- GUI_RECT Rect = {0};
- int xSize;
- int ySize;
- switch (pMsg->MsgId) {
- case WM_PAINT:
- GUI_EnableAlpha(1);
- xSize = WM_GetWindowSizeX(pMsg->hWin);
- ySize = WM_GetWindowSizeY(pMsg->hWin);
- Rect.x0 = 5;
- Rect.y0 = 5;
- Rect.x1 = xSize - 11;
- Rect.y1 = ySize - 11;
- GUI_SetColor(GUI_GRAY);
- GUI_DrawRect(0, 0, xSize - 2, ySize - 2);
- GUI_SetColor(GUI_DARKGRAY);
- GUI_DrawRect(1, 1, xSize - 1, ySize - 1);
- GUI_SetColor(GUI_WHITE);
- GUI_SetFont(GUI_FONT_20F_ASCII);
- GUI_SetColor(GUI_LIGHTGRAY);
- GUI_SetTextMode(GUI_TM_TRANS);
- GUI_DispStringInRectWrap("asdf", &Rect, GUI_TA_HCENTER | GUI_TA_VCENTER, GUI_WRAPMODE_WORD);
- GUI_EnableAlpha(0);
- break;
- }
- }
- static void _cbBk(WM_MESSAGE * pMsg) {
- int xSize;
- int ySize;
- switch (pMsg->MsgId) {
- case WM_PAINT:
- xSize = LCD_GetXSize();
- ySize = LCD_GetYSize();
- GUI_DrawGradientV(0, 0, xSize - 1, ySize - 1, GUI_BLUE, GUI_BLACK);
- GUI_SetColor(0xFFFFFF);
- GUI_SetTextMode(GUI_TM_TRANS);
- GUI_DispStringHCenterAt("Window effects demonstration", 0, 10);
- break;
- }
- }
- int main(void)
- {
- WM_HWIN hIntro;
- WM_SetCreateFlags(WM_CF_MEMDEV);
- GUI_Init();
- WM_SetCallback(WM_HBKWIN, _cbBk);
- WM_Exec();
- hIntro = WM_CreateWindow(0, 0, 160, 128, WM_CF_HASTRANS, _cbIntro, 0);
- while (1)
- {
- GUI_MEMDEV_ShiftInWindow(hIntro, 1000,GUI_MEMDEV_EDGE_LEFT);
- GUI_Delay(3000);
- }
- }