本文整理汇总了C++中GUI_DispStringHCenterAt函数的典型用法代码示例。如果您正苦于以下问题:C++ GUI_DispStringHCenterAt函数的具体用法?C++ GUI_DispStringHCenterAt怎么用?C++ GUI_DispStringHCenterAt使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GUI_DispStringHCenterAt函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: _DrawScreen
/*********************************************************************
*
* _DrawScreen
*/
static void _DrawScreen(void) {
GUI_RECT Rect;
int yd;
GUI_DrawBitmap(&_bmSeggerLogo_50x25, 10, 10);
GUI_SetFont(GUI_FONT_20B_ASCII);
GUI_DispStringHCenterAt("Antialiased text sample", 190, 5);
GUI_SetFont(GUI_FONT_13_ASCII);
GUI_DispStringHCenterAt("Shows antialiased text on different backgrounds.", 190, 25);
Rect.x0 = 0;
Rect.y0 = 43;
Rect.x1 = 59;
Rect.y1 = Rect.y0 + 95;
yd = (Rect.y1 - Rect.y0) / 3;
//
// 4 bit antialiasing sample
//
_DrawText("Antialiased text\n (4 bpp)", &Rect);
GUI_SetFont(&_FontAA4_32);
_DrawSample(&Rect, yd);
//
// 2 bit antialiasing sample
//
GUI_MoveRect(&Rect, 0, 101);
_DrawText("Antialiased text\n (2 bpp)", &Rect);
GUI_SetFont(&_FontAA2_32);
_DrawSample(&Rect, yd);
}
开发者ID:satyanarayangullapalli,项目名称:arm_lpc_1788_sdk,代码行数:32,代码来源:AA_Text.c
示例2: GUIDEMO_ShowIntro
/*********************************************************************
*
* GUIDEMO_ShowIntro
*
* This function has to be called by every sample
*/
void GUIDEMO_ShowIntro(const char * acTitle, const char * acDescription) {
int xSize, ySize, xCenter, yCenter, FontDistY, TimeWait, i;
xSize = LCD_GetXSize();
ySize = LCD_GetYSize();
xCenter = xSize >> 1;
yCenter = ySize >> 1;
GUIDEMO_HideInfoWin();
GUIDEMO_ShowControlWin();
GUI_Exec();
GUIDEMO_DrawBk(1);
GUI_SetColor(GUI_WHITE);
//
// Title
//
GUI_SetTextMode(GUI_TM_TRANS);
GUI_SetFont(&GUI_FontRounded22);
GUI_DispStringHCenterAt(acTitle, xCenter, 60);
//
// Description
//
GUI_SetFont(&GUI_FontSouvenir18);
FontDistY = GUI_GetFontDistY();
GUI_DispStringHCenterAt(acDescription, xCenter, yCenter - FontDistY + 10);
//
// Determine time to wait
//
i = 0;
while (acDescription[i]) {
i++;
}
TimeWait = i * 80;
GUIDEMO_Wait(TimeWait);
}
开发者ID:EnricoGiordano1992,项目名称:Tesi,代码行数:40,代码来源:GUIDEMO.c
示例3: _DemoHardkey
/*******************************************************************
*
* _DemoHardkey
*
* Function description
* 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();
}
开发者ID:fzzjoy,项目名称:SimulationTrial,代码行数:33,代码来源:SIM_Hardkey.c
示例4: GUIDEMO_ShowIntro
void GUIDEMO_ShowIntro(const char * s, const char * sExp) {
GUI_CONTEXT ContextOld;
GUI_SaveContext(&ContextOld);
_sInfo = s;
_sExplain = sExp;
GUI_SetDefault();
GUIDEMO_HideInfoWin();
GUI_SetBkColor(GUI_BLUE);
GUI_SetColor(GUI_WHITE);
GUI_Clear();
//GUI_SetFont(&GUI_FontComic18B_ASCII);
GUI_SetFont(&GUI_FontHZ12);
GUI_DispStringHCenterAt(s, LCD_GET_XSIZE() / 2, LCD_GET_YSIZE() / 3 - 10);
if (_sExplain) {
GUI_SetFont(&GUI_Font8_ASCII);
GUI_DispStringHCenterAt(_sExplain, LCD_GET_XSIZE() / 2, LCD_GET_YSIZE() / 2 - 10);
}
GUIDEMO_Delay(_sExplain ? 2000 : 4000);
#if GUI_WINSUPPORT
_UpdateInfoWin();
_UpdateCmdWin();
#endif
GUI_RestoreContext(&ContextOld);
#if GUI_WINSUPPORT
WM_ExecIdle();
#endif
GUIDEMO_NotifyStartNext();
GUI_SetBkColor(GUI_RED);
GUI_Clear();
}
开发者ID:rttg125,项目名称:Intelligent-bedroom-system,代码行数:30,代码来源:GUIDEMO.c
示例5: _DemoAntialiasing
/*******************************************************************
*
* _DemoAntialiasing
Draws lines with different antialiasing factors
*/
static void _DemoAntialiasing(void) {
int i, x1, x2, y1, y2;
const GUI_FONT *font_old;
y1 = 65;
y2 = 5;
/* Set drawing attributes */
GUI_SetColor(GUI_WHITE);
GUI_SetBkColor(GUI_BLACK);
GUI_SetPenShape(GUI_PS_FLAT);
GUI_Clear();
/* draw headline */
font_old = GUI_SetFont(&GUI_Font24_ASCII);
GUI_SetTextAlign(GUI_TA_HCENTER);
GUI_DispStringAt("AA_Lines - Sample", 160, 5);
/* Draw lines without antialiased */
GUI_Delay(1000);
GUI_SetFont(&GUI_Font8x16);
GUI_SetTextAlign(GUI_TA_LEFT);
GUI_DispStringAtCEOL("draw normal lines using", 5, 40);
GUI_DispStringAtCEOL("GUI_DrawLine", 5, 55);
GUI_Delay(2500);
x1 = 20;
x2 = 100;
GUI_SetFont(font_old);
GUI_DispStringHCenterAt("Normal", (x1 + x2) / 2, 30 + y1);
for (i = 1; i < 8; i++) {
GUI_SetPenSize(i);
GUI_DrawLine(x1, 40 + i * 15 + y1, x2, 40 + i * 15 + y1 + y2);
}
/* Draw lines with antialiasing quality factor 2 */
GUI_Delay(3000);
GUI_SetFont(&GUI_Font8x16);
GUI_DispStringAtCEOL("", 5, 40);
GUI_DispStringAtCEOL("", 5, 55);
GUI_Delay(200);
GUI_DispStringAtCEOL("draw antialiased lines using", 5, 40);
GUI_DispStringAtCEOL("GUI_AA_DrawLine", 5, 55);
GUI_Delay(3500);
x1 = 120;
x2 = 200;
GUI_AA_SetFactor(2);
GUI_SetFont(font_old);
GUI_DispStringHCenterAt("Antialiased\nusing factor 2", (x1 + x2) / 2, 30 + y1);
for (i = 1; i < 8; i++) {
GUI_SetPenSize(i);
GUI_AA_DrawLine(x1, 40 + i * 15 + y1, x2, 40 + i * 15 + y1 + y2);
}
/* Draw lines with antialiasing quality factor 6 */
GUI_Delay(1500);
x1 = 220;
x2 = 300;
GUI_AA_SetFactor(6);
GUI_SetFont(font_old);
GUI_DispStringHCenterAt("Antialiased\nusing factor 6", (x1 + x2) / 2, 30 + y1);
for (i = 1; i < 8; i++) {
GUI_SetPenSize(i);
GUI_AA_DrawLine(x1, 40 + i * 15 + y1, x2, 40 + i * 15 + y1 + y2);
}
GUI_Delay(7500);
}
开发者ID:AndreMiras,项目名称:EFM32-Library,代码行数:66,代码来源:AA_Lines.c
示例6: _DrawJPEGS
/*******************************************************************
*
* _DrawJPEGS
*
* Iterates over all JPEG files of a directory
*/
static void _DrawJPEGS(void) {
WIN32_FIND_DATA Context;
static char acPath[_MAX_PATH];
HANDLE hFind;
char acMask[_MAX_PATH];
char acFile[_MAX_PATH];
char acBuffer[_MAX_PATH];
GUI_SetBkColor(GUI_BLACK);
GUI_Clear();
GUI_SetColor(GUI_WHITE);
GUI_SetFont(&GUI_Font24_ASCII);
GUI_DispStringHCenterAt("Drawing scaled JPEGs - Sample", 160, 5);
GetWindowsDirectory(acBuffer, sizeof(acBuffer));
_GetFirstBitmapDirectory(acBuffer, acPath);
GUI_SetFont(&GUI_Font8x16);
sprintf(acMask, "%s*.jp*", acPath);
hFind = FindFirstFile(acMask, &Context);
if (hFind != INVALID_HANDLE_VALUE) {
do {
sprintf(acFile, "%s%s", acPath, Context.cFileName);
GUI_DispStringAtCEOL(acFile, 5, 40);
_DrawJPEG(acFile);
} while (FindNextFile(hFind, &Context));
} else {
GUI_DispStringHCenterAt("No JPEG files found!", 160, 60);
GUI_Delay(2000);
}
}
开发者ID:fzzjoy,项目名称:SimulationTrial,代码行数:35,代码来源:2DGL_DrawJPEGScaled.c
示例7: _ShowComments
/*******************************************************************
*
* _ShowComments
*
* Shows all comments of a GIF file
*/
static void _ShowComments(const char * pFile, int FileSize) {
GUI_RECT Rect = {80, 100, 239, 199};
char acBuffer[256] = {0};
int CommentCnt;
/* Display sample information */
GUI_SetFont(&GUI_Font8x16);
GUI_ClearRect(0, 40, 319, 59);
GUI_DispStringHCenterAt("Show all comments of a GIF file", 160, 40);
/* Show all comments */
GUI_ClearRect(0, 60, 319, 239); /* Clear the image area */
CommentCnt = 0;
while (!GUI_GIF_GetComment(pFile, FileSize, (unsigned char *)acBuffer, sizeof(acBuffer), CommentCnt)) {
char acNumber[12] = "Comment #0:";
acNumber[9] = '0' + CommentCnt;
GUI_DispStringHCenterAt(acNumber, 160, 80);
GUI_SetBkColor(GUI_BLACK);
GUI_SetColor(GUI_WHITE);
GUI_ClearRectEx(&Rect);
GUI_DispStringInRectWrap(acBuffer, &Rect, GUI_TA_HCENTER | GUI_TA_VCENTER, GUI_WRAPMODE_WORD);
GUI_SetBkColor(GUI_WHITE);
GUI_SetColor(GUI_BLACK);
GUI_Delay(4000); /* Wait a while */
CommentCnt++;
}
}
开发者ID:satyanarayangullapalli,项目名称:arm_lpc_1788_sdk,代码行数:31,代码来源:2DGL_DrawGIF.c
示例8: GUIDEMO_Intro
void GUIDEMO_Intro(void) {
int xCenter = LCD_GET_XSIZE() / 2;
int y;
char acText[50] = "Version of µC/GUI: ";
strcat(acText, GUI_GetVersionString());
GUI_SetBkColor(GUI_BLUE);
GUI_SetColor(GUI_YELLOW);
GUI_Clear();
GUI_SetFont(&GUI_Font13B_1);
GUI_DispStringHCenterAt("µC/GUI", xCenter, y= 10);
GUI_SetFont(&GUI_Font10_ASCII);
GUI_SetColor(GUI_WHITE);
GUI_DispStringHCenterAt("Universal graphic software"
"\nfor embedded applications"
, xCenter, y += 20);
GUI_SetFont(&GUI_Font10S_ASCII);
GUI_DispStringHCenterAt("Compiled " __DATE__ " "__TIME__, xCenter, y += 25);
GUI_DispStringHCenterAt(acText, xCenter, y += 16);
GUIDEMO_Delay(5000);
GUI_Clear();
GUI_DrawBitmap(&bmMicriumLogo, (LCD_GET_XSIZE() - bmMicriumLogo.XSize) / 2, 6);
GUI_SetFont(&GUI_Font13B_1);
GUI_DispStringHCenterAt("www.micrium.com", LCD_GET_XSIZE() / 2, LCD_GET_YSIZE() - 50);
GUIDEMO_Delay(5000);
}
开发者ID:a-c-t-i-n-i-u-m,项目名称:HY-STM32F103,代码行数:28,代码来源:GUIDEMO_Intro.c
示例9: DemoShiftJIS
void DemoShiftJIS(void) {
GUI_SetFont(&GUI_Font24_ASCII);
GUI_DispStringHCenterAt("FONT_ShiftJIS - Sample", 160, 5);
/* Set ShiftJIS font */
GUI_SetFont(&GUI_FontSJIS13);
/* Display string */
GUI_DispStringHCenterAt(aSJIS, 160, 80);
}
开发者ID:satyanarayangullapalli,项目名称:arm_lpc_1788_sdk,代码行数:8,代码来源:FONT_ShiftJIS.c
示例10: MainTask
/*********************************************************************
*
* MainTask
*/
void MainTask(void) {
GUI_Init();
while(1) {
GUI_DispStringHCenterAt("WIDGET_Window sample\nshows how to use a WINDOW widget", 160, 5);
GUI_ExecDialogBox(_aDialog, GUI_COUNTOF(_aDialog), _cbDialog, WM_HBKWIN, 30, 30);
GUI_Clear();
GUI_DispStringHCenterAt("Dialog has been closed", 160, 5);
GUI_Delay(1000);
GUI_Clear();
}
}
开发者ID:dadianxukong,项目名称:gps,代码行数:15,代码来源:WIDGET_Window.c
示例11: _DemoShiftJIS
/*******************************************************************
*
* Demonstrates output of ShiftJIS characters
*
********************************************************************
*/
static void _DemoShiftJIS(void) {
GUI_SetFont(&GUI_Font24_ASCII);
GUI_DispStringHCenterAt("FONT_ShiftJIS - Sample", 160, 5);
//
// Set ShiftJIS font
//
GUI_SetFont(&GUI_FontSJIS13);
//
// Display string
//
GUI_DispStringHCenterAt(aSJIS, 160, 80);
}
开发者ID:fzzjoy,项目名称:SimulationTrial,代码行数:18,代码来源:FONT_ShiftJIS.c
示例12: _cbBkWin
/*********************************************************************
*
* _cbBkWin
*
* Function description
* Callback routine of desktop window
*/
static void _cbBkWin(WM_MESSAGE * pMsg) {
switch (pMsg->MsgId) {
case WM_PAINT:
GUI_Clear();
GUI_SetFont(&GUI_Font24_ASCII);
GUI_DispStringHCenterAt("WIDGET_SortedListview - Sample", 160, 5);
GUI_SetFont(&GUI_Font10_ASCII);
GUI_DispStringHCenterAt("Please touch the header of the LISTVIEW for sorting...", 160, 35);
break;
default:
WM_DefaultProc(pMsg);
}
}
开发者ID:Trietptm-on-Coding-Algorithms,项目名称:CodeLibrary,代码行数:20,代码来源:WIDGET_SortedListview.c
示例13: _cbBkWin
/*********************************************************************
*
* _cbBkWin
*/
static void _cbBkWin(WM_MESSAGE * pMsg) {
const WM_KEY_INFO * pKeyInfo;
int NCode;
int Id;
switch (pMsg->MsgId) {
case WM_KEY:
pKeyInfo = (const WM_KEY_INFO*)pMsg->Data.p;
if (pKeyInfo->PressedCnt > 0) {
switch (pKeyInfo->Key) {
case GUI_KEY_TAB:
WM_SetFocusOnNextChild(pMsg->hWin);
break;
case GUI_KEY_BACKTAB:
WM_SetFocusOnPrevChild(pMsg->hWin);
break;
case GUI_KEY_ESCAPE:
_Break = 1;
break;
}
}
break;
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc); // Id of widget
NCode = pMsg->Data.v; // Notification code
switch (NCode) {
case WM_NOTIFICATION_RELEASED: // React only if released
switch (Id) {
case GUI_ID_BUTTON0:
_AppSelection = APP_DASHBOARD;
break;
case GUI_ID_BUTTON1:
_AppSelection = APP_CASHTERMINAL;
break;
}
break;
}
break;
case WM_PAINT:
GUI_DrawGradientV(0, 0, 639, 479, GUI_BLUE, GUI_BLACK);
GUI_SetFont(&GUI_FontAA2_32);
GUI_SetTextMode(GUI_TM_TRANS);
GUI_SetColor(GUI_WHITE);
GUI_DispStringHCenterAt("emWin VGA Demonstration\n", 400, 44);
GUI_SetFont(&GUI_FontAA2_21);
GUI_DispStringHCenterAt("Press the 'Dashboard' or the 'Cash Terminal'\nbutton to start one of the applications\n", 320, 150);
GUI_DrawBitmap(&bmSeggerLogo, 30, 30);
break;
}
}
开发者ID:fzzjoy,项目名称:SimulationTrial,代码行数:54,代码来源:MainTask.c
示例14: MainTask
/*******************************************************************
*
* MainTask
*/
void MainTask(void) {
int xSizeH;
GUI_Init();
xSizeH = LCD_GetXSize() / 2;
GUI_SetColor(GUI_WHITE);
GUI_SetFont(&GUI_Font24_ASCII);
GUI_DispStringHCenterAt("Fading sample", xSizeH, 5);
GUI_SetFont(&GUI_Font16B_ASCII);
GUI_DispStringHCenterAt("Shows how to use memory devices\nfor a fading effect", xSizeH, 40);
_DemoFade();
while (1) {
GUI_Delay(100);
}
}
开发者ID:dadianxukong,项目名称:gps,代码行数:18,代码来源:MEMDEV_FadeIn.c
示例15: _DispCursor
/*********************************************************************
*
* _DispCursor
*/
static void _DispCursor(void) {
int i, x, y;
GUI_DispStringHCenterAt("Available cursors:", 160, 80);
for (i = 0; i < 12; i++) {
x = 160 - (_apCursor[i]->pBitmap->XSize / 2);
y = 120 - (_apCursor[i]->pBitmap->YSize / 2);
GUI_DrawBitmap(_apCursor[i]->pBitmap, x, y);
GUI_DispStringHCenterAt(_aacCursorName[i], 160,145);
GUI_Delay(750);
GUI_ClearRect(0, 100, 319, 165);
}
GUI_ClearRect(0, 80, 319, 100);
GUI_Delay(500);
}
开发者ID:satyanarayangullapalli,项目名称:arm_lpc_1788_sdk,代码行数:18,代码来源:CURSOR_Sample.c
示例16: _ShowHiresAntialiasing
/*******************************************************************
*
* _ShowHiresAntialiasing
*
* Function description
* This function creates the memory auto devices and handle the
* rotation of the pointers
*/
static void _ShowHiresAntialiasing(void) {
GUI_AUTODEV aAuto[2];
PARAM Param;
unsigned i;
Param.Factor = 3;
GUI_SetBkColor(GUI_BLACK);
GUI_Clear();
GUI_SetColor(GUI_WHITE);
GUI_SetTextAlign(GUI_TA_HCENTER);
GUI_SetFont(&GUI_Font24_ASCII);
GUI_DispStringAt("AA_HiResAntialiasing - Sample", 160, 5);
GUI_SetFont(&GUI_Font6x8);
GUI_DispStringHCenterAt("Using\nhigh\nresolution\nmode", 110, 180);
GUI_DispStringHCenterAt("Not using\nhigh\nresolution\nmode", 210, 180);
//
// Create GUI_AUTODEV objects
//
for (i = 0; i < countof(aAuto); i++) {
GUI_MEMDEV_CreateAuto(&aAuto[i]);
}
//
// Calculate pointer for high resolution
//
for (i = 0; i < countof(_aPointer); i++) {
_aPointerHiRes[i].x = _aPointer[i].x * Param.Factor;
_aPointerHiRes[i].y = _aPointer[i].y * Param.Factor;
}
GUI_AA_SetFactor(Param.Factor); /* Set antialiasing factor */
while (1) {
for (i = 0; i < 1800; i++) {
float Angle = (i >= 900) ? 1800 - i : i;
Angle *= 3.1415926f / 1800;
//
// Draw pointer with high resolution
//
GUI_AA_EnableHiRes();
GUI_RotatePolygon(Param.aPoints, _aPointerHiRes, countof(_aPointer), Angle);
GUI_MEMDEV_DrawAuto(&aAuto[0], &Param.AutoInfo, _DrawHiRes, &Param);
//
// Draw pointer without high resolution
//
GUI_AA_DisableHiRes();
GUI_RotatePolygon(Param.aPoints, _aPointer, countof(_aPointer), Angle);
GUI_MEMDEV_DrawAuto(&aAuto[1], &Param.AutoInfo, _Draw, &Param);
GUI_Delay(2);
}
}
}
开发者ID:xinshaochen,项目名称:emWin,代码行数:57,代码来源:AA_HiResAntialiasing.c
示例17: _Draw
/********************************************************************
*
* _Draw
*
* Function description
* Draws some coloured output to the current device (display or memory device)
*/
static void _Draw(void) {
int i;
GUI_SetBkColor(GUI_YELLOW);
GUI_ClearRect(0, 75, 319, 138);
GUI_SetColor(GUI_RED);
GUI_SetFont(&GUI_Font32B_ASCII);
GUI_DispStringHCenterAt("Printing demo", 160, 75);
for (i = 0; i < 12; i += 2) {
GUI_SetColor(GUI_GREEN);
GUI_DrawRect(5 + i, 80 + i, 50 - i, 101 - i);
GUI_SetColor(GUI_BLUE);
GUI_DrawRect(269 + i, 80 + i, 314 - i, 101 - i);
}
for (i = 0; i < 32; i += 8) {
GUI_SetColor(GUI_BLUE);
GUI_FillRect(0, 107 + i, 319, 110 + i);
GUI_SetColor(GUI_YELLOW);
GUI_FillRect(0, 111 + i, 319, 114 + i);
}
i = 8;
_DrawBitmap(&bmTestPicture1, i + 0, 111, 0, 0);
_DrawBitmap(&bmTestPicture1, i + 35, 111, 1, 0);
_DrawBitmap(&bmTestPicture1, i + 70, 111, 0, 1);
_DrawBitmap(&bmTestPicture2, i + 105, 111, 0, 0);
_DrawBitmap(&bmTestPicture2, i + 140, 111, 1, 0);
_DrawBitmap(&bmTestPicture4, i + 175, 111, 0, 0);
_DrawBitmap(&bmTestPicture4, i + 210, 111, 1, 0);
_DrawBitmap(&bmTestPicture8, i + 245, 111, 0, 0);
_DrawBitmap(&bmTestPicture8, i + 280, 111, 1, 0);
}
开发者ID:caicry,项目名称:uFrame,代码行数:37,代码来源:MEMDEV_Printing.c
示例18: _DrawCalendar
/**************************************************************************************
* FunctionName : _DrawCalendar()
* Description : 绘制日历表格
* EntryParameter : None
* ReturnValue : None
**************************************************************************************/
void _DrawCalendar(CLD_DAY *pDay)
{
const U8 cstWek[][4] = { "SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT" };
U8 tmpWth = 320 / 7;
U8 tmpHgh = 180 / 6;
U8 i = 0, n = 0;
GUI_SetColor(GUI_GRAY); // 设置灰色
for (i = 0; i < 7; i++) // 画水平线
{
GUI_DrawHLine((60 + i*tmpHgh) - 1, 0, 320);
for (n = 0; n < 7; n++)
{
if (i < 6)
{
pDay[i * 7 + n].Y = (60 + i*tmpHgh) + tmpHgh / 2;
}
}
}
for (i = 0; i < 7; i++) // 画垂直平线
{
if (i < 6) GUI_DrawVLine((i + 1)*tmpWth, 60, 240);
for (n = 0; n < 6; n++)
{
pDay[i + 7 * n].X = ((i + 1)*tmpWth) - tmpWth / 2;
}
}
for (i = 0; i < 7; i++) // 显示星期
{
GUI_DispStringHCenterAt(cstWek[i], i*tmpWth + tmpWth / 2, 45);
}
}
开发者ID:fzzjoy,项目名称:GraduationProject,代码行数:38,代码来源:AppCalendar.c
示例19: _cbBkWindow
/*******************************************************************
*
* _cbBkWindow
*/
static void _cbBkWindow(WM_MESSAGE* pMsg) {
switch (pMsg->MsgId) {
case MSG_CHANGE_MAIN_TEXT:
strcpy(_acMainText, pMsg->Data.p);
WM_InvalidateWindow(pMsg->hWin);
break;
case MSG_CHANGE_INFO_TEXT:
strcpy(_acInfoText, pMsg->Data.p);
WM_InvalidateWindow(pMsg->hWin);
break;
case WM_PAINT:
GUI_SetBkColor(GUI_BLACK);
GUI_Clear();
GUI_SetColor(GUI_WHITE);
GUI_SetFont(&GUI_Font24_ASCII);
GUI_DispStringHCenterAt("LISTVIEW Widget - Sample", 160, 5);
GUI_SetFont(&GUI_Font8x16);
GUI_DispStringAt(_acMainText, 5, 40);
GUI_SetFont(&GUI_Font8x8);
GUI_DispStringAt(_acInfoText, 5, 60);
break;
default:
WM_DefaultProc(pMsg);
}
}
开发者ID:caicry,项目名称:uFrame,代码行数:29,代码来源:WIDGET_ListView.c
示例20: _DemoButton
/*******************************************************************
*
* _DemoButton
*/
static void _DemoButton(void) {
BUTTON_Handle hButton;
int Stat = 0;
GUI_SetFont(&GUI_Font8x16);
GUI_DispStringHCenterAt("Click on phone button...", 160,80);
GUI_Delay(500);
/* Create the button */
hButton = BUTTON_Create(142, 100, 36, 40, GUI_ID_OK, WM_CF_SHOW);
/* Modify the button attributes */
BUTTON_SetBkColor(hButton, 1, GUI_RED);
BUTTON_SetBitmapEx(hButton, 0, &bm_1bpp_0, 2, 4);
BUTTON_SetBitmapEx(hButton, 1, &bm_1bpp_1, 2, 4);
/* Loop until button is pressed */
while(GUI_GetKey() != GUI_ID_OK) {
if (Stat ^= 1) {
BUTTON_SetState(hButton,
BUTTON_STATE_HASFOCUS | BUTTON_STATE_INACTIVE);
} else {
BUTTON_SetState(hButton,
BUTTON_STATE_HASFOCUS | BUTTON_STATE_PRESSED);
}
GUI_Delay(500);
}
/* Delete button object */
BUTTON_Delete(hButton);
GUI_ClearRect(0, 50, 319, 239);
GUI_Delay(1750);
}
开发者ID:byxob,项目名称:calendar,代码行数:32,代码来源:WIDGET_PhoneButton.c
注:本文中的GUI_DispStringHCenterAt函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论