• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ GUI_SetTextMode函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GUI_SetTextMode函数的典型用法代码示例。如果您正苦于以下问题:C++ GUI_SetTextMode函数的具体用法?C++ GUI_SetTextMode怎么用?C++ GUI_SetTextMode使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GUI_SetTextMode函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: _Paint

/*********************************************************************
*
*       _Paint
*/
static void _Paint(PROGBAR_Handle hObj) {
  PROGBAR_Obj* pObj;
  GUI_RECT r, rInside, rClient, rText;
  const char* pText;
  char ac[5];
  int tm, xPos;
  pObj = PROGBAR_H2P(hObj);
  WM_GetClientRect(&rClient);
  GUI__ReduceRect(&rInside, &rClient, pObj->Widget.pEffect->EffectSize);
  xPos  = _Value2X(pObj, pObj->v);
  pText = _GetText(pObj, ac);
  GUI_SetFont(pObj->pFont);
  _GetTextRect(pObj, &rText, pText);
  tm = GUI_SetTextMode(GUI_TM_TRANS);
  /* Draw left bar */
  r    = rInside;
  r.x1 = xPos - 1;
  WM_SetUserClipArea(&r);
  _DrawPart(pObj, 0, rText.x0, rText.y0, pText);
  /* Draw right bar */
  r    = rInside;
  r.x0 = xPos;
  WM_SetUserClipArea(&r);
  _DrawPart(pObj, 1, rText.x0, rText.y0, pText);
  WM_SetUserClipArea(NULL);
  GUI_SetTextMode(tm);
  WIDGET__EFFECT_DrawDownRect(&pObj->Widget, &rClient);
}
开发者ID:ChunHungLiu,项目名称:ubuntu230os,代码行数:32,代码来源:PROGBAR.c


示例2: _Paint

/*********************************************************************
*
*       _Paint
*/
static void _Paint(PROGBAR_Handle hObj) {
  PROGBAR_Obj* pObj = PROGBAR_H2P(hObj);
  WM_HWIN hWin = hObj;
  int xsize = WM_GetWindowSizeX(hWin);
  int ysize = WM_GetWindowSizeY(hWin);
  int tm;
  GUI_SetFont(pObj->pFont);
  {
    int x1;
    int FontSizeY = GUI_GetFontSizeY();
    int xText = 0;
    int yText = (ysize-FontSizeY)/2;
    GUI_RECT r;
    int XSizeChar;
    char ac[5];   /* Just enough for the percentage */
    char*s = ac;
    const char* pText;
    if (pObj->hpText != WM_HMEM_NULL) {
      pText = (const char*) WM_HMEM2Ptr(pObj->hpText);
    } else {
      GUI_AddDecMin((100*(I32)(pObj->v-pObj->Min))/(pObj->Max-pObj->Min), &s);
      *s = '%';
			*(s+1) =0;
			pText = &ac[0];
		}
/* Calculate text positions */
    XSizeChar = GUI_GetStringDistX(pText);
    x1 = _Value2X(hObj, pObj->v);
    switch (pObj->TextAlign &GUI_TA_HORIZONTAL) {
    case GUI_TA_CENTER:
      xText  = (xsize-XSizeChar)/2;
			break;
    case GUI_TA_LEFT:
      xText  = 0;
			break;
    case GUI_TA_RIGHT:
      xText  = xsize-XSizeChar-1;
			break;
		}
    xText += pObj->XOff;
    yText += pObj->YOff;
    tm = GUI_SetTextMode(GUI_TM_TRANS);
/* Draw left bar */
    r.x0=0; r.x1=x1-1; r.y0=0; r.y1 = GUI_YMAX;
    WM_SetUserClipArea(&r);
    _DrawPart(pObj, 0, xText, yText, pText);
/* Draw right bar */
    r.x0=r.x1+1; r.x1=GUI_XMAX;
    WM_SetUserClipArea(&r);
    _DrawPart(pObj, 1, xText, yText, pText);
  }
  WM_SetUserClipArea(NULL);
  GUI_SetTextMode(tm);
}
开发者ID:stormbay,项目名称:DragonVer1.0,代码行数:58,代码来源:progbar.c


示例3: _Explain

/********************************************************************
*
*       _Explain
*/
static void _Explain(void) {
  int i;
  GUI_SetTextMode(GUI_TM_XOR);
  GUI_SetFont(&GUI_Font16B_ASCII);
  GUI_DispStringHCenterAt("MEMDEV_Printing", 160, 0);
  GUI_GotoXY(0,20);
  GUI_SetFont(&GUI_Font6x8);
  for (i = 0; i < GUI_COUNTOF(_acText); i++) {
    GUI_DispString(_acText[i]);
    GUI_DispNextLine();
  }
  GUI_SetTextMode(GUI_TM_TRANS);
}
开发者ID:caicry,项目名称:uFrame,代码行数:17,代码来源:MEMDEV_Printing.c


示例4: main

int main(void)
{
    //初始化系统时钟 使用外部50M晶振 PLL倍频到100M
    SystemClockSetup(ClockSource_EX50M,CoreClock_100M);
    DelayInit();
    LED_Init(LED_PinLookup_CHK60EVB, kNumOfLED);
    UART_DebugPortInit(UART4_RX_C14_TX_C15, 115200);
    DisplayCPUInfo();
    //初始化GUI
    GUI_Init(&CHGUI_InitStruct1);
    //设置背景色为黑色
    GUI_SetBkColor(BLACK);
    //普通字符显示模式
    GUI_SetTextMode(GUI_TEXTMODE_NORMAL);
    //设置前景色为红色
    GUI_SetColor(LGRAY);
    //将当前字体设置为CourierNew
    GUI_SetFontFormName("FONT_CourierNew");
    //打印字符
    GUI_printf("HelloWorld\r\n");
    //打印CHGUI版本号
    GUI_printf("CHGUI_Version:%0.2f\r\n", (float)(GUI_VERSION/100));
    //打印LCDID
    GUI_printf("ID:%X\r\n", GUI_GetDeivceID());
    while(1)
    {

    }
}
开发者ID:Jaly314,项目名称:CH-K-Lib,代码行数:29,代码来源:main.c


示例5: _Paint

/*********************************************************************
*
*       _Paint
*/
static void _Paint(TEXT_Handle hObj, TEXT_Obj* pObj) {
  const char * s;
  GUI_RECT Rect;
  GUI_USE_PARA(hObj);
  LCD_SetColor(pObj->Props.TextColor);
  GUI_SetFont    (pObj->Props.pFont);
  /* Fill with parents background color */
  #if !TEXT_SUPPORT_TRANSPARENCY   /* Not needed any more, since window is transparent*/
    if (pObj->Props.BkColor == GUI_INVALID_COLOR) {
      LCD_SetBkColor(WIDGET__GetBkColor(hObj));
    } else {
      LCD_SetBkColor(pObj->Props.BkColor);
    }
    GUI_Clear();
  #else
    if (!WM_GetHasTrans(hObj)) {
      LCD_SetBkColor(pObj->Props.BkColor);
      GUI_Clear();
    }
  #endif
  /* Show the text */
  if (pObj->hpText) {
    s = (const char*) GUI_ALLOC_h2p(pObj->hpText);
    GUI_SetTextMode(GUI_TM_TRANS);
    WM_GetClientRect(&Rect);
    GUI_DispStringInRectWrap(s, &Rect, pObj->Align, pObj->Props.WrapMode);
  }
}
开发者ID:Arakula,项目名称:Misa-Kitara-AP,代码行数:32,代码来源:TEXT.c


示例6: _DemoFade

/*******************************************************************
*
*       _DemoFade
*/
static void _DemoFade(void) {
  GUI_MEMDEV_Handle hMem0, hMem1;
  GUI_RECT Rect = {0};
  int x, y, v = 0, vz = 4;
  int xSize, ySize;
  xSize = LCD_GetXSize();
  ySize = LCD_GetYSize();
  hMem0 = GUI_MEMDEV_CreateFixed(0, 0, 138, 65, GUI_MEMDEV_NOTRANS, GUI_MEMDEV_APILIST_32, GUICC_888); /* Contains the text */
  hMem1 = GUI_MEMDEV_CreateFixed(0, 0, 138, 65, GUI_MEMDEV_NOTRANS, GUI_MEMDEV_APILIST_32, GUICC_888); /* Contains the bitmap */
  x = (xSize - _bmSeggerLogoBlue.XSize) / 2;
  y = (ySize - _bmSeggerLogoBlue.YSize) / 3 * 2;
  Rect.x1 = _bmSeggerLogoBlue.XSize - 1;
  Rect.y1 = _bmSeggerLogoBlue.YSize - 1;
  /* Fill memory device with some text */
  GUI_MEMDEV_Select(hMem0);
  GUI_SetColor(GUI_RED);
  GUI_SetFont(&GUI_Font32B_ASCII);
  GUI_SetTextMode(GUI_TM_TRANS);
  GUI_DispStringInRect("Fade in", &Rect, GUI_TA_HCENTER | GUI_TA_VCENTER);
  GUI_DrawRectEx(&Rect);
  /* Fill memory device with bitmap */
  GUI_MEMDEV_Select(hMem1);
  GUI_DrawBitmap(&_bmSeggerLogoBlue, 0, 0);
  /* Set device positions */
  GUI_MEMDEV_SetOrg(hMem0, x, y);
  GUI_MEMDEV_SetOrg(hMem1, x, y);
  GUI_MEMDEV_Select(0);
  /* Fading loop */
  while (1) {
    GUI_MEMDEV_FadeDevices(hMem0, hMem1, 1000);
    GUI_MEMDEV_FadeDevices(hMem1, hMem0, 1000);
  }
}
开发者ID:dadianxukong,项目名称:gps,代码行数:37,代码来源:MEMDEV_FadeIn.c


示例7: MainTask

/*******************************************************************
*
*       MainTask
*/
void MainTask(void) {
  int xPos;
  int yPos;
  int xSize;
  int i;
  
  i = 0;
  GUI_Init();
  //
  // Check if recommended memory for the sample is available
  //
  if (GUI_ALLOC_GetNumFreeBytes() < RECOMMENDED_MEMORY) {
    GUI_ErrorOut("Not enough memory available."); 
    return;
  }
  xPos = LCD_GetXSize() / 2;
  yPos = LCD_GetYSize() / 3;
  GUI_SetTextMode(GUI_TM_REV);
  GUI_SetFont(GUI_FONT_20F_ASCII);
  GUI_DispStringHCenterAt("Hello world!", xPos, yPos);
  GUI_SetFont(GUI_FONT_D24X32);
  xSize = GUI_GetStringDistX("0000");
  xPos -= xSize / 2;
  yPos += 24 + 10;
  while (1) {
    GUI_DispDecAt( i++, xPos, yPos, 4);
    if (i > 9999) {
      i = 0;
    }
  }
}
开发者ID:Trietptm-on-Coding-Algorithms,项目名称:CodeLibrary,代码行数:35,代码来源:BASIC_Hello1.c


示例8: utf16big_config

static void utf16big_config(txtEncodeParser *thiz, ParserConfig *config)
{
	__u16 tmp_chinese;
	config->p_dispstr   = 	thiz->dispstr;

	thiz->fd			=	config->fd;
	thiz->txtLength 	= 	config->len;	
	thiz->viewWidth		=	config->xScrWidth;
//	thiz->viewHeight	=	config->yScrHeight;	
//	thiz->lineofpage	=	config->lineofpage;
//	thiz->FontHeight	=	config->FontHeight;	
	
	thiz->bufferTxtlen	=	0;	
	thiz->start			= 	config->startOffset;
	
	if( thiz->start <= 2 )	
		thiz->bof = EPDK_TRUE;	
	else					
		thiz->bof = EPDK_FALSE;			
	
	thiz->eof			=	EPDK_FALSE;	
	thiz->pFont			=	config->pFont;
	thiz->hlyr			=	config->hlyr;
	
	GUI_LyrWinSel(thiz->hlyr);	
	GUI_SetTextMode(GUI_TM_TRANS);
	GUI_SetFont(thiz->pFont);	
	GUI_SetFontMode(GUI_FONTMODE_8BPP256);
	
	tmp_chinese 		= eLIBs_GB2312_to_Unicode(0xced2);
	thiz->chinese_width	= GUI_GetCharDistX(tmp_chinese);

	
}
开发者ID:silview,项目名称:C100A,代码行数:34,代码来源:utf16_big_parser.c


示例9: 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


示例10: key_s3c

void key_s3c(void)
{
int which_key,i;
while((rPDATG & 0xf0)==0xf0);
which_key=rPDATG&0xf0;
    switch(which_key)
    {
case 0xe0:
   Led_Display(0x1);
   point.y_point-=20;
   if(point.y_point<20)
   point.y_point=200;
   break;
case 0xd0:
   Led_Display(0x2);
   point.x_point-=20;
   if(point.x_point<20)
   point.x_point=200;
   break;
case 0xb0:
   Led_Display(0x4);
   if( map[point.y_map][point.x_map]==0 )
{
change_color();
map[point.y_map][point.x_map]=point.color;
draw_map();

if( if_won(point.y_map,point.x_map,point.color) )
{
GUI_SetTextMode(GUI_DM_TRANS); //设置为透明
GUI_SetFont(&GUI_Font8x16x1x2);
GUI_DispStringAt("win!",250,90);

for(i=0;i<20;i++)
GUI_Delay(1000);
map_initial();

GUI_SetDrawMode(GUI_DM_NORMAL);
GUI_SetColor(GUI_GREEN);
GUI_FillRect(0,0,320,240);
draw_net();
draw_point();
}

}
   break;
case 0x70:
   Led_Display(0x7);
   /*
   point.x_point+=20;
   if(point.x_point>200)
   point.x_point-=20;*/
   break;
default :
   break;
    }
    
    
}
开发者ID:yuekeshuang,项目名称:akaedu-c-learning,代码行数:59,代码来源:k.c


示例11: MYWIDGET_Callback

/*********************************************************************
*
*       MYWIDGET_Callback
*/
void MYWIDGET_Callback(WM_MESSAGE * pMsg) {
    MYWIDGET_Handle   hWin;
    GUI_PID_STATE   * pState;
    MYWIDGET_Obj      MyWidget;
    GUI_RECT          WinRect;
    int               ColorIndex;
    U8                Pressed;

    hWin = pMsg->hWin;
    WM_GetWindowRectEx(hWin, &WinRect);
    GUI_MoveRect(&WinRect, -WinRect.x0, -WinRect.y0);
    WM_GetUserData(hWin, &MyWidget, sizeof(MYWIDGET_Obj));
    switch (pMsg->MsgId) {
    case WM_PAINT:
        if (WM_IsEnabled(hWin)) {
            if (MyWidget.Pressed) {
                ColorIndex = MYWIDGET_CI_PRESSED;
            } else {
                ColorIndex = MYWIDGET_CI_UNPRESSED;
            }
        } else {
            ColorIndex = MYWIDGET_CI_DISABLED;
        }
        GUI_SetColor(MyWidget.aBkColor[ColorIndex]);
        GUI_FillRectEx(&WinRect);
        if (WM_HasFocus(hWin)) {
            GUI_SetColor(MyWidget.FocusColor);
            GUI_DrawRectEx(&WinRect);
        }
        GUI_SetColor(MyWidget.aTextColor[ColorIndex]);
        GUI_SetTextMode(GUI_TM_TRANS);
        GUI_DispStringInRect(MyWidget.pText, &WinRect, GUI_TA_HCENTER | GUI_TA_VCENTER);
        break;
    case WM_TOUCH:
        pState = (GUI_PID_STATE *)pMsg->Data.p;
        if (pState) {
            Pressed = pState->Pressed;
        } else {
            Pressed = 0;
        }
        if (MyWidget.Pressed != Pressed) {
            MyWidget.Pressed = Pressed;
            WM_SetUserData(hWin, &MyWidget, sizeof(MYWIDGET_Obj));
            if (Pressed) {
                WM_SetFocus(hWin);
            }
            WM_InvalidateWindow(hWin);
        }
        break;
    case WM_SET_FOCUS:
        if (pMsg->Data.v) {
            pMsg->Data.v = 0;
        }
        WM_InvalidateWindow(hWin);
        break;
    default:
        WM_DefaultProc(pMsg);
    }
}
开发者ID:hyller,项目名称:GladiatorLibrary,代码行数:63,代码来源:WIDGET_CustomWidgetType.c


示例12: MainTask

/*********************************************************************
*
*       MainTask
*/
void MainTask(void) {
  char acPath[_MAX_PATH];
  char acCpyPath[_MAX_PATH];

  GUI_Init();
  //
  // Set colors and text mode
  //
  GUI_SetBkColor (GUI_WHITE);
  GUI_SetColor   (GUI_BLACK);
  GUI_SetTextMode(GUI_TM_TRANS);
  //
  // Get base path to font data
  //
  if (_GetPathToFontData(acPath) == 0) {
    //
    // Show features
    //
    while (1) {
      //
      // Get the local .\FontData\Standard directory of fonts
      //
      strcpy(acCpyPath, acPath);
      strcat(acCpyPath, "\\FontData\\Standard");
      //
      // Page 1 - iType features
      //
      _IterateOverAllFiles(acCpyPath, "*.*", _PageOne);
      //
      // Page 2 - Linked font
      //
      // Get the local .\FontData\Linked directory of fonts
      //
      strcpy(acCpyPath, acPath);
      strcat(acCpyPath, "\\FontData\\Linked");
      _IterateOverAllFiles(acCpyPath, "*.ltt", _PageTwo);
      //
      // Page 3 - Edge Font
      //
      // Get the local \FontData\Edge directory of fonts
      //
      strcpy(acCpyPath, acPath);
      strcat(acCpyPath, "\\FontData\\Edge");
      _IterateOverAllFiles(acCpyPath, "*.ttc", _PageThree);
      //
      // Page 4 - Dynamic CSM adjustment
      //
      // Get the local \FontData\Edge directory of fonts
      //
      strcpy(acCpyPath, acPath);
      strcat(acCpyPath, "\\FontData\\Edge");
      _IterateOverAllFiles(acCpyPath, "*.ccc", _PageFour);
    }
    GUI_ITYPE_Done();
  }
}
开发者ID:Trietptm-on-Coding-Algorithms,项目名称:CodeLibrary,代码行数:60,代码来源:iTypeBasics.c


示例13: GL_SetDefault

void GL_SetDefault(void) {
  GUI_SetBkColor(GUI_DEFAULT_BKCOLOR);
  GUI_SetColor  (GUI_DEFAULT_COLOR);
  GUI_SetPenSize(1);
  GUI_SetTextAlign(0);
  GUI_SetTextMode(0);
  GUI_SetDrawMode(0);
  GUI_SetFont(GUI_DEFAULT_FONT);
  GUI_SetLineStyle(GUI_LS_SOLID);
}
开发者ID:byxob,项目名称:calendar,代码行数:10,代码来源:GUI_SetDefault.c


示例14: _cbStatus

/**
  * @brief  Callback routine of the status bar
  * @param  pMsg: pointer to a data structure of type WM_MESSAGE
  * @retval None
  */
static void _cbStatus(WM_MESSAGE* pMsg) {
	int xSize, ySize;
	static uint8_t TempStr[50];
	static WM_HTIMER hTimerTime;
	WM_HWIN hWin;

	hWin = pMsg->hWin;
	switch (pMsg->MsgId) {
		case WM_CREATE:
			hTimerTime = WM_CreateTimer(hWin, ID_TIMER_TIME, 1000, 0);
			break;
		case WM_DELETE:
			WM_DeleteTimer(hTimerTime);
			break;
		case WM_TIMER:
			WM_InvalidateWindow(hWin);
			WM_RestartTimer(pMsg->Data.v, 0);
			break;
		case WM_PAINT:
			xSize = WM_GetWindowSizeX(hWin);
			ySize = WM_GetWindowSizeY(hWin);
			/* Draw background */
			GUI_SetColor(0x303030);
			GUI_FillRect(0, 0, xSize, ySize - 3);
			GUI_SetColor(0x808080);
			GUI_DrawHLine(ySize - 2, 0, xSize);
			GUI_SetColor(0x404040);
			GUI_DrawHLine(ySize - 1, 0, xSize);
			GUI_SetTextMode(GUI_TM_TRANS);
			GUI_SetColor(GUI_WHITE);
			GUI_SetFont(GUI_FONT_13B_ASCII);
			/* Serial port*/
			if (pdTRUE == BluetoothReady) {
				GUI_DrawBitmap(&bmICON_BluetoothStatus, xSize - 155, 0);
			}
			if (pdTRUE == GPSReady) {
				GUI_DrawBitmap(&bmICON_GPS_Status, xSize - 125, 0);
			}
			sprintf((char *)TempStr, "CPU : %d %%", FreeRTOS_GetCPUUsage());
			if (75 > FreeRTOS_GetCPUUsage()) {
				GUI_SetColor(GUI_WHITE);
			}
			else {
				GUI_SetColor(GUI_RED);
			}
			GUI_DispStringAt((char *)TempStr, 4, 4);
			GUI_SetColor(GUI_WHITE);
			break;
		default:
			WM_DefaultProc(pMsg);
		break;
	}
}
开发者ID:LucianZala,项目名称:SmartEmbeddedDeviceFW,代码行数:58,代码来源:menu.c


示例15: _OnPaint

/*********************************************************************
*
*       _OnPaint
*/
static void _OnPaint(WM_HMEM hScaleObj, GUI_RECT * pRectInvalid) {
  GRAPH_SCALE_OBJ * pScaleObj;
  pScaleObj = (GRAPH_SCALE_OBJ *)GUI_ALLOC_h2p(hScaleObj);
  GUI_SetFont(pScaleObj->Props.pFont);
  GUI_SetColor(pScaleObj->Props.TextColor);
  GUI_SetTextMode(GUI_TM_TRANS);
  if (pScaleObj->Flags & GRAPH_SCALE_CF_VERTICAL) {
    _OnPaintVert(pScaleObj, pRectInvalid);
  } else {
    _OnPaintHorz(pScaleObj, pRectInvalid);
  }
}
开发者ID:Arakula,项目名称:Misa-Kitara-AP,代码行数:16,代码来源:GRAPH_SCALE.c


示例16: _DemoVScreen

/*********************************************************************
*
*       _DemoVScreen
*/
static void _DemoVScreen(void) {
  GUI_RECT Rect;
  unsigned j;
  int      xSize;
  int      ySize;
  int      n;
  int      aDelay[] = { 20, 5 };

  xSize = LCD_GetXSize();
  ySize = LCD_GetYSize();
  GUI_SetFont(&GUI_FontComic24B_ASCII);
  GUI_SetTextMode(GUI_TM_TRANS);
  Rect.x0 = 0;
  Rect.y0 = 0;
  Rect.x1 = xSize - 1;
  Rect.y1 = ySize - 1;
  GUI_SetColor(GUI_WHITE);
  GUI_DispStringInRect("Default screen", &Rect, GUI_TA_HCENTER | GUI_TA_VCENTER);
  GUI_Delay(250);
  Rect.y0 += ySize;
  Rect.y1 += ySize;
  GUI_DrawGradientV(Rect.x0, Rect.y0, Rect.x1, Rect.y1, 0xFFFFFF, 0x000000);
  Rect.y1 -= ySize / 3;
  GUI_SetColor(GUI_DARKGREEN);
  GUI_DispStringInRect("Here is the virtual screen", &Rect, GUI_TA_HCENTER | GUI_TA_VCENTER);
  n = ySize / 5;
  for (j = 0; j < GUI_COUNTOF(aDelay); j++) {
    if (_Loop(0, 5, n, aDelay[j]) == 1) {
      return;
    }
    GUI_SetOrg(0, ySize);
    GUI_Delay(250);
    if (_Loop(ySize, -5, n, aDelay[j]) == 1) {
      return;
    }
    GUI_SetOrg(0, 0);
    GUI_Delay(250);
    if (GUIDEMO_CheckCancel()) {
      return;
    }
  }
  for (j = 0; j < 5; j++) {
    GUI_SetOrg(0, ySize);
    GUI_Delay(200);
    GUI_SetOrg(0, 0);
    GUI_Delay(200);
    if (GUIDEMO_CheckCancel()) {
      return;
    }
  }
  GUIDEMO_Delay(1000);
}
开发者ID:fzzjoy,项目名称:SimulationTrial,代码行数:56,代码来源:GUIDEMO_VScreen.c


示例17: GUIDEMO_Intro

/*********************************************************************
*
*       GUIDEMO_Intro
*
**********************************************************************
*/
void GUIDEMO_Intro(void) {
  char acVersion[30] = "Version of emWin: ";
  int  xCenter, xSize, ySize;

  xSize   = LCD_GetXSize();
  ySize   = LCD_GetYSize();
  xCenter = xSize >> 1;

  GUIDEMO_DrawBk(0);
	GUI_AA_SetFactor(3);
	GUI_AA_DrawArc(60*3,60*3,50*3,50*3,0,180);
  GUI_SetTextMode(GUI_TM_TRANS);
  //
  // emWin
  //
  GUI_SetColor(GUI_WHITE);
  GUI_SetFont(&GUI_FontRounded22);
  GUI_DispStringHCenterAt("emWin", xCenter, (FACTOR_EMWIN * ySize) >> SCREEN_DIV);
  //
  // emWin description
  //
  GUI_SetFont(&GUI_FontSouvenir18);
  GUI_DispStringHCenterAt("Universal graphic software\nfor embedded applications", xCenter, (FACTOR_DESC * ySize) >> SCREEN_DIV);
  //
  // Any text
  //
  GUI_SetColor(0x2288ff);
  GUI_DispStringHCenterAt("Any CPU - Any Display - Any Application", xCenter, (FACTOR_ANY_COMP * ySize) >> SCREEN_DIV);
  //
  // Compiled
  //
  GUI_SetFont(&GUI_Font10S_ASCII);
  GUI_DispStringHCenterAt("Compiled " __DATE__ " "__TIME__,          xCenter, ((FACTOR_ANY_COMP * ySize) >> SCREEN_DIV) + DIST_ANY_COMP);
  //
  // Version
  //
  GUI_SetColor(GUI_WHITE);
  GUI_SetFont(&GUI_FontSouvenir18);
  strcat(acVersion, GUI_GetVersionString());
  GUI_DispStringHCenterAt(acVersion, xCenter,  (FACTOR_VERSION * ySize) >> SCREEN_DIV);
  //
  // Logo
  //
  GUI_DrawBitmap(&bmSeggerLogo, (xSize - bmSeggerLogo.XSize) >> 1, (FACTOR_LOGO * ySize) >> SCREEN_DIV);
  //
  // www.segger.com
  //
  GUI_SetColor(GUI_WHITE);
  GUI_SetFont(&GUI_FontRounded22);
  GUI_DispStringHCenterAt("www.segger.com", xCenter, (FACTOR_WWW * ySize) >> SCREEN_DIV);
  GUIDEMO_Delay(5000);
}
开发者ID:tongjingyu,项目名称:nxp-os,代码行数:58,代码来源:GUIDEMO_Intro.c


示例18: GUIDEMO_Main

/*********************************************************************
*
*       GUIDEMO_Main
*/
void GUIDEMO_Main(void) {
  FRAMEWIN_SKINFLEX_PROPS Framewin_Props;
#if GUIDEMO_USE_AUTO_BK
  int                     NumFreeBytes;
  int                     BitsPerPixel;
#endif

  GUI_MEMDEV_SetAnimationCallback(_cbEffect, (void *)&_Pressed);
  WM_SetCallback(WM_HBKWIN, _cbBk);
  BUTTON_SetReactOnLevel();
  FRAMEWIN_GetSkinFlexProps(&Framewin_Props, FRAMEWIN_SKINFLEX_PI_ACTIVE);
  Framewin_Props.Radius = 0;
  FRAMEWIN_SetSkinFlexProps(&Framewin_Props, FRAMEWIN_SKINFLEX_PI_ACTIVE);
  FRAMEWIN_GetSkinFlexProps(&Framewin_Props, FRAMEWIN_SKINFLEX_PI_INACTIVE);
  Framewin_Props.Radius = 0;
  FRAMEWIN_SetSkinFlexProps(&Framewin_Props, FRAMEWIN_SKINFLEX_PI_INACTIVE);
  FRAMEWIN_SetDefaultSkin  (_FRAMEWIN_DrawSkinFlex);
  PROGBAR_SetDefaultSkin   (PROGBAR_SKIN_FLEX);
  BUTTON_SetDefaultSkin    (BUTTON_SKIN_FLEX);
  SCROLLBAR_SetDefaultSkin (SCROLLBAR_SKIN_FLEX);
  SLIDER_SetDefaultSkin    (SLIDER_SKIN_FLEX);
  HEADER_SetDefaultSkin    (HEADER_SKIN_FLEX);
  GUI_SetTextMode          (GUI_TM_TRANS);
  GUIDEMO_Config(&_GUIDemoConfig);
  #if GUIDEMO_USE_VNC
    if (GUIDEMO_GetConfFlag(GUIDEMO_CF_USE_VNC)) {
      _GUIDemoConfig.pGUI_VNC_X_StartServer(0, 0);
    }
  #endif
  #if GUIDEMO_USE_AUTO_BK
    //
    // Determine if HW has enough memory to draw the gradient circle as background
    //
    BitsPerPixel = LCD_GetBitsPerPixel();
    if ((BitsPerPixel >= 16) && GUIDEMO_GetConfFlag(GUIDEMO_CF_USE_AUTO_BK)) {
      NumFreeBytes = GUI_ALLOC_GetNumFreeBytes();
      if (NumFreeBytes > NUMBYTES_NEEDED) {
        _pfDrawBk = _DrawBkCircle;
      } else {
        _pfDrawBk = _DrawBk;
      }
    } else
  #endif
    {
      _pfDrawBk = _DrawBkSimple;
    }
  GUIDEMO_SetDrawLogo(1);
  while (1) {
    _Main();
  }
}
开发者ID:PaxInstruments,项目名称:STM32CubeF4,代码行数:55,代码来源:GUIDEMO.c


示例19: mytext

static void mytext(WM_MESSAGE *pMsg)
{
	 int16_t  ID;
	 ID = WM_GetId(pMsg->hWin);
		switch (pMsg->MsgId)
		{
				case WM_PAINT:
									switch (ID)
									{  
											case ID_TEXT_0:
																GUI_SetBkColor(GUI_WHITE);
																GUI_Clear();
																GUI_SetColor(GUI_BLACK);
																GUI_FillRoundedRect(0,0,80,25,5);
																GUI_SetTextMode(GUI_TEXTMODE_TRANS);
																GUI_SetColor(GUI_WHITE);
																GUI_SetFont (&GUI_Font24);
																GUI_DispStringAt("518 横",5,2);
																break;
											
											case ID_TEXT_1:
																GUI_SetBkColor(GUI_WHITE);
																GUI_Clear();
																GUI_SetColor(GUI_BLACK);
																GUI_FillRoundedRect(0,0,83,25,5);
																GUI_SetTextMode(GUI_TEXTMODE_TRANS);
																GUI_SetColor(GUI_WHITE);
																GUI_SetFont (&GUI_Font24);
																GUI_DispStringAt(pCannel,5,2);			
												    break;
									}
				    	break;
				
				default: 
					    TEXT_Callback(pMsg);
				     break;
		}
}
开发者ID:zkan51,项目名称:NEVTEX,代码行数:38,代码来源:mainwin.c


示例20: _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



注:本文中的GUI_SetTextMode函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GUI_TextSelectHelper函数代码示例发布时间:2022-05-30
下一篇:
C++ GUI_SetFont函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap