/ * Stdeg.h code Writing: Wang Jiabao Last Update Date: 2000.04.01
Uses: Provide a friendly man-machine interface requirement: Must have a Microsoft mouse and driver must provide a multi-re-memory management program HIMEM.SYS with a VGA display card color display * /
/ * Border type by Winmake () * / Enum winframe {std_frame = 101, shadowline_frame, null_frame, button_frame}
#define button_up 1 / * Sign: The border of the button or window is convex or recessed * / # define x_btn_w 16 / * small button wide and high * / # define x_btn_h 16 # define normal_btn_w 70 / * big button Wide and high * / # define normal_btn_h 24
/ * ====================== cMenu >>>>>>>>>>>>>>>>>>>>> * / # define max_Menu_title 15 / * How many items per menu can have item * / int btn_text_color = black; / * button text color * / int menu_text_color = black; / * Text color in the menu * / int menu_background = lightgray; / * Menu Background Color * / INT MENU_CHOICE_BACKGROUND = LightRED; / * Menu Bright Bar Background Color * / INT MENU_CHOICE_TEXT_COLOR = White; / * Menu Bright Strip Text Color * // * Some Definitions for Menu Return * / ENUM {MENU_CLOSE = 60, MENU_NOT_CLOSE, MENU_Close_all}; struct cmenuinfo {char * info; / * If there is no NULL * / INT (* function) (); / * If there is no need to point to an empty function null () { ;} * /}; struct CMenu {int left, top, frame; struct CMenuInfo inf [MAX_MENU_TITLE]; int SaveBackImage [XMS_BLOCK_NUM]; int BackImageBlockNum; / * these two parameters are used by BackupWin & RestoreWin * /}; / * = ====================== cMenu end <<<<<<<<<<<<<<<<<<<<< * /
/ * ================ CDialog >>>>>>>>>>>>>>>>>>>>>> > * // * A universal dialog class, implement function, by calling two functions pointers * / # define dialog_close menu_close # define dialog_not_close menu_not_closestruct cdialog {int LEFT, TOP, RIGHT, BOTTOM; / * Border value * / char * TITLE ; / * Dialogue window name * / int (* draw) (); / * Initialization dialog window client area * / int (* react) (); / * When the client area in LButton points is called to process the event * / INT close; / * Sign can display close button * / int move; / * flag can be moved * / int Active; / * Whether it is opened, the design of the non-mode dialog box * / int SAVEDIALOGIMAGE [xms_block_num ]; / * Save window interface * / int Savedialogback [xms_block_num]; / * Save Background * / int BackImageBlockNum;}; / * =============== CDialog End <<<<<<< <<<<<<<<<<<<<<<<<<<<<<< * // * =================== cMessageBox >>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>, MSG_BTN_NUM; / * The button position for transmitting the message box * / char * msgbox_str1, * msgbox_str2; / * message * / enum msg_btn_style {YES_BUTTON = 1, YES_NO_BUTTON = 2}; struct CMessageBox {char * title; / * title * / int close; int move; int style; / * YES_BUTTON represents a YES button, Y_N_B Similarly * / char * str1; / * two sentence warnings * / char * str2;}; struct cMessageBox systemError = {" Source code error ", 0, 1, yes_button}; / * for EG internal function error message box * // * ================== cMessageBox end <<< <<<<<<<<<<<<<<<<<<<<< * /
/ * =================== Cbutton >>>>>>>>>>>>>>>>>>>>>>>> >>>>> * // * Generate the check button with the radio button, not make a button to * / int groups; #define max_btn 10 / * Most of each set of buttons * / #define CBTN_W 8 / * Check | Radio size * / # define CBTN_H 8enum {check = 1, Radio = 0, Press_ON_BTN = 1}; struct cbutton {Int Num; / * How much button * / int Style / * Style Check || Radio * / int status [* Selection status of each button * / char * btntip [max_btn]; / * button prompt information * / int btncoord [MAX_BTN] [2]; / * The coordinates of the button, the customer zone coordinate * /}; / * CButton object should not be called directly by CDIALOG.REACT, should be called by the response function called by the React to handle the return button status. If there is a multi-set button, define one Cbutton array * // * ==================== cbutton end <<<<<<<<<<<<<<<<<<<<<< <<<<<<<<<<< * // * ===================== CEDIT >>>>>>>>>>>>>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>]
Struct Cedit {char * s; / * Tip information * / char * e; / * Requires edited field * / char * p; / * format string * / int color; / * the fonts' color * / int SX; / * Tip The list of listed widths * / int sy; / * The message is listed in the list address * / int ex; / * Requires the column coordinate of the field * / int EY; / * Requires the row of fields * / int W; / * Need to edit the width of field * /}; / * ============================= CEDIT END <<<<<<<<<<<<<<< <<<<<<<<<<<<<<<<<<<<< * // * ==================== SELECT >>>> >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> # Define Noselect 32764INT SELECT (int WL, INT WT, INT WR, INT WB, CHAR * STR []); / * ============================= SELECT END <<<<<<<<< <<<<<<<<<<<<<<<<<<<<<<<<<<< * /
/ * ====================== WinReadtxt >>>>>>>>>>>>>>>>>>>>>> the number of rows >>>>>>>>>> * / # define TXT_WIN_BACKGROUND MENU_BACKGROUND # define TXT_WIN_TEXT lIGHTBLUE # define INITTXTWIN 3150 # define MAXLINENUM 200 / * can be displayed * / unsigned long lineaddr [MAXLINENUM]; int wl, wt, wr , wb; / * text display window, due to window moving, so use global variable * / file * txtfileHandle; Struct Creadtxt {Int Left, TOP, Right, Bottom; Int TxtLeft, TXTTTOP, TXTRIGHT, TXTBOTTOM; Char * txtfilename;}; int WinReadTxt (struct CReadTxt r); int ReadTxtFile (int left, int top, int right, int bottom, int key); / * initialization, key should INITTXTWIN * / int ActTxtWinButton (int mx, int my , struct cdialog bm); / * ================================ WinReadtxt End <<<<<<<<<<<<<<<<< <<<<<<<<<<<<<< * // * Returns the two big people * / int Max (int A, INT B);
/ * Point x, y in one box? * / BOOL Inbar (int X, int y, int L, int T, int R, int b);
/ * You can display Chinese and English, do not erase the background, this function does not turn off the mouse cursor * / void OutText (int X, int y, unsigned char color, unsigned char * hz);
/ * Display text, but use bkground to erase the background, this function turns off the mouse cursor * / void Outtextex (int X, int y, int bkground, int color, unsigned char * hz);
/ * Make a borderless fill rectangle * / void Fillbar with the colors * / void Fillbar (Int L, Int Bi) ;. Int Style, Int BkGround;
/ * Make an empty border, Status logo convex or concave * / bool Winmake (int L, int 4, int stat, int 1); int (int 1, int in);
/ * Popup menu * / int popmenu (struct cmenu * m);
INT XMS_HZK16; INT XMS_ASC16; BOOL LOAD_HZK16_2_XMS (); / * if Error Return 0 * /
Bool CheckChineseos (Void);
/ * Initialize the entire EG, including: a. Detect whether the Chinese character system exists b. Initialize the graphics system c. Detect HiMem.sys d. Pull the HZK16 into XMS to speed up the speed of the Chinese characters.. Show mouse cursions, so the cursor f is turned off in the drawing to load the system's timer to provide some precise control of time, modify the INT 08 interrupt * / void initgr (void); / * Destructure EG * / VOID Closegr (Void);
/ * Initialization and Running of dialogs * / bool initdialog (struct cdialog * bm); int RunDialog (Struct CDialog * BM);
/ * Make a button & Make a mouse to operate the action * / Bool Button (int GL, int GT, CHAR * BTN_STR, CHAR * style, int stat, Bool ActionButton (int L, Int T, char * BTN_STR, CHAR * STYLE);
/ * Users only need to fill in the structure, then call MessageBox, the other two functions for service functions are typical examples of CDIALOG framework calls * / int MessageBox (Struct CMessageBox * W); Static Int GmessageBoxDRAW (Struct CDialog BM); Static Int GMessageBoxReact (int X, int y, struct cdialog bm, int * return_value);
/ * Initialization and Response User Operation Function of CButton Structure and Syllabic Buttons * / Void Initbtn (Int Group, Struct Cbutton BTN [], Struct CDialog BM); int BTNREACT (int X, int y, struct cbutton [ ], struct cdialog); / * Make radial buttons * / void Creatradiobtn (int OX, INTOY, INT Status); int GetBTNSTATUS (int 201UPNUM, INT MEMBER, STRUCT CBUTTON BTN []);
INT GEDITFIELD (int N, INT T, INT R, INT B, INT N, STRUCT CEDIT G [], int yes_x, / int yes_y, int No_x, int no_y, char * title); Void Curs (int X, int y INT Show;