📄 sgwindow.h
字号:
/* ======================================================================= */
/* GWINDOW.H : Protptype for GWINDOW */
/* */
/* Using MS C6.0 Compiler */
/* */
/* */
/* ======================================================================= */
#include "yp.h"
#define VGA_BLACK 0 /* dark colors */
#define VGA_BLUE 1
#define VGA_GREEN 2
#define VGA_OLDWHITE 3
#define VGA_RED 4
#define VGA_DARKWHITE 5
#define VGA_BROWN 6
#define VGA_LIGHTGRAY 7
#define VGA_DARKGRAY 8 /* light colors */
#define VGA_LIGHTBLUE 9
#define VGA_LIGHTGREEN 10
#define VGA_LIGHTCYAN 11
#define VGA_LIGHTRED 12
#define VGA_NEWWHITE 13
#define VGA_YELLOW 14
#define VGA_WHITE 15
#define ID_OK 1
#define ID_CANCEL 0
#define OK 1
#define ERROR 0
#define line(x1,y1,x2,y2); _moveto(x1,y1);_lineto(x2,y2);
/* ------------------------------ Pressbutton -------------------------- */
typedef struct ias_pb
{
int left;
int top;
int width;
int height;
char far * label;
int ID;
int HotKey;
struct ias_pb far * next;
}PRESSBUTTON;
/* ---------------------------- H-ScrollBar -------------------------- */
typedef struct _hs
{
int left;
int top;
int width;
int min_value;
int max_value;
int curr_value;
int walk_step;
int jump_step;
int ID;
int LeftKey;
int RightKey;
int LeftJump;
int RightJump;
int enable;
struct _hs far * next;
}HSCROLLBAR;
/* ---------------------------- V-ScrollBar -------------------------- */
typedef struct _vs
{
int left;
int top;
int height;
int min_value;
int max_value;
int curr_value;
int walk_step;
int jump_step;
int ID;
int UpKey;
int DownKey;
int UpJump;
int DownJump;
int enable;
struct _vs far * next;
}VSCROLLBAR;
/* ---------------------------- List Block -------------------------- */
typedef struct _list_block
{
int left;
int top;
int select;
int ID;
int HotKey;
struct _list_block far * next;
}LISTBLOCK;
/* ---------------------------- Frame -------------------------- */
typedef struct _gframe
{
int left;
int top;
int height;
int width;
int ID;
int HotKey;
struct _gframe far * next;
}GWFRAME;
/* ------------------------------ Entry field -------------------------- */
#define CHAR 1
#define UCHAR 2
#define INT 3
#define UINT 4
#define LONG 5
#define ULONG 6
#define FLOAT 7
#define DOUBLE 8
#define STRING 9
#define FSTRING 10
#define NONEKEY 0xff00
typedef struct _ef
{
int left;
int top;
int width;
int height;
char far *prompt;
char type;
char far * buffer;
int (far * validatefunc)();
void (far * helpfunc)();
int ID;
int HotKey;
struct _ef far * next;
}ENTRYFIELD;
/* -------------------------- Popup window ------------------------------- */
typedef struct _wnd
{
unsigned long bufferpointer; /* points to window save block */
int left; /* nw x coordinate */
int top; /* nw y coordinate */
int width; /* window width */
int height; /* window height */
int bkcolor; /* background color */
int withtitle; /* 1 - with title, 0 - no title */
struct _wnd far * _nx; /* points to next window */
struct _wnd far * _pv; /* points to previous window */
PRESSBUTTON far * firstPB; /* points to first pressbutton */
ENTRYFIELD far * firstEF; /* points to first entry field */
HSCROLLBAR far * firstHS; /* points to first h-scrollbar */
VSCROLLBAR far * firstVS; /* points to first v-scrollbar */
LISTBLOCK far * firstLST; /* ponits to first list block */
GWFRAME far * firstFRM; /* ponits to first frame */
}POPUPWINDOW;
/* -------------------------------------------------------------------- */
/* Function prototypes */
/* -------------------------------------------------------------------- */
int InitGwindow(void);
int InitChildGwindow(void);
unsigned int get_char(void);
void ErrorMessage(char *);
void WorkingMessage(char *);
void ClearWorkingMessage(void);
int putcchar(int x,int y,int color,unsigned int inter_code);
void display_cstring(void);
int ccprintf( int x, int y, int color, char *fmt, ... );
void makeblock(int x,int y,int width,int height,int BlockType);
void makewhiteblock(int x,int y,int width,int height,int BlockType);
POPUPWINDOW far * EstablishPopupWindow( int x,int y,int width,int height,int bkcolor,int withtitle);
void DeletePopupWindow(POPUPWINDOW * wnd);
void DisplayPressButton(PRESSBUTTON * pb,int pressing); /* pressing:
1:pressing,0:free */
unsigned long SaveBlock(int x,int y,int width,int height);
int RestoreBlock(int x,int y,int width,int height,unsigned long BufferPointer);
void SetTitle(POPUPWINDOW * wnd,char * title);
int ccwprintf( POPUPWINDOW * wnd,int x,int y,int color,char * fmt,...);
void ModifyFrameSwitch(POPUPWINDOW *wnd,int id,int number);
void ModifyDataEntry(POPUPWINDOW *wnd,int id,char *buffer);
int print_screen(int ul_row,int ul_col,int dr_row,int dr_col);
void DisplaySwitch(int x,int y,int state);
int SplitNumber(long Innum,int stand,int *mnumber,int *refuse);
int SplitMaterial(char *YpMaterial,float YpRequ,float *mean_value,float *lower_bound,float *upper_bound,float *DF,int *outday);
void ReadColorSetting(int color,unsigned char *Red,unsigned char *Green,unsigned char *Blue);
void ModifyColor(int color,int red,int green,int blue );
int EstablishPressButton( POPUPWINDOW * wnd,
int left,
int top,
int width,
int height,
char * label,
int ID,
int HotKey);
int EstablishEntryField( POPUPWINDOW * wnd,
int left,
int top,
int width,
int height,
char * prompt,
char type,
char *buffer,
int (* validate)(),
void (* helpfunc)(),
int ID,
int HotKey
);
int FieldEntry( int * CursorX,
int * CursorY,
POPUPWINDOW * wnd,
ENTRYFIELD * ef
);
int Dialog(POPUPWINDOW * wnd,
int * PrevSelect,
int * CursurX,
int * CursorY,
int * ControlClass,
int * ControlID,
long * lPara);
void ClearWindowRect(POPUPWINDOW * wnd,int x,int y,int width,int height);
void DisplayHScrollBar(HSCROLLBAR *hs);
void DisplayVScrollBar(VSCROLLBAR *vs);
int EstablishHScrollBar( POPUPWINDOW * wnd,
int left,
int top,
int width,
int min_value,
int max_value,
int default_value,
int walk_step,
int jump_step,
int ID,
int LeftKey,
int RightKey,
int LeftJump,
int RightJump
);
int ModifyHScrollBar( POPUPWINDOW * wnd,
int left,
int top,
int width,
int min_value,
int max_value,
int default_value,
int walk_step,
int jump_step,
int ID,
int LeftKey,
int RightKey,
int LeftJump,
int RightJump
);
int EstablishVScrollBar( POPUPWINDOW * wnd,
int left,
int top,
int height,
int min_value,
int max_value,
int default_value,
int walk_step,
int jump_step,
int ID,
int UpKey,
int DownKey,
int UpJump,
int DownJump
);
int ModifyVScrollBar( POPUPWINDOW * wnd,
int left,
int top,
int height,
int min_value,
int max_value,
int default_value,
int walk_step,
int jump_step,
int ID,
int UpKey,
int DownKey,
int UpJump,
int DownJump
);
int EstablishFrame( POPUPWINDOW * wnd,
int left,
int top,
int width,
int height,
int ID,
int HotKey);
void SaveParentScreen(void);
void RestoreParentScreen(void);
int load_child(char * path_name);
int OpenFile(char * name_buffer,char * title ,char * OK_label);
typedef struct List_Atom {
char *Prompt;
int Width;
char **Content;
}LIST_ATOM;
int LIST(int left,int top,int AtomNumber,int RecordNumber,LIST_ATOM **Atom);
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -