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

📄 gpcgui.h

📁 使用键盘上的上、下、左、右四个按键
💻 H
字号:
///////////////////////////////////////////////////////////////////////////////////
//
//    Copyright (C) 1999 SEIKO EPSON Corp.
//    All Rights Reserved
//
//    File name :gpcgui.h
//    Function  :
//        This is a GUI header file
//    Revision history
//          Ver 0.10 1999/07/28  H.Matsuoka           Start
//          Ver 0.20 1999/12/20  SungYoung Shin       Update
//          Ver 0.30 2000/01/21  SungYoung Shin       Add Event function
//          Ver 0.31 2000/02/02  SungYoung Shin       Update Event Structure
//          Ver 0.32 2000/02/09  SungYoung Shin       Add Mouse Event Function
//          Ver 0.40 2000/02/25  SungYoung Shin       Update For WS4
//          Ver 0.41 2000/03/03  SungYoung Shin       Add guiField, guiFldControl Process
//          Ver 0.50 2000/04/10  SungYoung Shin       Update For Alpha2
//          Ver 0.60 2000/04/14  SungYoung Shin       Update For Alpha2 :: Event -> gpcevent.h
//          Ver 0.70 2000/05/22  SungYoung Shin       Add For guiCheckScrollButton()
//          Ver 0.80 2000/05/25  SungYoung Shin       Update For Alpha4
//          Ver 0.81 2000/06/08  SungYoung Shin       Delete GUI_FIELD_SIZE
//
///////////////////////////////////////////////////////////////////////////////////
#ifndef _GPCGUI_
#define _GPCGUI_

///////////////////////////////////////////////////////////////
//  Define Declare Section 
///////////////////////////////////////////////////////////////

// Buffer Size
#define GUI_CURSOR_SIZE      130 // 220

// Field Code
#define GUI_TAB_SIZE           4
#define GUI_SPACE            " "
#define GUI_ENTER            '\n'
#define GUI_TAB              0x9
#define GUI_UP_SCROLL       (-1)
#define GUI_DOWN_SCROLL        1
#define GUI_MAX_SCROLL        10

// Logical Code
#define GUI_TRUE               1
#define GUI_FALSE              0

// Button Status
#define GUI_BUTTON_ON          1
#define GUI_BUTTON_OFF         0

// Event Key Code for DMT33006 
#define GUI_KEY_UP             1  // 0x01
#define GUI_KEY_LEFT           2  // 0x02
#define GUI_KEY_DOWN           4  // 0x04
#define GUI_KEY_RIGHT          8  // 0x08
#define GUI_KEY_UL             3  // 0x03
#define GUI_KEY_DL             6  // 0x06
#define GUI_KEY_DR            12  // 0x0c
#define GUI_KEY_UR             9  // 0x09
#define GUI_KEY_ON            16  // 0x10

// Events Code for GUI
#define GUI_MSG_KEYON         16  // 0x10
#define GUI_MSG_KEYOFF        32  // 0x20

// Events Code for TIMER, MOUSE & KEY
#define GUI_MSG_MOVE         110   // MOUSE & KEY message

// event status, ChY(2001.8.21)
#define ES_APP              1 //0
#define ES_MOBILE           2 //1
#define ES_IDLE		   0             // ADDED BY Zxl

///////////////////////////////////////////////////////////////
//  Structure Declare Section 
///////////////////////////////////////////////////////////////

//typedef enum _guiControlStyle {
//    GPC_BUTTON,
//    GPC_SCROLL_BUTTON,
//    GPC_CHECK_BOX,
//    GPC_RADIO_BUTTON,
//    GPC_FIELD,
//    GPC_SIMPLEFRAME,
//} guiControlStyle;
#define GPC_BUTTON              0x00
#define GPC_SCROLL_BUTTON       0x01
#define GPC_CHECK_BOX           0x02
#define GPC_RADIO_BUTTON        0x03
#define GPC_FIELD               0x04
#define GPC_SIMPLEFIELDFRAME    0x08


typedef struct _guiControlAttr {
    char  attr;      // Control Attribute in the Form
} guiControlAttr;


typedef struct _guiControlGroup {
    short x;         // Group Position of X in the Form
    short y;         // Group Position of Y in the Form
    short width;     // Group Width in the Form
    short height;    // Group Height in the Form
    short groupID;   // Control Group ID in the Form
    char  *title;    // Point to Control Group Title in the Form
} guiControlGroup;

typedef struct _guiControl {
    short x;         // Control Position of X in the Form
    short y;         // Control Position of Y in the Form
    short width;     // Control Width in the Form
    short height;    // Control Height in the Form
    short id;        // Control ID in the Form
    char  style;     // Control Style in the Form
    char  *text;     // Point to Control Text		//sabrina
    guiControlAttr  *controlAttr;  // Point to Control Attribute
    guiControlGroup *group;  // Point to Control Group
    unsigned short  *Image;    // Point to Image Button
} guiControl;


typedef struct _guiForm {
    short x;              // Form Position of X 
    short y;              // Form Position of X 
    short width;          // Form Width
    short height;         // Form Height
    unsigned long bkclr;  // Form Background color
    short id;             // Form ID
    short control_cnt;    // Nmber of Control in the Form 
    char  *text;          // Point to Tittle of Form
    guiControl *control;  // Point to Control in the Form
} guiForm;


typedef struct _guiFieldControl {
    int     StartPoint;        // Start Point of TextField
    int     StartLine;         // Number of Start Line in the Field
    int     TotalText;         // Total Size of TextField
    short   ScreenLine;        // Number of Screen Lines in the Field
    short   LineChars;         // Number of Char in the Line
    char    *TextField;        // Point to TextField 
} guiFieldControl;


typedef struct _guiEvent {
    short     Events;         // Types of Events
    short     KeyCode;        // Key Code
    short     CtrlID;         // Current Ctrl ID
    short     CtrlNo;         // Current Ctrl No
    short     FormModifiers;  // Form Execute Status (GUI_TRUE:1, GUI_FALSE:0)

    int       screenX;        // Current Mouse Position X in the Form
    int       screenY;        // Current Mouse Position Y in the Form
}guiEvent;


typedef struct _guiPoint {
    int  x;     // Current Position X
    int  y;     // Current Position Y
}guiPoint;


///////////////////////////////////////////////////////////////
//  GUI Function Declare Section 
///////////////////////////////////////////////////////////////
int   guiDrawButton(guiControl *control);
int   guiDrawCheckBox(guiControl *control);
int   guiGroupRadioButton(guiControl *control, int pos);
int   guiDrawRadioButton(guiControl *control);
int   guiEraseRadioButton(guiControl *control);
int   guiDrawForm(guiForm *form);
int   guiLoadForm(guiForm *form, void (*event_handler)());
int   guiPopupWindow(guiForm *form);
int   guiClosePopupWindow(guiForm *form);
int   guiMouseButtonDown(guiPoint *Point);
int   guiMouseButtonUp(guiPoint *Point);
int   guiButtonDown(guiForm *form, int pos);
int   guiButtonUp(guiForm *form, int pos);
int   guiCheckPos(guiForm *form, guiPoint point);
int   guiCheckScrollButton(guiForm *form, int pos);
int   guiCheckControlExE(guiForm *form, int controlID);
int   guiDispCursor(guiForm *form, int pos);
int   guiEraseCursor(guiForm *form, int pos);
//int   guiDispMouse(guiPoint *Point);
//int   guiEraseMouse(guiPoint *Point);
int   guiSetCursorImage(unsigned short *pCursor);
//int   guiSetMouseImage(unsigned char *pMouse, unsigned char *pMouseMask);
int   guiSetMemoryBuf(unsigned short *pMemoryBuf);
int   guiDrawField(guiControl *field);
int   guiScrollField(guiControl *field, int scroll, int ScrollLines);
int   guiSetFieldText(guiControl *field, unsigned char *text, unsigned short *FieldBuf);


///////////////////////////////////////////////////////////////
//  Event Function Declare Section 
///////////////////////////////////////////////////////////////
unsigned char guiGetCursor();
void  guiInitEvent(void);
int   guiApplication(void);
void  guiGetEvent(guiEvent* Event);
int   guiPeekEvent(guiEvent* Event,int Timeout);
void  guiTM16CH3_GetKey();
void  guiTM16CH3_INT( void );
void  guiSetKeyTimer(unsigned short freq);
void  guiKillKeyTimer();


///////////////////////////////////////////////////////////////
//  External Declare Section 
///////////////////////////////////////////////////////////////
#if defined _SIMOS

extern guiForm  *guiCurForm;        // Point to Current Form Window
extern guiEvent *guiCurEvent;       // Point to Current Event Structure
extern int      guiButtonFlag;      // check key_on in the event
extern void     (*guiFormHandle)(); // Point to Current Form Handle

extern unsigned short *guiCurBuf;    // Point to Temporary Cursor Memory Buffer

extern int gpcWidth;         // Screen Size of Width
extern int gpcHeight;        // Screen Size of Height

#else

__declspec( dllimport )extern guiForm  *guiCurForm;        // Point to Current Form Window
__declspec( dllimport )extern guiEvent *guiCurEvent;       // Point to Current Event Structure
__declspec( dllimport )extern int      guiButtonFlag;      // check key_on in the event
__declspec( dllimport )extern void     (*guiFormHandle)(); // Point to Current Form Handle

__declspec( dllimport )extern unsigned char *guiCurBuf;    // Point to Temporary Cursor Memory Buffer

__declspec( dllimport )extern int gpcWidth;         // Screen Size of Width
__declspec( dllimport )extern int gpcHeight;        // Screen Size of Height
#endif

#endif // _GPCGUI_ 

⌨️ 快捷键说明

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