📄 uicaret.h
字号:
#ifndef __CARET_H__
#define __CARET_H__
/*---------------------------- INCLUDE FILES --------------------------------*/
#ifndef ON
#define ON 1
#endif
#ifndef OFF
#define OFF 0
#endif
/*------------------------------ DEFINES ------------------------------------*/
/*------------------------------ TYPEDEFS -----------------------------------*/
typedef struct {
BYTE nWidth; /* width of the caret */
BYTE nHeight; /* height of the caret */
short ixPos; /* x coordinate of the caret. */
short iyPos; /* y coordinate of the caret. */
BOOL bEnable; /* whether the caret is enable or not */
BOOL bVisible; /* whether the caret is visible or not */
BOOL bState; /* toggle the display of caret. */
} TCaret, * pTCaret;
/*------------------------ GLOBALS (EXTERNAL) -------------------------------*/
/*------------------------ GLOBALS (INTERNAL) -------------------------------*/
/*-----------------------------------------------------------------------------
Name : void guiCaret_Create( BYTE nWidth, BYTE nHeight )
Purpose : Creates a new caret for the system caret.
Param(s):
nWidth width of the caret
nHeight height of the caret
Returns :
Remark : CaretCreate automatically destroys the previous caret shape. The
caret is hidden until the application calls the CaretShow function
to make the caret visible.
This function MUST be called by any editor when the editor
GOT the FOCUS. When it LOST FOCUS, it MUST call CaretHidden
function.
-----------------------------------------------------------------------------*/
DLL_EXP(void) guiCaret_Create( BYTE nWidth, BYTE nHeight );
/*-----------------------------------------------------------------------------
Name : void guiCaret_ChangeSize( BYTE nWidth, BYTE nHeight )
Purpose : Creates a new caret for the system caret.
Param(s):
nWidth width of the caret
nHeight height of the caret
Returns :
Remark :
-----------------------------------------------------------------------------*/
DLL_EXP(void) guiCaret_ChangeSize( BYTE nWidth, BYTE nHeight );
/*-----------------------------------------------------------------------------
Name : void guiCaret_SetPos( short ixPos, short iyPos )
Purpose : Sets caret to a new position.
Param(s):
ixPos x coordinate of the new position
iyPos y coordinate of the new position
Returns : void
Remark :
-----------------------------------------------------------------------------*/
DLL_EXP(void) guiCaret_SetPos( short ixPos, short iyPos );
/*-----------------------------------------------------------------------------
Name : void guiCaret_GetPos( short* ixPos, short* iyPos )
Purpose : Gets caret current position.
Param(s):
ixPos
iyPos
Returns : void
Return Value:
ixPos pointer to caret's current x coordinate(short).
iyPos pointer to caret's current y coordinate(short).
Remark :
-----------------------------------------------------------------------------*/
DLL_EXP(void) guiCaret_GetPos( short* ixPos, short* iyPos );
/*-----------------------------------------------------------------------------
Name : void guiCaret_Show( void )
Purpose : Makes the caret visible on the screen at the caret's current
position. When the caret becomes visible, it begins flashing
automatically.
Param(s):
hWnd handle of the form with caret
Returns : void
Remark : post-condition:
- the caret state is toggled
- the caret of specified size is display at the specified
position in the new state if it is enabled
-----------------------------------------------------------------------------*/
DLL_EXP(void) guiCaret_Show( void );
/*-----------------------------------------------------------------------------
Name : BOOL guiCaret_Hide( void )
Purpose : Hides the caret.
Param(s):
hWnd handle of the form with caret
Returns : the previous caret visibility.
TRUE The previous caret is visible.
FALSE The previous caret is disable and invisible.
Remark : a) pre-condition
b) post-condition
- The caret is disabled and invisible.
-----------------------------------------------------------------------------*/
DLL_EXP(BOOL) guiCaret_Hide( void );
/*-----------------------------------------------------------------------------
Name : void guiCaret_Draw( void )
Purpose : Makes the caret visible on the screen at the caret's current
position. When the caret becomes visible, it begins flashing
automatically.
Param(s): void
Returns : void
Remark : post-condition:
- the caret state is toggled
- the caret of specified size is display at the specified
position in the new state if it is enabled
- Call only by real time clock IRQ
-----------------------------------------------------------------------------*/
DLL_EXP(void) guiCaret_Draw( void );
//call after the caret be cleaned by no notice
DLL_EXP(void) guiCaret_Enable( void ); //for ViewPort
//call before the caret be cleaned by no notice
DLL_EXP(void) guiCaret_Disable( void ); //for ViewPort
/**************************************************************/
/*******************<<end of uiCaret.h>>***********************/
/**************************************************************/
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -