⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 slider.h

📁 基于TI公司Cortex-M3的uart超级通信开发
💻 H
📖 第 1 页 / 共 4 页
字号:
//! Disables opaque text on the active portion of a slider widget.
//!
//! \param pWidget is a pointer to the slider widget to modify.
//!
//! This function disables the use of opaque text on the active portion of this
//! slider.  When not using opaque text, only the foreground pixels of the text
//! are drawn on the screen, allowing the previously drawn pixels (such as the
//! slider image) to show through the text.  Note that SL_STYLE_TEXT must also
//! be cleared to disable text rendering on the slider active area.
//!
//! \return None.
//
//*****************************************************************************
#define SliderTextOpaqueOff(pWidget)                \
        do                                          \
        {                                           \
            tSliderWidget *pW = pWidget;            \
            pW->ulStyle &= ~(SL_STYLE_TEXT_OPAQUE); \
        }                                           \
        while(0)

//*****************************************************************************
//
//! Enables opaque text on the active portion of a slider widget.
//!
//! \param pWidget is a pointer to the slider widget to modify.
//!
//! This function enables the use of opaque text on  the active portion of this
//! slider.  When using opaque text, both the foreground and background pixels
//! of the text are drawn on the screen, blocking out the previously drawn
//! pixels.    Note that SL_STYLE_TEXT must also be set to enable text
//! rendering on the slider active area.
//!
//! \return None.
//
//*****************************************************************************
#define SliderTextOpaqueOn(pWidget)              \
        do                                       \
        {                                        \
            tSliderWidget *pW = pWidget;         \
            pW->ulStyle |= SL_STYLE_TEXT_OPAQUE; \
        }                                        \
        while(0)

//*****************************************************************************
//
//! Disables the text on the background portion of a slider widget.
//!
//! \param pWidget is a pointer to the slider widget to modify.
//!
//! This function disables the drawing of text on the background portion of
//! a slider widget.  The display is not updated until the next paint request.
//!
//! \return None.
//
//*****************************************************************************
#define SliderBackgroundTextOff(pWidget)                \
        do                                              \
        {                                               \
            tSliderWidget *pW = pWidget;                \
            pW->ulStyle &= ~(SL_STYLE_BACKG_TEXT);      \
        }                                               \
        while(0)

//*****************************************************************************
//
//! Enables the text on the background portion of a slider widget.
//!
//! \param pWidget is a pointer to the slider widget to modify.
//!
//! This function enables the drawing of text on the background portion of a
//! slider widget.  The display is not updated until the next paint request.
//!
//! \return None.
//
//*****************************************************************************
#define SliderBackgroundTextOn(pWidget)                 \
        do                                              \
        {                                               \
            tSliderWidget *pW = pWidget;                \
            pW->ulStyle |= SL_STYLE_BACKG_TEXT;         \
        }                                               \
        while(0)

//*****************************************************************************
//
//! Disables opaque background text on a slider widget.
//!
//! \param pWidget is a pointer to the slider widget to modify.
//!
//! This function disables the use of opaque text on the background portion of
//! this slider.  When not using opaque text, only the foreground pixels of the
//! text are drawn on the screen, allowing the previously drawn pixels (such as
//! the slider image) to show through the text.  Note that SL_STYLE_BACKG_TEXT
//! must also be cleared to disable text rendering on the slider background
//! area.
//!
//! \return None.
//
//*****************************************************************************
#define SliderBackgroundTextOpaqueOff(pWidget)              \
        do                                                  \
        {                                                   \
            tSliderWidget *pW = pWidget;                    \
            pW->ulStyle &= ~(SL_STYLE_BACKG_TEXT_OPAQUE);   \
        }                                                   \
        while(0)

//*****************************************************************************
//
//! Enables opaque background text on a slider widget.
//!
//! \param pWidget is a pointer to the slider widget to modify.
//!
//! This function enables the use of opaque text on the background portion of
//! this slider.  When using opaque text, both the foreground and background
//! pixels of the text are drawn on the screen, blocking out the previously
//! drawn pixels.  Note that SL_STYLE_BACKG_TEXT must also be set to enable
//! text rendering on the slider background area.
//!
//! \return None.
//
//*****************************************************************************
#define SliderBackgroundTextOpaqueOn(pWidget)               \
        do                                                  \
        {                                                   \
            tSliderWidget *pW = pWidget;                    \
            pW->ulStyle |= SL_STYLE_BACKG_TEXT_OPAQUE;      \
        }                                                   \
        while(0)

//*****************************************************************************
//
//! Locks a slider making it ignore pointer input.
//!
//! \param pWidget is a pointer to the slider widget to modify.
//!
//! This function locks a slider widget and makes it ignore all pointer input.
//! When locked, a slider acts as a passive indicator.  Its value may be
//! changed using SliderValueSet() and the value display updated using
//! WidgetPaint() but no user interaction via the pointer will change the
//! widget value.
//!
//! \return None.
//
//*****************************************************************************
#define SliderLock(pWidget)                     \
        do                                      \
        {                                       \
            tSliderWidget *pW = pWidget;        \
            pW->ulStyle |= SL_STYLE_LOCKED;     \
        }                                       \
        while(0)

//*****************************************************************************
//
//! Unlocks a slider making it pay attention to pointer input.
//!
//! \param pWidget is a pointer to the slider widget to modify.
//!
//! This function unlocks a slider widget.  When unlocked, a slider will
//! respond to pointer input by setting its value appropriately and informing
//! the application via callbacks.
//!
//! \return None.
//
//*****************************************************************************
#define SliderUnlock(pWidget)                   \
        do                                      \
        {                                       \
            tSliderWidget *pW = pWidget;        \
            pW->ulStyle &= ~(SL_STYLE_LOCKED);  \
        }                                       \
        while(0)

//*****************************************************************************
//
//! Changes the text drawn on a slider widget.
//!
//! \param pWidget is a pointer to the slider widget to be modified.
//! \param pcTxt is a pointer to the text to draw onto the slider.
//!
//! This function changes the text that is drawn onto the slider.  The string
//! is centered across the slider and straddles the active and background
//! portions of the widget.  The display is not updated until the next paint
//! request.
//!
//! \return None.
//
//*****************************************************************************
#define SliderTextSet(pWidget, pcTxt)        \
        do                                   \
        {                                    \
            tSliderWidget *pW = pWidget;     \
            const char *pcT = pcTxt;         \
            pW->pcText = pcT;                \
        }                                    \
        while(0)

//*****************************************************************************
//
//! Changes the value range for a slider widget.
//!
//! \param pWidget is a pointer to the slider widget to be modified.
//! \param lMinimum is the minimum value that the slider will report.
//! \param lMaximum is the maximum value that the slider will report.
//!
//! This function changes the range of a slider.  Slider positions are reported
//! in terms of this range with the current position of the slider on the
//! display being scaled and translated into this range such that the minimum
//! value represents the left position of a horizontal slider or the bottom
//! position of a vertical slider and the maximum value represents the other
//! end of the slider range.  Note that this function does not cause the slider
//! to be redrawn.  The caller must call WidgetPaint() explicitly after this
//! call to ensure that the widget is redrawn.
//!
//! \return None.
//
//*****************************************************************************
#define SliderRangeSet(pWidget, lMinimum, lMaximum)  \
        do                                           \
        {                                            \
            tSliderWidget *pW = pWidget;             \
            pW->lMin = (lMinimum);                   \
            pW->lMax = (lMaximum);                   \
        }                                            \
        while(0)

//*****************************************************************************
//
//! Changes the minimum value for a slider widget.
//!
//! \param pWidget is a pointer to the slider widget to be modified.
//! \param lVal is the new value to set for the slider.  This is in terms of
//! the value range currently set for the slider.
//!
//! This function changes the value that the slider will display the next time
//! the widget is painted.  The caller is responsible for ensuring that the
//! value passed is within the range specified for the target widget.  The
//! caller must call WidgetPaint() explicitly after this call to ensure that
//! the widget is redrawn.
//!
//! \return None.
//
//*****************************************************************************
#define SliderValueSet(pWidget, lVal)        \
        do                                   \
        {                                    \
            tSliderWidget *pW = pWidget;     \
            pW->lValue = (lVal);             \
        }                                    \
        while(0)

//*****************************************************************************
//
// Prototypes for the slider widget APIs.
//
//*****************************************************************************
extern long SliderMsgProc(tWidget *pWidget, unsigned long ulMsg,
                          unsigned long ulParam1, unsigned long ulParam2);
extern void SliderInit(tSliderWidget *pWidget,
                       const tDisplay *pDisplay, long lX, long lY, long lWidth,
                       long lHeight);

//*****************************************************************************
//
// Mark the end of the C bindings section for C++ compilers.
//
//*****************************************************************************
#ifdef __cplusplus
}
#endif

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

#endif // __SLIDER_H__

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -