{ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ßßß ßßß ßßßßß ßß ßß ßßßß ßßßß ßß ßß ßß ßß ßß ßßß ßß ßßßßßßß ßßß ÉÍÍ ËÍ» ÉÍ» ËÍ» Ë Ë Ë ÉÍ» ÉÍ» ßß ß ßß ßß ßß ßß ßß º Ë Ì˼ Ì͹ Ìͼ Ì͹ º º ÈÍ» ßß ßß ßß ßß ßß ßß Èͼ ÊÈÍ Ê Ê Ê Ê Ê Ê Èͼ Èͼ ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ The MAX Graphics GUI Kit is Copyright 1995-Current Larry L. Athey (LA-Soft). Color Averaging procedures are courtesy of Sean Price (Rude Dog Software). ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ NOTE: This unit is dependent on the FastGraph or FastGraph/Light graphics library... ALSO: Yes, this unit does everything in real mode. I've seen too many odd things happen in my own and other's protected mode programs, I just don't trust it....Real mode works just fine for me and my needs.... PLUS: Yes, you're right again...This sucker isn't object oriented either. I guess this whole mess just makes me either the crappiest, or just the damn laziest programmer in the world. Hey, it's free, it works, and it get the job done for me, that's all I care about... :) ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ} INTERFACE {ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ} TYPE SVGA_Color_Scheme = RECORD {Record for the SVGA color scheme. } Win1Back, {Window type 1 background. } Win4Back, {Window type 4 background. } Win1High, {Window type 1 highlight. } Win4High, {Window type 4 highlight. } Win1Low, {Window type 1 lowlight. } Win4Low, {Window type 4 lowlight. } Win1Frame1, {Window type 1 frame high. } Win1Frame2, {Window type 1 frame low. } Win4Frame, {Window type 4 frame. } ActiveHdr, {Color for active window headers. } InactiveHdr, {Color for inactive window headers. } HdrTitle, {Window header title color. } ButtonFrame, {Button frame color. } ButtonFace, {Button background. } ButtonHigh, {Button highlight. } ButtonLow, {Button lowlight. } ButtonHot, {Button hotkey color. } ButtonText, {Button title color. } FrameLow, {Frame lowlight. } FrameHigh, {Frame highlight. } BoxBack, {Raised/Lowered box background. } BoxHigh, {Raised/Lowered box highlight. } BoxLow, {Raised/Lowered box lowlight. } FieldTextHigh, {Active entry field text color. } FieldTextLow, {Inactive entry field text color. } FieldBack, {Entry field background. } QuoteColor, {Color for BBS message quotes. } MsgColor, {Color for BBS message text. } TearColor, {Color for BBS message tear lines. } FlagColor, {Color for BBS message flags. } MsgIDcolor, {Color for BBS message ID info. } TextBack, {Background color for reader/editor/picklist.} PickHighBack, {Picklist item highlight background color. } PickHighFore, {Picklist item highlight foreground color. } ScreenColor : BYTE; {Screen background color. } END; {ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ} TYPE WindowRecord = RECORD {Record for window settings. } WindowSize : BYTE; {The window size in Bytes. } X1,Y1,X2,Y2 : INTEGER; {Window coordinates. } WType : BYTE; {Window type. } Title : STRING; {Window title. } END; {ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ} TYPE ButtonRecord = RECORD {Record for button settings. } ButtonType : BYTE; {Type of button for the current record. } X,Y,Width : INTEGER; {Button X/Y coordinates and width. } Height : INTEGER; {Button height in pixels. } Title : STRING[30]; {Button title. } ButStr : STRING[20]; {Button hotkey extension string. } Sound : STRING[12]; {Button sound attachment file name. } Return : BYTE; {Return code (ie: Ordinal Character Value). } Holdable : BOOLEAN; {Is the button holdable? } HasIcon : BOOLEAN; {Is there an icon on the button? } FieldOn : BOOLEAN; {If mouse field, is the field visible? } Icon : BYTE; {Main icon record location. } Flip : BYTE; {Secondary icon record location. } IX,IY : INTEGER; {Icon X/Y coordinates. } END; {ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ} TYPE FieldRecord = RECORD {Record for entry field settings. } X,Y : INTEGER; {Field X/Y coordinates. } Text : STRING; {Entry field text. } EType : BYTE; {Entry field type. } ELength : BYTE; {Character width of entry field. } CursorPos : BYTE; {Entry field cursor position. } Active : BOOLEAN; {Is this the currently selected field? } Width : INTEGER; {Entry field pixel width. } Size : BYTE; {Entry field font size (0 or 1). } END; {ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ} TYPE Pick_List = ARRAY[1..800] OF STRING[77]; {^ This is the array in memory that holds the text for picklist items. } {ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ} TYPE Pick_Info = RECORD {Record for the picklist settings. } Active : BOOLEAN; {Has the picklist been activated? } Running : BOOLEAN; {Is the picklist running? } X,Y : INTEGER; {Picklist X/Y coordinates. } Top : INTEGER; {Default selected item at the top of the list} NumItems : INTEGER; {Total number of items in the picklist. } ItemsOnScrn : INTEGER; {Number of items displayed on the screen. } Current : INTEGER; {The currently selected picklist item. } MaxChars : BYTE; {Character width of the picklist. } Locator : INTEGER; {PickList locator position. } Item : ARRAY[1..30] OF WORD;{Item index in the picklist window. } Width : INTEGER; {The right most location of the picklist. } Bottom : INTEGER; {The bottom most location of the picklist. } END; {ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ} TYPE PalScroller = RECORD {Record for the color palette scroller. } Active : BOOLEAN; {Has the palette scroller been activated? } X,Y : INTEGER; {X/Y coordinates of the palette scroller. } Top : BYTE; {Color value of the top scroller element. } Current : BYTE; {The currently selected palette color. } Item : ARRAY[1..16] OF WORD;{Item index in the palette scroller. } Width : INTEGER; {The right most location of the scroller. } Bottom : INTEGER; {The bottom most location of the scroller. } END; {ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ} TYPE Text_Buffer = ARRAY[1..400] OF STRING[79]; {^ This is the text buffer for the text editor and text reader. } {ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ} TYPE Text_Reader = RECORD {The record for the text reader settings. } X,Y : INTEGER; {Text reader X/Y coordinates. } Row : INTEGER; {Current text line Y coordinate. } Col : INTEGER; {Current text line X coordinate. } Lines : INTEGER; {How many lines of text in the buffer. } Last : INTEGER; {The last text line written to the screen. } Active : BOOLEAN; {Has the text reader been activated? } Running : BOOLEAN; {Is the text reader running? } END; {ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ} TYPE Text_Editor = RECORD {Record for the text editor settings. } Row : INTEGER; {Text editor row location. } Active : BOOLEAN; {Has the text editor been activated? } Running : BOOLEAN; {Is the text editor running? } Done : BOOLEAN; {Has the user pressed ^Q or ^Z ? } END; {ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ} TYPE Icon_Flips = RECORD {Record for the flipping icons. } X,Y : INTEGER; {Icon X,Y coordinate. } Icon : Array[1..4] OF BYTE; {Icon library record positions. } Size : BYTE; {Icon size: 1=16, 2=30, 3=60 pixels. } END; {ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ} TYPE Text_Port = RECORD {Record for the text view port coordinates. } X1 : INTEGER; {Text view port upper left X coordinate. } Y1 : INTEGER; {Text view port upper left Y coordinate. } X2 : BYTE; {Text view port columns. } Y2 : BYTE; {Text view port rows. } Active : BOOLEAN; {Is the text view port active? } END; {ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ} CONST BBSmessages : BOOLEAN = FALSE;{Translate BBS message text lines? } FPtr : POINTER = NIL; {Pointer to the external GEM font file. } GPtr : POINTER = NIL; {Pointer to the GEM System font. } BPtr : POINTER = NIL; {Pointer to the 5x8 Bitmapped Font. } VAR SysClk : ^WORD; {Real mem $40:$6C} {BIOS system clock counter.} C : SVGA_Color_Scheme; {The color scheme record variable.} WRec : WindowRecord; {The window record variable.} Buttons : ARRAY[1..30] OF ButtonRecord;{The button record variable.} Fields : ARRAY[1..30] OF FieldRecord; {The fields record variable.} PickList : ^Pick_List; {The picklist text variable.} PickInfo : Pick_Info; {The picklist record variable.} Scroller : PalScroller; {The scroller record variable.} TBuff : ^Text_Buffer; {The text buffer variable.} TextReader : Text_Reader; {The text reader record variable.} TextEditor : Text_Editor; {The text editor record variable.} IconFlip : ARRAY[1..30] OF Icon_Flips; {The icon flip record variable.} TvPort : Text_Port; {The text view port record variable.} WinTag : CHAR; {Identifier tag for screen save files. } MC : CHAR; {Character returned by mouse handler. } ShowBanner : BOOLEAN; {Show the info banner upon startup? [Y/N] } AltKey : BOOLEAN; {Was the last MC keypress an ALT key? [Y/N] } SVGAmode : BOOLEAN; {Are we in SVGA mode? [Y/N] } ConvertIt : BOOLEAN; {Convert color codes? [Y/N] } Mouse_On : BOOLEAN; {Is the mouse cursor turned on? [Y/N] } MouseInstalled : BOOLEAN; {Is the mouse driver installed? [Y/N] } AllowDragging : BOOLEAN; {Allow window dragging? [Y/N] } DragActive : BOOLEAN; {Is window dragging currently active? [Y/N] } ExplodeOn : BOOLEAN; {Are exploding windows activated? [Y/N] } ShowIcons : BOOLEAN; {Show the lower right corner MAX icons? [Y/N]} LastPressed : BYTE; {The number of the last button pressed. } NFlips : BYTE; {The total number of flipping icons. } NFields : BYTE; {The total number of fields in a window. } NButtons : BYTE; {The total number of buttons in a window. } FieldNum : BYTE; {The currently selected field number. } WindowNumber : BYTE; {The currently active window number. } SvgaID : INTEGER; {The SVGA Chipset ID Number. } Old_Mode : INTEGER; {Original screen mode before FireUpGui. } OldX : INTEGER; {Last X coordinate of the mouse for dragging.} OldY : INTEGER; {Last Y coordinate of the mouse for dragging.} OrgX : INTEGER; {Original X1 coordinate of a window. } OrgY : INTEGER; {Original Y1 coordinate of a window. } BackDropImage : STRING[80]; {640x480 PCX image to use as a backdrop. } IconLib16 : STRING[80]; {File name of the 16x16 icon library file. } IconLib30 : STRING[80]; {File name of the 30x30 icon library file. } IconLib60 : STRING[80]; {File name of the 60x60 icon library file. } EditorFile : STRING[80]; {Default file name for text editor saving. } {ÄÄStart Up And ShutdownÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ} PROCEDURE WaitForRetrace; PROCEDURE StartOffScreenDraw; PROCEDURE EndOffScreenDraw; PROCEDURE InitPalette; FUNCTION FireUpGui : BOOLEAN; PROCEDURE ShutDownGui; {ÄÄBasic Drawing ElementsÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ} PROCEDURE Draw_Line(X1,Y1,X2,Y2,FG : WORD); PROCEDURE Draw_Bezier(px1,py1,px2,py2,px3,py3,px4,py4,Count,Color : INTEGER); PROCEDURE Draw_Mesh(X1,Y1,X2,Y2,FG : WORD); {ÄÄText RelatedÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ} FUNCTION TextWidth(FontSize : BYTE ; InStr : STRING) : WORD; FUNCTION TextHeight(FontSize : BYTE ; InStr : STRING) : WORD; PROCEDURE LoadUserFont(FFile : STRING); PROCEDURE CvtTokens(InStr : STRING ; Font : BYTE); PROCEDURE OutText_XY(X,Y,FG,Font : WORD ; Txt : STRING); PROCEDURE ShadowText(X,Y,FG,SH,Font : WORD ; Txt : STRING); {ÄÄ3D Box/Rectangle DrawingÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ} PROCEDURE RaisedBox(X1,Y1,X2,Y2 : WORD); PROCEDURE LoweredBox(X1,Y1,X2,Y2 : WORD); PROCEDURE FrameHigh(X1,Y1,X2,Y2 : WORD); PROCEDURE FrameLow(X1,Y1,X2,Y2 : WORD); {ÄÄWindow Drawing/UndrawingÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ} PROCEDURE Kill_Window; PROCEDURE ExplodeBox(X1,Y1,X2,Y2 : INTEGER); PROCEDURE Draw_Window(X1,Y1,X2,Y2,WType : WORD ; Title : STRING); {ÄÄEntry Field RelatedÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ} PROCEDURE Entry_Field(X,Y,EType,ELength,ESize : WORD ; Stuff : STRING); PROCEDURE RedrawField; PROCEDURE ChangeField(Number : WORD); {ÄÄButton RelatedÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ} PROCEDURE Draw_Button(X,Y,Width : WORD ; Return : BYTE ; HasIcon : BOOLEAN ; Icon : BYTE ; Title : STRING); PROCEDURE Radio_Button(X,Y : WORD ; Return : BYTE); PROCEDURE Click_Zone(X,Y,Width,Height : WORD ; Return : BYTE); PROCEDURE User_Button(X,Y,Width,Height : WORD ; Return : BYTE); PROCEDURE Mouse_Field(X,Y,Width,Height : WORD ; Return : BYTE); PROCEDURE Ani_Button(X,Y : WORD ; Icon1,Icon2,Size,BType,Return : BYTE); {ÄÄScrolling Picklist RelatedÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ} PROCEDURE New_PickList(X,Y,OnScreen,MaxChars : WORD); PROCEDURE AddTo_PickList(InString : STRING); PROCEDURE PickText(X,Y : INTEGER ; Color : BYTE ; St : STRING); PROCEDURE SetUp_PickList; PROCEDURE Reset_PickList(Item : WORD); {ÄÄColor Palette RelatedÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ} PROCEDURE Palette_Scroller(X,Y : WORD); PROCEDURE SetUp_Scroller; {ÄÄText Editor/Reader RelatedÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ} PROCEDURE FillTextBuffer(F : STRING); PROCEDURE New_TextReader(Y : WORD); PROCEDURE ShowTextPage; PROCEDURE New_TextEditor(Row : WORD); PROCEDURE RunTextEditor; {ÄÄMiscellaneous StuffÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ} FUNCTION MouseHandler(DoKeys : BOOLEAN) : BYTE; PROCEDURE ResetGraphics; PROCEDURE Show_Mem; PROCEDURE ShowMouse; PROCEDURE HideMouse; PROCEDURE Text_View_Port(X1,Y1,X2,Y2 : INTEGER); {ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ}