📄 pushbutton.h
字号:
ulPressFillColor, ulOutlineColor, ulTextColor, \
pFont, pcText, pucImage, pucPressImage, \
usAutoRepeatDelay, usAutoRepeatRate, pfnOnClick) \
tPushButtonWidget sName = \
RectangularButtonStruct(pParent, pNext, pChild, pDisplay, lX, lY, \
lWidth, lHeight, ulStyle, ulFillColor, \
ulPressFillColor, ulOutlineColor, \
ulTextColor, pFont, pcText, pucImage, \
pucPressImage, usAutoRepeatDelay, \
usAutoRepeatRate, pfnOnClick)
//*****************************************************************************
//
//! Sets the auto-repeat delay for a push button widget.
//!
//! \param pWidget is a pointer to the push button widget to modify.
//! \param usDelay is the number of pointer events before auto-repeat starts.
//!
//! This function sets the delay before auto-repeat begins. Unpredictable
//! behavior will occur if this is called while the push button is pressed.
//!
//! \return None.
//
//*****************************************************************************
#define PushButtonAutoRepeatDelaySet(pWidget, usDelay) \
do \
{ \
tPushButtonWidget *pW = pWidget; \
pW->usAutoRepeatDelay = usDelay; \
} \
while(0)
//*****************************************************************************
//
//! Disables auto-repeat for a push button widget.
//!
//! \param pWidget is a pointer to the push button widget to modify.
//!
//! This function disables the auto-repeat behavior of a push button.
//!
//! \return None.
//
//*****************************************************************************
#define PushButtonAutoRepeatOff(pWidget) \
do \
{ \
tPushButtonWidget *pW = pWidget; \
pW->ulStyle &= ~(PB_STYLE_AUTO_REPEAT); \
} \
while(0)
//*****************************************************************************
//
//! Enables auto-repeat for a push button widget.
//!
//! \param pWidget is a pointer to the push button widget to modify.
//!
//! This function enables the auto-repeat behavior of a push button.
//! Unpredictable behavior will occur if this is called while the push button
//! is pressed.
//!
//! \return None.
//
//*****************************************************************************
#define PushButtonAutoRepeatOn(pWidget) \
do \
{ \
tPushButtonWidget *pW = pWidget; \
pW->ulStyle |= PB_STYLE_AUTO_REPEAT; \
} \
while(0)
//*****************************************************************************
//
//! Sets the auto-repeat rate for a push button widget.
//!
//! \param pWidget is a pointer to the push button widget to modify.
//! \param usRate is the number of pointer events between auto-repeat events.
//!
//! This function sets the rate at which auto-repeat events occur.
//! Unpredictable behavior will occur if this is called while the push button
//! is pressed.
//!
//! \return None.
//
//*****************************************************************************
#define PushButtonAutoRepeatRateSet(pWidget, usRate) \
do \
{ \
tPushButtonWidget *pW = pWidget; \
pW->usAutoRepeatRate = usRate; \
} \
while(0)
//*****************************************************************************
//
//! Sets the function to call when this push button widget is pressed.
//!
//! \param pWidget is a pointer to the push button widget to modify.
//! \param pfnOnClik is a pointer to the function to call.
//!
//! This function sets the function to be called when this push button is
//! pressed. The supplied function is called when the push button is first
//! pressed, and then repeated while the push button is pressed if auto-repeat
//! is enabled.
//!
//! \return None.
//
//*****************************************************************************
#define PushButtonCallbackSet(pWidget, pfnOnClik) \
do \
{ \
tPushButtonWidget *pW = pWidget; \
pW->pfnOnClick = pfnOnClik; \
} \
while(0)
//*****************************************************************************
//
//! Sets the fill color of a push button widget.
//!
//! \param pWidget is a pointer to the push button widget to be modified.
//! \param ulColor is the 24-bit RGB color to use to fill the push button.
//!
//! This function changes the color used to fill the push button on the
//! display. The display is not updated until the next paint request.
//!
//! \return None.
//
//*****************************************************************************
#define PushButtonFillColorSet(pWidget, ulColor) \
do \
{ \
tPushButtonWidget *pW = pWidget; \
pW->ulFillColor = ulColor; \
} \
while(0)
//*****************************************************************************
//
//! Sets the fill color of a push button widget when it is pressed.
//!
//! \param pWidget is a pointer to the push button widget to be modified.
//! \param ulColor is the 24-bit RGB color to use to fill the push button when
//! it is pressed.
//!
//! This function changes the color used to fill the push button on the
//! display when it is pressed. The display is not updated until the next
//! paint request.
//!
//! \return None.
//
//*****************************************************************************
#define PushButtonFillColorPressedSet(pWidget, ulColor) \
do \
{ \
tPushButtonWidget *pW = pWidget; \
pW->ulPressFillColor = ulColor; \
} \
while(0)
//*****************************************************************************
//
//! Disables filling of a push button widget.
//!
//! \param pWidget is a pointer to the push button widget to modify.
//!
//! This function disables the filling of a push button widget. The display is
//! not updated until the next paint request.
//!
//! \return None.
//
//*****************************************************************************
#define PushButtonFillOff(pWidget) \
do \
{ \
tPushButtonWidget *pW = pWidget; \
pW->ulStyle &= ~(PB_STYLE_FILL); \
} \
while(0)
//*****************************************************************************
//
//! Enables filling of a push button widget.
//!
//! \param pWidget is a pointer to the push button widget to modify.
//!
//! This function enables the filling of a push button widget. The display is
//! not updated until the next paint request.
//!
//! \return None.
//
//*****************************************************************************
#define PushButtonFillOn(pWidget) \
do \
{ \
tPushButtonWidget *pW = pWidget; \
pW->ulStyle |= PB_STYLE_FILL; \
} \
while(0)
//*****************************************************************************
//
//! Sets the font for a push button widget.
//!
//! \param pWidget is a pointer to the push button widget to modify.
//! \param pFnt is a pointer to the font to use to draw text on the push
//! button.
//!
//! This function changes the font used to draw text on the push button. The
//! display is not updated until the next paint request.
//!
//! \return None.
//
//*****************************************************************************
#define PushButtonFontSet(pWidget, pFnt) \
do \
{ \
tPushButtonWidget *pW = pWidget; \
const tFont *pF = pFnt; \
pW->pFont = pF; \
} \
while(0)
//*****************************************************************************
//
//! Changes the image drawn on a push button widget.
//!
//! \param pWidget is a pointer to the push button widget to be modified.
//! \param pImg is a pointer to the image to draw onto the push button.
//!
//! This function changes the image that is drawn onto the push button. The
//! display is not updated until the next paint request.
//!
//! \return None.
//
//*****************************************************************************
#define PushButtonImageSet(pWidget, pImg) \
do \
{ \
tPushButtonWidget *pW = pWidget; \
const unsigned char *pI = pImg; \
pW->pucImage = pI; \
} \
while(0)
//*****************************************************************************
//
//! Changes the image drawn on a push button widget when it is pressed.
//!
//! \param pWidget is a pointer to the push button widget to be modified.
//! \param pImg is a pointer to the image to draw onto the push button when it
//! is pressed.
//!
//! This function changes the image that is drawn onto the push button when it
//! is pressed. The display is not updated until the next paint request.
//!
//! \return None.
//
//*****************************************************************************
#define PushButtonImagePressedSet(pWidget, pImg) \
do \
{ \
tPushButtonWidget *pW = pWidget; \
const unsigned char *pI = pImg; \
pW->pucPressImage = pI; \
} \
while(0)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -