/************************************************************
FileName: Gui.h
Author:胡贵
Version :V1.0
Date: 2007.9.13
Description:
用于GUI的一些底层代码,只是部分功能,
还需要完善
History:
<author> <time> <version > <desc>
************************************************************/
#ifndef _GUI_H_
#define _GUI_H_
#include "comm.h"
#include "ds1302.h"
#define X_PIXEL 128
#define Y_PIXEL 64
#define X_PIXEL_NUMBER 3
#define Y_PIXEL_NUMBER 5
struct GUI_RECT
{
UINT8 x0;
UINT8 x1;
UINT8 y0;
UINT8 y1;
};
struct Text
{
UINT8 code* *p_Content;
/*#if TextProperty
UINT8 X_Distance;
UINT8 L_Margin;
UINT8 R_Margin;
UINT8 zimu_X_X;
#endif*/
};
struct GUI_BUTTON
{
UINT8 *p_HZ_STR;
UINT8 x;
UINT8 y;
UINT8 dx;
UINT8 dy;
};
struct StpLabelBlk_YMD
{
struct Time *p_Time;
struct Time Time_Temp;
UINT8 Location_Cur_Crt;
UINT8 x;
UINT8 y;
};
struct StpLabelBlk_Int
{
UINT16 *p_Dat;
UINT8 Location_Cur_Crt;
UINT8 n_Bit;
UINT16 Dat_Temp;
UINT8 x;
UINT8 y;
};
//逻辑开关量设置页数据结构
struct StpLabelBlk_Logic
{
UINT8 *p_Dat;
UINT8 Dat_Temp;
UINT8 x;
UINT8 y;
UINT8 Location_Cur_Crt;
};
/*The base GUI function declaration*/
void GUI_DrawPixel(UINT8 x,UINT8 y);
void GUI_DrawHLine(UINT8 x0,UINT8 x1,UINT8 y);
void GUI_DrawHLine_(UINT8 x0,UINT8 x1,UINT8 y);
void GUI_DrawVLine(UINT8 y0,UINT8 y1,UINT8 x);
void GUI_DrawRect(UINT8 x0,UINT8 x1,UINT8 y0,UINT8 y1);
UINT8 code* GetCharPointer(UINT8 character);
void GUI_DispChars(UINT8 *p_Char,UINT8 x,UINT8 y);
void GUI_DispLine(struct Text *p_Text,UINT8 n_Disp,struct GUI_RECT *p_Rect);
void GUI_DisIntData(INT16 dat,UINT8 x,UINT8 y,UINT8 *formate);
void GUI_DisFloatData(FLP32 dat,UINT8 x,UINT8 y,UINT8 *formate);
void GUI_InvertRect(UINT8 x0,UINT8 x1,UINT8 y0,UINT8 y1);
void GUI_ClearRect(UINT8 x0,UINT8 x1,UINT8 y0,UINT8 y1);
void ZK_To_Bitmap(UINT8 code* zk,UINT8 row,UINT8 col,UINT8* p_Bitmap);
void RegionInsertInDisBuffer(struct GUI_RECT* rect,UINT8* p_Content);
//UINT8 code* GetCharPointer(UINT8 character);
UINT16 get_hz_const(UINT8 *p);
UINT8 Generate_HZ_Group(UINT8 *p,UINT8 code **HZ_Group);
UINT8 GUI_DispLine_(UINT8 *p_HZ_Str,UINT8 x,UINT8 y);
void GUI_DrawArrow(UINT8 up_down);
void GUI_ClearAll(void);
void Gui_CharacterStyle_Set7_4(void);
void Gui_CharacterStyle_Set12_6(void);
void GUI_DrawButton(struct GUI_BUTTON *p_btn, UINT8 *p_HZ_Str,UINT8 x,UINT8 y,UINT8 dx,UINT8 dy);
void GUI_ButtonClick(struct GUI_BUTTON *p_btn);
void GUI_ButtonRelease(struct GUI_BUTTON *p_btn);
void GUI_ClearPixel(UINT8 x,UINT8 y);
void CreateStpLabel_YMD(UINT8 *p_HZ_Str,UINT8 x_HZ,UINT8 y_HZ,struct Time *p_T, UINT8 x_T,UINT8 y_T,UINT8 flag);
void OnOK_YMD(UINT8 flag);
void OnPre_YMD(UINT8 flag);
void OnNxt_YMD(UINT8 flag);
void CreateStpLable_Logic(UINT8 *p_HZ_Str,UINT8 *p_Logic,UINT8 x_HZ,UINT8 y_HZ,UINT8 x_dat,UINT8 y_Dat);
void OnOK_Logic(void);
void OnPre_Logic(void);
void OnNxt_Logic(void);
void OnCancle_Logic(void);
void CreateStpLabel_Int(UINT8 *p_HZ_Str,UINT8 x_HZ,UINT8 y_HZ,UINT16 *p_Int, UINT8 x_Dat,UINT8 y_Dat,UINT8 n_Int);
//UINT8 GetBCD_At(UINT16 dat,UINT8 n_Bit,UINT8 Location_Bit);
signed char GetBCD_At(UINT16 dat,UINT8 n_Bit,UINT8 Location_Bit);
void OnOk_Int(void);
void OnPre_Int(void);
void OnNxt_Int(void);
void OnCancle_Int(void);
#endif |