?? imgbutton.h
字號:
ImageButtonMsgProc \
}, \
ulStyle, \
ulForeColor, \
ulPressColor, \
ulBackColor, \
pFont, \
pcText, \
pucImage, \
pucPressImage, \
pucKeycapImage, \
sXOff, \
sYOff, \
usAutoRepeatDelay, \
usAutoRepeatRate, \
0, \
pfnOnClick \
}
//*****************************************************************************
//
//! Declares an initialized variable containing a image button widget data
//! structure.
//!
//! \param sName is the name of the variable to be declared.
//! \param pParent is a pointer to the parent widget.
//! \param pNext is a pointer to the sibling widget.
//! \param pChild is a pointer to the first child widget.
//! \param pDisplay is a pointer to the display on which to draw the push
//! button.
//! \param lX is the X coordinate of the upper left corner of the image button.
//! \param lY is the Y coordinate of the upper left corner of the image button.
//! \param lWidth is the width of the image button.
//! \param lHeight is the height of the image button.
//! \param ulStyle is the style to be applied to the image button.
//! \param ulForeColor is the color to be used for foreground pixels when
//! a 1bpp image is being drawn. It is ignored for all other image bit depths.
//! \param ulPressColor is the color to be used for foreground pixels when
//! the button is pressed and a 1bpp image is being drawn. It is ignored for
//! all other image bit depths.
//! \param ulBackColor is the color to be used for background pixels when
//! the button is released and a 1bpp image is being drawn. It is ignored for
//! all other image bit depths.
//! \param pFont is a pointer to the font to be used to draw text on the button.
//! \param pcText is a pointer to the text to draw on this button.
//! \param pucImage is a pointer to the image to draw on the background of
//! this image button when it is in the released state.
//! \param pucPressImage is a pointer to the image to draw on the background of
//! this image button when it is in the pressed state.
//! \param pucKeycapImage is a pointer to the image to draw as the keycap of the
//! on top of the image button, on top of the background image.
//! \param sXOff is the horizontal offset to apply when drawing the keycap image
//! on the button when in the pressed state.
//! \param sYOff is the vertical offset to apply when drawing the keycap image
//! on the button when in the pressed state.
//! \param usAutoRepeatDelay is the delay before starting auto-repeat.
//! \param usAutoRepeatRate is the rate at which auto-repeat events are
//! generated.
//! \param pfnOnClick is a pointer to the function that is called when the push
//! button is pressed.
//!
//! This macro provides an initialized image button widget data structure,
//! which can be used to construct the widget tree at compile time in global
//! variables (as opposed to run-time via function calls).
//!
//! \e ulStyle is the logical OR of the following:
//!
//! - \b #IB_STYLE_TEXT to indicate that text should be drawn on the button.
//! - \b #IB_STYLE_FILL to indicate that the background of the button should
//! be filled with color.
//! - \b #IB_STYLE_KEYCAP_OFF to indicate that the keycap image should not be
//! drawn.
//! - \b #IB_STYLE_IMAGE_OFF to indicate that the background image should not be
//! drawn.
//! - \b #IB_STYLE_AUTO_REPEAT to indicate that auto-repeat should be used.
//! - \b #IB_STYLE_RELEASE_NOTIFY to indicate that the callback should be made
//! when the button is released. If absent, the callback is called when the
//! button is initially pressed.
//!
//! \return Nothing; this is not a function.
//
//*****************************************************************************
#define ImageButton(sName, pParent, pNext, pChild, pDisplay, lX, lY, \
lWidth, lHeight, ulStyle, ulForeColor, ulPressColor, \
ulBackColor, pFont, pcText, pucImage, pucPressImage, \
pucKeycapImage, sXOff, sYOff, usAutoRepeatDelay, \
usAutoRepeatRate, pfnOnClick) \
tImageButtonWidget sName = \
ImageButtonStruct(pParent, pNext, pChild, pDisplay, lX, lY, \
lWidth, lHeight, ulStyle, ulForeColor, \
ulPressColor, ulBackColor, pFont, pcText, \
pucImage, pucPressImage, pucKeycapImage, \
sXOff, sYOff, usAutoRepeatDelay, \
usAutoRepeatRate, pfnOnClick)
//*****************************************************************************
//
//! Sets the auto-repeat delay for a image button widget.
//!
//! \param pWidget is a pointer to the image 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 image button is pressed.
//!
//! \return None.
//
//*****************************************************************************
#define ImageButtonAutoRepeatDelaySet(pWidget, usDelay) \
do \
{ \
tImageButtonWidget *pW = (tImageButtonWidget *)(pWidget); \
pW->usAutoRepeatDelay = usDelay; \
} \
while(0)
//*****************************************************************************
//
//! Disables auto-repeat for a image button widget.
//!
//! \param pWidget is a pointer to the image button widget to modify.
//!
//! This function disables the auto-repeat behavior of a image button.
//!
//! \return None.
//
//*****************************************************************************
#define ImageButtonAutoRepeatOff(pWidget) \
do \
{ \
tImageButtonWidget *pW = (tImageButtonWidget *)(pWidget); \
pW->ulStyle &= ~(IB_STYLE_AUTO_REPEAT); \
} \
while(0)
//*****************************************************************************
//
//! Enables auto-repeat for a image button widget.
//!
//! \param pWidget is a pointer to the image button widget to modify.
//!
//! This function enables the auto-repeat behavior of a image button.
//! Unpredictable behavior will occur if this is called while the image button
//! is pressed.
//!
//! \return None.
//
//*****************************************************************************
#define ImageButtonAutoRepeatOn(pWidget) \
do \
{ \
tImageButtonWidget *pW = (tImageButtonWidget *)(pWidget); \
pW->ulStyle |= IB_STYLE_AUTO_REPEAT; \
} \
while(0)
//*****************************************************************************
//
//! Sets the auto-repeat rate for a image button widget.
//!
//! \param pWidget is a pointer to the image 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 image button
//! is pressed.
//!
//! \return None.
//
//*****************************************************************************
#define ImageButtonAutoRepeatRateSet(pWidget, usRate) \
do \
{ \
tImageButtonWidget *pW = (tImageButtonWidget *)(pWidget); \
pW->usAutoRepeatRate = usRate; \
} \
while(0)
//*****************************************************************************
//
//! Sets the function to call when this image button widget is pressed.
//!
//! \param pWidget is a pointer to the image button widget to modify.
//! \param pfnOnClik is a pointer to the function to call.
//!
//! This function sets the function to be called when this image button is
//! pressed. The supplied function is called when the image button is first
//! pressed, and then repeated while the image button is pressed if auto-repeat
//! is enabled.
//!
//! \return None.
//
//*****************************************************************************
#define ImageButtonCallbackSet(pWidget, pfnOnClik) \
do \
{ \
tImageButtonWidget *pW = (tImageButtonWidget *)(pWidget); \
pW->pfnOnClick = pfnOnClik; \
} \
while(0)
//*****************************************************************************
//
//! Sets the fill color of a image button widget.
//!
//! \param pWidget is a pointer to the image button widget to be modified.
//! \param ulColor is the 24-bit RGB color to use to fill the image button.
//!
//! This function changes the color used to fill the background of the image
//! button on the display. This is a duplicate of ImageButtonBackgroundColorSet
//! which is left for backwards compatibility. The display is not updated
//! until the next paint request.
//!
//! \return None.
//
//*****************************************************************************
#define ImageButtonFillColorSet(pWidget, ulColor) \
do \
{ \
tImageButtonWidget *pW = (tImageButtonWidget *)(pWidget); \
pW->ulBackgroundColor = ulColor; \
} \
while(0)
//*****************************************************************************
//
//! Disables filling of a image button widget.
//!
//! \param pWidget is a pointer to the image button widget to modify.
//!
//! This function disables the filling of a image button widget. The display is
//! not updated until the next paint request.
//!
//! \return None.
//
//*****************************************************************************
#define ImageButtonFillOff(pWidget) \
do \
{ \
tImageButtonWidget *pW = (tImageButtonWidget *)(pWidget); \
pW->ulStyle &= ~(IB_STYLE_FILL); \
} \
while(0)
//*****************************************************************************
//
//! Enables filling of a image button widget.
//!
//! \param pWidget is a pointer to the image button widget to modify.
//!
//! This function enables the filling of a image button widget. The display is
//! not updated until the next paint request.
//!
//! \return None.
//
//*****************************************************************************
#define ImageButtonFillOn(pWidget) \
do \
{ \
tImageButtonWidget *pW = (tImageButtonWidget *)(pWidget); \
pW->ulStyle |= IB_STYLE_FILL; \
} \
while(0)
//*****************************************************************************
//
//! Enables the background image for an image button widget.
//!
//! \param pWidget is a pointer to the image button widget to modify.
//!
//! This function enables the drawing of the background image on an image button
//! widget. The display is not updated until the next paint request.
//!
//! \return None.
//
//*****************************************************************************
#define ImageButtonImageOn(pWidget) \
do \
{ \
tImageButtonWidget *pW = (tImageButtonWidget *)(pWidget); \
pW->ulStyle &= ~(IB_STYLE_IMAGE_OFF); \
} \
while(0)
//*****************************************************************************
//
//! Disables the background image for an image button widget.
//!
//! \param pWidget is a pointer to the image button widget to modify.
//!
//! This function disables the drawing of the background image on an image
//! button widget. The display is not updated until the next paint request.
//!
//! \return None.
//
//*****************************************************************************
#define ImageButtonImageOff(pWidget) \
do \
{ \
tImageButtonWidget *pW = (tImageButtonWidget *)(pWidget); \
pW->ulStyle |= IB_STYLE_IMAGE_OFF; \
} \
while(0)
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -