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

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

?? slider.c

?? STM32+Grlib
?? C
?? 第 1 頁 / 共 2 頁
字號:
        sValueRect.sXMax = pWidget->sPosition.sXMax;
        sValueRect.sYMin = sPos;
        sValueRect.sYMax = pWidget->sPosition.sYMax;

        //
        // Determine the rectangle corresponding to the top (empty) portion
        // of the slider.
        //
        sEmptyRect.sXMin = pWidget->sPosition.sXMin;
        sEmptyRect.sXMax = pWidget->sPosition.sXMax;
        sEmptyRect.sYMin = pWidget->sPosition.sYMin;
        sEmptyRect.sYMax = max(sEmptyRect.sYMin, sValueRect.sYMin - 1);
    }
    else
    {
        //
        // Determine the rectangle corresponding to the bottom (value) portion
        // of the slider.
        //
        sValueRect.sYMin = pWidget->sPosition.sYMin;
        sValueRect.sYMax = pWidget->sPosition.sYMax;
        sValueRect.sXMin = pWidget->sPosition.sXMin;
        sValueRect.sXMax = sPos;

        //
        // Determine the rectangle corresponding to the top (empty) portion
        // of the slider.
        //
        sEmptyRect.sYMin = pWidget->sPosition.sYMin;
        sEmptyRect.sYMax = pWidget->sPosition.sYMax;
        sEmptyRect.sXMax = pWidget->sPosition.sXMax;
        sEmptyRect.sXMin = min(sEmptyRect.sXMax, sValueRect.sXMax + 1);
    }

    //
    // Compute the center of the slider.  This will be needed later if drawing
    // text or an image.
    //
    lX = (pWidget->sPosition.sXMin +
          ((pWidget->sPosition.sXMax - pWidget->sPosition.sXMin + 1) / 2));
    lY = (pWidget->sPosition.sYMin +
          ((pWidget->sPosition.sYMax - pWidget->sPosition.sYMin + 1) / 2));

    //
    // Get the required clipping rectangle for the active/value part of
    // the slider.
    //
    bIntersect = GrRectIntersectGet(&sClipRect, &sValueRect, &sActiveClip);

    //
    // Does any part of the value rectangle intersect with the region we are
    // supposed to be redrawing?
    //
    if(bIntersect)
    {
        //
        // Yes - we have something to draw.
        //

        //
        // Set the new clipping rectangle.
        //
        GrContextClipRegionSet(&sCtx, &sActiveClip);

        //
        // Do we need to fill the active area with a color?
        //
        if(pSlider->ulStyle & SL_STYLE_FILL)
        {
            GrContextForegroundSet(&sCtx, pSlider->ulFillColor);
            GrRectFill(&sCtx, &sValueRect);
        }

        //
        // Do we need to draw an image in the active area?
        //
        if(pSlider->ulStyle & SL_STYLE_IMG)
        {
            GrContextForegroundSet(&sCtx, pSlider->ulTextColor);
            GrContextBackgroundSet(&sCtx, pSlider->ulFillColor);
            GrImageDraw(&sCtx, pSlider->pucImage,
                        lX - (GrImageWidthGet(pSlider->pucImage) / 2),
                        lY - (GrImageHeightGet(pSlider->pucImage) / 2));
        }

        //
        // Do we need to render a text string over the top of the active area?
        //
        if(pSlider->ulStyle & SL_STYLE_TEXT)
        {
            GrContextFontSet(&sCtx, pSlider->pFont);
            GrContextForegroundSet(&sCtx, pSlider->ulTextColor);
            GrContextBackgroundSet(&sCtx, pSlider->ulFillColor);
            GrStringDrawCentered(&sCtx, pSlider->pcText, -1, lX, lY,
                                 pSlider->ulStyle & SL_STYLE_TEXT_OPAQUE);
        }
    }

    //
    // Now get the required clipping rectangle for the background portion of
    // the slider.
    //
    bIntersect = GrRectIntersectGet(&sClipRect, &sEmptyRect, &sActiveClip);

    //
    // Does any part of the background rectangle intersect with the region we
    // are supposed to be redrawing?
    //
    if(bIntersect)
    {
        //
        // Yes - we have something to draw.
        //

        //
        // Set the new clipping rectangle.
        //
        GrContextClipRegionSet(&sCtx, &sActiveClip);

        //
        // Do we need to fill the active area with a color?
        //
        if(pSlider->ulStyle & SL_STYLE_BACKG_FILL)
        {
            GrContextForegroundSet(&sCtx, pSlider->ulBackgroundFillColor);
            GrRectFill(&sCtx, &sEmptyRect);
        }

        //
        // Do we need to draw an image in the active area?
        //
        if(pSlider->ulStyle & SL_STYLE_BACKG_IMG)
        {
            GrContextForegroundSet(&sCtx, pSlider->ulBackgroundTextColor);
            GrContextBackgroundSet(&sCtx, pSlider->ulBackgroundFillColor);
            GrImageDraw(&sCtx, pSlider->pucBackgroundImage,
                    lX - (GrImageWidthGet(pSlider->pucBackgroundImage) / 2),
                    lY - (GrImageHeightGet(pSlider->pucBackgroundImage) / 2));
        }

        //
        // Do we need to render a text string over the top of the active area?
        //
        if(pSlider->ulStyle & SL_STYLE_BACKG_TEXT)
        {
            GrContextFontSet(&sCtx, pSlider->pFont);
            GrContextForegroundSet(&sCtx, pSlider->ulBackgroundTextColor);
            GrContextBackgroundSet(&sCtx, pSlider->ulBackgroundFillColor);
            GrStringDrawCentered(&sCtx, pSlider->pcText, -1, lX, lY,
                                 pSlider->ulStyle & SL_STYLE_BACKG_TEXT_OPAQUE);
        }
    }
}

//*****************************************************************************
//
//! Handles pointer events for slider.
//!
//! \param pWidget is a pointer to the slider widget.
//! \param ulMsg is the pointer event message.
//! \param lX is the X coordinate of the pointer event.
//! \param lY is the Y coordinate of the pointer event.
//!
//! This function processes pointer event messages for a slider.  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 message is \b #WIDGET_MSG_PTR_MOVE or is \b #WIDGET_MSG_PTR_DOWN and
//! the coordinates are within the bounds of the slider, the slider value is
//! updated and, if changed, the slider's OnChange callback function is called.
//!
//! \return Returns 1 if the message was consumed by the slider and 0
//! otherwise.
//
//*****************************************************************************
static long
SliderClick(tWidget *pWidget, unsigned long ulMsg, long lX, long lY)
{
    tSliderWidget *pSlider;
    tRectangle sRedrawRect;
    short sPos;
    long lNewVal;

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

    //
    // Convert the generic widget pointer into a slider widget pointer.
    //
    pSlider = (tSliderWidget *)pWidget;

    //
    // If the slider is locked, ignore all pointer messages.
    //
    if(pSlider->ulStyle & SL_STYLE_LOCKED)
    {
        return(0);
    }

    //
    // See if the given coordinates are within the extents of the slider.
    //
    if((ulMsg == WIDGET_MSG_PTR_MOVE) ||
       ((ulMsg == WIDGET_MSG_PTR_DOWN) &&
        (lX >= pWidget->sPosition.sXMin) &&
        (lX <= pWidget->sPosition.sXMax) &&
        (lY >= pWidget->sPosition.sYMin) &&
        (lY <= pWidget->sPosition.sYMax)))
    {
        //
        // Map the pointer position to a slider value.
        //
        lNewVal = SliderPositionToValue(pSlider,
                             (pSlider->ulStyle & SL_STYLE_VERTICAL) ? lY : lX);

        //
        // Convert back to ensure that the dirty rectangle we calculate here
        // uses the same values as will be used when the widget is next
        // painted.
        //
        sPos = SliderValueToPosition(pSlider, lNewVal);

        //
        // Did the value change?
        //
        if(lNewVal != pSlider->lValue)
        {
            //
            // Yes - the value changed so report it to the app and redraw the
            // slider.
            //
            if(pSlider->pfnOnChange)
            {
                (pSlider->pfnOnChange)(pWidget, lNewVal);
            }

            //
            // Determine the rectangle that we need to redraw to update the
            // slider to the new position.
            //
            if(pSlider->ulStyle & SL_STYLE_VERTICAL)
            {
                //
                // Vertical slider case.
                //
                sRedrawRect.sYMin = min(pSlider->sPos, sPos);
                sRedrawRect.sYMax = max(pSlider->sPos, sPos);
                sRedrawRect.sXMin = pWidget->sPosition.sXMin;
                sRedrawRect.sXMax = pWidget->sPosition.sXMax;
            }
            else
            {
                //
                // Horizontal slider case.
                //
                sRedrawRect.sXMin = min(pSlider->sPos, sPos);
                sRedrawRect.sXMax = max(pSlider->sPos, sPos);
                sRedrawRect.sYMin = pWidget->sPosition.sYMin;
                sRedrawRect.sYMax = pWidget->sPosition.sYMax;
            }

            //
            // Update the widget value and position.
            //
            pSlider->lValue = lNewVal;
            pSlider->sPos = sPos;

            //
            // Redraw the area of the control that has changed.
            //
            SliderPaint(pWidget, &sRedrawRect);
        }

        //
        // These coordinates are within the extents of the slider widget.
        //
        return(1);
    }

    //
    // These coordinates are not within the extents of the slider widget.
    //
    return(0);
}

//*****************************************************************************
//
//! Handles messages for a slider widget.
//!
//! \param pWidget is a pointer to the slider widget.
//! \param ulMsg is the message.
//! \param ulParam1 is the first parameter to the message.
//! \param ulParam2 is the second parameter to the message.
//!
//! This function receives messages intended for this slider widget and
//! processes them accordingly.  The processing of the message varies based on
//! the message in question.
//!
//! Unrecognized messages are handled by calling WidgetDefaultMsgProc().
//!
//! \return Returns a value appropriate to the supplied message.
//
//*****************************************************************************
long
SliderMsgProc(tWidget *pWidget, unsigned long ulMsg,
                         unsigned long ulParam1, unsigned long ulParam2)
{
    //
    // Check the arguments.
    //
    ASSERT(pWidget);

    //
    // Determine which message is being sent.
    //
    switch(ulMsg)
    {
        //
        // The widget paint request has been sent.
        //
        case WIDGET_MSG_PAINT:
        {
            //
            // Handle the widget paint request.
            //
            SliderPaint(pWidget, &(pWidget->sPosition));

            //
            // Return one to indicate that the message was successfully
            // processed.
            //
            return(1);
        }

        //
        // One of the pointer requests has been sent.
        //
        case WIDGET_MSG_PTR_DOWN:
        case WIDGET_MSG_PTR_MOVE:
        case WIDGET_MSG_PTR_UP:
        {
            //
            // Handle the pointer request, returning the appropriate value.
            //
            return(SliderClick(pWidget, ulMsg, ulParam1, ulParam2));
        }

        //
        // An unknown request has been sent.
        //
        default:
        {
            //
            // Let the default message handler process this message.
            //
            return(WidgetDefaultMsgProc(pWidget, ulMsg, ulParam1, ulParam2));
        }
    }
}

//*****************************************************************************
//
//! Initializes a slider widget.
//!
//! \param pWidget is a pointer to the slider widget to initialize.
//! \param pDisplay is a pointer to the display on which to draw the slider.
//! \param lX is the X coordinate of the upper left corner of the slider.
//! \param lY is the Y coordinate of the upper left corner of the slider.
//! \param lWidth is the width of the slider.
//! \param lHeight is the height of the slider.
//!
//! This function initializes the provided slider widget.
//!
//! \return None.
//
//*****************************************************************************
void
SliderInit(tSliderWidget *pWidget, const tDisplay *pDisplay, long lX, long lY,
           long lWidth, long lHeight)
{
    unsigned long ulIdx;

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

    //
    // Clear out the widget structure.
    //
    for(ulIdx = 0; ulIdx < sizeof(tSliderWidget); ulIdx += 4)
    {
        ((unsigned long *)pWidget)[ulIdx / 4] = 0;
    }

    //
    // Set the size of the slider widget structure.
    //
    pWidget->sBase.lSize = sizeof(tSliderWidget);

    //
    // Mark this widget as fully disconnected.
    //
    pWidget->sBase.pParent = 0;
    pWidget->sBase.pNext = 0;
    pWidget->sBase.pChild = 0;

    //
    // Save the display pointer.
    //
    pWidget->sBase.pDisplay = pDisplay;

    //
    // Set the extents of this slider.
    //
    pWidget->sBase.sPosition.sXMin = lX;
    pWidget->sBase.sPosition.sYMin = lY;
    pWidget->sBase.sPosition.sXMax = lX + lWidth - 1;
    pWidget->sBase.sPosition.sYMax = lY + lHeight - 1;

    //
    // Use the slider message handler to process messages to this widget.
    //
    pWidget->sBase.pfnMsgProc = SliderMsgProc;
}

//*****************************************************************************
//
// Close the Doxygen group.
//! @}
//
//*****************************************************************************

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91精品婷婷国产综合久久性色| 国产精品18久久久久久久网站| 在线日韩一区二区| 一区二区在线观看免费视频播放 | 天天亚洲美女在线视频| 7777精品伊人久久久大香线蕉超级流畅 | 日韩欧美一级在线播放| 美女视频第一区二区三区免费观看网站| 欧美精品久久99久久在免费线 | 大白屁股一区二区视频| 中文字幕成人在线观看| 色婷婷久久一区二区三区麻豆| 亚洲最新视频在线观看| 69久久99精品久久久久婷婷| 极品少妇一区二区三区精品视频 | 国产一区二区三区精品欧美日韩一区二区三区| 日韩欧美精品在线视频| 国产mv日韩mv欧美| 亚洲精品日韩一| 日韩精品一区二区三区swag| 成人美女视频在线看| 亚洲午夜久久久久| 日韩精品在线一区| 91在线观看美女| 青青草成人在线观看| 国产女同互慰高潮91漫画| 91福利精品视频| 国内精品国产成人| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 欧美吞精做爰啪啪高潮| 国产精品自拍三区| 亚洲午夜免费视频| 欧美大片一区二区三区| 色婷婷久久一区二区三区麻豆| 毛片不卡一区二区| 亚洲视频一二区| 欧美成人bangbros| 欧洲人成人精品| 成人免费毛片片v| 美女尤物国产一区| 亚洲综合精品久久| 国产欧美一区二区精品秋霞影院| 欧美日韩电影在线播放| 99久久精品国产毛片| 六月婷婷色综合| 亚洲第一激情av| 亚洲欧洲av另类| 久久人人超碰精品| 日韩一区二区三区四区 | 日本一区中文字幕| 综合网在线视频| 久久精品视频一区| 蜜臂av日日欢夜夜爽一区| 中文字幕亚洲成人| 666欧美在线视频| 成人av在线观| 国产在线观看免费一区| 久久久www免费人成精品| 欧美一区二区三区视频免费| 首页综合国产亚洲丝袜| 中文字幕一区日韩精品欧美| 久久精品一区四区| 欧美成人video| 99久久国产免费看| 成人一级视频在线观看| 91麻豆精东视频| 7777精品伊人久久久大香线蕉经典版下载 | 久久免费国产精品| 中文字幕在线一区免费| 亚洲综合色视频| 美女视频免费一区| 成人91在线观看| 欧美日韩国产不卡| 国产欧美综合在线| 亚洲福利一二三区| 国产一区二区三区免费在线观看| 成人精品视频一区二区三区| 欧美色窝79yyyycom| 精品欧美乱码久久久久久| 中文字幕视频一区二区三区久| 亚洲成精国产精品女| 国产精品综合网| 欧美日韩久久一区二区| 久久精品亚洲国产奇米99| 亚洲黄色免费电影| 国产精品一二三区在线| 91成人在线观看喷潮| 精品欧美乱码久久久久久1区2区| 亚洲麻豆国产自偷在线| 九色|91porny| 欧美日韩国产在线观看| 国产精品日产欧美久久久久| 日产精品久久久久久久性色| 暴力调教一区二区三区| 欧美一级片在线看| 亚洲欧洲综合另类在线| 国产一区二区三区黄视频 | 国产 欧美在线| 欧美日韩免费一区二区三区视频| 久久久国产一区二区三区四区小说 | 欧美一区二区三区视频免费| 亚洲欧美在线另类| 国产乱码精品一区二区三区av | 99精品在线观看视频| 欧美电影免费观看完整版| 亚洲综合色自拍一区| 成人美女视频在线看| 亚洲精品一区二区在线观看| 亚洲第一二三四区| 97精品久久久午夜一区二区三区| 亚洲精品在线网站| 麻豆久久一区二区| 欧美美女bb生活片| 国产精品国产三级国产aⅴ入口| 性久久久久久久久| 99综合影院在线| 欧美成人激情免费网| 亚洲亚洲精品在线观看| 国产不卡在线播放| 91麻豆精品91久久久久久清纯| 中文字幕乱码日本亚洲一区二区| 日本欧美加勒比视频| 91在线精品一区二区| 26uuu精品一区二区在线观看| 丝袜美腿亚洲综合| 欧美日韩综合在线免费观看| 国产精品不卡一区| 国产一区 二区| 欧美一级理论片| 亚洲国产视频直播| 一本久道中文字幕精品亚洲嫩| 欧美成人精品3d动漫h| 亚洲成年人影院| 在线精品视频小说1| 中国色在线观看另类| 极品美女销魂一区二区三区免费| 欧美日韩dvd在线观看| 五月婷婷久久丁香| 欧美猛男超大videosgay| 丝瓜av网站精品一区二区| 欧美夫妻性生活| 麻豆成人综合网| 精品sm在线观看| 国产成人啪午夜精品网站男同| 国产三级久久久| 成人av在线看| 一区二区三区 在线观看视频| 色诱亚洲精品久久久久久| 亚洲精品日韩专区silk| 欧美午夜宅男影院| 日本午夜精品视频在线观看| 日韩丝袜情趣美女图片| 日本成人在线电影网| 欧美成人综合网站| 韩国一区二区视频| 中文字幕永久在线不卡| 欧美在线三级电影| 久久精品二区亚洲w码| 国产欧美日韩亚州综合| 99这里只有久久精品视频| 亚洲午夜免费电影| 欧美videos中文字幕| 成人午夜电影久久影院| 亚洲免费在线电影| 制服丝袜亚洲网站| 国产精品99久久久久久似苏梦涵| 成人免费一区二区三区在线观看| 精品婷婷伊人一区三区三| 日韩成人免费看| 欧美国产日韩一二三区| 欧美视频一区二区三区在线观看 | 欧美中文字幕一区二区三区亚洲| 天堂蜜桃91精品| 国产日韩欧美a| 91福利视频网站| 国产一区在线看| 一区二区三区产品免费精品久久75| 欧美日韩成人综合在线一区二区| 国产精品77777| 亚洲福利电影网| 国产区在线观看成人精品| 91啪亚洲精品| 青青草原综合久久大伊人精品 | 中文字幕一区二区三区精华液| 欧美三级日韩三级| 高清不卡在线观看| 午夜a成v人精品| 18成人在线视频| 欧美一区二区三区视频在线观看| 国产美女视频91| 亚洲精品第1页| 91精品欧美一区二区三区综合在| 精品一区二区在线播放| 国产精品萝li| 91同城在线观看| 日本一不卡视频| 中日韩免费视频中文字幕| 欧美男人的天堂一二区| 国产在线一区观看| 亚洲精品欧美综合四区|