/*********************************************************************
*
*       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);
}
void GUIDEMO_HardwareInfo(void) {
  #if (LCD_CONTROLLER == 1375) | (LCD_CONTROLLER == 13705) | (LCD_CONTROLLER == 1386) | (LCD_CONTROLLER == 13806)
    GUIDEMO_ShowIntro("Hardware info",   "" );
    GUI_Clear();
    #if GUIDEMO_LARGE
      GUI_SetFont(&GUI_FontComic24B_ASCII);
    #else
      GUI_SetFont(&GUI_FontComic18B_ASCII);
    #endif
    GUIDEMO_SetColor(GUI_WHITE);
    #if (LCD_CONTROLLER == 1375) | (LCD_CONTROLLER == 13705)
      #if GUIDEMO_LARGE
        GUI_DispStringAt("EPSON 13705\n", 10, 65 );
      #else
        GUI_DispStringHCenterAt("EPSON 13705\n", LCD_XSIZE >> 1, LCD_YSIZE / 14);
      #endif
      _Show("On chip VRAM",  "80 kb");
      _Show("Max. colors",   "4096 (4 bit per color)");
      _Show("Display types", "Mono / color / TFT");
      _Show("LUT",           "256 index colors");
    #elif (LCD_CONTROLLER == 1386) | (LCD_CONTROLLER == 13806)
      #if GUIDEMO_LARGE
        GUI_DispStringAt("EPSON 13806\n", 10, 65 );
      #else
        GUI_DispStringHCenterAt("EPSON 13806\n", LCD_XSIZE >> 1, LCD_YSIZE / 14);
      #endif
      _Show("On chip VRAM",  "1200 kb");
      _Show("Max. colors",   "65536 (up to 16 bpp)");
      _Show("Display types", "Mono / color / TFT (analog / digital)");
      _Show("LUT",           "256 index colors");
    #endif
    GUIDEMO_Delay(1500);
  #endif
}
void GUIDEMO_Circle(void) {
  int XSize = LCD_GetXSize();
  int YSize = LCD_GetYSize();
  GUIDEMO_ShowIntro("Circles",
                    "\nArbitrary circles"
                    "\nand arcs.");
  GUI_Clear();
  GUI_SetFont(&GUI_Font8x16);
  GUI_SetColor(GUI_WHITE);
  #if GUIDEMO_LARGE
    GUI_DispStringAt("Circle", 0, 0);
  #endif
  GUI_FillCircle (XSize / 2, YSize / 2, 50);
  GUIDEMO_Wait();
  GUI_SetDrawMode(GUI_DM_XOR);
  GUI_FillCircle (XSize / 2, YSize / 2, 60);
  GUI_SetDrawMode(0);
  GUIDEMO_Wait();
  #if GUI_SUPPORT_AA
    #if GUIDEMO_LARGE
      GUIDEMO_ShowInfo("Circles with\nAntialiasing");
    #endif
    GUI_Clear();
    GUI_SetColor(GUI_WHITE);
    #if GUIDEMO_LARGE
      GUI_DispStringAt("Antialiased\ncircle", 0, 0);
    #endif
    GUI_AA_FillCircle(XSize / 2, YSize / 2, 47);
    GUIDEMO_Wait();
  #endif
}
Exemple #4
0
void GUIDEMO_Graph(void) {
  _YSize = (LCD_GetYSize() - 100);
  GUIDEMO_ShowIntro("Drawing a graph",
                    "\nOptimized drawing routine"
                    "\nfor drawing graph data");
  GUI_Clear();
  _Label();
  _DemoRandomGraph();
  GUIDEMO_NotifyStartNext();
  _DemoSineWave();
}
/*********************************************************************
*
*       MainTask
*/
void GUIDEMO_AntialiasedText(void) {
  unsigned OldAlphaState;

  GUIDEMO_ShowIntro("Antialiased Text", "Output antialiased text\non different backgrounds.");
  GUIDEMO_DrawBk();
  GUIDEMO_DispTitle("Antialiased text sample");
  OldAlphaState = GUI_EnableAlpha(1);
  _DrawScreen();
  GUIDEMO_Wait(4000);
  GUI_EnableAlpha(OldAlphaState);
}
Exemple #6
0
void GUIDEMO_Graph(void) {
  GUIDEMO_ShowIntro("Drawing a graph",
                    "\nOptimized drawing routine for"
                    "\ndrawing graph data");
  GUI_Clear();
  _Label();
  _DemoRandomGraph();
  GUIDEMO_NotifyStartNext();
  _DemoSineWave();
  GUIDEMO_NotifyStartNext();
  _DemoOrData();
}
Exemple #7
0
/*********************************************************************
*
*       GUIDEMO_Cursor
*/
void GUIDEMO_Cursor(void) {
  GUIDEMO_ShowIntro("Cursor", "emWin supports\nsoftware cursors");
  _DispCursor();
  GUIDEMO_Wait(4000);
  GUIDEMO_CursorShow();
  #if (GUI_SUPPORT_CURSOR && GUI_SUPPORT_TOUCH)
    if (GUIDEMO_GetConfFlag(GUIDEMO_CF_SUPPORT_TOUCH)) {
      GUI_CURSOR_SetPosition(0,0);
      GUI_CURSOR_Select(&GUI_CursorArrowM);
    }
  #endif
}
void GUIDEMO_Messagebox(void) {
  GUI_COLOR Color;
  GUIDEMO_ShowIntro("Message boxes",
                    "Message boxes" "\ncan easily be created");
  Color = WM_SetDesktopColor(GUI_RED);
  GUI_MessageBox("Message", "Text", 0);
  GUI_Delay(1000);
  GUI_MessageBox("2. Message", "Text", 0);
  GUI_Delay(1000);
  WM_SetDesktopColor(Color);
  GUIDEMO_NotifyStartNext();

}
Exemple #9
0
void GUIDEMO_Speed(void) {
  int t = GUI_GetTime();
  int i = 0;
  int XSize = LCD_GET_XSIZE();
  int YSize = LCD_GET_YSIZE();
  I32 NumPixels=0;
  U16 aColorIndex[8];
  GUIDEMO_ShowIntro("High speed",
                    "Multi layer clipping"
                    "\nHighly optimized drivers"
                    );
  for (i = 0; i< 8; i++) {
    aColorIndex[i] = GUI_Color2Index(_aColor[i]);
  }  
  for (i = 0; (((t + 8000) - (int)GUI_GetTime()) > 0) && !GUIDEMO_CheckCancel(); i++) {
    GUI_RECT r;
    GUI_SetColorIndex(aColorIndex[i&7]);
    /* Calculate random positions */
    r.x0 = rand() % XSize - XSize / 2;
    r.y0 = rand() % YSize - YSize / 2;
    r.x1 = r.x0 + rand() % XSize;
    r.y1 = r.y0 + rand() % YSize;
    GUI_FillRect(r.x0, r.y0, r.x1, r.y1);
    /* Clip rectangle to visible area and add the number of pixels (for speed computation) */
    if (r.x1 >= XSize)
      r.x1 = XSize - 1;
    if (r.y1 >= YSize)
      r.y1 = YSize - 1;
    if (r.x0 < 0 )
      r.x0 = 0;
    if (r.y1 < 0)
      r.y1 = 0;
    NumPixels += (r.x1 - r.x0) * (r.y1 - r.y0);
    /* Allow short breaks so we do not use all available CPU time ... */
  }
  t = (GUI_GetTime() - t) / 100;
  GUI_Clear();
  GUIDEMO_NotifyStartNext();
  #if GUIDEMO_LARGE
    GUI_SetFont(&GUI_FontComic24B_ASCII);
  #else
    GUI_SetFont(&GUI_Font16B_ASCII);
  #endif
  GUI_SetColor(GUI_WHITE);
  GUI_DispStringAt("Pixels/sec: ", 10, (LCD_GetYSize() - GUI_GetFontSizeY()) / 2);
  if (t == 0)
    t++;
  GUI_DispDecMin(10 * (NumPixels / t));
  GUIDEMO_Wait();
}
/*********************************************************************
*
*       GUIDEMO_VScreen
*/
void GUIDEMO_VScreen(void) {
  int ySize, vySize;

  ySize  = LCD_GetYSize();
  vySize = LCD_GetVYSize();
  if (vySize < (ySize << 1)) {
    return;
  }
  GUIDEMO_ShowIntro("VScreen demo",
                    "Demonstrates how to use\n"
                    "virtual screens");
  GUIDEMO_DrawBk(1);
  _DemoVScreen();
  GUI_SetOrg(0, 0);
}
Exemple #11
0
void GUIDEMO_Graph(void) {
  #if GUIDEMO_LARGE
    _YSize = (LCD_YSIZE - 100);
  #else
    _YSize = (LCD_YSIZE -  30);
  #endif
  GUIDEMO_ShowIntro("Drawing a graph",
                    "\nOptimized drawing routine"
                    "\nfor drawing graph data");
  GUI_Clear();
  _Label();
  _DemoRandomGraph();
  GUIDEMO_NotifyStartNext();
  _DemoSineWave();
  GUIDEMO_NotifyStartNext();
  _DemoOrData();
}
Exemple #12
0
void GUIDEMO_Cursor(void) {
  int i = 0;
  GUIDEMO_ShowIntro("Cursor",
                    "\nuC/GUI supports"
                    "\nsoftware cursor");
  GUI_SetBkColor(GUI_BLUE);
  GUI_Clear();
  _DispCursor();
  GUIDEMO_Delay(2000);
  GUIDEMO_NotifyStartNext();
  GUI_CURSOR_Show(); 
  for ( i = 0;(i < countof(_aCursor) && !GUIDEMO_CheckCancel()); i++) {
      _MoveCursor(_aCursor[i]);
  }
  GUI_CURSOR_SetPosition(0,0);
  GUI_CURSOR_Select(&GUI_CursorArrowM);  
}
/*********************************************************************
*
*       GUIDEMO_Dialog
*/
void GUIDEMO_Dialog(void) {
  int i;
  WM_HWIN hWin;
  GUI_COLOR DesktopColorOld;

  GUIDEMO_ShowIntro("Dialog boxes", "\nDialog boxes\ncan easily be created");
  GUIDEMO_HideInfoWin();
  DesktopColorOld = WM_SetDesktopColor(GUI_RED);  /* Automatically update desktop window */
  hWin = GUI_CreateDialogBox(aDialogCreate, GUI_COUNTOF(aDialogCreate), _cbCallback, 0, 0, 0);
  for (i = 0; i < GUI_COUNTOF(_aID); i++) {
    GUIDEMO_Delay(_aID[i].Time);
    GUI_SendKeyMsg(_aID[i].Id, 1);			/* 把消息发送至指定键,把键盘数据发送到输入焦点所在窗口,1表示放开状态 */
  }
  #if !(GUIDEMO_TINY)
    #if !(GUIDEMO_LARGE)
      if (LCD_GetYSize() < 120) {
      } else
    #endif
    {
      GUIDEMO_Delay(1000);
      for (i = 0; i <= 100; i += 10) {
        if (WM_IsWindow(hWin)) {		/* 确定指定句柄是否是有效的窗口句柄,0:句柄不是有效的窗口句柄,1:句柄是有效的窗口句柄 */
          SLIDER_SetValue(WM_GetDialogItem(hWin, GUI_ID_SLIDER0), i);	/* 返回对话框项目(小工具)的窗口句柄, 设置滑动条的当前值 */
        }
        GUIDEMO_Delay(100);
      }
    }
  #endif
  GUIDEMO_Delay(800);
  if (WM_IsWindow(hWin)) {
    WM_MoveTo(hWin, 20, 20);		/* 将指定窗口移动到某个位置。 */
    GUIDEMO_Delay(500);
  }
  if (WM_IsWindow(hWin)) {
    WM_MoveTo(hWin, 60, 20);
    GUIDEMO_Delay(800);
  }
  /* Cleanup ... */
  if (WM_IsWindow(hWin)) {
    WM_DeleteWindow(hWin);			/* 删除窗口。 */
  }
  GUIDEMO_NotifyStartNext();
  WM_SetDesktopColor(DesktopColorOld);   /* Restore old settings */
}
Exemple #14
0
/*********************************************************************
*
*       GUIDEMO_Dialog
*/
void GUIDEMO_Dialog(void) {
  int i;
  WM_HWIN hWin;
  GUI_COLOR DesktopColorOld;
  GUIDEMO_ShowIntro("Dialog boxes", "\nDialog boxes\ncan easily be created");
  GUIDEMO_HideInfoWin();
  DesktopColorOld = GUIDEMO_SetBkColor(GUI_RED);
  DesktopColorOld = WM_SetDesktopColor(DesktopColorOld);  /* Automatically update desktop window */
  hWin = GUI_CreateDialogBox(aDialogCreate, GUI_COUNTOF(aDialogCreate), _cbCallback, 0, 0, 0);
  for (i = 0; i < GUI_COUNTOF(_aID); i++) {
    GUIDEMO_Delay(_aID[i].Time);
    GUI_SendKeyMsg(_aID[i].Id, 1);
  }
  #if !(GUIDEMO_TINY)
    #if !(GUIDEMO_LARGE)
      if (LCD_GetYSize() < 120) {
      } else
    #endif
    {
      GUIDEMO_Delay(1000);
      for (i = 0; i <= 100; i += 10) {
        if (WM_IsWindow(hWin)) {
          SLIDER_SetValue(WM_GetDialogItem(hWin, GUI_ID_SLIDER0), i);
        }
        GUIDEMO_Delay(100);
      }
    }
  #endif
  GUIDEMO_Delay(800);
  if (WM_IsWindow(hWin)) {
    WM_MoveTo(hWin, 20, 20);
    GUIDEMO_Delay(500);
  }
  if (WM_IsWindow(hWin)) {
    WM_MoveTo(hWin, 60, 20);
    GUIDEMO_Delay(800);
  }
  /* Cleanup ... */
  if (WM_IsWindow(hWin)) {
    WM_DeleteWindow(hWin);
  }
  GUIDEMO_NotifyStartNext();
  WM_SetDesktopColor(DesktopColorOld);   /* Restore old settings */
}
Exemple #15
0
void GUIDEMO_DemoLUT(void) {
  int i;
  GUIDEMO_ShowIntro("Modify LUT", "... after drawing color bars");
  GUIDEMO_ShowColorBar();
	for (i = 100; (i >= 0) && !GUIDEMO_CheckCancel(); i -= 2) {
    _ModifyLUT(100, 100, i);
    GUI_Delay(20);
	}
	for (i = 100; (i >= 0) && !GUIDEMO_CheckCancel(); i -= 2) {
    _ModifyLUT(100, i, 0);
    GUI_Delay(20);
	}
	for (i = 100; (i >= 0) && !GUIDEMO_CheckCancel(); i -= 2) {
    _ModifyLUT(i, i, i);
    GUI_Delay(20);
	}
  LCD_InitLUT();
  GUIDEMO_Wait();
}
void show_bitmap()
{
	
	
	int ax_Phys[2],ay_Phys[2],i;
	unsigned char *images[] = { gImage_terminator_large,
					gImage_britney
					};
	//clear_buttons_and_frames();
	
	GUIDEMO_ShowIntro("Photographic Bitmap",
                    "Showing"
                    "\nTerminator Sarah Connor Chronicles"
                    "\nBy Siddharth Kaul");
	GLCD_Init ();
  	GLCD_Clear (White);
	i = 0;
	do
	{
		GUI_PID_STATE State;
		GUI_TOUCH_GetState(&State);
		if (State.Pressed) 
		{
			GLCD_Clear(White);
		    GLCD_Bitmap(0, 0, 320, 240, images[i]);
			i++;
			if(i > 1)
			{
				i = 0;	
			}
			
			//break;
		}
	}while(1);//end of do while	
	//delete pointer to free up memory
	free(images);
	/*
	GUI_SetFont(&GUI_Font24B_1);
	GUI_SetColor(GUI_YELLOW);
	GUI_DispStringAt("Terminator", 0,0);*/
}
void GUIDEMO_DemoPolygon(void) {
  int XMid = LCD_GetXSize() / 2;
  int YMid = LCD_GetYSize() / 2;
  GUIDEMO_ShowIntro("Arbitrary Polygons", 
                    "\nStandard and antialiased");
  GUI_SetColor(GUI_WHITE);
  GUI_SetFont(&GUI_FontComic18B_ASCII);
  #if GUIDEMO_LARGE
    GUI_DispStringAt("Arbitrary\nPolygons", 0, 0);
  #endif
  GUI_FillPolygon(&_aArrow[0], 7, XMid - 50, YMid + 40);
  GUI_FillPolygon(&_aArrow[0], 7, XMid + 50, YMid + 40);
  GUI_SetColor(GUI_GREEN);
  GUI_FillPolygon(&_aTriangle[0], 3, XMid, YMid + 60);
  GUI_SetColor(GUI_WHITE);
  #if GUI_SUPPORT_AA
    GUI_AA_EnableHiRes();
    GUI_AA_FillPolygon(&_aiCursor[0], 4, XMid * 3, (YMid - 40) * 3);
  #endif
  GUIDEMO_Wait();
}
void GUIDEMO_ShowInternationalFonts(void) {
  GUIDEMO_ShowIntro("International fonts",
                    "uC/GUI supports UNICODE"
                    "\n(all characters)and"
                    "\nShift JIS (Japan)"
                    );
/* Show japanese text */
  _ShowJapaneseSample();
/* Show some character sets */
  _ShowCharacters("ASCII characters\n& European\nextensions", &GUI_Font13_1, 13);
  _ShowCharacters("Hiragana &\nKatakana", &GUI_Font16_HK, 16);
/* Show fonts */
  _ShowFonts("Proportional\nFonts", 
             "FontConverter available to create your own fonts...", 
             _apPropFonts);
  _ShowFonts("Monospaced\nFonts", 
             "Fonts with fixed character width...", 
             _apMonoFonts);
  _ShowFonts("Digits", 
             "\n+- 0.1234", 
             _apDigitFonts);
/* Show alignments */
  GUIDEMO_NotifyStartNext();
}
Exemple #19
0
/*********************************************************************
*
*       GUIDEMO_Speed
*/
void GUIDEMO_Speed(void) {
  GUI_RECT ClipRect;
  GUI_RECT Rect;
  unsigned aColorIndex[8];
  char     cText[40] = { 0 };
  U32      PixelsPerSecond;
  int      TimeStart;
  int      vySize;
  int      xSize;
  int      ySize;
  int      i;

  xSize  = LCD_GetXSize();
  ySize  = LCD_GetYSize();
  vySize = LCD_GetVYSize();
  if (vySize > ySize) {
    ClipRect.x0 = 0;
    ClipRect.y0 = 0;
    ClipRect.x1 = xSize;
    ClipRect.y1 = ySize;
    GUI_SetClipRect(&ClipRect);
  }
  GUIDEMO_ShowIntro("High speed", "Multi layer clipping\nHighly optimized drivers");
  GUIDEMO_HideControlWin();
  for (i = 0; i< 8; i++) {
    aColorIndex[i] = GUI_Color2Index(_aColor[i]);
  }
  TimeStart = GUIDEMO_GetTime();
  for (i = 0; ((GUIDEMO_GetTime() - TimeStart) < 5000) && (GUIDEMO_CheckCancel() == 0); i++) {
    GUI_SetColorIndex(aColorIndex[i&7]);
    //
    // Calculate random positions
    //
    Rect.x0 = rand() % xSize - xSize / 2;
    Rect.y0 = rand() % ySize - ySize / 2;
    Rect.x1 = Rect.x0 + 20 + rand() % xSize;
    Rect.y1 = Rect.y0 + 20 + rand() % ySize;
    GUI_FillRect(Rect.x0, Rect.y0, Rect.x1, Rect.y1);
    //
    // Clip rectangle to visible area and add the number of pixels (for speed computation)
    //
    if (Rect.x1 >= xSize) {
      Rect.x1 = xSize - 1;
    }
    if (Rect.y1 >= ySize) {
      Rect.y1 = ySize - 1;
    }
    if (Rect.x0 < 0 ) {
      Rect.x0 = 0;
    }
    if (Rect.y1 < 0) {
      Rect.y1 = 0;
    }
    GUI_Exec();
    //
    // Allow short breaks so we do not use all available CPU time ...
    //
  }
  GUIDEMO_NotifyStartNext();
  PixelsPerSecond = _GetPixelsPerSecond();
  GUI_SetClipRect(NULL);
  GUIDEMO_DrawBk();
  GUI_SetColor(GUI_WHITE);
  GUI_SetTextMode(GUI_TM_TRANS);
  GUI_SetFont(&GUI_FontRounded22);
  GUI_DrawBitmap(&bmSeggerLogo70x35, 5, 5);
  GUIDEMO_AddStringToString(cText, "Pixels/sec: ");
  GUIDEMO_AddIntToString(cText, PixelsPerSecond);
  GUI_DispStringHCenterAt(cText, xSize / 2, (ySize - GUI_GetFontSizeY()) / 2);
  GUIDEMO_Delay(4000);
}
/*****************************************************************************
**   Main Function  rtc_main()
******************************************************************************/
void rtc_main (void)
{ 
  /* SystemClockUpdate() updates the SystemFrequency variable */
  SystemCoreClockUpdate();

  /* Initialize RTC module */
  RTCInit();
  GUIDEMO_ShowIntro("Real Time Clock",
                    "Showing"
                    "\nReal Time Clock"
                    "\nBy Siddharth Kaul");
	GUI_Clear();
	GUI_SetBkColor(GUI_BLUE);
	GUI_SetColor(GUI_LIGHTRED);
	GUI_Clear();
	GUI_SetFont(&GUI_Font24B_1);
  local_time.RTC_Sec = 0;
  local_time.RTC_Min = 0;
  local_time.RTC_Hour = 0;
  local_time.RTC_Mday = 8;
  local_time.RTC_Wday = 3;
  local_time.RTC_Yday = 12;		/* current date 07/12/2006 */
  local_time.RTC_Mon = 7;
  local_time.RTC_Year = 2006;
  RTCSetTime( local_time );		/* Set local time */

  alarm_time.RTC_Sec = 0;
  alarm_time.RTC_Min = 0;
  alarm_time.RTC_Hour = 0;
  alarm_time.RTC_Mday = 1;
  alarm_time.RTC_Wday = 0;
  alarm_time.RTC_Yday = 1;		/* alarm date 01/01/2007 */
  alarm_time.RTC_Mon = 1;
  alarm_time.RTC_Year = 2007;
  RTCSetAlarm( alarm_time );		/* set alarm time */

  NVIC_EnableIRQ(RTC_IRQn);

  /* mask off alarm mask, turn on IMYEAR in the counter increment interrupt
  register */
  RTCSetAlarmMask(AMRSEC|AMRMIN|AMRHOUR|AMRDOM|AMRDOW|AMRDOY|AMRMON|AMRYEAR);
  LPC_RTC->CIIR = IMMIN | IMYEAR;
  /* 2007/01/01/00:00:00 is the alarm on */
    
  RTCStart();

  while (1) 
  {					/* Loop forever */
	current_time = RTCGetTime();
	{
	  	char rtc_sec,rtc_min,rtc_hour;
		rtc_sec = current_time.RTC_Sec;
		rtc_min = current_time.RTC_Min;
		rtc_hour = current_time.RTC_Hour;
		GUI_DispCharAt(rtc_sec, 10, 10);
	  	GUI_DispCharAt(rtc_min, 14, 20);
	  	GUI_DispCharAt(rtc_hour, 18, 30);
	 }	
	}
  

}
void GUIDEMO_ColorBar(void) {
  GUI_COLOR ColorStartBlack, ColorStartWhite;
  char      acText[80] = { 0 };
  int       NumColors, BitsPerPixel, xSize, ySize;
  int       Time, TimeStart;
  int       Dir, Index;

  xSize = LCD_GetXSize();
  ySize = LCD_GetYSize();
  GUIDEMO_ShowIntro("Color bar",
                    "STemWin features an integrated\n"
                    "color management which automatically finds\n"
                    "the best available color for any logical color");
  GUIDEMO_DrawBk(1);
  //
  // Heading
  //
	GUI_SetColor(GUI_WHITE);
	GUI_SetFont(&GUI_FontRounded22);
	GUI_DispStringHCenterAt("Color bars", xSize >> 1, 12);
  GUI_SetFont(&GUI_Font16_ASCII);
  //
  // Colors
  //
  GUI_DispStringAt("Red",     1, Y_START);
  GUI_DispStringAt("Green",   1, Y_START + Y_STEP *  2);
  GUI_DispStringAt("Blue",    1, Y_START + Y_STEP *  4);
  GUI_DispStringAt("Grey",    1, Y_START + Y_STEP *  5 + (Y_STEP >> 1));
  GUI_DispStringAt("Yellow",  1, Y_START + Y_STEP *  7);
  GUI_DispStringAt("Cyan",    1, Y_START + Y_STEP *  9);
  GUI_DispStringAt("Magenta", 1, Y_START + Y_STEP * 11);
  //
  // Additional Information
  //
  GUI_SetFont(&GUI_Font8_ASCII);
  //
  // LCD Controller
  //
  #ifdef LCD_CONTROLLER
    GUIDEMO_AddStringToString(acText, "LCD Controller: ");
    GUIDEMO_AddStringToString(acText, LCD_CONTROLLER);
    GUI_DispStringAt         (acText, 12, ySize - 45);
    GUIDEMO_ClearText        (acText);
  #endif
  //
  // BPP and number of colors
  //
  BitsPerPixel = LCD_GetBitsPerPixel();
  GUIDEMO_AddIntToString   (acText, BitsPerPixel);
  GUIDEMO_AddStringToString(acText, " bpp");
  NumColors = LCD_GetDevCap(LCD_DEVCAP_NUMCOLORS);
  if (NumColors) {
    GUIDEMO_AddStringToString(acText, ", ");
    GUIDEMO_AddIntToString   (acText, NumColors);
    GUIDEMO_AddStringToString(acText, " colors");
  }
  GUI_DispStringAt(acText, 12, ySize - 25);
  //
  // Gradients
  //
  TimeStart = GUIDEMO_GetTime();
  while (((GUIDEMO_GetTime() - TimeStart) < TIME_RUN) && (GUIDEMO_CheckCancel() == 0)) {
    Time  = (GUIDEMO_GetTime() - TimeStart) % ((TIME_PAUSE + TIME_STEP) << 1);
    Dir   = Time / (TIME_PAUSE + TIME_STEP);
    Time -= Dir * (TIME_PAUSE + TIME_STEP);
    if (Time > TIME_PAUSE) {
      continue;
    }
    Index = ((Time * 0xFF) / TIME_STEP) ^ (Dir * 0xFF);
    ColorStartBlack = 0x000000 + 0x010101 * Index;
    ColorStartWhite = 0xFFFFFF - ColorStartBlack;
    GUI_DrawGradientH(GRADIENT_START_X, Y_START + Y_STEP *  0, xSize, (Y_START + Y_STEP *  1) - 1, GUI_RED,     ColorStartBlack);
    GUI_DrawGradientH(GRADIENT_START_X, Y_START + Y_STEP *  1, xSize, (Y_START + Y_STEP *  2) - 1, GUI_RED,     ColorStartWhite);
    GUI_DrawGradientH(GRADIENT_START_X, Y_START + Y_STEP *  2, xSize, (Y_START + Y_STEP *  3) - 1, GUI_GREEN,   ColorStartBlack);
    GUI_DrawGradientH(GRADIENT_START_X, Y_START + Y_STEP *  3, xSize, (Y_START + Y_STEP *  4) - 1, GUI_GREEN,   ColorStartWhite);
    GUI_DrawGradientH(GRADIENT_START_X, Y_START + Y_STEP *  4, xSize, (Y_START + Y_STEP *  5) - 1, GUI_BLUE,    ColorStartBlack);
    GUI_DrawGradientH(GRADIENT_START_X, Y_START + Y_STEP *  5, xSize, (Y_START + Y_STEP *  6) - 1, GUI_BLUE,    ColorStartWhite);
    GUI_DrawGradientH(GRADIENT_START_X, Y_START + Y_STEP *  6, xSize, (Y_START + Y_STEP *  7) - 1, GUI_GRAY,    ColorStartBlack);
    GUI_DrawGradientH(GRADIENT_START_X, Y_START + Y_STEP *  7, xSize, (Y_START + Y_STEP *  8) - 1, GUI_YELLOW,  ColorStartWhite);
    GUI_DrawGradientH(GRADIENT_START_X, Y_START + Y_STEP *  8, xSize, (Y_START + Y_STEP *  9) - 1, GUI_YELLOW,  ColorStartBlack);
    GUI_DrawGradientH(GRADIENT_START_X, Y_START + Y_STEP *  9, xSize, (Y_START + Y_STEP * 10) - 1, GUI_CYAN,    ColorStartWhite);
    GUI_DrawGradientH(GRADIENT_START_X, Y_START + Y_STEP * 10, xSize, (Y_START + Y_STEP * 11) - 1, GUI_CYAN,    ColorStartBlack);
    GUI_DrawGradientH(GRADIENT_START_X, Y_START + Y_STEP * 11, xSize, (Y_START + Y_STEP * 12) - 1, GUI_MAGENTA, ColorStartWhite);
    GUI_DrawGradientH(GRADIENT_START_X, Y_START + Y_STEP * 12, xSize, (Y_START + Y_STEP * 13) - 1, GUI_MAGENTA, ColorStartBlack);
    GUI_Exec();
  }
}
void GUIDEMO_Bitmap(void) {
    int XSize = LCD_GetXSize();
    int YSize = LCD_GetYSize();
    GUIDEMO_ShowIntro("Bitmaps",
                      "Showing"
                      "\ndifferent bitmaps with"
                      "\nand without compression");
    GUI_SetBkColor(GUI_BLUE);
    GUI_Clear();
#if GUI_WINSUPPORT & GUI_SUPPORT_MEMDEV
    WM_EnableMemdev(WM_HBKWIN);
#endif
#if GUIDEMO_LARGE
    GUI_DrawBitmap(&_bmLadyBug, 20, 50);
    GUI_SetFont(&GUI_Font13_1);
    GUI_DispStringAt("RLE Compressed bitmaps", 10, 10);
    GUIDEMO_Wait();
    GUI_Clear();
    GUI_DispStringAt("1/2/4/8 bpp bitmaps", 10, 10);
    GUI_DrawBitmap(&GUIDEMO_bm4bpp, 20, 50);
    GUIDEMO_Delay(4000);
    GUIDEMO_NotifyStartNext();
    /* Tile display with image */
    {
        int ix, iy;
        for (ix = 0; ix < XSize / GUIDEMO_bm4bpp.XSize + 1; ix++) {
            for (iy = 0; iy < YSize / GUIDEMO_bm4bpp.YSize + 1; iy++) {
                GUI_DrawBitmap(&GUIDEMO_bm4bpp,
                               GUIDEMO_bm4bpp.XSize * ix ,
                               GUIDEMO_bm4bpp.YSize * iy);
            }
        }
    }
    GUIDEMO_Delay(2000);
    GUIDEMO_NotifyStartNext();
    GUIDEMO_ShowInfo("Bitmaps may also be\nmagnified and rotated");
    GUI_SetTextMode(GUI_TM_TRANS);
    GUI_SetFont(&GUI_Font16_1);
    {
        int i, tm;
        double xMul, Angle;
        for (i = 200; (i < 3000) && !GUIDEMO_CheckCancel();) {
            tm = GUI_GetTime();
            GUI_DrawBitmapEx(&GUIDEMO_bm4bpp, XSize / 2, YSize / 2, GUIDEMO_bm4bpp.XSize / 2, GUIDEMO_bm4bpp.YSize / 2, i, i);
            GUI_DispStringHCenterAt("Bitmaps can be magnified...", XSize / 2, 100);
            GUI_Exec();
            while ((GUI_GetTime() < (tm + 10)) && !GUIDEMO_CheckCancel());
            i += (GUI_GetTime() - tm) * 6;
        }
        GUIDEMO_Delay(2000);
        GUIDEMO_NotifyStartNext();
        GUI_Clear();
        GUI_DispStringHCenterAt("...and rotated.", XSize / 2, ((YSize + GUIDEMO_bm4bpp.YSize) >> 1) + 5);
        for (Angle = 0; Angle < PI4 && !GUIDEMO_CheckCancel();) {
            tm = GUI_GetTime();
            xMul = cos(Angle) * 1000;
            GUI_ClearRect((XSize - GUIDEMO_bm4bpp.XSize) >> 1, (YSize - GUIDEMO_bm4bpp.YSize) >> 1, (XSize + GUIDEMO_bm4bpp.XSize) >> 1, (YSize + GUIDEMO_bm4bpp.YSize) >> 1);
            GUI_DrawBitmapEx(&GUIDEMO_bm4bpp, XSize / 2, YSize / 2, GUIDEMO_bm4bpp.XSize / 2, GUIDEMO_bm4bpp.YSize / 2, xMul, 1000);
            GUI_Exec();
            while ((GUI_GetTime() < (tm + 10)) && !GUIDEMO_CheckCancel());
            Angle += (GUI_GetTime() - tm) / 250.0f;
        }
        GUI_DrawBitmapEx(&GUIDEMO_bm4bpp, XSize / 2, YSize / 2, GUIDEMO_bm4bpp.XSize / 2, GUIDEMO_bm4bpp.YSize / 2, 1000, 1000);
    }
    GUIDEMO_Wait();
#else
    {
        const GUI_BITMAP * pBm;
        int TextModeOld = GUI_SetTextMode(GUI_TM_XOR);
        GUI_SetFont(&GUI_Font8_ASCII);
        pBm = &_bmLadyBug;
        GUI_DrawBitmap(pBm, (XSize - (int)pBm->XSize) / 2, (YSize - (int)pBm->YSize) / 2);
        GUI_DispStringAt("RLE Compressed bitmaps", 8, 10);
        GUIDEMO_Wait();
        GUI_Clear();
        GUI_SetTextMode(GUI_TM_TRANS);
        pBm = &GUIDEMO_bm4bpp;
        GUI_DrawBitmap(pBm, (XSize - (int)pBm->XSize) / 2, (YSize - (int)pBm->YSize) / 2);
        GUI_DispStringAt("1/2/4/8 bpp bitmaps", 8, 10);
        GUIDEMO_Wait();
        GUI_Clear();
        {
            int i, tm;
            double xMul, Angle;
            for (i = 200; (i < 2000) && !GUIDEMO_CheckCancel();) {
                tm = GUI_GetTime();
                GUI_DrawBitmapEx(&GUIDEMO_bm4bpp, XSize / 2, YSize / 2, GUIDEMO_bm4bpp.XSize / 2, GUIDEMO_bm4bpp.YSize / 2, i, i);
                GUI_DispStringAt("Bitmaps can be magnified...", 8, 10);
                GUI_Exec();
                while ((GUI_GetTime() < (tm + 10)) && !GUIDEMO_CheckCancel());
                i += (GUI_GetTime() - tm) * 6;
            }
            GUIDEMO_Delay(2000);
            GUIDEMO_NotifyStartNext();
            GUI_Clear();
            for (Angle = 0; Angle < PI4 && !GUIDEMO_CheckCancel();) {
                tm = GUI_GetTime();
                xMul = cos(Angle) * 1000;
                GUI_ClearRect((XSize - GUIDEMO_bm4bpp.XSize) >> 1, (YSize - GUIDEMO_bm4bpp.YSize) >> 1, (XSize + GUIDEMO_bm4bpp.XSize) >> 1, (YSize + GUIDEMO_bm4bpp.YSize) >> 1);
                GUI_DrawBitmapEx(&GUIDEMO_bm4bpp, XSize / 2, YSize / 2, GUIDEMO_bm4bpp.XSize / 2, GUIDEMO_bm4bpp.YSize / 2, xMul, 1000);
                GUI_DispStringAt("...and rotated.", 8, 10);
                GUI_Exec();
                while ((GUI_GetTime() < (tm + 10)) && !GUIDEMO_CheckCancel());
                Angle += (GUI_GetTime() - tm) / 250.0f;
            }
            GUI_DrawBitmapEx(&GUIDEMO_bm4bpp, XSize / 2, YSize / 2, GUIDEMO_bm4bpp.XSize / 2, GUIDEMO_bm4bpp.YSize / 2, 1000, 1000);
            GUI_DispStringAt("...and rotated.", 8, 10);
        }
        GUIDEMO_Wait();
        GUI_SetTextMode(TextModeOld);
    }
#endif
#if GUI_WINSUPPORT & GUI_SUPPORT_MEMDEV
    WM_DisableMemdev(WM_HBKWIN);
#endif
}
Exemple #23
0
void GUIDEMO_DemoProgBar(void) {
  int i, iRep;
  int XMid = LCD_GetXSize() / 2;
  int YMid = LCD_GetYSize() / 2;
  int Length[2] = {100, 140};
  int Height[2] = {20, 10};
  #if GUIDEMO_LARGE
    int MaxReps = 2;
  #else
    int MaxReps = 1;
  #endif
  PROGBAR_Handle ahProgBar[2];
  GUIDEMO_ShowIntro("Widgets", 
                    "\nProgressbars in"
                    "\nall variations");
  GUI_Clear();
  GUI_SetColor(GUI_WHITE);
  GUI_SetFont(&GUI_Font8x16);
  GUI_DispStringHCenterAt("Progress bar", XMid, YMid - 40);
  /* Create `em */  
  ahProgBar[0] = PROGBAR_Create(XMid - Length[0] / 2,
                                YMid - 15,
                                Length[0], 
                                Height[0], 
                                WM_CF_SHOW);
  ahProgBar[1] = PROGBAR_Create(XMid - Length[1] / 2,
                                YMid + 20,
                                Length[1], 
                                Height[1], 
                                WM_CF_SHOW);
  /* Use memory device (optional, for better looks) */
  #if GUI_SUPPORT_MEMDEV
    PROGBAR_EnableMemdev(ahProgBar[0]);
    PROGBAR_EnableMemdev(ahProgBar[1]);
  #endif
  GUIDEMO_Delay (1000);
  PROGBAR_SetMinMax(ahProgBar[1], 0, 500);
  for (iRep = 0; iRep < MaxReps; iRep++) {
    PROGBAR_SetFont(ahProgBar[0], &GUI_Font8x16);
    #if   (LCD_BITSPERPIXEL == 2)
      PROGBAR_SetBarColor(ahProgBar[0], 0, GUI_BLACK);
      PROGBAR_SetBarColor(ahProgBar[1], 0, GUI_BLACK);
      PROGBAR_SetBarColor(ahProgBar[0], 1, GUI_LIGHTGRAY);
    #elif (LCD_BITSPERPIXEL <= 4)
      PROGBAR_SetBarColor(ahProgBar[0], 0, GUI_DARKGRAY);
      PROGBAR_SetBarColor(ahProgBar[0], 1, GUI_LIGHTGRAY);
    #else
      PROGBAR_SetBarColor(ahProgBar[0], 0, GUI_GREEN);
      PROGBAR_SetBarColor(ahProgBar[0], 1, GUI_RED);
    #endif
    for (i = 0; (i <= 100) && !GUIDEMO_CheckCancel(); i++) {
      PROGBAR_SetValue(ahProgBar[0], i);
      PROGBAR_SetValue(ahProgBar[1], i);
      GUI_Delay(5);
    }
    PROGBAR_SetText(ahProgBar[0], "Tank empty");
    for (; (i >= 0)&& !GUIDEMO_CheckCancel(); i--) {
      PROGBAR_SetValue(ahProgBar[0], i);
      PROGBAR_SetValue(ahProgBar[1], 200 - i);
      GUI_Delay(5);
    }
    PROGBAR_SetText(ahProgBar[0], "Any text ...");
    PROGBAR_SetTextAlign(ahProgBar[0], GUI_TA_LEFT);
    for (; (i <= 100)&& !GUIDEMO_CheckCancel(); i++) {
      PROGBAR_SetValue(ahProgBar[0], i);
      PROGBAR_SetValue(ahProgBar[1], 200 + i);
      GUI_Delay(5);
    }
    for (; (i >= 0)&& !GUIDEMO_CheckCancel(); i--) {
      PROGBAR_SetValue(ahProgBar[0], i);
      PROGBAR_SetValue(ahProgBar[1], 400 - i);
      GUI_Delay(5);
    }
    PROGBAR_SetFont(ahProgBar[0], &GUI_FontComic18B_1);
    PROGBAR_SetText(ahProgBar[0], "Any font ...");
    for (; (i <= 100)&& !GUIDEMO_CheckCancel(); i++) {
      PROGBAR_SetValue(ahProgBar[0], i);
      PROGBAR_SetValue(ahProgBar[1], 400 + i);
      GUI_Delay(5);
    }
    GUIDEMO_Delay(1000);
  }
  GUIDEMO_Delay(1000);
  PROGBAR_Delete(ahProgBar[0]);
  PROGBAR_Delete(ahProgBar[1]);
  GUIDEMO_Delay(1000);
  GUI_SetFont(&GUI_Font10S_ASCII);
}
Exemple #24
0
void GUIDEMO_Bitmap(void) {
  int XSize = LCD_GetXSize();
  int YSize = LCD_GetYSize();
  GUIDEMO_ShowIntro("Bitmaps",
                    "Showing different bitmaps"
                    "\nwith and without compression");
  GUI_SetBkColor(GUI_BLUE);
  GUI_Clear();
  #if GUIDEMO_LARGE
    GUI_DrawBitmap(&_bmLadyBug, 20, 50);
    GUI_SetFont(&GUI_Font13_1);
    GUI_DispStringAt("RLE Compressed bitmaps", 10, 10);
    GUIDEMO_Wait();
    GUI_Clear();
    GUI_DispStringAt("1/2/4/8 bpp bitmaps", 10, 10);
    GUI_DrawBitmap(&GUIDEMO_bm4bpp, 20, 50);
    GUIDEMO_Delay(500);
    GUIDEMO_NotifyStartNext();
    /* Tile display with image */
    { 
      int ix, iy;
      for (ix = 0; ix < XSize / GUIDEMO_bm4bpp.XSize + 1; ix++) {
        for (iy = 0; iy < YSize / GUIDEMO_bm4bpp.YSize + 1; iy++) {
          GUI_DrawBitmap(&GUIDEMO_bm4bpp, 
                         GUIDEMO_bm4bpp.XSize * ix , 
                         GUIDEMO_bm4bpp.YSize * iy);
        }
      }
    }
    GUIDEMO_Delay(2000);
    GUIDEMO_NotifyStartNext();
    GUIDEMO_ShowInfo("Bitmaps may also\nbe magnified");
    GUI_DrawBitmapMag(&GUIDEMO_bm4bpp, (XSize - GUIDEMO_bm4bpp.XSize * 3) / 2, 60, 3, 3);
    GUI_SetTextMode(GUI_TM_TRANS);
    GUI_SetFont(&GUI_Font16_1);
    GUI_DispStringHCenterAt("Bitmaps can be magnified", XSize / 2, 100);
    GUIDEMO_Wait();
  #else
    {
      const GUI_BITMAP * pBm;
      int TextModeOld = GUI_SetTextMode(GUI_TM_XOR);
      GUI_SetFont(&GUI_Font8_ASCII);
      pBm = &_bmLadyBug;
      GUI_DrawBitmap(pBm, (XSize - (int)pBm->XSize) / 2, (YSize - (int)pBm->YSize) / 2);
      GUI_DispStringAt("RLE Compressed bitmaps", 10, 10);
      GUIDEMO_Wait();
      GUI_Clear();
      pBm = &GUIDEMO_bm4bpp;
      GUI_DrawBitmap(pBm, (XSize - (int)pBm->XSize) / 2, (YSize - (int)pBm->YSize) / 2);
      GUI_DispStringAt("1/2/4/8 bpp bitmaps", 10, 10);
      GUIDEMO_Wait();
      /*
      {
        int i, nMax = 10;
        GUI_Clear();
        for (i = 2; i < nMax; i++) {
          GUI_DrawBitmapMag(pBm, (XSize - (int)pBm->XSize * i) / 2, (YSize - (int)pBm->YSize * i) / 2, i, i);
          GUI_DispStringAt("Bitmaps can be magnified", 10, 10);
          GUIDEMO_Delay(100);
        }
        for (i = nMax; i > 2; i--) {
          GUI_DrawBitmapMag(pBm, (XSize - (int)pBm->XSize * i) / 2, (YSize - (int)pBm->YSize * i) / 2, i, i);
          GUI_DispStringAt("Bitmaps can be magnified", 10, 10);
          GUIDEMO_Delay(100);
        }
      }
      */
      GUI_DrawBitmapMag(pBm, (XSize - (int)pBm->XSize * 2) / 2, (YSize - (int)pBm->YSize * 2) / 2, 2, 2);
      GUI_DispStringAt("Bitmaps can be magnified", 10, 10);
      GUIDEMO_Wait();
      GUI_SetTextMode(TextModeOld);
    }
  #endif
}
Exemple #25
0
/*********************************************************************
*
*       Public functions
*
**********************************************************************
*/
void GUIDEMO_Graph(void) {
  GUIDEMO_ShowIntro("Drawing a graph", "Optimized drawing routine\nfor drawing graph data");
  GUIDEMO_ShowInfoWin();
  _GraphDemo();
  GUIDEMO_NotifyStartNext();
}
Exemple #26
0
void GUIDEMO_ColorBar(void) {
  int nBars = 13;
  int NumColors = LCD_GetDevCap(LCD_DEVCAP_NUMCOLORS);
  int XSize = LCD_GetXSize();
  int i, yStep, y0, x0;
  int lcd_ysize;
  int BitsPerPixel;
  
  lcd_ysize = LCD_GetYSize();
  y0 = 70;
  x0 = 60;
  GUIDEMO_ShowIntro("Color bar",
                    "emWin features "
                    "\nan integrated color"
                    "\nmanagement"
                    "\nwill always find the best available color"
                    "\nfor any logical color");
	XSize -= x0;
  yStep = (lcd_ysize - y0 - 60) / nBars;
  GUI_SetColor(GUI_WHITE);
  GUI_SetBkColor(GUI_BLACK); 
  GUI_Clear();
	GUI_SetFont(&GUI_Font8x16);
	GUI_DispString("Color bars\n");
  GUI_SetFont(&GUI_Font8_ASCII);
  #ifdef LCD_CONTROLLER
    GUI_DispString("\nLCD_CONTROLLER: ");
    GUI_DispDecMin(LCD_CONTROLLER);
    GUI_DispString("\n");
  #endif
  BitsPerPixel = LCD_GetBitsPerPixel();
  GUI_DispDecMin(BitsPerPixel);
  GUI_DispString(" bpp");
  #ifdef LCD_BUSWIDTH
    GUI_DispString(", ");
    GUI_DispDecMin(LCD_BUSWIDTH);
    GUI_DispString(" bit bus");
  #endif
  GUI_DispString(", ");
  GUI_DispDecMin(NumColors);
  GUI_DispString(" colors\n");
  GUI_SetFont(&GUI_Font8x8);
  GUI_SetColor(GUI_WHITE);
  GUI_DispStringAt("Red",     0, y0 +      yStep);
  GUI_DispStringAt("Green",   0, y0 + 3  * yStep);
  GUI_DispStringAt("Blue",    0, y0 + 5  * yStep);
  GUI_DispStringAt("Grey",    0, y0 + 6  * yStep);
  GUI_DispStringAt("Yellow",  0, y0 + 8  * yStep);
  GUI_DispStringAt("Cyan",    0, y0 + 10 * yStep);
  GUI_DispStringAt("Magenta", 0, y0 + 12 * yStep);
  for (i = 0; (i < XSize) && !GUIDEMO_CheckCancel(); i++) {
    U16 cs = (255 * (U32)i) / XSize;
    U16 x = x0 + i;;
/* Red */
    GUI_SetColor(cs);
    GUI_DrawVLine(x, y0, y0 + yStep - 1);
    GUI_SetColor(0x0000ff + (255 - cs) * 0x10100L);
    GUI_DrawVLine(x, y0 + yStep, y0 + 2 * yStep - 1);
/* Green */
    GUI_SetColor(cs<<8);
    GUI_DrawVLine(x, y0 + 2 * yStep, y0 + 3 * yStep - 1);
    GUI_SetColor(0x00ff00 + (255 - cs) * 0x10001L);
    GUI_DrawVLine(x, y0 + 3 * yStep, y0 + 4 * yStep - 1);
/* Blue */
    GUI_SetColor(cs * 0x10000L);
    GUI_DrawVLine(x, y0 + 4 * yStep, y0 + 5 * yStep - 1);
    GUI_SetColor(0xff0000 + (255 - cs) * 0x00101L);
    GUI_DrawVLine(x, y0 + 5 * yStep, y0 + 6 * yStep - 1);
/* Gray */
    GUI_SetColor(cs * 0x10101L);
    GUI_DrawVLine(x, y0 + 6 * yStep, y0 + 7 * yStep - 1);
/* Yellow */
    GUI_SetColor(cs * 0x00101L);
    GUI_DrawVLine(x, y0 + 7 * yStep, y0 + 8 * yStep - 1);
    GUI_SetColor(0x00ffff + (255 - cs) * 0x10000L);
    GUI_DrawVLine(x, y0 + 8 * yStep, y0 + 9 * yStep - 1);
/* Cyan */
    GUI_SetColor(cs * 0x10100L);
    GUI_DrawVLine(x, y0 + 9 * yStep, y0 + 10 * yStep - 1);
    GUI_SetColor(0xffff00 + (255 - cs) * 0x00001L);
    GUI_DrawVLine(x, y0 + 10 * yStep, y0 + 11 * yStep - 1);
/* Magenta */
    GUI_SetColor(cs * 0x10001L);
    GUI_DrawVLine(x, y0 + 11 * yStep, y0 + 12 * yStep - 1);
    GUI_SetColor(0xff00ff + (255 - cs) * 0x00100L);
    GUI_DrawVLine(x, y0 + 12 * yStep, y0 + 13 * yStep - 1);
  }
  GUIDEMO_Wait();
}
Exemple #27
0
/*********************************************************************
*
*       GUIDEMO_Listview
*/
void GUIDEMO_Listview(void) {
  GUIDEMO_ShowIntro("Listview demo", "Shows some features of\nthe LISTVEW widget");
  GUIDEMO_DrawBk();
  GUIDEMO_ShowInfoWin();
  _DemoListview();
}
Exemple #28
0
void GUIDEMO_ShowColorBar(void) {
  int nBars = 13;
  int YSize = LCD_GetYSize();
  int y0 = 70; 
  int yStep = (YSize - y0 - (YSize < 320 ? 0 : 60)) / nBars;
  int i;
  int x0 = 60;
  int NumColors = LCD_GetDevCap(LCD_DEVCAP_NUMCOLORS);
  int xsize = LCD_GetDevCap(LCD_DEVCAP_XSIZE);
	xsize -=x0;
  GUIDEMO_ShowIntro("Color bar",
                    "uC/GUI integrated color"
                    "\nmanagement always find the"
                    "\nbest available color for any"
					"\nlogical color");
  GUI_SetColor(GUI_WHITE);
  GUI_SetBkColor(GUI_BLACK); 
  GUI_Clear();
	GUI_SetFont(&GUI_Font8x16);
	GUI_DispString("Color bars\n");
	GUI_SetFont(&GUI_Font8_ASCII);
  #ifdef LCD_CONTROLLER
    GUI_DispString("\nLCD_CONTROLLER: ");
    GUI_DispDecMin(LCD_CONTROLLER);
    GUI_DispString("\n");
  #endif
  GUI_DispDecMin(LCD_BITSPERPIXEL);
  GUI_DispString(" bpp");
  #ifdef LCD_BUSWIDTH
    GUI_DispString(", ");
    GUI_DispDecMin(LCD_BUSWIDTH);
    GUI_DispString(" bit bus");
  #endif
  GUI_DispString(", ");
  GUI_DispDecMin(NumColors);
  GUI_DispString(" colors\n");
  #if (LCD_FIXEDPALETTE) 
    GUI_DispString("Fixed palette: ");
    GUI_DispDecMin(LCD_FIXEDPALETTE);
  #else
    GUI_DispString("(Custom)");
  #endif
  GUI_SetFont(&GUI_Font8x8);
  GUI_SetColor(GUI_WHITE);
  GUI_DispStringAt("Red",     0, y0 +      yStep);
  GUI_DispStringAt("Green",   0, y0 + 3  * yStep);
  GUI_DispStringAt("Blue",    0, y0 + 5  * yStep);
  GUI_DispStringAt("Grey",    0, y0 + 6  * yStep);
  GUI_DispStringAt("Yellow",  0, y0 + 8  * yStep);
  GUI_DispStringAt("Cyan",    0, y0 + 10 * yStep);
  GUI_DispStringAt("Magenta", 0, y0 + 12 * yStep);
  for (i = 0; (i < xsize) && !GUIDEMO_CheckCancel(); i++) {
    U16 cs = (255 * (U32)i) / xsize;
    U16 x = x0 + i;;
/* Red */
    GUI_SetColor(cs);
    GUI_DrawVLine(x, y0, y0 + yStep - 1);
    GUI_SetColor(0x0000ff + (255 - cs) * 0x10100L);
    GUI_DrawVLine(x, y0 + yStep, y0 + 2 * yStep - 1);
/* Green */
    GUI_SetColor(cs<<8);
    GUI_DrawVLine(x, y0 + 2 * yStep, y0 + 3 * yStep - 1);
    GUI_SetColor(0x00ff00 + (255 - cs) * 0x10001L);
    GUI_DrawVLine(x, y0 + 3 * yStep, y0 + 4 * yStep - 1);
/* Blue */
    GUI_SetColor(cs * 0x10000L);
    GUI_DrawVLine(x, y0 + 4 * yStep, y0 + 5 * yStep - 1);
    GUI_SetColor(0xff0000 + (255 - cs) * 0x00101L);
    GUI_DrawVLine(x, y0 + 5 * yStep, y0 + 6 * yStep - 1);
/* Gray */
    GUI_SetColor(cs * 0x10101L);
    GUI_DrawVLine(x, y0 + 6 * yStep, y0 + 7 * yStep - 1);
/* Yellow */
    GUI_SetColor(cs * 0x00101L);
    GUI_DrawVLine(x, y0 + 7 * yStep, y0 + 8 * yStep - 1);
    GUI_SetColor(0x00ffff + (255 - cs) * 0x10000L);
    GUI_DrawVLine(x, y0 + 8 * yStep, y0 + 9 * yStep - 1);
/* Cyan */
    GUI_SetColor(cs * 0x10100L);
    GUI_DrawVLine(x, y0 + 9 * yStep, y0 + 10 * yStep - 1);
    GUI_SetColor(0xffff00 + (255 - cs) * 0x00001L);
    GUI_DrawVLine(x, y0 + 10 * yStep, y0 + 11 * yStep - 1);
/* Magenta */
    GUI_SetColor(cs * 0x10001L);
    GUI_DrawVLine(x, y0 + 11 * yStep, y0 + 12 * yStep - 1);
    GUI_SetColor(0xff00ff + (255 - cs) * 0x00100L);
    GUI_DrawVLine(x, y0 + 12 * yStep, y0 + 13 * yStep - 1);
  }
  GUIDEMO_Wait();
}