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

📄 uichkbtn.h

📁 嵌入工linux开发的源码
💻 H
字号:
#ifndef _GUI_CHKBUTTON_H_
#define _GUI_CHKBUTTON_H_

#include <typedefine.h>

#define GUI_CHKBTN_CAPTION_SIZE 30

/*chkbtn style*/
#define BUTTON_CHECKBOX1   0x0000
#define BUTTON_CHECKBOX2   0x0002
#define BUTTON_RADIO       0x0004
#define BUTTON_LABEL       0x0008

#define OFFCHECKED         0       
#define ONCHECKED          1 
#define FAILCHECKED        2

#define CHKBTN_BORDER_COLOR  GUI_BLACK
#define CHKBTN_BACK_COLOR    GUI_WHITE
#define CHKBTN_FONT_COLOR    GUI_BLACK


typedef struct tagguiGroup 
{
    struct tagguiGroupItem *head;       // point to first item
    struct tagguiGroupItem *current;    // point to current item
	HNDL   select_handle;                     // for first select 
}guiGroup,*pguiGroup;

struct tagguiGroupItem
{
    struct tagGuiChkButton       *button;     // point to current check-button
    struct tagguiGroupItem *prev;    
    struct tagguiGroupItem *next;
};

typedef struct tagGuiChkButton
{
	struct tagGuiControl base ;               
	
	/* extention attribute */
	char   caption[GUI_CHKBTN_CAPTION_SIZE+1] ; 
	WORD  fChecked;                            
	
    struct tagguiGroup *group;           
}GuiChkButton,*pGuiChkButton;


/*********************************************************************/
//para: left,top,right,bottom:refer to window or vport
//dest: create chkbtn
//return:
//fail: NULL
//sucess: chkbtn handle
/*********************************************************************/
DLL_EXP(HNDL) guiChkButton_Create( WORD left, WORD top,	WORD right, WORD bottom, char* caption, WORD style ) ;

/*********************************************************************/
//para: handle & select or not
//dest: select chkbtn or not
//return:
//fail: FAILCHECKED
//sucess: ONCHECKED or FAILCHECKED
/*********************************************************************/
DLL_EXP(WORD) guiChkButton_SetValue( HNDL handle, WORD fChecked);


/*********************************************************************/
//para: handle
//dest: get chkbtn's select status
//return:
//fail: FAILCHECKED
//sucess: ONCHECKED or FAILCHECKED
/*********************************************************************/
DLL_EXP(WORD) guiChkButton_GetValue( HNDL handle );

/*********************************************************************/
//para: handle and chkbtn's caption string
//dest: set chkbtn's caption
//return:
//fail: STATUS_ERR
//sucess: STATUS_OK
/*********************************************************************/
DLL_EXP(STATUS) guiChkButton_SetCaption( HNDL handle, const char *string);

/*********************************************************************/
//para: chkbtn handle 
//dest: get chkbtn's caption
//return:
//fail: NULL
//sucess: chkbtn's caption'string pointer
/*********************************************************************/
DLL_EXP(char *) guiChkButton_GetCaption( HNDL handle );

/*********************************************************************/
//para: chkbtn handle 
//dest: delete chkbtn
//return:
//fail: 0
//free the group resource and the chkbtn resource:1
//only release the chkbtn resource:2
/*********************************************************************/
DLL_EXP(STATUS) guiChkButton_Delete( HNDL handle );

/*********************************************************************/
//para: chkbtn handle 
//dest: show chkbtn
//return:
//fail: STATUS_ERR
//sucess: STATUS_OK
/*********************************************************************/
DLL_EXP(STATUS) guiChkButton_Show( HNDL handle );


/** Grouping Function **/

/*********************************************************************/
//para: void
//dest: create group,manage the chkbtn
//return:
//fail: NULL
//sucess: return the group handle
/*********************************************************************/
DLL_EXP(HNDL) guiGroup_Create( void ); 

/*********************************************************************/
//para: group handle ande chkbtn handle 
//dest: add chkbtn to group
//return:
//fail: STATUS_ERR
//sucess: STATUS_OK
/*********************************************************************/
DLL_EXP(STATUS) guiGroup_Add( HNDL hGroup, HNDL hButton ); 

/*********************************************************************/
//para: group handle
//dest: delete chkbtn and it's group 
//return:
//fail: STATUS_ERR
//sucess: STATUS_OK
/*********************************************************************/
DLL_EXP(STATUS) guiGroup_Delete( HNDL hGroup );

/*********************************************************************/
//para: group handle and chkbtn handle
//dest: remove the chkbtn from the group list
//return:
//fail:-1
//if chkbtn is not in a group and remove sucess:0
//if chkbtn is in a group and remove sucess :1  
/*********************************************************************/
DLL_EXP(STATUS) guiGroup_Remove( HNDL hGroup, HNDL hButton ); 

/*********************************************************************/
//para: group handle
//dest: get which chkbtn is select in it's group
//return:
//fail or no: NULL
//sucess: return the select chkbtn handle
/*********************************************************************/
DLL_EXP(HNDL) guiGroup_GetCheck( HNDL hGroup ); 

/*********************************************************************/
//para: check button's handle and it's check status
//dest: process check button in group and keep one check status 
//check button in the group
//return:void
/*********************************************************************/
void _chkbtn_group_handler(HNDL handle,WORD fchecked);

#endif


⌨️ 快捷键说明

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