Beispiel #1
0
/*********************************************************************
*
*       _InitDialogOrder
*/
static void _InitDialogOrder(WM_HWIN hWin) {
  WM_HWIN hItem;

  //
  // Init framewindow
  //
  FRAMEWIN_SetFont(hWin, &GUI_Font10_ASCII);
  FRAMEWIN_SetTitleHeight(hWin, 14);
  FRAMEWIN_SetMoveable(hWin, 1);
  //
  // Init edit widget
  //
  hItem = WM_GetDialogItem(hWin, GUI_ID_EDIT0);
  WM_DisableWindow(hItem);
  //
  // Init dropdown box color
  //
  hItem = WM_GetDialogItem(hWin, GUI_ID_DROPDOWN0);
  DROPDOWN_AddString(hItem, "Blue");
  DROPDOWN_AddString(hItem, "Green");
  DROPDOWN_AddString(hItem, "Red");
  DROPDOWN_SetBkColor(hItem, 1, GUI_WHITE);
  DROPDOWN_SetTextColor(hItem, 1, GUI_BLACK);
  //
  // Init dropdown box model
  //
  hItem = WM_GetDialogItem(hWin, GUI_ID_DROPDOWN1);
  DROPDOWN_AddString(hItem, "Navigation system");
  DROPDOWN_AddString(hItem, "CD Player");
  DROPDOWN_AddString(hItem, "Other ...");
  DROPDOWN_SetBkColor(hItem, 1, GUI_WHITE);
  DROPDOWN_SetTextColor(hItem, 1, GUI_BLACK);
}
Beispiel #2
0
/*********************************************************************
*
*       _InitDialogSelect
*/
static void _InitDialogSelect(WM_HWIN hWin) {
  WM_HWIN hItem;
  int     i;
  
  i = 0;
  //
  // Init framewindow
  //
  FRAMEWIN_SetFont(hWin, &GUI_Font10_ASCII);
  FRAMEWIN_SetTitleHeight(hWin, 14);
  FRAMEWIN_SetMoveable(hWin, 1);
  //
  // Init listbox items
  //
  hItem = WM_GetDialogItem(hWin, GUI_ID_LISTVIEW0);
  WM_SetScrollbarV(hItem, 1);
  LISTVIEW_SetGridVis(hItem, 1);
  LISTVIEW_SetLBorder(hItem, 3);
  LISTVIEW_SetRBorder(hItem, 3);
  LISTVIEW_AddColumn(hItem,  80, "Make",    GUI_TA_LEFT);
  LISTVIEW_AddColumn(hItem, 100, "Options", GUI_TA_LEFT);
  while (_acItems[i][0][0]) {
    _AddListviewItem(hItem, _acItems[i][0], _acItems[i][1]);
    i++;
  }
}
Beispiel #3
0
/*********************************************************************
*
*       MainTask
*/
void CreateWindow(void) {
  WM_HWIN hMultiPage;
  WM_HWIN hFrameWin;
  WM_HWIN hDialog;
	

  //
  // Check if recommended memory for the sample is available
  //
  if (GUI_ALLOC_GetNumFreeBytes() < RECOMMENDED_MEMORY) {
    GUI_ErrorOut("Not enough memory available."); 
    return;
  }
  WM_SetCallback(WM_HBKWIN, _cbBkWindow);
  //
  // Create the frame window
  //
  hFrameWin = FRAMEWIN_Create("Sample", NULL, WM_CF_SHOW, 0, 0, 240, 152);
  FRAMEWIN_SetClientColor(hFrameWin, GUI_GREEN);
  FRAMEWIN_SetActive(hFrameWin, 1);
  FRAMEWIN_SetMoveable(hFrameWin, 1);
  //
  // Create the MULTIPAGE widget
  //
  hMultiPage = MULTIPAGE_CreateEx(7, 6, 220, 120, WM_GetClientWindow(hFrameWin), WM_CF_SHOW, 0, 0);
  GUI_Delay(500);
  //
  // Create and attach the MULTIPAGE dialog windows
  //
  hDialog = GUI_CreateDialogBox(_aDialogCreate1, GUI_COUNTOF(_aDialogCreate1), NULL,       WM_UNATTACHED, 0, 0);
  MULTIPAGE_AddPage(hMultiPage, hDialog, "Page 1");
  GUI_Delay(500);
  hDialog = GUI_CreateDialogBox(_aDialogCreate2, GUI_COUNTOF(_aDialogCreate2), NULL,       WM_UNATTACHED, 0, 0);
  MULTIPAGE_AddPage(hMultiPage, hDialog, "Page 2");
  GUI_Delay(500);
  hDialog = GUI_CreateDialogBox(_aDialogCreate3, GUI_COUNTOF(_aDialogCreate3), NULL,       WM_UNATTACHED, 0, 0);
  MULTIPAGE_AddPage(hMultiPage, hDialog, "Page 3");
  GUI_Delay(500);
  hDialog = GUI_CreateDialogBox(_aDialogCreate4, GUI_COUNTOF(_aDialogCreate4), _cbDialog4, WM_UNATTACHED, 0, 0);
  MULTIPAGE_AddPage(hMultiPage, hDialog, "Page 4");
  GUI_Delay(500);
  hDialog = GUI_CreateDialogBox(_aDialogCreate5, GUI_COUNTOF(_aDialogCreate5), NULL,       WM_UNATTACHED, 0, 0);
  MULTIPAGE_AddPage(hMultiPage, hDialog, "Page 5");
  GUI_Delay(500);
  hDialog = GUI_CreateDialogBox(_aDialogCreate6, GUI_COUNTOF(_aDialogCreate6), NULL,       WM_UNATTACHED, 0, 0);
  MULTIPAGE_AddPage(hMultiPage, hDialog, "Page 6");
  GUI_Delay(500);
  //
  // Demonstrate the use of MULTIPAGE_SetAlign
  //
  MULTIPAGE_SetAlign(hMultiPage, MULTIPAGE_ALIGN_RIGHT);
  GUI_Delay(500);
  MULTIPAGE_SetAlign(hMultiPage, MULTIPAGE_ALIGN_RIGHT | MULTIPAGE_ALIGN_BOTTOM);
  GUI_Delay(500);
  MULTIPAGE_SetAlign(hMultiPage, MULTIPAGE_ALIGN_LEFT | MULTIPAGE_ALIGN_BOTTOM);
  while (1) {
    GUI_Delay(100);
  }
}
Beispiel #4
0
//WM_HWIN CreateMojeokno(void);
WM_HWIN CreateMojeokno(void) {
  WM_HWIN hWin;
  hWin = GUI_CreateDialogBox(_aDialogCreate, GUI_COUNTOF(_aDialogCreate), _cbDialog, WM_HBKWIN, 0, 0);
  FRAMEWIN_SetFont(hWin,GUI_FONT_COMIC18B_ASCII);
  FRAMEWIN_SetSkin(hWin,FRAMEWIN_SKIN_FLEX);
  FRAMEWIN_SetMoveable(hWin,1);
  return hWin;
}
Beispiel #5
0
/*********************************************************************
*
*       MainTask
*/
void MainTask(void) {
  WM_HWIN hMultiPage;
  WM_HWIN hFrameWin;
  WM_HWIN hDialog;

  //
  // Enable use of memory devices
  //
  WM_SetCreateFlags(WM_CF_MEMDEV);
  GUI_Init();
  WM_SetCallback(WM_HBKWIN, _cbBkWindow);
  //
  // Create the frame window
  //
  hFrameWin = FRAMEWIN_Create("FrameWindow", NULL, WM_CF_SHOW, 40, 44, 240, 152);
  FRAMEWIN_SetClientColor(hFrameWin, GUI_GREEN);
  FRAMEWIN_SetActive(hFrameWin, 1);
  FRAMEWIN_SetMoveable(hFrameWin, 1);
  //
  // Create the MULTIPAGE widget
  //
  hMultiPage = MULTIPAGE_CreateEx(7, 6, 220, 120, WM_GetClientWindow(hFrameWin), WM_CF_SHOW, 0, 0);
  GUI_Delay(500);
  //
  // Create and attach the MULTIPAGE dialog windows
  //
  hDialog = GUI_CreateDialogBox(_aDialogCreate1, GUI_COUNTOF(_aDialogCreate1), NULL,       WM_UNATTACHED, 0, 0);
  MULTIPAGE_AddPage(hMultiPage, hDialog, "Page 1");
  GUI_Delay(500);
  hDialog = GUI_CreateDialogBox(_aDialogCreate2, GUI_COUNTOF(_aDialogCreate2), NULL,       WM_UNATTACHED, 0, 0);
  MULTIPAGE_AddPage(hMultiPage, hDialog, "Page 2");
  GUI_Delay(500);
  hDialog = GUI_CreateDialogBox(_aDialogCreate3, GUI_COUNTOF(_aDialogCreate3), NULL,       WM_UNATTACHED, 0, 0);
  MULTIPAGE_AddPage(hMultiPage, hDialog, "Page 3");
  GUI_Delay(500);
  hDialog = GUI_CreateDialogBox(_aDialogCreate4, GUI_COUNTOF(_aDialogCreate4), _cbDialog4, WM_UNATTACHED, 0, 0);
  MULTIPAGE_AddPage(hMultiPage, hDialog, "Page 4");
  GUI_Delay(500);
  hDialog = GUI_CreateDialogBox(_aDialogCreate5, GUI_COUNTOF(_aDialogCreate5), NULL,       WM_UNATTACHED, 0, 0);
  MULTIPAGE_AddPage(hMultiPage, hDialog, "Page 5");
  GUI_Delay(500);
  hDialog = GUI_CreateDialogBox(_aDialogCreate6, GUI_COUNTOF(_aDialogCreate6), NULL,       WM_UNATTACHED, 0, 0);
  MULTIPAGE_AddPage(hMultiPage, hDialog, "Page 6");
  GUI_Delay(500);
  //
  // Demonstrate the use of MULTIPAGE_SetAlign
  //
  MULTIPAGE_SetAlign(hMultiPage, MULTIPAGE_ALIGN_RIGHT);
  GUI_Delay(500);
  MULTIPAGE_SetAlign(hMultiPage, MULTIPAGE_ALIGN_RIGHT | MULTIPAGE_ALIGN_BOTTOM);
  GUI_Delay(500);
  MULTIPAGE_SetAlign(hMultiPage, MULTIPAGE_ALIGN_LEFT | MULTIPAGE_ALIGN_BOTTOM);
  while (1) {
    GUI_Delay(100);
  }
}
Beispiel #6
0
WM_HWIN CreateGraph(void)
{
  WM_HWIN hWin;
  hWin = GUI_CreateDialogBox(_aDialogCreategraph, GUI_COUNTOF(_aDialogCreategraph), _cbDialoggraph, WM_HBKWIN, 0, 0);
  FRAMEWIN_SetFont(hWin,GUI_FONT_COMIC18B_ASCII);
  FRAMEWIN_SetSkin(hWin,FRAMEWIN_SKIN_FLEX);
  FRAMEWIN_SetMoveable(hWin,1);
  FRAMEWIN_SetResizeable(hWin,1);
  return hWin;
}
Beispiel #7
0
WM_HWIN CreateMojeokno2(void)
{
  WM_HWIN hWin;
  hWin = GUI_CreateDialogBox(_aDialog2Create, GUI_COUNTOF(_aDialog2Create), _cbDialog2, WM_HBKWIN, 0, 0);
//  hItem = WM_GetId(ID_FRAMEWIN_1);
  FRAMEWIN_SetFont(hWin,GUI_FONT_COMIC18B_ASCII);
  FRAMEWIN_SetSkin(hWin,FRAMEWIN_SKIN_FLEX);
  FRAMEWIN_SetMoveable(hWin,1);
  FRAMEWIN_SetResizeable(hWin,1);
  return hWin;
}
/*********************************************************************
*
*       GUIDEMO_DemoFrameWin
*/
void GUIDEMO_DemoFrameWin(void) {
    FRAMEWIN_Handle hFrame;
    LISTBOX_Handle hListBox;
    int xSize = LCD_GetXSize();
    int ySize = LCD_GetYSize();
    int i, x, y, w, h;
    const GUI_FONT* pFont = &GUI_FontComic18B_1;
    GUI_COLOR DesktopColorOld;
#if GUIDEMO_LARGE
    GUIDEMO_ShowIntro("Frame Window & Listbox", NULL);
#else
    GUIDEMO_ShowIntro("Frame Window\n & Listbox", NULL);
#endif
    DesktopColorOld = GUIDEMO_SetBkColor(GUI_RED);
    DesktopColorOld = WM_SetDesktopColor(DesktopColorOld);      /* Automatically update desktop window */
    x = BORDER;
#if GUIDEMO_LARGE
    y = 75;
#else
    y = BORDER;
#endif
    w = xSize - x - BORDER;
    h = ySize - y - BORDER;
    if (w > 140) {
        w = 140;
    }
    if (h > 120) {
        h = 120;
    }
    hFrame = FRAMEWIN_Create("Select language", NULL, WM_CF_SHOW, x, y, w, h);
    FRAMEWIN_SetActive(hFrame, 1);
    FRAMEWIN_SetMoveable(hFrame, 1);
    FRAMEWIN_AddMaxButton(hFrame, FRAMEWIN_BUTTON_RIGHT, 0);
    FRAMEWIN_AddMinButton(hFrame, FRAMEWIN_BUTTON_RIGHT, 1);
    FRAMEWIN_SetFont(hFrame, &GUI_Font13_ASCII);
    hListBox = LISTBOX_CreateAsChild(_asLang, WM_GetClientWindow(hFrame), 0, 0, 0, 0, WM_CF_SHOW | WM_SF_ANCHOR_LEFT | WM_SF_ANCHOR_TOP | WM_SF_ANCHOR_RIGHT | WM_SF_ANCHOR_BOTTOM);
    WM_SetFocus(hListBox);
    LISTBOX_SetFont(hListBox, pFont);
    GUIDEMO_Wait();
    for (i = 0; (i < 10) && !GUIDEMO_CheckCancel(); i++) {
        LISTBOX_IncSel(hListBox);
        GUIDEMO_Delay(250);
    }
    for (i = 0; (i < 10) && !GUIDEMO_CheckCancel(); i++) {
        LISTBOX_DecSel(hListBox);
        GUIDEMO_Delay(250);
    }
    GUIDEMO_Delay(500);
    LISTBOX_Delete(hListBox);
    FRAMEWIN_Delete(hFrame);
    WM_SetDesktopColor(DesktopColorOld);
}
/*******************************************************************
*
*       _DemoTransWindow
*/
static void _DemoTransWindow(void) {
  WM_HWIN hTransWin;
  WM_HWIN hFrameWin;

  WM_SetDesktopColor(GUI_RED);
  hTransWin = WM_CreateWindow(10, 10, 72, 52, WM_CF_SHOW | WM_CF_HASTRANS | WM_CF_STAYONTOP, _cbTransWindow, 0);
  hFrameWin = FRAMEWIN_Create("Framewin", 0, WM_CF_SHOW, 100, 70, 120, 100);
  FRAMEWIN_SetActive(hFrameWin, 1);
  FRAMEWIN_SetMoveable(hFrameWin, 1);
  GUI_CURSOR_Show();
  while (1) {
    WM_InvalidateWindow(hTransWin);
    GUI_Delay(20);
  }
}
Beispiel #10
0
/*********************************************************************
*
*       _DemoMultiedit
*/
static void _DemoMultiedit(void) {
  GUI_RECT Rect;
  int WinFlags;
  _hFrame = 1;
  _Overwrite = 0;
  _ReadOnly  = 0;
  _Password  = 0;
  /* Create framewin */
  _ChangeInfoText("Create framewin", SPEED);
  _hFrame = FRAMEWIN_CreateEx(60, 80, 200, 120, WM_HBKWIN, WM_CF_SHOW, 0, 0, "Notepad", 0);
  _hClient = WM_GetClientWindow(_hFrame);
  _pcbFrameWin       = WM_SetCallback(_hFrame,  _cbFrameWin);
  _pcbFrameWinClient = WM_SetCallback(_hClient, _cbFrameWinClient);
  /* Set framewin properties */
  FRAMEWIN_SetMoveable(_hFrame, 1);
  FRAMEWIN_SetActive(_hFrame, 1);
  FRAMEWIN_SetTextAlign(_hFrame, GUI_TA_HCENTER | GUI_TA_VCENTER);
  FRAMEWIN_SetFont(_hFrame, &GUI_Font8x12_ASCII);
  FRAMEWIN_SetTitleHeight(_hFrame, 16);
  /* Add framewin buttons */
  if (_ChangeInfoText("Add framewin buttons", SPEED)) return;
  FRAMEWIN_AddCloseButton(_hFrame, FRAMEWIN_BUTTON_LEFT,  0);
  FRAMEWIN_AddMaxButton(_hFrame, FRAMEWIN_BUTTON_RIGHT, 0);
  FRAMEWIN_AddMinButton(_hFrame, FRAMEWIN_BUTTON_RIGHT, 1);
  WM_InvalidateWindow(_hFrame);
  /* Create buttons */
  if (_ChangeInfoText("Add option buttons", SPEED)) return;
  _hWrapButton = _CreateLButton("None",   0, 36, 16, _hClient, ID_NONEWRAP);
                 _CreateLButton("Word",  37, 36, 16, _hClient, ID_WORDWRAP);
                 _CreateLButton("Char",  74, 36, 16, _hClient, ID_CHARWRAP);
                 _CreateRButton("PSW",   52, 25, 16, _hClient, ID_PASSWORD);
                 _CreateRButton("OVR",   26, 25, 16, _hClient, ID_OVERWRITE);
                 _CreateRButton("R/O",    0, 25, 16, _hClient, ID_READONLY);
  _SetButtonState(_hWrapButton, 1);
  /* Create multiedit */
  if (_ChangeInfoText("using\nMULTIEDIT_CreateEx", SPEED)) return;
  WinFlags = WM_CF_SHOW | WM_CF_ANCHOR_RIGHT | WM_CF_ANCHOR_LEFT | WM_CF_ANCHOR_TOP | WM_CF_ANCHOR_BOTTOM;
  WM_GetClientRectEx(_hClient, &Rect);
  _hMEdit = MULTIEDIT_CreateEx(0, 0, 0, Rect.y1 - 16 + 1, _hClient, WinFlags, MULTIEDIT_CF_INSERT, 0, 0, "");
  _pcbMultiEdit = WM_SetCallback(_hMEdit,  _cbMultiEdit);
  MULTIEDIT_SetAutoScrollH(_hMEdit, 1);
  MULTIEDIT_SetAutoScrollV(_hMEdit, 1);
  WM_SetFocus(_hMEdit);
  if (_ChangeInfoText("using\nMULTIEDIT_SetText", SPEED)) return;
  MULTIEDIT_SetText(_hMEdit, "This sample demonstrates the use of a multiedit widget!");
  if (_ChangeInfoText("using\nMULTIEDIT_SetFont", SPEED)) return;
  MULTIEDIT_SetFont(_hMEdit, &GUI_Font16_1);
  if (_ChangeInfoText("using\nMULTIEDIT_SetTextColor", SPEED)) return;
  MULTIEDIT_SetTextColor(_hMEdit, 0, 0xE00000);
  if (_ChangeInfoText("using\nMULTIEDIT_SetBkColor", SPEED)) return;
  MULTIEDIT_SetBkColor(_hMEdit, 0, 0xD0FFFF);
  if (_ChangeInfoText("using\nMULTIEDIT_SetWrapWord", SPEED)) return;
  MULTIEDIT_SetWrapWord(_hMEdit);
  _SetButtonState(_hWrapButton, 0);
  _hWrapButton = WM_GetDialogItem(_hClient, ID_WORDWRAP);
  _SetButtonState(_hWrapButton, 1);
  if (_ChangeInfoText("using\nMULTIEDIT_SetHBorder", SPEED)) return;
  MULTIEDIT_SetHBorder(_hMEdit, 3);
  if (_ChangeInfoText("using\nMULTIEDIT_SetPrompt", SPEED)) return;
  MULTIEDIT_SetPrompt(_hMEdit, "Type: ");
  if (_ChangeInfoText("Play with multiedit...", SPEED)) return;
  while (_hFrame) {
    GUI_Delay(100);
  }
}
/*********************************************************************
*
*       MainTask
*/
void MainTask(void) {
  WM_HWIN hScrollbar, hDlgOptions;
  GUI_RECT RectDlg, RectClient;
  int Cnt = 0, IndexEffect = 0, ButtonState = 0, DropdownState = 0;
  int ProgbarValue   = 0, ProgbarInc   = 1;
  int SliderValue    = 0, SliderInc    = 1;
  int ScrollbarValue = 0, ScrollbarInc = 1;
  int ListViewInc  = 1;
  int ListBoxInc   = 1;
  int MultiEditInc = 1;
  int Vz = 1;
  const WIDGET_EFFECT * _apEffect[] = {&WIDGET_Effect_3D,     /* Array of effects */
                                      &WIDGET_Effect_Simple, 
                                      &WIDGET_Effect_None};
  const char * _apEffects[] = {"Widget effect: 3D", "Widget effect: Simple", "Widget effect: None"};
  GUI_Init();
  GUI_CURSOR_Show();
  WM_SetCallback(WM_HBKWIN, _cbBkWindow);
  WM_SetCreateFlags(WM_CF_MEMDEV);  /* Use memory devices on all windows to avoid flicker */
  WM_EnableMemdev(WM_HBKWIN);       /* Enable use of memory devices for desktop windows */
  /* Create framewindow and set its properties */
  _hFrameWin = FRAMEWIN_CreateEx(0, 0, 640, 480, 0, WM_CF_SHOW, 0, 0, "", &_cbCallbackFramewin);
  FRAMEWIN_SetMoveable(_hFrameWin, 1);
  FRAMEWIN_SetText(_hFrameWin, _apEffects[0]);
  FRAMEWIN_SetFont(_hFrameWin, &GUI_Font13B_ASCII);
  /* Create main dialog window as child from framewindows client window */
  _hDlg = GUI_CreateDialogBox(_aDlgWidgets,
                              GUI_COUNTOF(_aDlgWidgets), 
                              &_cbCallbackWidgets, 
                              WM_GetClientWindow(_hFrameWin), 0, 0);
  /* Attach scrollbar to framewindows client window and set its properties */
  hScrollbar = SCROLLBAR_CreateAttached(WM_GetClientWindow(_hFrameWin), 0);
  WM_GetWindowRectEx(_hDlg, &RectDlg);
  WM_GetClientRectEx(WM_GetClientWindow(_hFrameWin), &RectClient);
  SCROLLBAR_SetNumItems(hScrollbar, RectDlg.x1);
  SCROLLBAR_SetPageSize(hScrollbar, RectClient.x1);
  /* Create options dialog with 'stay on top' and 'moveable' attribute */
  hDlgOptions = GUI_CreateDialogBox(_aDlgOptions, 
                                    GUI_COUNTOF(_aDlgOptions), 
                                    &_cbCallbackOptions, 
                                    WM_HBKWIN, 0, 0);
  FRAMEWIN_SetMoveable(hDlgOptions, 1);
  WM_SetStayOnTop(hDlgOptions, 1);
  /* Main loop for modifying the widgets */
  while (1) {
    if (_AutoMode) {
      Cnt++;
      /* Modify progbar */
      if ((Cnt % 2) == 0) {
        ProgbarValue += ProgbarInc;
        if ((ProgbarValue == 110) || (ProgbarValue == -10)) {
          ProgbarInc *= -1;
        }
        PROGBAR_SetValue(_ahWin[PROGBAR0], ProgbarValue);
      }
      /* Modify slider */
      if ((Cnt % 2) == 0) {
        int j;
        SliderValue += SliderInc;
        if ((SliderValue == 100) || (SliderValue == 0)) {
          SliderInc *= -1;
        }
        for (j = 0; j < 3; j++) {
          SLIDER_SetValue(_ahWin[SLIDER0 + j], SliderValue);
        }
      }
      /* Modify scrollbar */
      if ((Cnt % 3) == 0) {
        int j;
        ScrollbarValue += ScrollbarInc;
        if ((ScrollbarValue == 90) || (ScrollbarValue == 0)) {
          ScrollbarInc *= -1;
        }
        for (j = 0; j < 3; j++) {
          SCROLLBAR_SetValue(_ahWin[SCROLLBAR0 + j], ScrollbarValue);
        }
      }
      /* Modify multipage */
      if ((Cnt % 120) == 0) {
        MULTIPAGE_SelectPage(_ahWin[MULTIPAGE0], MULTIPAGE_GetSelection(_ahWin[MULTIPAGE0]) ^ 1);
      }
      /* Modify dropdown */
      if ((Cnt % 120) == 0) {
        DropdownState ^= 1;
        if (DropdownState) {
          DROPDOWN_Expand(_ahWin[DROPDOWN0]);
        } else {
          DROPDOWN_Collapse(_ahWin[DROPDOWN0]);
        }
      }
      /* Modify button */
      if ((Cnt % 40) == 0) {
        ButtonState ^= 1;
        BUTTON_SetPressed(_ahWin[BUTTON0], ButtonState);
      }
      /* Modify listbox */
      if ((Cnt % 30) == 0) {
        int Sel;
        Sel = LISTBOX_GetSel(_ahWin[LISTBOX0]);
        if (Sel < 0) {
          Sel = 0;
        }
        LISTBOX_SetSel(_ahWin[LISTBOX0], Sel + ListBoxInc);
        Sel = LISTBOX_GetSel(_ahWin[LISTBOX0]);
        if ((Sel == (int)LISTBOX_GetNumItems(_ahWin[LISTBOX0]) - 1) || (Sel == 0)) {
          ListBoxInc *= -1;
        }
      }
      /* Modify listview */
      if ((Cnt % 50) == 0) {
        int Sel;
        Sel = LISTVIEW_GetSel(_ahWin[LISTVIEW0]);
        if (Sel < 0) {
          Sel = 0;
        }
        LISTVIEW_SetSel(_ahWin[LISTVIEW0], Sel + ListViewInc);
        Sel = LISTVIEW_GetSel(_ahWin[LISTVIEW0]);
        if ((Sel == (int)LISTVIEW_GetNumRows(_ahWin[LISTVIEW0]) - 1) || (Sel == 0)) {
          ListViewInc *= -1;
        }
      }
      /* Modify multiedit */
      if ((Cnt % 5) == 0) {
        int Sel, Len;
        char acBuffer[100];
        MULTIEDIT_SetCursorOffset(_ahWin[MULTIEDIT0], MULTIEDIT_GetCursorCharPos(_ahWin[MULTIEDIT0]) + MultiEditInc);
        MULTIEDIT_GetText(_ahWin[MULTIEDIT0], acBuffer, sizeof(acBuffer));
        Sel = MULTIEDIT_GetCursorCharPos(_ahWin[MULTIEDIT0]);
        Len = strlen(acBuffer);
        if ((Sel == (Len - 1)) || (Sel == 0)) {
          MultiEditInc *= -1;
        }
        if (!DropdownState) {
          WM_SetFocus(_ahWin[MULTIEDIT0]);
        }
      }
      /* Modify graph */
      _AddValues(_ahWin[GRAPH0], 95);
      /* Move window */
      if ((Cnt % 1200) == 0) {
        int Inc;
        WM_HWIN hScroll;
        WM_SCROLL_STATE ScrollState;
        hScroll = WM_GetScrollbarH(WM_GetClientWindow(_hFrameWin));
        WM_GetScrollState(hScroll, &ScrollState);
        Inc = (ScrollState.NumItems - ScrollState.PageSize) / 2;
        ScrollState.v += Inc * Vz;
        if ((ScrollState.v >= Inc * 2) || (ScrollState.v <= 0)) {
          Vz *= -1;
        }
        SCROLLBAR_SetValue(hScroll, ScrollState.v);
      }
      /* Change effect */
      if ((Cnt % 400) == 0) {
        int Index;
        WM_HWIN hWin;
        IndexEffect++;
        Index = IndexEffect % GUI_COUNTOF(_apEffect);
        _SetEffect(Index);
        hWin = WM_GetDialogItem(hDlgOptions, GUI_ID_RADIO0);
        RADIO_SetValue(hWin, Index);
      }
    }
    /* Wait a while */
    GUI_Delay(10);
  }
}