本文整理汇总了C++中WIDGET_GetState函数的典型用法代码示例。如果您正苦于以下问题:C++ WIDGET_GetState函数的具体用法?C++ WIDGET_GetState怎么用?C++ WIDGET_GetState使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了WIDGET_GetState函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: _OnPaint_start
/**
* @brief Paints record button
* @param hObj: button handle
* @retval None
*/
static void _OnPaint_start(BUTTON_Handle hObj) {
GUI_SetBkColor(FRAMEWIN_GetDefaultClientColor());
GUI_Clear();
if(VNC_GetState() == VNC_IDLE)
{
if ((WIDGET_GetState(hObj) & BUTTON_STATE_PRESSED))
{
GUI_DrawBitmap(&bmvnc_play_pressed, 0, 0);
}
else
{
GUI_DrawBitmap(&vnc_bmplay_unpressed, 0, 0);
}
}
else
{
if ((WIDGET_GetState(hObj) & BUTTON_STATE_PRESSED))
{
GUI_DrawBitmap(&bmstop_pressed, 0, 0);
}
else
{
GUI_DrawBitmap(&bmstop_unpressed, 0, 0);
}
}
}
示例2: _OnPaint_record
/**
* @brief Paints record button
* @param hObj: button handle
* @retval None
*/
static void _OnPaint_record(BUTTON_Handle hObj) {
GUI_SetBkColor(FRAMEWIN_GetDefaultClientColor());
GUI_Clear();
if(RecorderMode == RECORDER_MODE_REC_DISABLED)
{
GUI_DrawBitmap(&bmrecord_disabled, 0, 0);
}
else if(RecorderMode == RECORDER_MODE_PLAYING)
{
GUI_DrawBitmap(&record_bmplay_pressed, 0, 0);
}
else if(RecorderMode == RECORDER_MODE_REC_IDLE)
{
if((WIDGET_GetState(hObj) & BUTTON_STATE_PRESSED))
{
GUI_DrawBitmap(&bmrecord_pressed, 0, 0);
}
else
{
GUI_DrawBitmap(&bmrecord, 0, 0);
}
}
else if(RecorderMode == RECORDER_MODE_PLAY_IDLE)
{
if((WIDGET_GetState(hObj) & BUTTON_STATE_PRESSED))
{
GUI_DrawBitmap(&record_bmplay_pressed, 0, 0);
}
else
{
GUI_DrawBitmap(&record_bmplay, 0, 0);
}
}
else if(RecorderMode == RECORDER_MODE_RECORDING)
{
if((WIDGET_GetState(hObj) & BUTTON_STATE_PRESSED))
{
GUI_DrawBitmap(&bmcancel, 0, 0);
}
else
{
GUI_DrawBitmap(&bmcancel_unpressed, 0, 0);
}
}
}
示例3: _OnPaint_play
/**
* @brief Paints play button
* @param hObj: button handle
* @retval None
*/
static void _OnPaint_play(BUTTON_Handle hObj) {
int Index;
Index = (WIDGET_GetState(hObj) & BUTTON_STATE_PRESSED) ? 1 : 0;
GUI_SetBkColor(FRAMEWIN_GetDefaultClientColor());
GUI_Clear();
if((VideoPlayer_State == VIDEO_IDLE) || (VideoPlayer_State == VIDEO_PAUSE))
{
if(Index)
{
GUI_DrawBitmap(&bmplay_pressed, 0, 0);
}
else
{
GUI_DrawBitmap(&bmplay_not_pressed, 0, 0);
}
}
else
{
if(Index)
{
GUI_DrawBitmap(&bmpause_pressed, 0, 0);
}
else
{
GUI_DrawBitmap(&bmpause_not_pressed, 0, 0);
}
}
}
示例4: _OnPaint
/**
* @brief Paints of the owner drawn button.
* @param hObj: pointer to button handle
* @retval None
*/
static void _OnPaint(BUTTON_Handle hObj) {
int Index;
GUI_RECT Rect;
Index = (WIDGET_GetState(hObj) & BUTTON_STATE_PRESSED) ? 1 : 0;
GUI_SetBkColor(FRAMEWIN_GetDefaultClientColor());
GUI_Clear();
WM_GetClientRect(&Rect);
/* Draw button background */
if(Index)
{
GUI_SetColor(0x40000000 | GUI_GRAY);
}
else
{
GUI_SetColor(0x40000000 | GUI_DARKGRAY);
}
GUI_FillRectEx(&Rect);
/* Draw black shape */
GUI_SetColor(GUI_DARKGRAY);
GUI_DrawRectEx(&Rect);
GUI_DrawBitmap(&bmSTLogo40x20, 0, 0);
}
示例5: _OnPaint_play
/**
* @brief Paints Play button
* @param hObj: button handle
* @retval None
*/
static void _OnPaint_play(BUTTON_Handle hObj) {
int Index;
GUI_SetBkColor(FRAMEWIN_GetDefaultClientColor());
GUI_Clear();
Index = (WIDGET_GetState(hObj) & BUTTON_STATE_PRESSED) ? 1 : 0;
if(Index)
{
if(slideshow_state == ON)
{
GUI_DrawBitmap(&bmpause_pressed, 0, 0);
}
else if(slideshow_state == OFF)
{
GUI_DrawBitmap(&bmplay_pressed, 0, 0);
}
}
else
{
if(slideshow_state == ON)
{
GUI_DrawBitmap(&bmpause_not_pressed, 0, 0);
}
else if(slideshow_state == OFF)
{
GUI_DrawBitmap(&bmplay_not_pressed, 0, 0);
}
}
}
示例6: _OnPaint_pause
/**
* @brief Paints pause button
* @param hObj: button handle
* @retval None
*/
static void _OnPaint_pause(BUTTON_Handle hObj) {
GUI_SetBkColor(FRAMEWIN_GetDefaultClientColor());
GUI_Clear();
if((RecorderMode == RECORDER_MODE_REC_IDLE)||
(RecorderMode == RECORDER_MODE_PLAY_IDLE)||
(RecorderMode == RECORDER_MODE_REC_DISABLED))
{
GUI_DrawBitmapMag(&record_bmpause_des, 0, 0, 2, 2);
}
else
{
if((WIDGET_GetState(hObj) & BUTTON_STATE_PRESSED))
{
GUI_DrawBitmapMag(&record_bmpause_pressed, 0, 0, 2, 2);
}
else
{
if((AUDIO_RECORDER_GetState() == AUDIO_RECORDER_PLAY_PAUSE)||
(AUDIO_RECORDER_GetState() == AUDIO_RECORDER_RECORD_PAUSE))
{
GUI_DrawBitmapMag(&record_bmpause_pressed, 0, 0, 2, 2);
}
else
{
GUI_DrawBitmapMag(&record_bmpause, 0, 0, 2, 2);
}
}
}
}
示例7: _OnPaint
/*********************************************************************
*
* _OnPaint
*
* Purpose: Paints the owner drawn button
*/
static void _OnPaint(BUTTON_Handle hObj) {
int Index;
char ac[50];
GUI_RECT Rect;
Index = (WIDGET_GetState(hObj) & BUTTON_STATE_PRESSED) ? 1 : 0;
WM_GetClientRect(&Rect);
//
// Draw filled ellipse with button background color
//
GUI_SetColor(BUTTON_GetBkColor(hObj, Index));
GUI_FillEllipse(Rect.x1 / 2, Rect.y1 / 2, Rect.x1 / 2, Rect.y1 / 2);
//
// Draw black shape
//
GUI_SetColor(GUI_BLACK);
GUI_DrawEllipse(Rect.x1 / 2, Rect.y1 / 2, Rect.x1 / 2, Rect.y1 / 2);
//
// Draw button text with widget attributes
//
GUI_SetColor(BUTTON_GetTextColor(hObj, Index));
GUI_SetBkColor(BUTTON_GetBkColor(hObj, Index));
GUI_SetFont(BUTTON_GetFont(hObj));
BUTTON_GetText(hObj, ac, sizeof(ac));
if (_Pressed) {
strcpy(ac + strlen(ac), "\npressed");
}
GUI_DispStringInRect(ac, &Rect, GUI_TA_HCENTER | GUI_TA_VCENTER);
}
示例8: _OnPaint_play
/**
* @brief Paints Play button
* @param hObj: button handle
* @retval None
*/
static void _OnPaint_play(BUTTON_Handle hObj) {
int Index;
GUI_SetBkColor(FRAMEWIN_GetDefaultClientColor());
GUI_Clear();
Index = (WIDGET_GetState(hObj) & BUTTON_STATE_PRESSED) ? 1 : 0;
if(Index)
{
if(AUDIOPLAYER_GetState() == AUDIOPLAYER_PLAY)
{
if(PlayerSettings.b.pause == PAUSE_ACTIVE)
{
GUI_DrawBitmap(&bmplay_pressed, 0, 0);
}
else if(PlayerSettings.b.pause == PLAY_ACTIVE)
{
GUI_DrawBitmap(&bmpause_pressed, 0, 0);
}
}
else if(AUDIOPLAYER_GetState() == AUDIOPLAYER_STOP)
{
if(PlayerSettings.b.pause == PLAY_ACTIVE)
{
GUI_DrawBitmap(&bmplay_pressed, 0, 0);
}
else if(PlayerSettings.b.pause == PAUSE_ACTIVE)
{
GUI_DrawBitmap(&bmpause_pressed, 0, 0);
}
}
}
else
{
if(AUDIOPLAYER_GetState() == AUDIOPLAYER_PLAY)
{
if(PlayerSettings.b.pause == PAUSE_ACTIVE)
{
GUI_DrawBitmap(&bmplay_not_pressed, 0, 0);
}
else if(PlayerSettings.b.pause == PLAY_ACTIVE)
{
GUI_DrawBitmap(&bmpause_not_pressed, 0, 0);
}
}
else if(AUDIOPLAYER_GetState() == AUDIOPLAYER_STOP)
{
if(PlayerSettings.b.pause == PLAY_ACTIVE)
{
GUI_DrawBitmap(&bmplay_not_pressed, 0, 0);
}
else if(PlayerSettings.b.pause == PAUSE_ACTIVE)
{
GUI_DrawBitmap(&bmpause_not_pressed, 0, 0);
}
}
}
}
示例9: _OnPaint_fullscreen
/**
* @brief Paints Full Screen button
* @param hObj: button handle
* @retval None
*/
static void _OnPaint_fullscreen(BUTTON_Handle hObj) {
int Index;
GUI_SetBkColor(FRAMEWIN_GetDefaultClientColor());
GUI_Clear();
Index = (WIDGET_GetState(hObj) & BUTTON_STATE_PRESSED) ? 1 : 0;
if(Index)
{
GUI_DrawBitmap(&bmwindowfullscreen, 0, 0);
}
else
{
GUI_DrawBitmap(&bmwindownofullscreen, 0, 0);
}
}
示例10: _OnPaint_close
/**
* @brief Paints Close button
* @param hObj: button handle
* @retval None
*/
static void _OnPaint_close(BUTTON_Handle hObj) {
int Index;
GUI_SetBkColor(FRAMEWIN_GetDefaultClientColor());
GUI_Clear();
Index = (WIDGET_GetState(hObj) & BUTTON_STATE_PRESSED) ? 1 : 0;
if(Index)
{
GUI_DrawBitmap(&bmclose_pressed, 0, 0);
}
else
{
GUI_DrawBitmap(&bmclose_not_pressed, 0, 0);
}
}
示例11: _OnPaint_drowise
/**
* @brief Paints drowise button
* @param hObj: button handle
* @retval None
*/
static void _OnPaint_drowise(BUTTON_Handle hObj) {
int Index;
GUI_SetBkColor(FRAMEWIN_GetDefaultClientColor());
GUI_Clear();
Index = (WIDGET_GetState(hObj) & BUTTON_STATE_PRESSED) ? 1 : 0;
if(Index)
{
GUI_DrawBitmap(&bmdes_water_sub, 0, 0);
}
else
{
GUI_DrawBitmap(&bmwater_sub, 0, 0);
}
}
示例12: _OnPaint_stop
/**
* @brief Paints Stop button
* @param hObj: button handle
* @retval None
*/
static void _OnPaint_stop(BUTTON_Handle hObj) {
GUI_SetBkColor(FRAMEWIN_GetDefaultClientColor());
GUI_Clear();
if((RecorderMode == RECORDER_MODE_REC_IDLE)||
(RecorderMode == RECORDER_MODE_REC_DISABLED))
{
GUI_DrawBitmapMag(&record_bmstop_des, 0, 0, 2, 2);
}
else
{
if((WIDGET_GetState(hObj) & BUTTON_STATE_PRESSED))
{
GUI_DrawBitmapMag(&record_bmstop_pressed, 0, 0, 2, 2);
}
else
{
GUI_DrawBitmapMag(&record_bmstop, 0, 0, 2, 2);
}
}
}
示例13: _OnPaint_exit1
/**
* @brief Paints exit1 button
* @param hObj: button handle
* @retval None
*/
static void _OnPaint_exit1(BUTTON_Handle hObj) {
GUI_SetBkColor(GUI_TRANSPARENT);
GUI_Clear();
if((WIDGET_GetState(hObj) & BUTTON_STATE_PRESSED))
{
GUI_SetColor(GUI_DARKGRAY);
GUI_AA_FillCircle(0, 100, 100);
GUI_SetBkColor(GUI_DARKGRAY);
GUI_SetColor(GUI_WHITE);
}
else
{
GUI_SetColor(GUI_STCOLOR_LIGHTBLUE);
GUI_AA_FillCircle(0, 100, 100);
GUI_SetBkColor(GUI_STCOLOR_LIGHTBLUE);
GUI_SetColor(GUI_WHITE);
}
GUI_SetFont(&GUI_FontLubalGraph32);
GUI_DispStringAt("back", 10, 35);
}
示例14: _OnPaint_okMessage
/**
* @brief Paints ok message button
* @param hObj: button handle
* @retval None
*/
static void _OnPaint_okMessage(BUTTON_Handle hObj) {
GUI_SetBkColor(GUI_WHITE);
GUI_Clear();
if((WIDGET_GetState(hObj) & BUTTON_STATE_PRESSED))
{
GUI_SetColor(GUI_DARKGRAY);
GUI_AA_FillCircle(60, 60, 50);
GUI_SetBkColor(GUI_DARKGRAY);
GUI_SetColor(GUI_WHITE);
}
else
{
GUI_SetColor(GUI_STCOLOR_LIGHTBLUE);
GUI_AA_FillCircle(60, 60, 50);
GUI_SetBkColor(GUI_STCOLOR_LIGHTBLUE);
GUI_SetColor(GUI_WHITE);
}
GUI_SetFont(&GUI_FontLubalGraph24B);
GUI_DispStringAt("OK", 43, 35);
}
示例15: _OnPaint_add2PL
/**
* @brief Paints add to playlist button
* @param hObj: button handle
* @retval None
*/
static void _OnPaint_add2PL(BUTTON_Handle hObj) {
GUI_SetBkColor(GUI_WHITE);
GUI_Clear();
if((WIDGET_GetState(hObj) & BUTTON_STATE_PRESSED))
{
GUI_SetColor(GUI_DARKGRAY);
GUI_AA_FillCircle(56, 60, 60);
GUI_SetBkColor(GUI_DARKGRAY);
GUI_SetColor(GUI_WHITE);
}
else
{
GUI_SetColor(GUI_STCOLOR_LIGHTBLUE);
GUI_AA_FillCircle(56, 60, 60);
GUI_SetBkColor(GUI_STCOLOR_LIGHTBLUE);
GUI_SetColor(GUI_WHITE);
}
GUI_SetFont(&GUI_Font24B_1);
GUI_DispStringAt("Add", 65, 30);
}