亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? radiobutton.c

?? STM32+Grlib
?? C
?? 第 1 頁 / 共 2 頁
字號:
//*****************************************************************************
//
// radiobutton.c - Radio button widget.
//
// Copyright (c) 2008-2010 Texas Instruments Incorporated.  All rights reserved.
// Software License Agreement
// 
// Texas Instruments (TI) is supplying this software for use solely and
// exclusively on TI's microcontroller products. The software is owned by
// TI and/or its suppliers, and is protected under applicable copyright
// laws. You may not combine this software with "viral" open-source
// software in order to form a larger program.
// 
// THIS SOFTWARE IS PROVIDED "AS IS" AND WITH ALL FAULTS.
// NO WARRANTIES, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING, BUT
// NOT LIMITED TO, IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE. TI SHALL NOT, UNDER ANY
// CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR CONSEQUENTIAL
// DAMAGES, FOR ANY REASON WHATSOEVER.
// 
// This is part of revision 5821 of the Stellaris Graphics Library.
//
//*****************************************************************************

#include "driverlib/debug.h"
#include "grlib/grlib.h"
#include "grlib/widget.h"
#include "grlib/radiobutton.h"

//*****************************************************************************
//
//! \addtogroup radiobutton_api
//! @{
//
//*****************************************************************************

//*****************************************************************************
//
//! Draws a radio button widget.
//!
//! \param pWidget is a pointer to the radio button widget to be drawn.
//! \param bClick is a boolean that is \b true if the paint request is a result
//! of a pointer click and \b false if not.
//!
//! This function draws a radio button widget on the display.  This is called
//! in response to a \b #WIDGET_MSG_PAINT message.
//!
//! \return None.
//
//*****************************************************************************
static void
RadioButtonPaint(tWidget *pWidget, unsigned long bClick)
{
    tRadioButtonWidget *pRadio;
    tContext sCtx;
    long lX, lY;

    //
    // Check the arguments.
    //
    ASSERT(pWidget);

    //
    // Convert the generic widget pointer into a radio button widget pointer.
    //
    pRadio = (tRadioButtonWidget *)pWidget;

    //
    // Initialize a drawing context.
    //
    GrContextInit(&sCtx, pWidget->pDisplay);

    //
    // Initialize the clipping region based on the extents of this radio
    // button.
    //
    GrContextClipRegionSet(&sCtx, &(pWidget->sPosition));

    //
    // See if the radio button fill style is selected.
    //
    if((pRadio->usStyle & RB_STYLE_FILL) && !bClick)
    {
        //
        // Fill the radio button with the fill color.
        //
        GrContextForegroundSet(&sCtx, pRadio->ulFillColor);
        GrRectFill(&sCtx, &(pWidget->sPosition));
    }

    //
    // See if the radio button outline style is selected.
    //
    if((pRadio->usStyle & RB_STYLE_OUTLINE) && !bClick)
    {
        //
        // Outline the radio button with the outline color.
        //
        GrContextForegroundSet(&sCtx, pRadio->ulOutlineColor);
        GrRectDraw(&sCtx, &(pWidget->sPosition));
    }

    //
    // Draw the radio button.
    //
    lX = pWidget->sPosition.sXMin + (pRadio->usCircleSize / 2) + 2;
    lY = (pWidget->sPosition.sYMin +
          ((pWidget->sPosition.sYMax - pWidget->sPosition.sYMin) / 2));
    if(!bClick)
    {
        GrContextForegroundSet(&sCtx, pRadio->ulOutlineColor);
        GrCircleDraw(&sCtx, lX, lY, pRadio->usCircleSize / 2);
    }

    //
    // Select the foreground color based on whether or not the radio button is
    // selected.
    //
    if(pRadio->usStyle & RB_STYLE_SELECTED)
    {
        GrContextForegroundSet(&sCtx, pRadio->ulOutlineColor);
    }
    else
    {
        GrContextForegroundSet(&sCtx, pRadio->ulFillColor);
    }

    //
    // Fill in the radio button.
    //
    GrCircleFill(&sCtx, lX, lY, (pRadio->usCircleSize / 2) - 2);

    //
    // See if the radio button text or image style is selected.
    //
    if((pRadio->usStyle & (RB_STYLE_TEXT | RB_STYLE_IMG)) && !bClick)
    {
        //
        // Shrink the clipping region by the size of the radio button so that
        // it is not overwritten by further "decorative" portions of the
        // widget.
        //
        sCtx.sClipRegion.sXMin += pRadio->usCircleSize + 4;

        //
        // If the radio button outline style is selected then shrink the
        // clipping region by one pixel on each side so that the outline is not
        // overwritten by the text or image.
        //
        if(pRadio->usStyle & RB_STYLE_OUTLINE)
        {
            sCtx.sClipRegion.sYMin++;
            sCtx.sClipRegion.sXMax--;
            sCtx.sClipRegion.sYMax--;
        }

        //
        // See if the radio button image style is selected.
        //
        if(pRadio->usStyle & RB_STYLE_IMG)
        {
            //
            // Determine where along the Y extent of the widget to draw the
            // image.  It is drawn at the top if it takes all (or more than
            // all) of the Y extent of the widget, and it is drawn centered if
            // it takes less than the Y extent.
            //
            if(GrImageHeightGet(pRadio->pucImage) >
               (sCtx.sClipRegion.sYMax - sCtx.sClipRegion.sYMin))
            {
                lY = sCtx.sClipRegion.sYMin;
            }
            else
            {
                lY = (sCtx.sClipRegion.sYMin +
                      ((sCtx.sClipRegion.sYMax - sCtx.sClipRegion.sYMin -
                        GrImageHeightGet(pRadio->pucImage) + 1) / 2));
            }

            //
            // Set the foreground and background colors to use for 1 BPP
            // images.
            //
            GrContextForegroundSet(&sCtx, pRadio->ulTextColor);
            GrContextBackgroundSet(&sCtx, pRadio->ulFillColor);

            //
            // Draw the image next to the radio button.
            //
            GrImageDraw(&sCtx, pRadio->pucImage, sCtx.sClipRegion.sXMin, lY);
        }

        //
        // See if the radio button text style is selected.
        //
        if(pRadio->usStyle & RB_STYLE_TEXT)
        {
            //
            // Determine where along the Y extent of the widget to draw the
            // string.  It is drawn at the top if it takes all (or more than
            // all) of the Y extent of the widget, and it is drawn centered if
            // it takes less than the Y extent.
            //
            if(GrFontHeightGet(pRadio->pFont) >
               (sCtx.sClipRegion.sYMax - sCtx.sClipRegion.sYMin))
            {
                lY = sCtx.sClipRegion.sYMin;
            }
            else
            {
                lY = (sCtx.sClipRegion.sYMin +
                      ((sCtx.sClipRegion.sYMax - sCtx.sClipRegion.sYMin -
                        GrFontHeightGet(pRadio->pFont) + 1) / 2));
            }

            //
            // Draw the text next to the radio button.
            //
            GrContextFontSet(&sCtx, pRadio->pFont);
            GrContextForegroundSet(&sCtx, pRadio->ulTextColor);
            GrContextBackgroundSet(&sCtx, pRadio->ulFillColor);
            GrStringDraw(&sCtx, pRadio->pcText, -1, sCtx.sClipRegion.sXMin, lY,
                         pRadio->usStyle & RB_STYLE_TEXT_OPAQUE);
        }
    }
}

//*****************************************************************************
//
//! Handles pointer events for a radio button.
//!
//! \param pWidget is a pointer to the radio button widget.
//! \param ulMsg is the pointer event message.
//! \param lX is the X coordinate of the pointer event.
//! \param lY is the Y coordiante of the pointer event.
//!
//! This function processes pointer event messages for a radio button.  This is
//! called in response to a \b #WIDGET_MSG_PTR_DOWN, \b #WIDGET_MSG_PTR_MOVE,
//! and \b #WIDGET_MSG_PTR_UP messages.
//!
//! If the \b #WIDGET_MSG_PTR_UP message is received with a position within the
//! extents of the radio button, the radio button's selected state will be
//! unchanged if it is already selected.  If it is not selected, it will be
//! selected, its OnChange function will be called, and the peer radio button
//! widget that is selected will be unselected, causing its OnChange to be
//! called as well.
//!
//! \return Returns 1 if the coordinates are within the extents of the radio
//! button and 0 otherwise.
//
//*****************************************************************************
static long
RadioButtonClick(tWidget *pWidget, unsigned long ulMsg, long lX, long lY)
{
    tRadioButtonWidget *pRadio, *pRadio2;
    tWidget *pSibling;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
高清在线不卡av| 亚洲色图欧美在线| 久久精品999| 欧美大白屁股肥臀xxxxxx| 九九国产精品视频| 欧美精品一区二区三区蜜桃视频| 国产一区视频在线看| 国产三级三级三级精品8ⅰ区| 国产成人午夜电影网| 亚洲欧洲韩国日本视频| 色偷偷一区二区三区| 五月天国产精品| 精品久久久久香蕉网| 成人黄色免费短视频| 午夜精品影院在线观看| 精品久久五月天| 99久久国产综合精品女不卡| 亚洲综合成人在线| 91精品国产综合久久婷婷香蕉| 国产在线精品视频| 亚洲一区二区成人在线观看| 日韩一区二区麻豆国产| 国产成人丝袜美腿| 亚洲国产一区在线观看| 精品播放一区二区| 色老汉av一区二区三区| 免费观看成人鲁鲁鲁鲁鲁视频| 国产日韩成人精品| 欧美丰满美乳xxx高潮www| 国产伦精一区二区三区| 亚洲综合在线电影| 久久影院视频免费| 欧美无砖专区一中文字| 国产高清精品久久久久| 亚洲国产综合在线| 国产精品卡一卡二卡三| 欧美精品在线观看播放| 成人精品视频一区二区三区尤物| 婷婷综合在线观看| 国产精品天干天干在线综合| 69堂亚洲精品首页| 色综合久久中文综合久久97| 精品一区二区三区不卡| 亚洲一级二级三级在线免费观看| 久久免费精品国产久精品久久久久| 91视频一区二区| 激情成人午夜视频| 亚洲成人一区二区在线观看| 国产精品久久久久久亚洲毛片 | 欧美在线观看视频一区二区三区 | 国产无一区二区| 欧美日韩免费在线视频| eeuss鲁一区二区三区| 久久精工是国产品牌吗| 亚洲成人黄色影院| 亚洲欧美激情视频在线观看一区二区三区 | 在线播放中文字幕一区| 色综合欧美在线| 成人听书哪个软件好| 国产精品综合av一区二区国产馆| 日本va欧美va欧美va精品| 亚洲午夜私人影院| 亚洲精品视频免费观看| 国产精品久99| 欧美国产日韩精品免费观看| 久久综合九色综合欧美就去吻| 91精品国产美女浴室洗澡无遮挡| 在线观看欧美日本| 91精品1区2区| 色狠狠av一区二区三区| 91在线精品一区二区| 成人精品电影在线观看| 成人美女视频在线看| 成人性生交大片免费看中文| 粉嫩av一区二区三区| 国产福利一区二区| 成人免费视频caoporn| 成人激情电影免费在线观看| 丁香天五香天堂综合| 不卡区在线中文字幕| www.激情成人| 91免费版在线看| 在线免费观看日本一区| 欧美三级资源在线| 欧美一区二区三区在线视频| 日韩精品一区在线| 久久久久久电影| 国产精品美女久久久久高潮| 中文字幕日韩欧美一区二区三区| 亚洲欧美一区二区在线观看| 亚洲精品乱码久久久久久黑人| 亚洲高清在线精品| 久久精品72免费观看| 国产成人综合网站| 色综合咪咪久久| 欧美日韩国产免费一区二区| 日韩免费在线观看| 国产日韩v精品一区二区| 亚洲视频免费看| 亚洲一区二区中文在线| 蜜臀精品一区二区三区在线观看| 国产一区91精品张津瑜| 97精品久久久午夜一区二区三区| 欧美午夜寂寞影院| 26uuu国产电影一区二区| 国产精品久久久久一区二区三区| 夜夜精品浪潮av一区二区三区| 秋霞av亚洲一区二区三| 国产盗摄一区二区| 在线观看av一区二区| 欧美刺激午夜性久久久久久久| 国产精品成人在线观看| 亚洲1区2区3区4区| 懂色av中文字幕一区二区三区 | 国产精品18久久久久久vr| 91亚洲精华国产精华精华液| 777a∨成人精品桃花网| 国产精品毛片久久久久久| 午夜电影网一区| 国产**成人网毛片九色| 7777精品伊人久久久大香线蕉完整版| 国产亚洲精品7777| 亚洲成人自拍一区| av一区二区三区四区| 日韩欧美中文字幕公布| 亚洲免费伊人电影| 国产成人免费在线| 欧美精选一区二区| 亚洲欧洲精品成人久久奇米网| 麻豆91精品视频| 欧美系列在线观看| 亚洲视频一二三区| 国产成人综合亚洲网站| 欧美一区二区三区视频在线| 亚洲欧美国产三级| 国产精品亚洲成人| 日韩欧美一二区| 亚洲图片欧美综合| 色悠久久久久综合欧美99| 久久久国产一区二区三区四区小说 | 91精品国产色综合久久不卡蜜臀| 亚洲视频香蕉人妖| 成人免费视频caoporn| 久久久精品人体av艺术| 日本视频中文字幕一区二区三区| av网站免费线看精品| 国产亚洲欧美中文| 国产一区二区三区四区五区美女| 欧美一区二区三区系列电影| 亚洲成人免费视| 在线观看成人免费视频| 亚洲人妖av一区二区| 国产成人一级电影| 国产日产欧美精品一区二区三区| 久久国产精品露脸对白| 欧美一区二区福利在线| 日韩在线观看一区二区| 精品视频免费在线| 亚洲图片欧美色图| 欧美性色aⅴ视频一区日韩精品| 一区在线中文字幕| 99视频精品全部免费在线| 亚洲国产成人在线| 国产91高潮流白浆在线麻豆 | 欧美日韩一区中文字幕| 亚洲国产一区二区三区 | 日本韩国欧美一区| 亚洲人成网站精品片在线观看| 99精品视频中文字幕| 国产精品久久久久7777按摩| 成人国产精品免费网站| 国产精品美女久久久久久久久久久| 风间由美性色一区二区三区| 一区在线播放视频| 欧美性videosxxxxx| 日韩中文字幕不卡| 日韩精品一区二区三区蜜臀| 狠狠色丁香久久婷婷综| 欧美精品一区二区在线观看| 国产精品18久久久久久久久 | 玖玖九九国产精品| www久久精品| 国产ts人妖一区二区| 亚洲国产高清aⅴ视频| 91免费国产在线观看| 亚洲午夜激情av| 欧美va在线播放| 国产91富婆露脸刺激对白| 亚洲色图都市小说| 欧美久久久影院| 国产精品一级黄| 亚洲精品欧美在线| 3d成人动漫网站| 国产乱人伦偷精品视频免下载 | 日本不卡视频在线| 精品国产乱码91久久久久久网站| 国产福利精品导航| 亚洲影视资源网| 精品女同一区二区| 97国产一区二区|