📄 button.h
字号:
#ifndef _ASIXBUTTON_H
#define _ASIXBUTTON_H
#include "asixwin.h"
//define button ctrl_str
#define MAX_TAG_WIDTH 116 //130 //modified by xuanhui 2002/3/19
//modified by xuanhui 2002/3/19
#define BTN_INTERVAL 1 //一般一段文字四周所间隔的距离
#define BTN_REGULAR_STR_INTERVAL 5 //在Disp16StringGrey()中, string顶部与半高的距离差
#define BTN_TAG_HEIGHT (CHINESE_CHAR_HEIGHT+BTN_INTERVAL+2) //16 modified by xuanhui 2002/3/28 //tag边框的高
#define BTN_XTAG_INTERVAL 10 //tag顶点离button左顶点的水平距离
#define BTN_YTAG_INTERVAL 3 //tag顶点离button左顶点的垂直距离
#define BTN_UNDERLINE_INTERVAL 8 //在风格BS_UNDERLINE中,下划线与半高的距离差
#define BTN_MULTILINE_INTERVAL 4 //在风格BS_MULTILINE中,文字框四周所间隔的距离
// longn_qi 2002/09/09 added
#define BTN_STATUS_UP 0x00 // 按钮抬起
#define BTN_STATUS_DOWN 0x01 // 按钮按下
#define BTN_STATUS_REPAINT 0x02 // 重绘按钮
#define BTN_STATUS_MASKED 0x04 //
struct bt_ctrl_str
{
U32 classid; //the class the button belongs to
U32 wndid; //the single identifier of a button
U32 bt_id; //the areaid of the button
U32 bt_style; //the style of a created button
U8 bt_state; //the state of a created button
char *bt_caption; //the caption of a button
U16 bt_icon_width; //the width of the icon displayed on the button surface
U16 bt_icon_hight; //the hight of the icon displayed on the button surface
P_U8 bt_icon; //the icon of a button
P_U8 bt_back_saved; //save the background of the rectangle which will creat a button
//P_U8 bt_face_saved; //if the button was saved,it will point to the first address of the memory
P_U8 bt_tag_saved; //if the tag of the button was saved, it will point to the first address of the memory
U16 tag_x; //the x coordinates of the tag
U16 tag_y; //the y coordinates of the tag
U16 tag_width; //the width of the tag
U16 tag_hight; //the hight of the tag
};
extern STATUS Btn_create(char *caption,U32 style,U16 x,U16 y,U16 width,U16 hight,U32 parent,U32 menu,void **ctrl_str,void *exdata);
extern STATUS Btn_destroy( void *ctrl_str );
extern STATUS Btn_msg_trans(void *ctrl_str, U16 msg_type, U32 areaid, P_U16 data, U32 size, PMSG trans_msg);
extern STATUS Btn_msg_proc(U32 win_id, U16 bt_msg_type, U32 lparam, void *data, U16 wparam, void *reserved );
extern STATUS Btn_caption(void *ctrl_str, char *caption, void *exdata);
extern STATUS Btn_enable(void *ctrl_str, U8 enable);
extern STATUS Btn_repaint(void *ctrl_str, U32 lparam);
extern STATUS MaskButton( U32 btid, U8 mode );
// debug asix button
#ifndef DEBUG_ASIX_BUTTON
#define DEBUG_ASIX_BUTTON
#include <stdio.h>
#include "sysdebug.h"
#include "asixdbg.h"
#if ENABLE_ASIX_BUTTON_DEBUG_OUT
#define asix_btprintf(str) dbgprintf( str )
#define asix_btoutput(str, var) dbgoutput(str, var)
#define _asix_btdbgout(str) _dbgout(#str)
#define asix_btassert(p) ((p) ? (void)0 : \
(void) _asix_btdbgout(Assertion failed: ##p##, file ##__FILE__## , line ##__LINE__## \n ))
// mem debug
#define asix_bt_memdbgprintf(str) dbgprintf( str )
#define asix_bt_memdbgoutput(str, var) dbgoutput(str, var)
#else // disable asix button control debug
#define asix_btprintf(str)
#define asix_btoutput(str, var)
#define asix_btassert(p)
#define asix_bt_memdbgprintf(str)
#define asix_bt_memdbgoutput(str, var)
#endif
#endif /* DEBUG_ASIX_BUTTON */
#endif //#ifndef _ASIXBUTTON_H
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -