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

📄 ebtrackbar.h

📁 基于minigui开发的一套图形控件系统
💻 H
字号:
//
// $Id: ebtrackbar.h,v 1.1.1.1 2005/01/18 11:47:57 tangjb Exp $
//
// trackbar.h: the head file of TrackBar(Slider) Control module.
//
// Copyright (c) 2000, Wei Yongming
//
// Note:
//   Originally by Zheng Yiran.
//
// Create date: 2000/12/02
//
/*当使用图片做指针和背景时,指针的滑动轨道边界离背景图边界的距离是游标的一半,
 *,另一个坐标上游标居中
 *
 *
 *
*/

#ifndef __EBTRACKBAR_H
#define __EBTRACKBAR_H

#ifdef  __cplusplus
extern  "C" {
#endif

/************************** TrackBar Control ***********************************/
    /**
     * \defgroup ctrl_trackbar TrackBar control
     * @{
     */

/**
 * \def CTRL_TRACKBAR
 * \brief The class name of trackbar control.
 */
#define CTRL_EBTRACKBAR              ("ebtrackbar")

    /**
     * \defgroup ctrl_trackbar_styles Styles of trackbar control
     * @{
     */

/**
 * \def TBS_NOTIFY
 * \brief Causes the trackbar to notify the parent window with a notification message 
 * 		when the user clicks or doubleclicks the trackbar.
 */
#define ETBS_NOTIFY                 0x0001L

/**
 * \def TBS_VERTICAL
 * \brief The trackbar control will be oriented vertically.
 */
#define ETBS_VERTICAL               0x0002L

/**
 * \def TBS_BORDER
 * \brief The trackbar control will have border.
 */
#define ETBS_BORDER                 0x0004L

/**
 * \def TBS_TIP
 * \brief The trackbar control will display tick marks above the control.
 */
#define ETBS_TIP                    0x0008L

/**
 * \def TBS_FOCUS
 * \brief The trackbar control has the focus frame.
 */
#define ETBS_FOCUS                  0x0010L

/**
 * \def TBS_DRAGGED
 * \brief The user is dragging the slider.
 */
#define ETBS_DRAGGED                0x0020L

/**
 * \def TBS_MOUSEDOWN
 * \brief The mouse button is down.
 */
#define ETBS_MOUSEDOWN              0x0040L

#define ETBS_BKALPHA		    0x0080L



//指针经过后的填充方式;
#define ETBS_FILLTYPE		0x00000300L
#define ETBS_FILLNONE		0x00000000L//无填充;
#define ETBS_FILLLINE		0x00000100L//填充线条;
#define ETBS_FILLIDTN		0x00000200L//用指针图标填充;
#define ETBS_FILLRECT		0x00000300L//矩形填充;

//背景的方式;
#define ETBS_BKTYPE		0x00000C00L
#define ETBS_BKNORMAL		0x00000000L//常用标准背景;
#define ETBS_BKBITMAP		0x00000400L//位图句柄;
#define ETBS_BKBMPFILE		0x00000800L//位图文件;
#define ETBS_BKICON		0x00000C00L//图标句柄;

//指示针的方式;
#define ETBS_IDTNTYPE		0x00003000L
#define ETBS_IDTNAROW		0x00000000L//箭头指示针;
#define ETBS_IDTNBITMAP		0x00001000L//位图句柄指示针;
#define ETBS_IDTNBMPFILE	0x00002000L//位图文件指示针;
#define ETBS_IDTNICON		0x00003000L//位图图标句柄指示针;
				

    /** @} end of ctrl_trackbar_styles */

    /**
     * \defgroup ctrl_trackbar_msgs Messages of trackbar control
     * @{
     */

/**
 * \def TBM_SETRANGE
 * \brief Sets the range of minimum and maximum logical positions for the 
 * 		slider in a trackbar.
 *
 * \code
 * TBM_SETRANGE
 * int min;
 * int max;
 *
 * wParam = (WPARAM)min;
 * lParam = (LPARAM)max;
 * \endcode
 *
 * \param min Minimum position for the slider.
 * \param max Maximum position for the slider.
 */
#define ETBM_SETRANGE               0xF090

/**
 * \def TBM_GETMIN
 * \brief Gets the minimum logical position for the slider.
 *
 * \code
 * TBM_GETMIN
 *
 * wParam = 0;
 * lParam = 0;
 * \endcode
 *
 * \return The minimum logical position for the slider.
 */
#define ETBM_GETMIN                 0xF091

/**
 * \def TBM_SETPOS
 * \brief Sets the current logical position of the slider.
 *
 * \code
 * TBM_SETPOS
 * int pos;
 *
 * wParam = (WPARAM)pos;
 * lParam = 0;
 * \endcode
 *
 * \param pos New logical position of the slider.
 */
#define ETBM_SETPOS                 0xF092

/**
 * \def TBM_GETPOS
 * \brief Gets the current logical position of the slider.
 *
 * \code
 * TBM_GETPOS
 *
 * wParam = 0;
 * lParam = 0;
 * \endcode
 *
 * \return The current logical position of the slider.
 */
#define ETBM_GETPOS                 0xF093

/**
 * \def TBM_SETLINESIZE
 * \brief Sets the number of logical positions moved in response to keyboard
 * 	input from the arrow keys.
 *
 * Sets the number of logical positions the trackbar's slider moves in response
 * to keyboard input from the arrow keys. The logical positions are the integer
 * increments in the trackbar's range of minimum to maximum slider positions.
 *
 * \code
 * TBM_SETLINESIZE
 * int linesize;
 *
 * wParam = (WPARAM)linesize;
 * lParam = 0;
 * \endcode
 *
 * \param linesize New line size;
 */
#define ETBM_SETLINESIZE            0xF094

/**
 * \def TBM_GETLINESIZE
 * \brief Gets the number of logical positions moved in response to keyboard
 * 	input from the arrow keys.
 *
 * Gets the number of logical positions the trackbar's slider moves in response
 * to keyboard input from the arrow keys. The logical positions are the integer
 * increments in the trackbar's range of minimum to maximum slider positions.
 *
 * \code
 * TBM_GETLINESIZE
 *
 * wParam = 0;
 * lParam = 0;
 * \endcode
 *
 * \return The current line size.
 */
#define ETBM_GETLINESIZE            0xF095

/**
 * \def TBM_SETPAGESIZE
 * \brief Sets the number of logical positions moved in response to keyboard
 * 		input from page keys..
 *
 * Sets the number of logical positions the trackbar's slider moves in response
 * to keyboard input form page keys, such as PAGE DOWN or PAGE UP keys. The 
 * logical positions are the integer increments in the trackbar's range of 
 * minimum to maximum slider positions.
 *
 * \code
 * TBM_SETPAGESIZE
 * int pagesize;
 *
 * wParam = (WPARAM)pagesize;
 * lParam = 0;
 * \endcode
 *
 * \param pagesize New page size;
 */
#define ETBM_SETPAGESIZE            0xF096

/**
 * \def TBM_GETPAGESIZE
 * \brief Gets the number of logical positions moved in response to keyboard
 * 		input from page keys..
 *
 * Gets the number of logical positions the trackbar's slider moves in response
 * to keyboard input form page keys, such as PAGE DOWN or PAGE UP keys. The 
 * logical positions are the integer increments in the trackbar's range of 
 * minimum to maximum slider positions.
 *
 * \code
 * TBM_GETPAGESIZE
 *
 * wParam = 0;
 * lParam = 0;
 * \endcode
 *
 * \return The current page size;
 */
#define ETBM_GETPAGESIZE            0xF097

/**
 * \def TBM_SETSTARTTIP
 * \brief Sets the starting logical position of a tick mark.
 *
 * \code
 * TBM_SETSTARTTIP
 * int starttip;
 *
 * wParam = (WPARAM)starttip;
 * lParam = 0;
 * \endcode
 *
 * \param starttip New starting logical position of a tick mark;
 */
#define ETBM_SETSTARTTIP            0xF098

/**
 * \def TBM_SETENDTIP
 * \brief Sets the ending logical position of a tick mark.
 *
 * \code
 * TBM_SETENDTIP
 * int endtip;
 *
 * wParam = (WPARAM)endtip;
 * lParam = 0;
 * \endcode
 *
 * \param starttip New ending logical position of a tick mark;
 */
#define ETBM_SETENDTIP              0xF099

/**
 * \def TBM_GETTIP
 * \brief Gets the starting and ending logical position of a tick mark.
 *
 * \code
 * TBM_GETTIP
 * int *starttip;
 * int *endtip;
 *
 * wParam = (WPARAM)starttip;
 * lParam = (LPARAM)endtip;
 * \endcode
 *
 * \param starttip Retreives the starting logical position of a tick mark.
 * \param endtip Retreives the ending logical position of a tick mark.
 */
#define ETBM_GETTIP                 0xF09A

/**
 * \def TBM_SETTICKFREQ
 * \brief Sets the interval frequency for tick marks in a trackbar.
 *
 * \code
 * TBM_SETTICKFREQ
 * int tickfreq;
 *
 * wParam = (WPARAM)tickfreq;
 * lParam = 0;
 * \endcode
 *
 * \param tickfreq New interval frequency for tick marks in a trackbar;
 */
#define ETBM_SETTICKFREQ            0xF09B

/**
 * \def TBM_GETTICKFREQ
 * \brief Gets the interval frequency for tick marks in a trackbar.
 *
 * \code
 * TBM_GETTICKFREQ
 *
 * wParam = 0;
 * lParam = 0;
 * \endcode
 *
 * \return The current interval frequency for tick marks in a trackbar;
 */
#define ETBM_GETTICKFREQ            0xF09C

/**
 * \def TBM_SETMIN
 * \brief Sets the minimum logical position for the slider in a trackbar.
 *
 * \code
 * TBM_SETMIN
 * int min;
 *
 * wParam = (WPARAM)min;
 * lParam = 0;
 * \endcode
 *
 * \param min The new minimum logical position for the slider in a trackbar.
 */
#define ETBM_SETMIN                 0xF09D

/**
 * \def TBM_SETMAX
 * \brief Sets the maximum logical position for the slider in a trackbar.
 *
 * \code
 * TBM_SETMAX
 * int max;
 *
 * wParam = (WPARAM)max;
 * lParam = 0;
 * \endcode
 *
 * \param min The new maximum logical position for the slider in a trackbar.
 */
#define ETBM_SETMAX                 0xF09E

/**
 * \def TBM_GETMAX
 * \brief Gets the maximum logical position for the slider in a trackbar.
 *
 * \code
 * TBM_GETMAX
 *
 * wParam = 0;
 * lParam = 0;
 * \endcode
 *
 * \return The current maximum logical position for the slider in a trackbar.
 */
#define ETBM_GETMAX                 0xF09F

#define ETBM_SETFGNDCOLOR	    0xF0A0	/*设置前景颜色*/
#define ETBM_GETFGNDCOLOR	    0xF0A1	/*设置前景颜色*/

#define ETBM_SETTBBORDER	    0xF0A2
#define ETBM_GETTBBORDER	    0xF0A3

    /** @} end of ctrl_trackbar_msgs */

    /**
     * \defgroup ctrl_trackbar_ncs Notification codes of trackbar control
     * @{
     */

/**
 * \def TBN_REACHMIN
 * \brief Notifies that the slider has reached the minimum position.
 */
#define ETBN_REACHMIN                1

/**
 * \def TBN_REACHMAX
 * \brief Notifies that the slider has reached the maximum position.
 */
#define ETBN_REACHMAX                2

/**
 * \def TBN_CHANGE
 * \brief Notifies that the position of the slider has changed.
 */
#define ETBN_CHANGE                  3

    /** @} end of ctrl_trackbar_ncs */

    /** @} end of ctrl_trackbar */

#define TipLen	32
typedef  struct tagEBTRACKBARDATA
{
    DWORD state;
    int nMin;
    int nMax;
    int nPos;
    int nLineSize;
    int nPageSize;
    int	nFgndColor;
    char sStartTip[TipLen];
    char sEndTip[TipLen];
    int nTickFreq;
    int mousepos;
    DWORD nImage;
    DWORD nSliderImage;
    int nTbBorder;
}EBTRACKBARDATA;
typedef EBTRACKBARDATA* PEBTRACKBARDATA;

BOOL RegisterEBTrackBarControl (void);
void EBTrackBarControlCleanup (void);

#ifdef  __cplusplus
}
#endif

#endif // __EBTRACKBAR_H

⌨️ 快捷键说明

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