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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? listbox.c

?? STM32+Grlib
?? C
?? 第 1 頁 / 共 2 頁
字號:
            //
            // If this distance is greater than or equal to the height of a
            // line of text, we need to check to see if we need to scroll the
            // list box contents.
            //
            if(abs(lLineNum) >= GrFontHeightGet(pListBox->pFont))
            {
                //
                // We have to scroll if this is possible.  How many lines can
                // be visible on the display?
                //
                lVisible = (pListBox->sBase.sPosition.sYMax -
                            pListBox->sBase.sPosition.sYMin) /
                            (long)GrFontHeightGet(pListBox->pFont);

                //
                // If we have fewer strings in the listbox than there are lines
                // on the display, scrolling is not possible so give up now.
                //
                if(lVisible > (long)pListBox->usPopulated)
                {
                    return(1);
                }

                //
                // How many lines of scrolling does the latest pointer position
                // indicate?  A negative value implies downward scrolling (i.e.
                // showing earlier strings).
                //
                lScroll = lLineNum / (long)GrFontHeightGet(pListBox->pFont);

                //
                // What is the farthest we could scroll downwards (i.e. moving
                // the pointer towards the bottom of the screen)?  Note - this
                // will be negative or 0.
                //
                lMaxDown = (pListBox->usStartEntry >= pListBox->usOldestEntry) ?
                           (pListBox->usOldestEntry - pListBox->usStartEntry ) :
                           ((pListBox->usOldestEntry - pListBox->usStartEntry) -
                             pListBox->usMaxEntries);

                //
                // What is the farthest we could scroll upwards?  Note - this
                // will be a positive number.
                //
                lMaxUp = ((long)pListBox->usPopulated - lVisible) + lMaxDown;

                //
                // Determine the actual scroll distance given the maximum
                // distances calculated.
                //
                lScroll = min(lScroll, lMaxUp);
                lScroll = max(lScroll, lMaxDown);

                if(lScroll)
                {
                	long lTemp;
                	
                    //
                    // Adjust the start entry appropriately, taking care to handle
                    // the wrap case.  The use of a temporary variable here is 
                    // required to work around a compiler bug which resulted in an
                    // invalid value of pListBox->usStartEntry following the 
                    // calculation.
                    //
                    lTemp = pListBox->usStartEntry;
                    lTemp += lScroll;
                    lTemp %= (long)pListBox->usMaxEntries;
                    pListBox->usStartEntry = (unsigned short)lTemp;
                
                    //
                    // Remember that we scrolled.
                    //
                    pListBox->usScrolled = 1;

                    //
                    // Adjust the pointer position we record to take into account
                    // the amount we just scrolled.
                    //
                    pListBox->lPointerY -= (lScroll *
                                            GrFontHeightGet(pListBox->pFont));

                    //
                    // Repaint the contents of the widget.
                    //
                    WidgetPaint((tWidget *)pListBox);
                }
            }

            return(1);
        }
    }

    //
    // We don't handle any other messages so return 0 if we get these.
    //
    return(0);
}

//*****************************************************************************
//
//! Handles messages for a listbox widget.
//!
//! \param pWidget is a pointer to the listbox 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 listbox 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
ListBoxMsgProc(tWidget *pWidget, unsigned long ulMsg, unsigned long ulParam1,
              unsigned long ulParam2)
{
    tListBoxWidget *pListBox;

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

    //
    // Convert the generic pointer to a list box pointer.
    //
    pListBox = (tListBoxWidget *)pWidget;

    //
    // Determine which message is being sent.
    //
    switch(ulMsg)
    {
        //
        // A pointer message has been received.
        //
        case WIDGET_MSG_PTR_DOWN:
        case WIDGET_MSG_PTR_UP:
        case WIDGET_MSG_PTR_MOVE:
            return(ListBoxPointer(pListBox, ulMsg, (long)ulParam1,
                                  (long)ulParam2));

        //
        // The widget paint request has been sent.
        //
        case WIDGET_MSG_PAINT:
        {
            //
            // Handle the widget paint request.
            //
            ListBoxPaint(pWidget);

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

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

//*****************************************************************************
//
//! Initializes a listbox widget.
//!
//! \param pWidget is a pointer to the listbox widget to initialize.
//! \param pDisplay is a pointer to the display on which to draw the listbox.
//! \param ppcText is a pointer to an array of character pointers which will
//! hold the strings that the listbox displays.
//! \param usMaxEntries provides the total number of entries in the \e ppcText
//! array.
//! \param usPopulatedEntries provides the number of entries in the \e ppcText
//! array which are populated.
//! \param lX is the X coordinate of the upper left corner of the listbox.
//! \param lY is the Y coordinate of the upper left corner of the listbox.
//! \param lWidth is the width of the listbox.
//! \param lHeight is the height of the listbox.
//!
//! This function initializes the provided listbox widget.
//!
//! \return None.
//
//*****************************************************************************
void
ListBoxInit(tListBoxWidget *pWidget, const tDisplay *pDisplay,
            const char **ppcText, unsigned short usMaxEntries,
            unsigned short usPopulatedEntries, 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(tListBoxWidget); ulIdx += 4)
    {
        ((unsigned long *)pWidget)[ulIdx / 4] = 0;
    }

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

    //
    // 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 listbox.
    //
    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 listbox message handler to process messages to this listbox.
    //
    pWidget->sBase.pfnMsgProc = ListBoxMsgProc;

    //
    // Initialize some of the widget fields that are not accessible via
    // macros.
    //
    pWidget->ppcText = ppcText;
    pWidget->usMaxEntries = usMaxEntries;
    pWidget->usPopulated = usPopulatedEntries;
    pWidget->sSelected = (short)0xFFFF;
}

//*****************************************************************************
//
//! Adds a line of text to a listbox.
//!
//! \param pListBox is a pointer to the listbox widget that is to receive the
//! new text string.
//! \param pcTxt is a pointer to the string that is to be added to the listbox.
//!
//! This function adds a new string to the listbox.  If the listbox has
//! style \b #LISTBOX_STYLE_WRAP and the current string table is full, this
//! function will discard the oldest string and replace it with the one passed
//! here.  If this style flag is absent, the function will return -1 if no
//! empty entries exist in the string table for the widget.
//!
//! The display is not automatically updated as a result of this function call.
//! An application must call WidgetPaint() to update the display after adding
//! a new string to the listbox.
//!
//! \note To replace the string associated with a particular, existing element
//! in the listbox, use ListBoxTextSet().
//!
//! \return Returns the string table index into which the new string has been
//! placed if successful or -1 if the string table is full and
//! \b #LISTBOX_STYLE_WRAP is not set.
//
//*****************************************************************************
long ListBoxTextAdd(tListBoxWidget *pListBox, const char *pcTxt)
{
    unsigned long ulIndex;

    //
    // Is the list box full?
    //
    if(pListBox->usPopulated == pListBox->usMaxEntries)
    {
        //
        // The box is already full.  If the wrap style is not set, fail
        // the call.
        //
        if(!(pListBox->ulStyle & LISTBOX_STYLE_WRAP))
        {
            //
            // The listbox is full and it is not configured to wrap so we can't
            // add another string to it.
            //
            return(-1);
        }
        else
        {
            //
            // We are wrapping so replace the oldest entry in the box.
            //
            ulIndex = pListBox->usOldestEntry;

            //
            // Check to see if we are displaying the oldest entry and, if so,
            // move the start entry on by one to keep the display order
            // correct.
            //
            if(pListBox->usOldestEntry == pListBox->usStartEntry)
            {
                pListBox->usStartEntry++;
                if(pListBox->usStartEntry == pListBox->usMaxEntries)
                {
                    pListBox->usStartEntry = 0;
                }
            }

            //
            // The new oldest entry is the next one.  Update the index and
            // take care to wrap if we reach the end of the string table.
            //
            pListBox->usOldestEntry++;
            if(pListBox->usOldestEntry == pListBox->usMaxEntries)
            {
                pListBox->usOldestEntry = 0;
            }
        }
    }
    else
    {
        //
        // The listbox is not full so add the new string to the first free
        // slot in the string table.
        //
        ulIndex = pListBox->usPopulated;
        pListBox->usPopulated++;
    }

    //
    // Save the new string in the appropriate string table entry.
    //
    pListBox->ppcText[ulIndex] = pcTxt;

    //
    // Tell the caller which string table entry was added.
    //
    return((long)ulIndex);
}

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

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人一区二区三区在线观看| 亚洲自拍都市欧美小说| 激情伊人五月天久久综合| 欧美人伦禁忌dvd放荡欲情| 久久福利资源站| 久久久欧美精品sm网站| 国产麻豆日韩欧美久久| 中文在线一区二区| av在线不卡网| 亚洲成人中文在线| 日韩久久精品一区| 不卡的电影网站| 一区二区久久久久久| 欧美高清hd18日本| 国产一区二区在线电影| 国产精品三级电影| 欧美日韩国产中文| 国产一区二区三区最好精华液| 中文字幕电影一区| 欧美午夜精品一区| 九色porny丨国产精品| 国产精品免费视频观看| 欧美日韩精品三区| 国产一区二区三区美女| 亚洲理论在线观看| 欧美mv日韩mv国产网站app| www.亚洲在线| 美日韩一区二区| 亚洲国产高清aⅴ视频| 欧美区视频在线观看| 国产真实乱子伦精品视频| 亚洲视频 欧洲视频| 26uuu另类欧美亚洲曰本| 色综合中文字幕国产| 日韩电影网1区2区| 中文一区在线播放| 日韩精品一区二区三区蜜臀| 91色视频在线| 国产精品一区在线| 亚洲已满18点击进入久久| 亚洲精品在线观看网站| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 亚洲伊人伊色伊影伊综合网| 精品少妇一区二区三区在线视频| 成人aa视频在线观看| 激情综合网激情| 一区二区三区国产精品| 国产欧美日韩另类一区| 日韩女优电影在线观看| 欧美午夜精品久久久| 成人精品免费看| 国产精品一线二线三线| 午夜私人影院久久久久| 一区二区三区日韩欧美| 国产精品网站一区| 国产日产欧美精品一区二区三区| 欧美一区二区国产| 91精品国产综合久久精品| 在线亚洲人成电影网站色www| 成人免费视频视频在线观看免费| 久久精品国产网站| 日韩成人午夜精品| 亚洲成人激情自拍| 亚洲主播在线观看| 亚洲免费观看高清完整版在线观看 | 日本韩国欧美一区二区三区| 国产资源在线一区| 久久激情综合网| 久久精品99国产国产精| 日韩中文字幕区一区有砖一区| 亚洲精品成人天堂一二三| 中文字幕在线一区免费| 国产精品视频一区二区三区不卡| 国产日韩视频一区二区三区| 久久亚洲私人国产精品va媚药| 欧美videossexotv100| 日韩女优av电影| 日韩欧美一级在线播放| 欧美大度的电影原声| 欧美不卡一区二区三区四区| 日韩免费高清av| 精品88久久久久88久久久| 26uuu久久综合| 久久精品一区八戒影视| 欧美国产在线观看| 一区精品在线播放| 亚洲综合成人在线| 日韩国产欧美视频| 粉嫩av一区二区三区| 成人在线综合网| jiyouzz国产精品久久| 97精品久久久午夜一区二区三区| 99久精品国产| 欧美色图激情小说| 日韩一区二区电影在线| 久久婷婷国产综合精品青草| 国产拍揄自揄精品视频麻豆| 最新高清无码专区| 亚洲小说欧美激情另类| 日本视频在线一区| 国产一区二区免费视频| jvid福利写真一区二区三区| 欧美在线观看视频一区二区三区| 在线不卡的av| 精品国产自在久精品国产| 中文字幕高清不卡| 亚洲成人黄色影院| 久久成人麻豆午夜电影| 不卡电影一区二区三区| 88在线观看91蜜桃国自产| 久久久久久麻豆| 亚洲夂夂婷婷色拍ww47| 毛片一区二区三区| av福利精品导航| 91精品国产欧美一区二区成人| www国产精品av| 亚洲午夜久久久久久久久久久| 看电视剧不卡顿的网站| 91免费看片在线观看| 精品免费一区二区三区| 亚洲特黄一级片| 精品一区二区精品| 色婷婷综合久久久久中文| 日韩欧美久久久| 亚洲精品免费视频| 国产一区二区伦理片| 欧美亚洲丝袜传媒另类| 久久久不卡网国产精品二区| 成人一区二区三区中文字幕| 欧美男女性生活在线直播观看| 日本一区二区三区高清不卡| 亚洲va中文字幕| 91亚洲精品久久久蜜桃网站 | 狠狠色狠狠色综合日日91app| 99久久综合狠狠综合久久| 欧美一二三四在线| 一区二区三区国产豹纹内裤在线| 国产精品自产自拍| 日韩情涩欧美日韩视频| 亚洲一二三区在线观看| 成人网在线播放| 精品国产免费久久| 午夜精品久久久久久久久久| 99久久久精品| 国产精品视频看| 国产福利一区二区三区视频| 91精品久久久久久蜜臀| 亚洲一区二区三区四区中文字幕| 成人国产在线观看| 国产蜜臀97一区二区三区| 美女国产一区二区三区| 欧美日韩aaa| 亚洲一二三区视频在线观看| 色综合久久中文字幕综合网| 国产精品午夜在线| 国产精品一区二区男女羞羞无遮挡| 欧美一区二区视频在线观看 | 91在线丨porny丨国产| 欧美大片免费久久精品三p| 奇米亚洲午夜久久精品| 欧美午夜精品免费| 亚洲国产另类av| 在线观看精品一区| 樱桃视频在线观看一区| 一本色道久久综合亚洲精品按摩| 自拍偷拍国产亚洲| 97se狠狠狠综合亚洲狠狠| 亚洲色图第一区| 在线观看免费视频综合| 午夜精品久久久久影视| 欧美日韩国产综合一区二区| 五月天激情小说综合| 日韩一卡二卡三卡国产欧美| 视频一区在线视频| 日韩午夜激情电影| 麻豆国产91在线播放| 精品91自产拍在线观看一区| 国产一区二区在线看| 国产精品素人一区二区| 97se亚洲国产综合在线| 夜夜操天天操亚洲| 制服丝袜激情欧洲亚洲| 久久黄色级2电影| 中文字幕av一区 二区| 91影院在线观看| 午夜精品一区二区三区电影天堂| 欧美一区二区在线免费观看| 久久国产精品无码网站| 国产目拍亚洲精品99久久精品| 99视频有精品| 亚洲成av人在线观看| 欧美mv日韩mv国产网站| 成人av在线播放网站| 亚洲综合在线观看视频| 制服丝袜亚洲网站| 成人一道本在线| 亚洲午夜免费福利视频| 久久伊99综合婷婷久久伊| 91在线视频网址| 久久不见久久见免费视频1|