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

📄 asix_sb.h

📁 一个操作系统源代码 用于嵌入式设备 在Vc++环境下仿真 成功移植到多款处理器上
💻 H
字号:
#ifndef _ASIX_SB_H
#define _ASIX_SB_H

#define MIN_SBHEIGHT	12
#define MIN_SBWIDTH		12
#define MIN_SLIDERBAR	12//make the bar larger and so easier to drag

#define	BMP_WIDTH		10
#define	BMP_HEIGHT		10

//they are used to note which area is selected
#define SB_UPRIGHT		1
#define SB_DOWNLEFT		2
#define SB_SLIDER		3

struct sb_ctrl
{
	U32		classid;
	U32		windowid;
	U32 	style;
	//size of the whole window of scroll bar
	U16		x, y;
	U16		width, height;
	
	U16		boxw;//width of slider bar
	//range of the whole SB window, but they are not used!
	U16		start, end; 
	//slider_area is the range of slider bar's moving
	U16		slider_area_start, slider_area_range, slider_area_end;
		
	U16		minpos,maxpos;//logical min & max
	//U16		posperpoint;//a point represents some postion changes
	
	U16		curpos;//physical postion of slider bar
	U16		thumblen;//length of slider bar
	U16		thumbend;//thumend=curpos+thumblen-1
	U16		logcurpos;//current logic position
	U16		logrange;//logic range
		
	U8		scrollstatus;//enable=1 or disable=0
	U8		enablescroll;//only used when PenDown happened in slider_area
	U8		keepscroll;//only used when slider bar is scrolling
	//if there are some area where color is changed in the slider_area
	//then "haveinversed" change to 1;
	//else back to 0;
	U8		haveinversed;
	//active area id	
	U32		upright_id, downleft_id, slider_id;
	//show which icon is selected( upright_id, downleft_id or slider_id)
	U8		areaselect;
	//pen position
	S16		penx, peny;
	S16		oldpenx, oldpeny;
	
	U8		*sb_coveredmap;//used when WS_SAVESCREEN is required!
	//save the slider bar's bitmap
	U8		*slider_map;
	
};

extern	STATUS	sb_create(char *caption, U32 style, U16 x, U16 y, U16 width, U16 height, U32 wndid, U32 menu, void **ctrl_str,void *exdata);
extern	STATUS	sb_destroy(void *ctrl_str);
extern	STATUS	sb_msgproc(U32 win_id, U16 asix_msg, U32 lparam, void *data, U16 wparam, void *reserved);
extern	STATUS	sb_msgtrans(void *ctrl_str, U16 msg_type, U32 areaId, P_U16 data, U32 size, PMSG trans_msg);
extern  STATUS  sb_repaint(void *ctrl_str, U32 lparam);
extern  STATUS  sb_enable(void *ctrl_str, U8 enable);

extern	STATUS 	SetScrollRange(U32 windowid,U16 minpos, U16 maxpos);
extern	STATUS 	GetScrollRange(U32 windowid, P_U16 minpos,P_U16 maxpos);
extern	U16 	GetScrollPos(U32 windowid, U16 message, U16 wparam, U8 flag);
extern	STATUS 	SetScrollPos(U32 windowid, U16 wparam, U32 menu, U16 message);

#include <asixwin\asixdbg.h>

#if ENABLE_ASIX_SCROLLBAR_DEBUG_OUT

#define asix_sbprintf(str)	dbgprintf( str )
#define asix_sboutput(str, var)	dbgoutput(str, var)
#define _asix_sbdbgout(str)	_dbgout(#str)
#define asix_sbassert(p)	((p) ? 	(void)0 : \
								(void) _asix_sbdbgout(Assertion failed:  ##p##, file ##__FILE__## , line  ##__LINE__## \n ))

// mem debug			
#define asix_sb_memdbgprintf(str)	dbgprintf( str )
#define asix_sb_memdbgoutput(str, var)	dbgoutput(str, var)

#else // disable asix button control debug

#define asix_sbprintf(str)
#define asix_sboutput(str, var)
#define asix_sbassert(p)

#define asix_sb_memdbgprintf(str)	
#define asix_sb_memdbgoutput(str, var)	

#endif


#endif

⌨️ 快捷键说明

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