本文整理汇总了C++中GUI_SetBkColor函数的典型用法代码示例。如果您正苦于以下问题:C++ GUI_SetBkColor函数的具体用法?C++ GUI_SetBkColor怎么用?C++ GUI_SetBkColor使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GUI_SetBkColor函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Draw
static void Draw(void * p) {
int i;
PARAM * pParam = (PARAM *)p;
GUI_SetBkColor(GUI_BLACK);
GUI_SetColor(GUI_DARKGRAY);
GUI_ClearRect(19, (LCD_YSIZE - 20) - YSIZE, (LCD_XSIZE - 2), (LCD_YSIZE - 21));
for (i = 0; i < (YSIZE / 2); i += 20) {
GUI_DrawHLine((LCD_YSIZE - 20) - (YSIZE / 2) + i, 19, (LCD_XSIZE - 2));
if (i) {
GUI_DrawHLine((LCD_YSIZE - 20) - (YSIZE / 2) - i, 19, (LCD_XSIZE - 2));
}
}
for (i = 40; i < (LCD_XSIZE - 20); i += 40) {
GUI_DrawVLine(18 + i, (LCD_YSIZE - 20) - YSIZE, (LCD_YSIZE - 21));
}
GUI_SetColor(COLOR_GRAPH0);
GUI_DrawGraph(pParam->aY, (LCD_XSIZE - 20), 19, (LCD_YSIZE - 20) - YSIZE);
}
示例2: _cbDesktop
/*********************************************************************
*
* _cbDesktop
*
* Purpose:
* This routine handles the drawing of the desktop window.
*/
static void _cbDesktop(WM_MESSAGE * pMsg) {
int i;
switch (pMsg->MsgId) {
case WM_PAINT:
GUI_SetBkColor(GUI_RED);
GUI_Clear();
GUI_SetFont(&GUI_Font24_ASCII);
GUI_DispStringHCenterAt(_aTitle, 160, 5);
GUI_DispNextLine();
GUI_SetFont(GUI_DEFAULT_FONT);
GUI_DispNextLine();
for (i = 0; i < GUI_COUNTOF(_apExplain); i++) {
GUI_DispStringHCenterAt(_apExplain[i], 160, GUI_GetDispPosY());
GUI_DispNextLine();
}
break;
}
}
示例3: _OnPaint
/*********************************************************************
*
* _OnPaint
*/
static void _OnPaint(void) {
int xPos = 0;
GUI_RECT Rect;
GUI_SetBkColor(GUI_GRAY);
GUI_Clear();
WM_GetClientRect(&Rect);
Rect.x1 = HEADER_GetItemWidth(_hHeader, 0);
GUI_SetColor(GUI_RED);
GUI_FillRect(Rect.x0, Rect.y0, Rect.x1, Rect.y1);
Rect.x0 = Rect.x1;
Rect.x1 += HEADER_GetItemWidth(_hHeader, 1);
GUI_SetColor(GUI_GREEN);
GUI_FillRect(Rect.x0, Rect.y0, Rect.x1, Rect.y1);
Rect.x0 = Rect.x1;
Rect.x1 += HEADER_GetItemWidth(_hHeader, 2);
GUI_SetColor(GUI_BLUE);
GUI_FillRect(Rect.x0, Rect.y0, Rect.x1, Rect.y1);
}
示例4: cbBackWin
static WM_RESULT cbBackWin( WM_MESSAGE* pMsg) {
WM_KEY_INFO* pKeyInfo;
switch (pMsg->MsgId) {
case WM_KEY:
pKeyInfo = (WM_KEY_INFO*)pMsg->Data.p;
if (pKeyInfo->PressedCnt == 0) {
GUI_StoreKey(pKeyInfo->Key);
}
break;
case WM_PAINT:
if (WM__BkColor != GUI_INVALID_COLOR) {
GUI_SetBkColor(WM__BkColor);
GUI_Clear();
}
default:
WM_DefaultProc(pMsg);
}
}
示例5: _cbClock
static void _cbClock(WM_MESSAGE *pMsg)
{
int NCode, Id;
//PARAM pParam;
switch (pMsg->MsgId)
{
case WM_PAINT:
GUI_SetBkColor(GUI_WHITE);
GUI_Clear();
GUI_SetColor(GUI_BLACK);
_ShowButton(pMsg->hWin);
GUI_DrawBitmap(&bmwatch, 37, 0);
//GUI_AA_FillPolygon(pParam.aPoint1, GUI_COUNTOF(_aNeedle[0]), MAG * LCD_GetXSize() / 2, MAG * (LCD_GetYSize() / 2));
// GUI_AA_FillPolygon(pParam.aPoint2, GUI_COUNTOF(_aNeedle[1]), MAG * LCD_GetXSize() / 2, MAG * (LCD_GetYSize() / 2));
//GUI_AA_FillPolygon(pParam.aPoint3, GUI_COUNTOF(_aNeedle[2]), MAG * LCD_GetXSize() / 2, MAG * (LCD_GetYSize() / 2));
GUI_FillCircle(160, 120, 3);
break;
case WM_NOTIFY_PARENT:
Id = WM_GetId(pMsg->hWinSrc); /* Id of widget */
NCode = pMsg->Data.v; /* Notification code */
switch (NCode)
{
case WM_NOTIFICATION_CLICKED:
switch (Id)
{
case BUTTON_ID_EXIT:
GUI_SetAppIndex(APP_MainMenu);
GUI_SetAppDirection(MEMDEV_ANIMATION_LEFT);
_MoveShiftWindow(&pMsg->hWin, MEMDEV_ANIMATION_RIGHT, 1, 1);
GUI_SetCancel(APP_Clock);
GUI_ClearHalt();
break;
default:
break;
}
}
break;
default:
WM_DefaultProc(pMsg);
}
}
示例6: _cbWindow2
/*******************************************************************
*
* _cbWindow2
*/
static void _cbWindow2(WM_MESSAGE* pMsg) {
int x, y;
switch (pMsg->MsgId) {
case WM_PAINT:
GUI_SetBkColor(_WindowColor2);
GUI_Clear();
GUI_SetColor(GUI_WHITE);
GUI_SetFont(&GUI_Font24_ASCII);
x = WM_GetWindowSizeX(pMsg->hWin);
y = WM_GetWindowSizeY(pMsg->hWin);
GUI_DispStringHCenterAt("Window 2", x / 2, (y / 4) - 12);
break;
case WM_SIZE:
WM_InvalidateWindow(_hChild);
break;
default:
WM_DefaultProc(pMsg);
}
}
示例7: OUI_DrawGraph
void OUI_DrawGraph(){
GUI_MEMDEV_Select(OUI_MemoryDeviceGrid.DeviceHandle);
GUI_SetBkColor(OUI_GRAPH_BACKGROUND);
GUI_Clear();
GUI_SetColor(OUI_GRAPH_LINES);
for(int i = 0; i <= 180; i += 20){
GUI_DrawLine(0, i, 270, i);
}
for(int i = 0; i <= 270; i += 30){
GUI_DrawLine(i, 0, i, 180);
}
OUI_Components[2]->DrawGraph(OUI_Components[1], 0, 0);
OUI_Components[1]->DrawGraph(OUI_Components[1], 0, 0);
GUI_MEMDEV_CopyToLCDAt(OUI_MemoryDeviceGrid.DeviceHandle,OUI_MemoryDeviceGrid.X,OUI_MemoryDeviceGrid.Y);
GUI_MEMDEV_Clear(OUI_MemoryDeviceGrid.DeviceHandle);
}
示例8: _DemoOrData
/*******************************************************************
*
* _DemoOrData
*/
static void _DemoOrData(void) {
int i;
PARAM Param;
GUI_RECT Rect = {19, (LCD_YSIZE - 20) - YSIZE, (LCD_XSIZE - 2), (LCD_YSIZE - 21)};
GUI_HMEM hMem = GUI_ALLOC_AllocZero(405 * sizeof(I16));
GUI_SetColor(GUI_WHITE);
GUI_SetBkColor(GUI_RED);
GUI_ClearRect(0, 55, LCD_XSIZE, 75);
GUI_SetFont(&GUI_FontComic18B_1);
GUI_DispStringAt("Several waves...", 20 ,55);
Param.aY = GUI_ALLOC_h2p(hMem);
_GetSineData(Param.aY, 405);
GUI_MEMDEV_Draw(&Rect, _Draw, &Param, 0, 0);
for (i = 0; (i < 90); i++) {
_DrawOrData(GUI_GREEN, ++Param.aY);
GUI_Delay(10);
}
GUI_ALLOC_Free(hMem);
}
示例9: _OnPaint_bg
/**
* @brief Paints record button
* @param hObj: button handle
* @retval None
*/
static void _OnPaint_bg(BUTTON_Handle hObj) {
int Index = 0;
GUI_SetBkColor(FRAMEWIN_GetDefaultClientColor());
GUI_Clear();
Index = (WIDGET_GetState(hObj) & BUTTON_STATE_PRESSED) ? 1 : 0;
if (Index)
{
GUI_DrawBitmap(&bmbg, 0, 0);
}
else
{
GUI_DrawBitmap(&bmbg, 0, 0);
}
}
示例10: _OnPaint_camera
/**
* @brief Paints camera button
* @param hObj: button handle
* @retval None
*/
static void _OnPaint_camera(BUTTON_Handle hObj, uint32_t alarm_status, uint32_t camera_status) {
GUI_SetBkColor(FRAMEWIN_GetDefaultClientColor());
GUI_Clear();
GUI_DrawBitmap(&bmcamera, 0, 0);
if(HomeSettings.b.alarm == ALARM_ON)
{
if(HomeSettings.b.camera != CAM_DESACTIVATED)
{
GUI_DrawBitmap(&bmdes_camera, 0, 0);
}
}
else
{
GUI_DrawBitmap(&bmcamera, 0, 0);
}
}
示例11: MainTask
/*********************************************************************
*
* MainTask
*/
void MainTask(void) {
GUI_PID_STATE TouchState;
int xPhys;
int yPhys;
GUI_Init();
GUI_CURSOR_Show();
GUI_CURSOR_Select(&GUI_CursorCrossL);
GUI_SetBkColor(GUI_WHITE);
GUI_SetColor(GUI_BLACK);
GUI_Clear();
GUI_DispString("Measurement of\nA/D converter values");
while (1) {
GUI_TOUCH_GetState(&TouchState); // Get the touch position in pixel
xPhys = GUI_TOUCH_GetxPhys(); // Get the A/D mesurement result in x
yPhys = GUI_TOUCH_GetyPhys(); // Get the A/D mesurement result in y
//
// Display the measurement result
//
GUI_SetColor(GUI_BLUE);
GUI_DispStringAt("Analog input:\n", 0, 20);
GUI_GotoY(GUI_GetDispPosY() + 2);
GUI_DispString("x:");
GUI_DispDec(xPhys, 4);
GUI_DispString(", y:");
GUI_DispDec(yPhys, 4);
//
// Display the according position
//
GUI_SetColor(GUI_RED);
GUI_GotoY(GUI_GetDispPosY() + 4);
GUI_DispString("\nPosition:\n");
GUI_GotoY(GUI_GetDispPosY() + 2);
GUI_DispString("x:");
GUI_DispDec(TouchState.x,4);
GUI_DispString(", y:");
GUI_DispDec(TouchState.y,4);
//
// Wait a while
//
GUI_Delay(100);
};
}
示例12: _cbBkWindow
/*********************************************************************
*
* _cbBkWindow
*/
static void _cbBkWindow(WM_MESSAGE * pMsg) {
int xPos;
int yPos;
xPos = LCD_GetXSize() / 2 - bmSeggerLogoBlue.XSize/2;
yPos = LCD_GetYSize() / 2 - bmSeggerLogoBlue.YSize/2 ;
switch (pMsg->MsgId) {
case WM_PAINT:
GUI_SetBkColor(GUI_BLUE);
GUI_Clear();
GUI_SetColor(GUI_WHITE);
GUI_SetFont(&GUI_Font24_ASCII);
GUI_DispStringHCenterAt("DIALOG_SliderColor - Sample", 160, 5);
GUI_DrawBitmap(&bmSeggerLogoBlue, xPos, yPos );
break;
default:
WM_DefaultProc(pMsg);
}
}
示例13: GetAs12HourClock
/*****************************************************************************
* Function
* DESCRIPTION:
* Redraws or clears the colon.
*****************************************************************************/
bool DataPointTime::RedrawColon()
{
if (mVisible)
{
int x = 0;
int minutes = mTime.GetTime(MINUTES);
char sz_time[10];
if (mFormat == DATETIME_FORMAT_MDY_AMPM)// timeformat using am/pm
{
bool isAm;
int hoursOffset;
GetAs12HourClock(&isAm, &hoursOffset);
sprintf(sz_time, ":%02d %s", minutes, isAm ? "am" : "pm");
}
else
{
sprintf(sz_time, ":%02d", minutes);
}
SelectWindow();
GUI_SetColor(mColour);
GUI_SetBkColor(mBackgroundColour);
GUI_SetFont(GetFont());
x = GetWidth() - GUI_GetStringDistX(sz_time);
if (mShowColon)
{
GUI_DispStringAt(":", x, 2);
mLastColonPosition = x;
}
else if (mLastColonPosition == x)
{
GUI_ClearRect(x, 0, x + 1, GetHeight() - 1);
}
Validate();
}
return true;
}
示例14: _UpdateCmdWin
static void _UpdateCmdWin(void) {
#if GUI_WINSUPPORT && GUIDEMO_LARGE
/* Update info in command window */
WM_HWIN hWin;
GUI_CONTEXT ContextOld;
GUI_SaveContext(&ContextOld);
hWin = WM_SelectWindow(_ahInfoWin[1]);
GUI_SetDefault();
GUI_SetBkColor(GUI_GRAY);
GUI_Clear();
GUI_DispStringAt("Demo ", 0, 0);
GUI_DispDecMin(_iTest + 1);
GUI_DispString(".");
GUI_DispDecMin(_iTestMinor);
GUI_DispString("/");
GUI_DispDecMin(countof(_apfTest));
WM_SelectWindow(hWin);
GUI_RestoreContext(&ContextOld);
#endif
}
示例15: _cbChild
/*******************************************************************
*
* _cbChild
*/
static void _cbChild(WM_MESSAGE* pMsg) {
GUI_RECT Rect;
int x, y;
switch (pMsg->MsgId) {
case WM_PAINT:
WM_GetInsideRect(&Rect);
GUI_SetBkColor(_ChildColor);
GUI_SetColor(_ChildFrame);
GUI_ClearRectEx(&Rect);
GUI_DrawRectEx(&Rect);
GUI_SetColor(GUI_RED);
GUI_SetFont(&GUI_Font24_ASCII);
x = WM_GetWindowSizeX(pMsg->hWin);
y = WM_GetWindowSizeY(pMsg->hWin);
GUI_DispStringHCenterAt("Child window", x / 2, (y / 2) - 12);
break;
default:
WM_DefaultProc(pMsg);
}
}