Esempio n. 1
0
/*******************************************************************
*
*       _DemoListBox
*/
void _DemoListBox(void) {
  int i;
  int Entries = GUI_COUNTOF(_ListBox) - 1;
  LISTBOX_Handle hListBox;
  int xSize = LCD_GetXSize();
  //int ySize = GUI_GetYDistOfFont(&GUI_Font13B_1) * Entries;
  int ySize = LCD_GetYSize();
  /* Create the listbox */
  hListBox = LISTBOX_Create(_ListBox, 0, 0, xSize, ySize, WM_CF_SHOW);
  /* Change current selection of the listbox */
  for (i = 0; i < Entries-1; i++) {
    GUI_Delay(500);
    LISTBOX_IncSel(hListBox);
    WM_ExecIdle();
	}
  GUI_Delay(75000);
  for (i = 0; i < Entries-1; i++) {
    GUI_Delay(500);
    LISTBOX_DecSel(hListBox);
    WM_ExecIdle();
	}
  GUI_Delay(7500);
  /* Delete listbox widget */
  LISTBOX_Delete(hListBox);
  GUI_ClearRect(0, 50, 319, 239);
  GUI_Delay(750);
}
/*******************************************************************
*
*       _DemoHardkey

  Demonstrates HARDKEY simulation with a listbox
*/
static void _DemoHardkey(void) {
    LISTBOX_Handle hListBox;
    GUI_SetBkColor(GUI_BLACK);
    GUI_Clear();
    GUI_SetColor(GUI_WHITE);
    GUI_SetTextAlign(GUI_TA_HCENTER);
    GUI_SetFont(&GUI_Font24_ASCII);
    GUI_DispStringAt("Hardkey - Sample", 160, 5);
    GUI_SetFont(&GUI_Font8x8);
    GUI_DispStringHCenterAt("Exit",  65, 230);
    GUI_DispStringHCenterAt("Up",   160, 230);
    GUI_DispStringHCenterAt("Down", 255, 230);
    /* Create the listbox */
    hListBox = LISTBOX_Create(_aListBox, 100, 100, 120, 75, WM_CF_SHOW);
    WM_SetFocus(hListBox);
    LISTBOX_SetFont(hListBox, &GUI_Font13B_1);
    SCROLLBAR_CreateAttached(hListBox, SCROLLBAR_CF_VERTICAL);
    /* Handle the listbox */
    while (!_Ready) {
        GUI_Delay(10);
    }
    /* Delete listbox widget */
    LISTBOX_Delete(hListBox);
    GUI_Clear();
}
/*******************************************************************
*
*       _DemoListBox
*/
static void _DemoListBox(void) {
  int            i;
  int            Entries;
  int            ySize;
  LISTBOX_Handle hListBox;
  
  Entries = GUI_COUNTOF(_ListBox) - 1;
  ySize   = GUI_GetYDistOfFont(&GUI_Font13B_1) * Entries;
  //
  // Create the listbox
  //
  hListBox = LISTBOX_Create(_ListBox, 130, 80, 60, ySize, WM_CF_SHOW);
  //
  // Change current selection of the listbox
  //
  for (i = 0; i < Entries-1; i++) {
    GUI_Delay(500);
    LISTBOX_IncSel(hListBox);
    WM_ExecIdle();
	}
  for (i = 0; i < Entries-1; i++) {
    GUI_Delay(500);
    LISTBOX_DecSel(hListBox);
    WM_ExecIdle();
	}
  GUI_Delay(750);
  //
  // Delete listbox widget
  //
  LISTBOX_Delete(hListBox);
  GUI_ClearRect(0, 50, 319, 239);
  GUI_Delay(750);
}
Esempio n. 4
0
LISTBOX_Handle GListBox_Init()
{
	int Entries = GUI_COUNTOF(g_stListBox) - 1;
	LISTBOX_Handle hListBox;

	int xSize = LCD_GetXSize();
	//int ySize = GUI_GetYDistOfFont(&GUI_Font13B_1) * Entries;
	int ySize = LCD_GetYSize();
	/* Create the listbox */
	hListBox = LISTBOX_Create(g_stListBox, 0, 0, xSize, ySize, WM_CF_SHOW);
	return hListBox;
}
Esempio n. 5
0
/*******************************************************************
*
*       _DemoListBox
*/
static void _DemoListBox(void) {
  LISTBOX_Handle hListBox;
  /* Display titel */
  GUI_SetBkColor(0xB00000);
  GUI_SetColor(0xFFFFFF);
  GUI_SetFont(&GUI_Font24_ASCII);
  GUI_DispStringHCenterAt("Listbox - Sample", 160, 5);
  GUI_Delay(SPEED / 2);
  /* Create listbox */
  GUI_SetFont(&GUI_Font8x16);
  GUI_SetTextAlign(GUI_TA_LEFT);
  GUI_DispStringAtCEOL("using", 5, 40);
  GUI_DispStringAtCEOL("LISTBOX_Create", 5, 55);
  GUI_Delay(SPEED * 0.9);
  hListBox = LISTBOX_Create(_ListBox, 100, 80, 120, 115, WM_CF_SHOW);
  GUI_Delay(SPEED * 0.75);
  /* Show serveral functions of listbox */
  _ShowSeveralFunctions(hListBox);
  /* Clear display */
  GUI_Clear();
  GUI_Delay(SPEED * 1.5);
}