home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-04-14 | 105.6 KB | 4,856 lines |
- {
- ════════════════════════════════════════════════════════════════════════════
-
- Visionix Win/User Interface Low-level (VWINLOW)
- Copyright 1991,92,93 Visionix
- ALL RIGHTS RESERVED
-
- ────────────────────────────────────────────────────────────────────────────
-
- Revision history in reverse chronological order:
-
- Initials Date Comment
- ──────── ──────── ────────────────────────────────────────────────────────
-
- lpg 03/15/93 Added Source Documentation
-
- mep 02/11/93 Cleaned up code for beta release
- Changed WSet to use VGen.
- Changed WColorFromString to not need Ofs.
- Fixed for DPMI Compiling
-
- jrt 02/08/93 Sync with beta 0.12 release
-
- jrt 02/01/93 Mods to support any screen size VCRT supports
-
- jrt 12/07/92 Sync with beta 0.11 release
-
- jrt 12/02/92 Got rid of local color mapping table; changed border
- code to work in a more politically-correct fashion.
-
- jrt 11/21/92 Sync with beta 0.08
-
- jrt 09/01/92 First logged revision.
-
- --------------------------------------------------------------------------
-
- Caveats/Known Bugs
-
-
- this unit is under construction!
-
- caveats: shadow handling???
-
- change checkinvisblebuttons method
- Mouse stuff to use VPoint
-
- WColorFromString to use VColor, along with color mapping
-
- Get rid of WFExist, move to VGen ExistOnPath
-
- look at how memory "behind" WMessage, WInfoMsg is stored
-
- Go over WOpen, create WGetPreOpenInfo
-
- Look at DoBox, ReDoBox, WDoBoxFrame. Make 1 proc w/param???
- also WDrawbox, WBox
-
- Move WSet/GetPalette, WLoadBlueGray/GreenPallete to VCOLOR??
-
- get rid of WFlushKeyBuf, WReadKey, WKeyPressed since we now
- have a VCRT in driver to do all of that.
-
- Get rid of WTextColor WTextBackground, WTextAttr, etc by
- writing a VCRT out driver.
-
-
- ════════════════════════════════════════════════════════════════════════════
- }
-
- Unit VWinLow;
-
-
- Uses
-
- VTypes,
- VGen,
- VMem,
- VMulti,
- VFont,
- VIn,
- VCrt,
- DOS;
-
- {────────────────────────────────────────────────────────────────────────────}
-
- {---------------------------------------------------------------}
- { Misc constants which should be moved to different units ASAP. }
- {---------------------------------------------------------------}
-
- Const
-
- Key_Exit = -1;
-
- LBLUE = 1;
- MBLUE = 2;
- HBLUE = 3;
-
- LGRAY = 5;
- MGRAY = 6;
- HGRAY = 7;
-
- {------------------------------------------------------------------}
- { Following is the font data for EGA/VGA redefined check boxes and }
- { radio buttons. The redefined check boxes and radio buttons use }
- { a total of 8 characters of the character set. }
- { (radio button= 2 chars wide*2 states [on/off])+ }
- { (check box = 2 chars wide*2 states [on/off]) }
- {------------------------------------------------------------------}
-
- FCCBR : Array[0..15] of BYTE =
- ( $00, $00, $FC, $1C, $3C, $74, $E4, $E4,
- $74, $3C, $1C, $FC, $00, $00, $00, $00 );
-
- FCRBL : Array[0..15] of BYTE =
- ( $00, $00, $07, $18, $23, $4F, $4F, $4F,
- $4F, $23, $18, $07, $00, $00, $00, $00 );
-
- FCRBR : Array[0..15] of BYTE =
- ( $00, $00, $C0, $30, $88, $E4, $E4, $E4,
- $E4, $88, $30, $C0, $00, $00, $00, $00 );
-
- FCCBL : Array[0..15] of BYTE =
- ( $00, $00, $1F, $1C, $1E, $17, $13, $13,
- $17, $1E, $1C, $1F, $00, $00, $00, $00 );
-
- FOCBR : Array[0..15] of BYTE =
- ( $00, $00, $FC, $04, $04, $04, $04, $04,
- $04, $04, $04, $FC, $00, $00, $00, $00 );
-
- FOCBL : Array[0..15] of BYTE =
- ( $00, $00, $1F, $10, $10, $10, $10, $10,
- $10, $10, $10, $1F, $00, $00, $00, $00 );
-
- FORBL : Array[0..15] of BYTE =
- ( $00, $00, $07, $18, $20, $40, $40, $40,
- $40, $20, $18, $07, $00, $00, $00, $00 );
-
- FORBR : Array[0..15] of BYTE =
- ( $00, $00, $C0, $30, $08, $04, $04, $04,
- $04, $08, $30, $C0, $00, $00, $00, $00 );
-
- {---------------------------------------------------------------------}
- { Following is the font data for ega/vga redifined border characters. }
- { This border type goes to the outermost edge of the characters, and }
- { is one pixel wide. }
- {---------------------------------------------------------------------}
-
- C183_188 : Array[0..95] of BYTE =
- ( $80, $80, $80, $80, $80, $80, $80, $80,
- $80, $80, $80, $80, $80, $80, $80, $80,
- $00, $00, $00, $00, $00, $F8, $18, $F8,
- $18, $18, $18, $18, $18, $18, $18, $18,
- $01, $01, $01, $01, $01, $01, $01, $FF,
- $01, $01, $01, $01, $01, $01, $01, $01,
- $01, $01, $01, $01, $01, $01, $01, $01,
- $01, $01, $01, $01, $01, $01, $01, $01,
- $FF, $01, $01, $01, $01, $01, $01, $01,
- $01, $01, $01, $01, $01, $01, $01, $01,
- $01, $01, $01, $01, $01, $01, $01, $01,
- $01, $01, $01, $01, $01, $01, $01, $FF );
-
-
- C200_205 : Array[0..95] of BYTE =
- ( $80, $80, $80, $80, $80, $80, $80, $80,
- $80, $80, $80, $80, $80, $80, $80, $FF,
- $FF, $80, $80, $80, $80, $80, $80, $80,
- $80, $80, $80, $80, $80, $80, $80, $80,
- $00, $00, $00, $00, $00, $00, $00, $00,
- $00, $00, $00, $00, $00, $00, $00, $01,
- $01, $00, $00, $00, $00, $00, $00, $00,
- $00, $00, $00, $00, $00, $00, $00, $00,
- $FF, $00, $00, $00, $00, $00, $00, $00,
- $00, $00, $00, $00, $00, $00, $00, $00,
- $00, $00, $00, $00, $00, $00, $00, $00,
- $00, $00, $00, $00, $00, $00, $00, $FF );
-
- C224_250 : Array[0..431] of BYTE =
- ( $FF, $81, $99, $99, $99, $99, $99, $99,
- $99, $99, $BD, $99, $81, $FF, $00, $00,
- $80, $00, $00, $00, $00, $00, $00, $00,
- $00, $00, $00, $00, $00, $00, $00, $00,
- $00, $00, $00, $00, $00, $00, $00, $00,
- $00, $00, $00, $00, $00, $00, $00, $80,
- $00, $1F, $10, $13, $10, $10, $10, $10,
- $10, $10, $10, $10, $1F, $0F, $00, $00,
- $00, $FF, $00, $00, $00, $00, $55, $00,
- $55, $00, $00, $00, $FF, $FF, $00, $00,
- $00, $FF, $00, $00, $00, $00, $54, $00,
- $54, $00, $00, $00, $FF, $FF, $00, $00,
- $00, $C0, $60, $60, $60, $60, $60, $60,
- $60, $60, $60, $60, $E0, $E0, $00, $00,
- $00, $FF, $00, $00, $00, $FF, $00, $00,
- $01, $01, $D0, $00, $FF, $FF, $00, $00,
- $00, $FF, $00, $00, $00, $FE, $00, $DC,
- $12, $12, $DC, $00, $FF, $FF, $00, $00,
- $00, $FF, $00, $00, $00, $00, $0F, $FF,
- $0F, $00, $00, $00, $FF, $FF, $00, $00,
- $00, $FF, $00, $00, $00, $00, $C0, $FC,
- $C0, $00, $00, $00, $FF, $FF, $00, $00,
- $00, $FF, $00, $00, $00, $8B, $CA, $AB,
- $9A, $8B, $00, $00, $FF, $FF, $00, $00,
- $00, $FF, $00, $00, $00, $DF, $04, $84,
- $04, $C4, $00, $00, $FF, $FF, $00, $00,
- $FF, $80, $80, $81, $83, $87, $8F, $9F,
- $81, $81, $81, $81, $81, $80, $80, $FF,
- $FF, $01, $01, $81, $C1, $E1, $F1, $F9,
- $81, $81, $81, $81, $81, $01, $01, $FF,
- $FF, $80, $80, $81, $81, $81, $81, $81,
- $9F, $8F, $87, $83, $81, $80, $80, $FF,
- $FF, $01, $01, $81, $81, $81, $81, $81,
- $F9, $F1, $E1, $C1, $81, $01, $01, $FF,
- $00, $00, $0F, $30, $20, $7F, $80, $40,
- $40, $20, $20, $10, $0F, $00, $00, $00,
- $00, $00, $80, $7C, $02, $C2, $22, $12,
- $12, $0A, $0A, $06, $FE, $00, $00, $00,
- $00, $00, $7F, $40, $5B, $40, $55, $40,
- $56, $40, $5D, $40, $40, $7F, $00, $00,
- $00, $00, $E0, $50, $48, $44, $7C, $04,
- $D4, $04, $B4, $04, $04, $FC, $00, $00,
- $00, $00, $7F, $40, $40, $7F, $40, $40,
- $40, $40, $40, $40, $40, $7F, $00, $00,
- $00, $00, $FC, $04, $04, $FC, $04, $04,
- $04, $04, $04, $04, $04, $FC, $00, $00,
- $00, $1F, $17, $10, $10, $10, $10, $10,
- $10, $10, $14, $10, $1F, $0F, $00, $00,
- $00, $E0, $DF, $0F, $00, $70, $88, $88,
- $70, $00, $00, $00, $FF, $FF, $00, $00,
- $00, $00, $00, $00, $00, $00, $18, $18,
- $00, $00, $00, $00, $00, $00, $00, $00,
- $00, $3F, $DF, $80, $00, $70, $88, $88,
- $70, $00, $01, $00, $FF, $FF, $00, $00 );
-
- {-------------------------------------------------------------------------
-
- Window flags:
-
- 65536 15
- 32768 14
- 16384 13 Active Border
- 8192 12 Locked Shadow
-
- 4096 11 \ Shadow Type:
- 2048 10 > 00=none, 01=half char, 02=reserved
- 1024 09 / 03=double vert+double horiz attrib
-
- 512 08 \_ Vertical Scroll Bar Style:
- 256 07 / 00=none, 01=1 char wide, 02=2 char wide, 03=reserved
-
- 128 06 \_ Horizontal Scroll Bar Style:
- 64 05 / 00=none, 01=1 char high, 02=2 char high, 03=reserved
-
- 32 04 reserved
- 16 03 HasCloseBox
-
- 8 03 reserved
- 4 02 HasSizeBox
-
- 2 01 \_ Title Style:
- 1 00 / 00=none, 01=left, 02=centered, 03=right
-
- -------------------------------------------------------------------------}
-
- cwnShadow = 1;
- cwnlockshadow = 2;
- cwnactivebord = 4;
-
- fwTitleHidden = 0;
- fwTitleLeft = 1;
- fwTitleCenter = 2;
- fwTitleRight = 3;
-
- fwSizeBox = 4;
-
- fwHasCloseBox = 16;
-
- fwHSBNone = 0;
- fwHSB1Char = 64;
- fwHSB2Char = 128;
-
- fwVSBNone = 0;
- fwVSB1Char = 256;
- fwVSB2Char = 512;
-
- fwShadowNone = 0;
- fwShadowHalf = 1024;
- fwShadowAlt = 2048;
- fwShadow = 1024+2048;
-
- fwShadowLocked = 8192;
- fwActiveBorder = 16384;
-
- {-----------------------------------------------------------------}
- { Window border types and constants. This section is currently }
- { being reworked, and that is why there are so many commented out }
- { constants and such. }
- {-----------------------------------------------------------------}
-
- {------------------------------------------------------------------
-
- Border Attribute word:
-
- 64 07 reserved
- 32 06 \_ Vertical Scroll Bar indicator style
- 16 05 / 00=use cahrs, 01=use border color
-
- 8 04 \_ Horizontal Scroll Bar indicator Style
- 4 03 / 00=use chars, 01=use border color
-
- 2 02 \_ Border Color Style:
- 1 01 / 00=use bordcolor for all
- 01=use bordcolor for top line, wincolor for rest
- 02= reserved
- 03= reserved
-
- ------------------------------------------------------------------}
-
- fwbUseBorderColorForAll = 00;
- fwbUseBorderColorForTop = 01;
-
- fwbHSBUseCharsForIndicator = 4;
- fwbHSBUseColorForIndicator = 8;
-
- fwbVSBUseCharsForIndicator = 16;
- fwbVSBUseColorForIndicator = 32;
-
- cwbTitleLeft = 1;
- cwbColorStyleAll = 2;
- cwbColorStyleTop = 4;
-
- Type
-
- {------------------------------------------------------------------}
- { Button and button list defintions. This applies to push-buttons }
- { only. Button lists are simply an array of TButton. }
- {------------------------------------------------------------------}
-
- TButton = Record
-
- BType : BYTE;
- X : BYTE;
- Y : BYTE;
- FC : INTEGER;
- BC : INTEGER;
- Text : ST80;
-
- END;
-
- TButtonList4 = ARRAY[1..4 ] of TButton;
- TButtonList = ARRAY[1..20] of TButton;
- PButtonList = ^TButtonList;
-
-
- {------------------------------------------------------------------}
- { "Menu" definitions. Menus are arrays of STRING[80] (or ST80s). }
- {------------------------------------------------------------------}
-
- TMenu = Array[1..26 ] of ST80;
- TMenu50 = Array[1..50 ] of ST80;
- TMenu100 = Array[1..100] of ST80;
- TMenuMax = Array[1..100] of ST80;
-
- PMenu = ^TMenu;
- PMenu50 = ^TMenu50;
- PMenu100 = ^TMenu100;
- PMenuMax = ^TMenuMax;
-
- {-----------------------------------------------------------------}
- { Screen records. These records define a cell of display console }
- { memory and an entire screen of display console memory. }
- {-----------------------------------------------------------------}
-
- TScreenCell = Record
-
- Ch : CHAR;
- At : BYTE;
-
- END;
-
- TScreen = Array[1..50,1..80] of TScreenCell;
- PScreen = ^TScreen;
-
- {--------------------------------------------------------------}
- { Region store record. A region store is a record that stores }
- { a rectangular portion of the display console. }
- {--------------------------------------------------------------}
-
- TRegionStore = RECORD
-
- X1 : INTEGER;
- Y1 : INTEGER;
- X2 : INTEGER;
- Y2 : INTEGER;
-
- SMH : THandle; { Store memory handle }
-
- END;
-
- PRegionStore = ^TRegionStore;
-
- {----------------------------------------------------------------}
- { Frame Joint record. A frame joint is a point on the border of }
- { the window which should be a "joint" to connect to a line that }
- { is in the interior of the window. }
- {----------------------------------------------------------------}
-
- TFrameJoint = Record
-
- Side : BYTE;
- Offset : BYTE;
-
- END;
-
- {-------------------------------------------------------------}
- { Screen Stack node record. The screen stack is used for the }
- { WPushScreen and WPopScreen commands. }
- {-------------------------------------------------------------}
-
- PScreenStack = ^TScreenStack;
-
- TScreenStack = Record
-
- RS : PRegionStore;
-
- CursorX : BYTE;
- CursorY : BYTE;
- CAttr : BYTE;
- Next : PScreenStack;
-
- END;
-
- {-------------------------------------}
- { Window managers color mapping table }
- {-------------------------------------}
-
- TColorMap = ARRAY[0..255] of BYTE;
-
- {---------------------------------------------}
- { Window manager internal register structure. }
- {---------------------------------------------}
-
- TWIntRegisters = Record
-
- Case BYTE of
-
- 1 : ( BP, ES, DS, DI, SI, DX, CX, BX, AX, IP, CS, Flags : WORD );
- 2 : ( Dummy : ARRAY[1..5] of WORD;
- DL, DH, CL, CH, BL, BH, AL, AH : BYTE );
-
- END;
-
- {--------------------------------------------------------------}
- { Window Event Procedure types and constants. A windows event }
- { procedure is called any time an event happens in/to the }
- { specific window. }
- {--------------------------------------------------------------}
-
- TWinEvent = RECORD
-
- Category : WORD;
- Code : WORD;
- Data1 : LONGINT;
- Data2 : LONGINT;
- Data3 : LONGINT;
- Data4 : LONGINT;
- Pointer1 : POINTER;
- Pointer2 : POINTER;
- Pointer3 : POINTER;
- Pointer4 : POINTER;
-
- END;
-
- PWinEvent = ^TWinEvent;
-
- {----}
-
- PWin = ^TWin;
-
- TWinEventProc = Procedure( Win : PWin;
- Event : TWinEvent );
-
- {-----------------------------------------------------------}
- { Window record. One of this is created and maintained for }
- { each window. They are maintained as a double-linked list }
- { which is in the order that the windows are "stacked" on }
- { the screen. }
- {-----------------------------------------------------------}
-
- TWin = Record
-
- Name : ST80; { name of the window }
-
- BorderX : BYTE; { Coords of the outside window edge }
- BorderY : BYTE;
- BorderX2 : BYTE;
- BorderY2 : BYTE;
-
- X : BYTE; { coords of the inner window }
- Y : BYTE;
- X2 : BYTE;
- Y2 : BYTE;
-
- BorderFC : BYTE; { Border colors }
- BorderBC : BYTE;
-
- FC : BYTE; { inner window colors }
- BC : BYTE;
-
- CursorX : BYTE; { cursor x and Y }
- CursorY : BYTE;
-
- FS : PRegionStore; { "front" store }
- BS : PRegionStore; { "Back" store }
-
- YShadowSave : ARRAY[1..80] of TScreenCell; { shadow stores }
- XShadowSav1 : ARRAY[1..50] of TScreenCell;
- XShadowSav2 : ARRAY[1..50] of TScreenCell;
-
- LastTextAttr : BYTE; { text attribute }
-
- HasShadow : BOOLEAN; { TRUE if window has a shadow }
- ShadowLock : BOOLEAN; { TRUE if the shadow is locked on }
- Hidden : BOOLEAN; { TRUE if the window is hidden }
-
- BorderNum : WORD; { Border number window uses }
-
- BorderProc : POINTER; { Pointer to custom bord proc }
-
- FrameJoint : ARRAY[1..20] of TFrameJoint; {Frame-joint info }
-
- EventProc : TWinEventProc; { Pointer to event procedure }
-
- Prev : PWin; { Pointer to previous window rec }
- Next : PWin; { Pointer to next window rec }
-
- END;
-
- TBorder = Record
-
- UL : CHAR;
- UR : CHAR;
- BL : CHAR;
- BR : CHAR;
- HU : CHAR;
- HL : CHAR;
- VL : CHAR;
- VR : CHAR;
- NL : CHAR;
- NR : CHAR;
- BF1 : CHAR;
- BF2 : CHAR;
- BF3 : CHAR;
- BF4 : CHAR;
- BF11 : CHAR;
- BF12 : CHAR;
- BF13 : CHAR;
- BF14 : CHAR;
- Hline : ARRAY[1..2] of CHAR;
- VLine : ARRAY[1..2] of CHAR;
-
- END;
-
- PBorder = ^TBorder;
-
- {----------------------------------------------------------------}
- { Window manager environment. This is the record that maintains }
- { all the information about the current status of the window }
- { manager. It is created when the window manager is opened. }
- {----------------------------------------------------------------}
-
- TWinEnv = Record
-
- Look : BYTE;
-
- ProgramName : ST80;
-
- CurWin : PWin;
-
- LastCol : INTEGER;
- LastRow : INTEGER;
- CenterCol : INTEGER;
- CenterRow : INTEGER;
- OrigMode : INTEGER;
- HiRez : BOOLEAN;
- SuperRez : BOOLEAN;
-
- NoActive : BOOLEAN;
-
- CursorOn : BOOLEAN;
- CursorBig : BOOLEAN;
-
- Shadow : BOOLEAN;
-
- KeepScreen : BOOLEAN;
-
- MActive : BOOLEAN;
- MPointerOn : BOOLEAN;
-
- Recording : BOOLEAN;
- Playing : BOOLEAN;
-
- BW : BOOLEAN;
- Mono : BOOLEAN;
-
- Clock : BOOLEAN;
-
- Events : BOOLEAN;
-
- ShowFreeMem : BOOLEAN;
-
- ShadowLock : BOOLEAN;
-
- SaveScreenContents : BOOLEAN;
-
- WNewFlags : LONGINT;
-
- PlayDelay : INTEGER;
-
- Border : INTEGER;
-
- KHits : BYTE;
-
- InitChar : ST80;
-
- LeftButton : CHAR;
- RightButton : CHAR;
-
- InitTxtC : INTEGER;
- InitBckC : INTEGER;
-
- Help : INTEGER;
- HelpPage : INTEGER;
- HelpFile : ST80;
- HelpProc : POINTER;
-
-
- MessageBack : STRING;
- InfoMsgBack : STRING;
-
-
- NumPrgs : BYTE;
- NumPrompts : BYTE;
- NumInfos : BYTE;
- NumMsgs : BYTE;
-
- PrgButtons : TButtonList4;
- PromptButtons : TButtonList4;
- InfoButtons : TButtonList4;
- MsgButtons : TButtonList4;
-
- MsgLineStyle : BYTE;
-
- {----}
-
- PreInit : Record
-
- X : BYTE;
- Y : BYTE;
- TextAttr : BYTE;
- RS : PRegionStore;
-
- END;
-
- {----}
-
- KeyRecChan : TEXT;
- KeyRecFileName : ST80;
-
- CursorX : BYTE;
- CursorY : BYTE;
- CurAttr : BYTE;
- CurTextColor : BYTE;
- CurBackColor : BYTE;
-
- KeyBuff : STRING;
-
- DialogNum : INTEGER;
- TopLeftNum : BYTE;
-
- MenuLineColor : BYTE;
- MenuLineColorF : BYTE;
-
- GemIconColor : BYTE;
- GemFore : BYTE;
- GemBack : BYTE;
- GemHFore : BYTE;
- GemHBack : BYTE;
- GemNFore : BYTE;
- GemNBack : BYTE;
- GemBPlace : BYTE;
- GemButtonType : BYTE;
- GemHButtonType : BYTE;
- GemMinBSize : BYTE;
-
- EventKey : BYTE;
- EventExtKey : BYTE;
- EventButtons : BYTE;
-
- TopLineFore : BYTE;
- TopLineBack : BYTE;
-
- TimerProc : POINTER;
-
- MouseType : BYTE;
-
- WidgetFontOn : BOOLEAN;
-
- END;
-
- {----}
-
- PWinEnvStack=^TWinEnvStack;
-
- TWinEnvStack=Record
-
- Info : TWinEnv;
- Next : PWinEnvStack;
-
- END;
-
- {────────────────────────────────────────────────────────────────────────────}
-
- Procedure WRegionStoreWrite( RS : PRegionStore );
-
- Procedure WTextColor( Color : INTEGER );
-
- Procedure WTextBackGround( Color : INTEGER );
-
- Procedure WTextColors( FC : INTEGER;
- BC : INTEGER );
-
- Procedure WTextAttr( Attr : BYTE );
-
-
- Function WOnWinEdge( TheWin : PWin;
- X : INTEGER;
- Y : INTEGER ) : BOOLEAN;
-
- Procedure WError( Error : ST80 );
-
- Function WColorFromString( S : STRING ) : BYTE;
-
- Function WReadButtonListRel( Blist : PButtonList;
- X : INTEGER;
- Y : INTEGER;
- Count : BYTE ) : INTEGER;
-
- Function WReadButtonList( BList : PButtonList;
- Count : BYTE ) : INTEGER;
-
- Function WSReadButtonList( BList : PButtonList;
- Count : BYTE ) : INTEGER;
-
- Function WKeyPressed : BOOLEAN;
-
- Function WIDoReadKey : CHAR;
-
- Procedure WCursorOn;
-
- Procedure WCursorOff;
-
- Procedure WCursorBig;
-
- Procedure WCursorSmall;
-
- Procedure WMPointerOn;
-
- Procedure WMPointerOff;
-
- Procedure WMGetStatus( Var Buttons : INTEGER;
- Var X : INTEGER;
- Var Y : INTEGER );
-
- Procedure WMWaitForNoButtons;
-
- Procedure WBackRefresh( S : STRING;
- FC : BYTE;
- BC : BYTE );
-
- Procedure WSet( S : ST80 );
-
- Procedure WOpen( BackGroundCH : ST80;
- TxtColor : BYTE;
- BckColor : BYTE;
- S : ST80 );
-
- Procedure WClear( X : INTEGER;
- Y : INTEGER;
- X2 : INTEGER;
- Y2 : INTEGER;
- FC : INTEGER;
- BC : INTEGER );
-
- Procedure WNew( X : INTEGER;
- Y : INTEGER;
- X2 : INTEGER;
- Y2 : INTEGER;
- FC : BYTE;
- BC : BYTE;
- BorderFC : BYTE;
- BorderBC : BYTE;
- Name : ST80 );
-
- Procedure WEnter( Name : ST80 );
-
- Procedure WExit;
-
- Procedure WGo( Name : ST80 );
-
- Procedure WDispose( Name : ST80 );
-
- Procedure WPopEnv;
-
- Procedure WPushEnv;
-
- Procedure WSubmitBorder( X : INTEGER;
- S : ST80;
- SBIFore : BYTE;
- SBIBack : BYTE;
- Attr : LONGINT );
-
- Procedure WDoBoxFrame( TheWin : PWin );
-
- Procedure WSubmitFrameJoint( Num : INTEGER;
- Side : INTEGER;
- Offset : INTEGER );
-
- Procedure WPopScreen;
-
- procedure WShowFreeMem;
-
- Procedure WMTShowFreeMem( NewProc : BOOLEAN );
-
- Procedure WPushScreen;
-
- Procedure WHideUnHide( Name : ST80;
- HideWin : BOOLEAN );
-
- Function WFExist( FName : STRING ) : BOOLEAN;
-
- Procedure WGoCurrentWin;
-
- Function WGetWinPointer( Name : ST80 ) : THandle;
-
- Procedure WDrawShadowOn( P : PWin );
-
- Procedure WEraseShadowFrom( P : PWin );
-
- Procedure WFastWrite( X : INTEGER;
- Y : INTEGER;
- FC : BYTE;
- BC : BYTE;
- S : STRING );
-
- Procedure WSFastWrite( X : INTEGER;
- Y : INTEGER;
- FC : BYTE;
- BC : BYTE;
- S : STRING );
-
- Procedure WTSR_Entry;
-
- Procedure WSetHasShadow( Name : ST80;
- Bool : BOOLEAN );
-
- Procedure WFlushKeyBuf;
-
- Procedure WRename( OrigName : ST80;
- NewName : ST80 );
-
- Procedure WLoadWidgetFont;
-
- Procedure WLoadLook1BorderFont;
-
- Procedure WSetPalette( PalNum,
- R, G, B : BYTE );
-
- Procedure WGetPalette( PalNum : BYTE;
- Var R, G, B : BYTE );
-
-
- Procedure WLoadBlueGrayPalette;
-
- Procedure WLoadGreenGrayPalette;
-
- Procedure WDrawBox( X, Y, X2, Y2,
- F, B, Style : INTEGER );
-
- Procedure WBox( X, Y, X2, Y2,
- Style : INTEGER );
-
- Procedure WEventsOn;
-
- Procedure WEventsOff;
-
- {────────────────────────────────────────────────────────────────────────────}
-
- Var
-
- WinEnv : TWinEnv;
-
- NilWin : PWin;
-
- M_Vid_Mem : PScreen;
- C_Vid_Mem : PScreen;
- Vid_Mem : PScreen;
- ColorTable : ARRAY[0..255] of INTEGER;
-
- WinStack : PWin;
-
- WinEnvStack : PWinEnvStack;
-
- ScreenStack : PScreenStack;
-
- VidWidth : WORD;
- BaseAddr : WORD;
- Border : ARRAY[1..10] of TBorder;
- ColorMap : TColorMap;
- WrLastSec : WORD;
-
- {────────────────────────────────────────────────────────────────────────────}
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WFastWrite( X : INTEGER;
- Y : INTEGER;
- FC : BYTE;
- BC : BYTE;
- S : STRING );
-
- [PARAMETERS]
-
- X Starting X Window Coordinate for Text (Base 1)
- Y Starting Y Window Coordinate for Text (Base 1)
- FC Text Foreground Color
- BC Text Background Color
- S Text String to Write
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- Optimized routine to output a string to the provided Window Coordinates
- in the given colors. Use WSFastWrite if you wish the Text to be written
- relative to the Full Screen.
-
- [SEE-ALSO]
-
- WSFastWrite
-
- [EXAMPLE]
-
- BEGIN
-
- WNew( 5,2,30,7, WHITE,CYAN,WHITE,CYAN, 'Window' );
-
- WFastWrite( 2,3, BLUE,CYAN, 'Sample Window Text' );
-
- While NOT WKeyPressed Do;
- WDispose( 'Window' );
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WSFastWrite( X : INTEGER;
- Y : INTEGER;
- FC : BYTE;
- BC : BYTE;
- S : STRING );
-
- [PARAMETERS]
-
- X Starting X Screen Coordinate for Text
- Y Starting Y Screen Coordinate for Text
- FC Text Foreground Color
- BC Text Background Color
- S Text String to Write
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- Optimized routine to output a string to the provided Screen coordinates
- in the given colors. Use WFastWrite if you wish the Text to be written
- relative to the current Window.
-
- [SEE-ALSO]
-
- WFastWrite
-
- [EXAMPLE]
-
- BEGIN
-
- WSFastWrite( 30,10, WHITE,RED, 'Sample Screen Text' );
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WShowFreeMem;
-
- [PARAMETERS]
-
- (None)
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- This function displays the current Free Memory and Max Memory on the
- Program Title bar. This is mainly intended as a Programmer's Debugging
- tool in determining when memory is not properly being allocated or
- deallocated.
-
- [SEE-ALSO]
-
- ShowFreeMemMultiProc
- WMTShowFreeMem
-
- [EXAMPLE]
-
- VAR
- ch : CHAR;
-
- BEGIN
-
- WShowFreeMem;
-
- WMessage( 'Press a Key and watch the Memory Usage', WHITE,CYAN );
- ch := WReadKey;
- WNew( 5,2,30,7, WHITE,CYAN,WHITE,CYAN, 'Window' );
- WShowFreeMem;
-
- WMessage( 'Press another Key and Keep an eye on the Memory', WHITE,CYAN );
- ch := WReadKey
- WDispose( 'Window' );
- WShowFreeMem;
-
- WMessage( 'Press any key to Quit', WHITE,CYAN );
- While NOT WKeyPressed Do;
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure ShowFreeMemMultiProc( Status : BYTE;
- Var IData : POINTER ); Far;
-
- [PARAMETERS]
-
- Status ?
- IData ?
-
- [RETURNS]
-
- [DESCRIPTION]
-
- This is the Multi-Tasking Procedure which Keeps the Screen display
- updated about the current Free Memory. It is Very Low-Level and
- should be allowed to load through the WMTShowFreeMem Procedure call.
-
- [SEE-ALSO]
-
- WShowFreeMem
- WMTShowFreeMem
-
- [EXAMPLE]
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WMTShowFreeMem( NewProc : BOOLEAN );
-
- [PARAMETERS]
-
- NewProc If this is the First Time This Procedure was Loaded?
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- Installs the Multi-Tasking Free Memory Display Procedure. From this
- point forward, the free memory will be constantly updated in real-time
- on the fist line of the screen.
-
- The main purpose of this routine was for debugging memory allocation,
- usage and deallocation (making sure you release it all!). It is an
- extremely useful debugging tools.
-
- It cannot be unloaded except by restarting the program.
-
- [SEE-ALSO]
-
- WShowFreeMem
- ShowFreeMemMultiProc
-
- [EXAMPLE]
-
- VAR
- ch : CHAR;
-
- BEGIN
-
- WMTShowFreeMem;
-
- WMessage( 'Press a Key and watch the Memory Usage', WHITE,CYAN );
- ch := WReadKey;
- WNew( 5,2,30,7, WHITE,CYAN,WHITE,CYAN, 'Window' );
-
- WMessage( 'Press another Key and Keep an eye on the Memory', WHITE,CYAN );
- ch := WReadKey
- WDispose( 'Window' );
-
- WMessage( 'Press any key to Quit', WHITE,CYAN );
- While NOT WKeyPressed Do;
-
- END;
-
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WFixX( Var X : INTEGER );
-
- [PARAMETERS]
-
- X VAR Modified X Coordinate
-
- [RETURNS]
-
- Function : None
- (VAR : [X] X Coordinate)
-
- [DESCRIPTION]
-
- If X < 0 then the value represented is the distance from the bottom
- of the Screen rather than an absolute coordinate. This function
- checks for this and modifies the value accordingly.
-
- [SEE-ALSO]
-
- WFixY
- WFixXY
- WFixRectangle
-
- [EXAMPLE]
-
- VAR
- X : INTEGER;
-
- BEGIN
-
- X := 30;
- WFixX( X );
-
- { X = 30 }
-
- X := -5;
- WFixX( X );
-
- { If the Screen Width was 80 then X = 75 }
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WFixY( Var Y : INTEGER );
-
- [PARAMETERS]
-
- Y VAR Modified Y Coordinate
-
- [RETURNS]
-
- Function : None
- (VAR : [Y] Y Coordinate)
-
- [DESCRIPTION]
-
- If Y < 0 then the value represented is the distance from the bottom
- of the Screen rather than an absolute coordinate. This function
- checks for this and modifies the value accordingly.
-
- [SEE-ALSO]
-
- WFixX
- WFixXY
- WFixRectangle
-
- [EXAMPLE]
-
- VAR
- Y : INTEGER;
-
- BEGIN
-
- Y := 15;
- WFixY( Y );
-
- { Y = 15 }
-
- Y := -5;
- WFixY( Y );
-
- { If the Screen Height was 25 then Y = 20 }
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WFixXY( Var X, Y : INTEGER );
-
- [PARAMETERS]
-
- X VAR Modified X Coordinate
- Y VAR Modified Y Coordinate
-
- [RETURNS]
-
- Function : None
- (VAR : [X] Modified X Coordinate)
- (VAR : [Y] Modified Y Coordinate)
-
- [DESCRIPTION]
-
- If X < 0 or Y < 0 then the value represented is the distance from the
- Right or Bottom of the Screen, respectively, rather than an absolute
- coordinate. This function checks for this and modifies the values
- accordingly.
-
- [SEE-ALSO]
-
- WFixX
- WFixY
- WFixRectangle
-
- [EXAMPLE]
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WFixRectangle( Var X1, Y1, X2, Y2 : INTEGER );
-
- [PARAMETERS]
-
- X1 VAR Modified X1 Window Coordinate
- Y1 VAR Modified Y1
- X2 VAR Modified
- Y2 VAR Modified Y2 Window Coordinate
-
- [RETURNS]
-
- [DESCRIPTION]
-
- If and of the Rectangle Coordinates are Negative, they represent
- Positions Relative to the Screen Boundaries rather than Absolute
- Coordinates. This function checks for this and modifies the
- values accordingly.
-
- Additionally, if the Right Point is Less than the Left Point, or
- the Top more than the Bottom, these coordinates are swapped. This
- prevents windows from attempting to open with strange, erroneous
- dimensions.
-
- [SEE-ALSO]
-
- WFixX
- WFixY
- WFixXY
-
- [EXAMPLE]
-
- VAR
- X1,Y1,X2,Y2 : INTEGER;
-
- BEGIN
-
- { Assume Screen Dimensions of 80x25 }
-
- X1 := 5; Y1 := 2;
- X2 := 20; Y2 := 7;
- WFixRectangle( X1, Y1, X2, Y2 );
- { Window Coordinates ( 5, 2, 20, 7 ) - all same }
-
-
- X1 := 5; Y1 := 2;
- X2 := -20; Y2 := -7;
- WFixRectangle( X1, Y1, X2, Y2 );
- { Window Coordinates ( 5, 2, 60, 18 ) - relative to border }
-
- X1 := 15; Y1 := 2;
- X2 := -20; Y2 := -7;
- WFixRectangle( X1, Y1, X2, Y2 );
- { Window Coordinates ( 5, 2, 15, 18 ) - swapped coords }
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WAssertPointer( P : Pointer;
- Msg : STRING );
-
- [PARAMETERS]
-
- P Pointer to Check
- Msg Error Message if NIL Pointer
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- This function basically Filters Pointers to Ensure that they are
- not NIL Pointers. Pointers which are NIL never make it thru here
- as a WError Message is presented and the Program is Halted.
-
- If the Pointer is not NIL then everything is OK and the Program
- Continues.
-
- [SEE-ALSO]
-
- WAssertHandle
-
- [EXAMPLE]
-
- VAR
- P : POINTER;
-
- BEGIN
-
- GetMem( P, 1000 );
-
- WAssertPointer( P, 'Memory not Allocated' ); { EVERYTHING OK }
-
- { Basically do something with the Pointer before Deallocating it }
- FillChar( P^, SizeOf( 1000 ), 5 );
-
- FreeMem( P, 1000 );
-
- WAssertPointer( P, 'Pointer Not Assigned to Memory' ); { HALTS HERE }
-
- { Should have Halted before it reached this point }
- FillChar( P^, SizeOf( 1000 ), 7 );
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WAssertHandle( H : THandle;
- Msg : STRING );
-
- [PARAMETERS]
-
- H Handle (Pointer) to Check;
- Msg Error Message if NIL Handle
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- This function basically Filters Handles (Pointers) to Ensure that they
- are not NIL Handles. Handles which are NIL never make it thru here as
- a WError Message is presented and the Program is Halted.
-
- If the Handle is not NIL then everything is OK and the Program
- Continues.
-
- [SEE-ALSO]
-
- WAssertPointer
-
- [EXAMPLE]
-
- VAR
- H : POINTER;
-
- BEGIN
-
- GetMem( H, 1000 );
-
- WAssertPointer( H, 'Handle Memory not Allocated' ); { EVERYTHING OK }
-
- { Basically do something with the Pointer before Deallocating it }
- FillChar( H^, SizeOf( 1000 ), 5 );
-
- FreeMem( H, 1000 );
-
- WAssertPointer( H, 'Handle Not Assigned to Memory' ); { HALTS HERE }
-
- { Should have Halted before it reached this point }
- FillChar( H^, SizeOf( 1000 ), 7 );
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Function WRegionStoreAlloc( Flags : WORD;
- X1 : INTEGER;
- Y1 : INTEGER;
- X2 : INTEGER;
- Y2 : INTEGER ):PRegionStore;
-
- [PARAMETERS]
-
- Flags (These weren't used in the Code!)
- X1 Left X Coordinate of Region
- Y1 Upper Y Coordinate of Region
- X2 Right X Coordinate of Region
- Y2 Lower Y Coordinate of Region
-
- [RETURNS]
-
- Pointer to Stored Region Data in (Just the Memory, Data not here yet)
-
- [DESCRIPTION]
-
- This function Allocates enough memory to store a given region. It simply
- allocates the Memory, the Region Data is NOT stored Yet other than simply
- the coordinates.
-
- [SEE-ALSO]
-
- WRegionStoreFree
- WRegionStoreRead
- WRegionStoreWrite
- WRegionStoreCopy
-
- [EXAMPLE]
-
- VAR
- P : POINTER;
-
- BEGIN
-
- P := WRegionStoreAlloc( 0, 5,2,20,7 );
-
- WAssertPointer( P, 'Memory Allocation Error' );
-
- WriteLn( 'Memory Must be Allocated, or it wouldn''t have made it here!' );
-
- While NOT WKeyPressed Do;
-
- WRegionStoreFree( P );
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WRegionStoreFree( RS : PRegionStore );
-
- [PARAMETERS]
-
- RS Pointer to Stored Region Data
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- Disposes of any memory associated with this Data Pointer.
-
- [SEE-ALSO]
-
- WRegionStoreAlloc
- WRegionStoreRead
- WRegionStoreWrite
- WRegionStoreCopy
-
- [EXAMPLE]
-
- VAR
- P : POINTER;
-
- BEGIN
-
- P := WRegionStoreAlloc( 0, 5,2,20,7 );
-
- WAssertPointer( P, 'Memory Allocation Error' );
-
- WriteLn( 'Memory Must be Allocated, or it wouldn''t have made it here!' );
-
- While NOT WKeyPressed Do;
-
- WRegionStoreFree( P );
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WRegionStoreRead( RS : PRegionStore );
-
- [PARAMETERS]
-
- RS Pointer to Pre-Allocated Memory to store Region Data in
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- This is the function which actually stores the Region Data! It requires
- the Caller to have called "WRegionStoreAlloc" to create and Allocate the
- memory required for storage. All we do here is simply read Screen Data
- and Load it in the Storage Area.
-
- [SEE-ALSO]
-
- WRegionStoreAlloc
- WRegionStoreFree
- WRegionStoreWrite
- WRegionStoreCopy
-
- [EXAMPLE]
-
- VAR
- P : POINTER;
- I : INTEGER;
-
- BEGIN
-
- P := WRegionStoreAlloc( 0, 5,2,20,7 );
-
- WAssertPointer( P, 'Memory Allocation Error' );
-
-
- { Fill the Screen with Something }
-
- For i := 1 to 24 Do
- WriteLn( 'Memory Must be Allocated, or it wouldn''t have made it here!' );
-
-
- { And Read the Pre-Assigned Region }
-
- WRegionStoreRead( P );
-
- ClrScr;
- WriteLn( 'Press any Key to Restore the Region Data' );
- ch := WReadKey;
-
- { Write Region back to the Screen }
-
- WRegionStoreWrite( P );
- WRegionStoreFree( P );
-
- WriteLn;
- WriteLn;
- WriteLn( 'Press any key to Quit' );
- While NOT WKeyPressed Do;
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WRegionStoreWrite( RS : PRegionStore );
-
- [PARAMETERS]
-
- RS Pointer to Stored Region Data
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- This function takes the Pre-Allocated and Pre-Read Storage Data and writes
- it back out to the Screen. If nothing has been Read into the Data area,
- it will write out to the screen anything which happens to be there!
-
- [SEE-ALSO]
-
- WRegionStoreAlloc
- WRegionStoreFree
- WRegionStoreRead
- WRegionStoreCopy
-
- [EXAMPLE]
-
- VAR
- P : POINTER;
- I : INTEGER;
-
- BEGIN
-
- P := WRegionStoreAlloc( 0, 5,2,20,7 );
-
- WAssertPointer( P, 'Memory Allocation Error' );
-
-
- { Fill the Screen with Something }
-
- For i := 1 to 24 Do
- WriteLn( 'Memory Must be Allocated, or it wouldn''t have made it here!' );
-
-
- { And Read the Pre-Assigned Region }
-
- WRegionStoreRead( P );
-
- ClrScr;
- WriteLn( 'Press any Key to Restore the Region Data' );
- ch := WReadKey;
-
- { Write Region back to the Screen }
-
- WRegionStoreWrite( P );
- WRegionStoreFree( P );
-
- WriteLn;
- WriteLn;
- WriteLn( 'Press any key to Quit' );
- While NOT WKeyPressed Do;
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WRegionStoreCopy( SS : PRegionStore;
- DS : PRegionStore );
-
- [PARAMETERS]
-
- SS Source Pointer to Storage Data
- DS Destination Pointer to Storage Data
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- This function Duplicates the data which is in the Source Storage Area
- to the Destination Storage Area. Both Storage Pointers MUST be previously
- allocated or the system will Halt with an Error Message. Data is not
- destroyed or Erased after the action. Just that now there are 2 copies
- of this data.
-
- NOTE: These Regions MUST have been assigned with the Same Coordinates!
- This will be handled in future editions.
-
- [SEE-ALSO]
-
- WRegionStoreAlloc
- WRegionStoreFree
- WRegionStoreRead
- WRegionStoreWrite
-
- [EXAMPLE]
-
- VAR
- P1,P2 : POINTER;
-
- BEGIN
-
- P1 := WRegionStoreAlloc( 0, 5,2,20,7 );
- P2 := WRegionStoreAlloc( 0, 5,2,20,7 );
-
- WAssertPointer( P1, 'Memory Allocation Error - P1' );
- WAssertPointer( P2, 'Memory Allocation Error - P2' );
-
- For i := 1 to 24 Do
- WriteLn( 'Memory Must be Allocated, or it wouldn''t have made it here!' );
-
- { Read the Region Data from screen }
-
- WRegionStoreRead( P1 );
-
- WriteLn( 'Region Read, Press any key to Continue' );
- ch := WReadKey;
- ClrScr;
-
- { Now copy the Region Data }
-
- WRegionStoreCopy( P1, P2 );
-
- { Just for good measure, let's get rid of this one }
-
- WRegionStoreFree( P1 );
- WriteLn( 'Press any Key to Copy Data' );
-
- WriteLn( 'Region Data has been copied and P1 Deallocated.' );
- WriteLn( 'Press any key to Restore Screen Region...' );
-
- ch := WReadKey;
- WRegionStoreWrite( P2 );
-
- WriteLn;
- WriteLn;
- WriteLn( 'Press any Key to Quit' );
- While NOT WKeyPressed Do;
-
- WRegionStoreFree( P2 );
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WPushEnv;
-
- [PARAMETERS]
-
- (None)
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- This function allows the caller to store (and later retrieve) the
- current Window Environment to the Stack, so that temporary minor
- or major modifications may be made to the Environment and later
- returned to the original state.
-
- Any Number of Pushes may be made throughout the program so long as
- there is memory available.
-
- [SEE-ALSO]
-
- WPopEnv
-
- [EXAMPLE]
-
- BEGIN
-
- WPushEnv;
-
- WSet( 'SHADOWS' );
-
- WNew( 5,2,20,7,WHITE,BLUE,WHITE,BLUE,'Window');
-
- While NOT WKeyPressed Do;
-
- WDispose( 'Window' );
-
- WPopEnv;
-
- { We should not be back to our previous Environment Settings }
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WPopEnv;
-
- [PARAMETERS]
-
- (None)
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- This function allows the caller to retrieve the last Pushed Window
- Environment from the Stack, and make it the Current Window Environment
- Style.
-
- [SEE-ALSO]
-
- WPushEnv
-
- [EXAMPLE]
-
- BEGIN
-
- WPushEnv;
-
- WSet( 'SHADOWS' );
-
- WNew( 5,2,20,7,WHITE,BLUE,WHITE,BLUE,'Window');
-
- While NOT WKeyPressed Do;
-
- WDispose( 'Window' );
-
- WPopEnv;
-
- { We should now be back to our previous Environment Settings }
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WPushScreen;
-
- [PARAMETERS]
-
- (None)
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- This function allows the caller to store (and later retrieve) the
- current Screen on a Stack, so that temporary minor or major
- modifications may be made to the Screen and later returned to the
- original state.
-
- This is especially useful when shelling to another program that
- modifies the screen. You want to restore things when you get back,
- so you Push the Screen before you leave and Pop it afterwards.
-
- Any Number of Pushes may be made throughout the program so long as
- there is memory available.
-
- [SEE-ALSO]
-
- WPopScreen
-
- [EXAMPLE]
-
- BEGIN
-
- WNew( 5,2,20,7,WHITE,BLUE,WHITE,BLUE,'Window');
- WPushScreen;
-
- WSFastWrite( 30, 10, WHITE,RED, 'THIS IS A TEST - JUST A TEST!!!!' );
- WSFastWrite( 30, 11, WHITE,RED, 'PRESS ANY KEY TO GET RID OF THIS STUFF' );
- ch := WReadKey;
-
- WPopScreen;
-
- { We should not be back to our previous Environment Settings }
-
- While NOT WKeyPressed Do;
- WDispose( 'Window' );
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WPopScreen;
-
- [PARAMETERS]
-
- (None)
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- This function allows the caller to Retrieve (from a Previous Push)
- the last stored Screen on the Stack. This is done to correct any
- minor or major modifications that may have been made to the Screen.
-
- This is especially useful when shelling to another program that
- modifies the screen. You want to restore things when you get back,
- so you Push the Screen before you leave and Pop it afterwards.
-
- Any Number of Pushes may be made throughout the program so long as
- there is memory available.
-
- [SEE-ALSO]
-
- WPopScreen
-
- [EXAMPLE]
-
- BEGIN
-
- WNew( 5,2,20,7,WHITE,BLUE,WHITE,BLUE,'Window');
- WPushScreen;
-
- WSFastWrite( 30, 10, WHITE,RED, 'THIS IS A TEST - JUST A TEST!!!!' );
- WSFastWrite( 30, 11, WHITE,RED, 'PRESS ANY KEY TO GET RID OF THIS STUFF' );
- ch := WReadKey;
-
- WPopScreen;
-
- { We should not be back to our previous Environment Settings }
-
- While NOT WKeyPressed Do;
- WDispose( 'Window' );
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Function WOnWinEdge( TheWin : PWin;
- X : INTEGER;
- Y : INTEGER ) : BOOLEAN;
-
- [PARAMETERS]
-
- TheWin Pointer to Window Data Structure
- X X Screen Coordinate
- Y Y Screen Coordinate
-
- [RETURNS]
-
- Whether or not this Screen Coordinate is the Border of the given Window
-
- [DESCRIPTION]
-
- Tests the provided Coordinates and determines whether or not these
- Screen Coordinates are on the Border of the provided Window. If
- So it returns a TRUE else a FALSE.
-
- This is mainly used to determine if a mouse button is depressed upon
- the window border (so as to move the whole window with the mouse).
-
- [SEE-ALSO]
-
- [EXAMPLE]
-
- BEGIN
-
- WNew( x,y,x,y,WHITE,BLUE,WHITE,BLUE,'Window' );
-
- WriteLn( '(25,10) on Border : ', WOnWinEdge( p, 5, 15 ) );
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure MultiWriteTime( Status : BYTE;
- Var IData : Pointer ); Far;
-
- [PARAMETERS]
-
- Status ?
- IData ?
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- If the Clock is ON in the Window Environment, then this function will
- update the Display Time at the upper right corner of the Screen.
-
- This is an internal function intended only to be used by the system.
- It links with the Multi-tasker and allows a continuous time update
- ion the screen.
-
- This is a Very Low-Level Function and should be allowed to be loaded
- by the WOpen Operation (Unless you are familiar with the Multi-Tasking
- Unit.
-
- [SEE-ALSO]
-
- WOpen
-
- [EXAMPLE]
-
- (None Available)
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Function WReadButtonListRel( Blist : PButtonList;
- X : INTEGER;
- Y : INTEGER;
- Count : BYTE ):INTEGER;
-
- [PARAMETERS]
-
- BList Pointer to Button List Data
- X X Screen Coordinate
- Y Y Screen Coordinate
- Count Number of Buttons in the List
-
- [RETURNS]
-
- Which Button in List the Screen Coordinates Reference (255=None)
-
- [DESCRIPTION]
-
- This function Tests a Screen Coordinate with the Button List Data to
- determine if this coordinate represents any of the Buttons in the list.
- If so, the Button Index is returned, otherwise the value 255 is returned.
-
- [SEE-ALSO]
-
- WReadButtonList
- WSReadButtonList
- CheckInvisibleButtons
-
- [EXAMPLE]
-
- VAR
- X,Y,I : INTEGER;
- BR : TButtonList;
- ch : CHAR;
-
- BEGIN
-
- MakeBRec( Addr( BR[1] ), 5,20, WHITE,BLUE, 'Button 1' );
- MakeBRec( Addr( BR[2] ), 25,10, WHITE,BLUE, 'Button 2' );
- MakeBRec( Addr( BR[3] ), 50,15, WHITE,BLUE, 'Button 3' );
- MakeBRec( Addr( BR[4] ), 70, 5, WHITE,BLUE, 'Button 4' );
-
- WMessage( 'Press any Key to Test another Coord|<ESC>=Quit', WHITE,CYAN );
-
- REPEAT
- x := Random( 80 );
- y := Random( 25 );
-
- I := WReadButtonListRel( Addr(BR), X, Y, 4);
- Write( 'Coords (',x,',',y,') = ' );
-
- If i <> 255 Then
- WriteLn( 'Button ',i )
- Else
- WriteLn( 'No Button' );
-
- ch := WReadKey;
-
- UNTIL ch = #27;
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Function WReadButtonList( BList : PButtonList;
- Count : BYTE ) : INTEGER;
-
- [PARAMETERS]
-
- BList Pointer to Button List Data
- Count Number of Buttons in List
-
- [RETURNS]
-
- Which Button the Mouse is Currently ON
-
- [DESCRIPTION]
-
- This function Tests the Current Mouse Window Coordinate and determines
- if this coordinate represents any of the Buttons in the list. If so,
- the Button Index is returned, otherwise the value 255 is returned.
-
- The Button List Data is prepared as Window Relative Coordinates and
- so the Mouse test is also Window Relative.
-
- [SEE-ALSO]
-
- WReadButtonListRel
- WSReadButtonList
- CheckInvisibleButtons
-
- [EXAMPLE]
-
- VAR
- X,Y,I : INTEGER;
- BR : TButtonList;
- ch : CHAR;
-
- BEGIN
-
- MakeBRec( Addr( BR[1] ), 5,20, WHITE,BLUE, 'Button 1' );
- MakeBRec( Addr( BR[2] ), 25,10, WHITE,BLUE, 'Button 2' );
- MakeBRec( Addr( BR[3] ), 50,15, WHITE,BLUE, 'Button 3' );
- MakeBRec( Addr( BR[4] ), 70, 5, WHITE,BLUE, 'Button 4' );
-
- WMessage( 'Press any Key to Test another Coord|<ESC>=Quit', WHITE,CYAN );
-
- REPEAT
- x := Random( 80 );
- y := Random( 25 );
-
- I := WReadButtonListRel( Addr(BR), X, Y, 4);
- Write( 'Coords (',x,',',y,') = ' );
-
- If i <> 255 Then
- WriteLn( 'Button ',i )
- Else
- WriteLn( 'No Button' );
-
- ch := WReadKey;
-
- UNTIL ch = #27;
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Function WSReadButtonList( BList : PButtonList;
- Count : BYTE ) : INTEGER;
-
- [PARAMETERS]
-
- BList Pointer to Button List Data
- Count Number of Buttons in List
-
- [RETURNS]
-
- Which Button the Mouse is Currently ON
-
- [DESCRIPTION]
-
- This function Tests the Current Mouse Screen Coordinate and determines
- if this coordinate represents any of the Buttons in the list. If so,
- the Button Index is returned, otherwise the value 255 is returned.
-
- The Button List Data is prepared as Window Relative Coordinates and
- so the Mouse test is also Window Relative.
-
- [SEE-ALSO]
-
- WReadButtonListRel
- WReadButtonList
- CheckInvisibleButtons
-
- [EXAMPLE]
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Function CheckInvisibleButtons( B : TButtonList4;
- Count : BYTE ) : STRING;
-
- [PARAMETERS]
-
- B Button List Array
- Count Number of Buttons Listed
-
- [RETURNS]
-
- [DESCRIPTION]
-
- Some Mouse Buttons may be "Invisible" Buttons such as text contained upon
- a message or other text status line. A button isn't actually drawn there
- as the text is sufficient, however this does not change the fact that the
- area is an Active Button.
-
- When This function is called, the current Mouse coordinates are checked
- with button list to determine if ANY Button is below it. If it happens
- to be an "Invisible" Button, the Text below it is compared with one of
- the Invisible Button Text to determine what function is being referenced.
-
- Invisible Button Text must be one of the Following:
-
- "<ESC>"
- "<SPACE>"
- "<ENTER>"
- "<Fx>" (Where X is a Number from 1 to Max Function Key Nbr)
- (ie. "<F10>")
-
- [SEE-ALSO]
-
- WReadButtonListRel
- WReadButtonList
- WSReadButtonList
-
- [EXAMPLE]
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WShowFreeMemKeyProc( Status : BYTE;
- Key1, Key2 : CHAR ); Far;
-
- [PARAMETERS]
-
- Status
- Key1
- Key2
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- [SEE-ALSO]
-
- [EXAMPLE]
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WKeyDriverProc( IDP : PInDriverPacket ); Far;
-
- [PARAMETERS]
-
- IDP Pointer to In-Driver Packet
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- This is the Low-Level Input Driver Function that supports all Keyboard,
- Mouse, and other Input. It is submitted as the In-Driver Procedure to
- the In Driver System. And supports all higher-level functions.
-
- [SEE-ALSO]
-
- [EXAMPLE]
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WVkeyInit;
-
- [PARAMETERS]
-
- (None)
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- ****** THIS FUNCTION NOT IMPLEMENTED! ******
-
- [SEE-ALSO]
-
- [EXAMPLE]
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Function WKeyPressed : BOOLEAN;
-
- [PARAMETERS]
-
- (None)
-
- [RETURNS]
-
- Whether a Key is Pressed or in the Window Key Buffer
-
- [DESCRIPTION]
-
- Checks the Window Key Buffer and the Keyboard and returns whether
- a key is available.
-
- [SEE-ALSO]
-
- WIDoReadKey
-
- [EXAMPLE]
-
- BEGIN
-
- WriteLn( 'Press any Key' );
- WriteLn( 'WKeyPressed = ',WKeyPressed );
-
- While NOT WKeyPressed Do;
- WriteLn( 'WKeyPressed = ',WKeyPressed );
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Function WIDoReadKey : CHAR;
-
- [PARAMETERS]
-
- (None)
-
- [RETURNS]
-
- The First Key in the Window Key Buffer (or Keyboard)
-
- [DESCRIPTION]
-
- Reads the first Key in the Window Key Buffer or the Keyboard, in order
- of priority.
-
- [SEE-ALSO]
-
- WKeyPressed
-
- [EXAMPLE]
-
- Uses VGen,VWinLow;
-
- VAR
- ch : CHAR;
-
- BEGIN
-
- WriteLn( 'This Tests continues until you press ESC' );
-
- REPEAT
-
- ch := WIDoReadKey;
- WriteLn( 'Ch = ',ByteToHex(Ord(ch)),'h = ',Ord(ch):3,'d = ',ch );
-
- UNTIL ch = #27;
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WInitColorMap;
-
- [PARAMETERS]
-
- (None)
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- *****THIS FUNCTION NOT IMPLEMENTED*****
-
- [SEE-ALSO]
-
- [EXAMPLE]
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WTextColor( Color : INTEGER );
-
- [PARAMETERS]
-
- FC New Text Foreground Color
- BC New Text Background Color
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- This function sets both the text foreground and background colors for the
- active window. If there is no active window, it will set the colors for
- the console screen itself.
-
- [SEE-ALSO]
-
- WTextColor
- WTextBackGround
- WTextAttr
-
- [EXAMPLE]
-
- VAR
- I : INTEGER;
-
- BEGIN
-
- For i ;= 0 to 15 Do
- BEGIN
-
- WTextColor( i );
- Write( 'Fore' );
-
- END; { For i }
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WTextBackGround( Color : INTEGER );
-
- [PARAMETERS]
-
- Color New Text Background Color
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- This function sets the text background color for the active window.
- If there is no active window, it will set the text background color
- for the console screen itself.
-
- [SEE-ALSO]
-
- WTextColor
- WTextColors
- WTextAttr
-
- [EXAMPLE]
-
- VAR
- I : INTEGER;
-
- BEGIN
-
- For i := 0 to 7 Do
- BEGIN
-
- WTextBackGround( i );
- Write( 'Back' );
-
- END; { For i }
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WTextAttr( Attr : BYTE );
-
- [PARAMETERS]
-
- Attr New Text Attribute Byte
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- This function sets the text attribute the active window.
- If there is no active window, it will set the text attribute for the
- console screen itself.
-
- [SEE-ALSO]
-
- WTextColor
- WTextBackGround
- WTextColors
-
- [EXAMPLE]
-
- VAR
- I : INTEGER;
-
- BEGIN
-
- For i := 0 to 64 Do
- BEGIN
-
- WTextAttr( i );
- Write( 'X' );
-
- END; { For i }
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WTextColors( FC : INTEGER;
- BC : INTEGER );
-
- [PARAMETERS]
-
- FC New Text Foreground Color
- BC New Text Background Color
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- This function sets both the text foreground and background colors for the
- active window. If there is no active window, it will set the colors for
- the console screen itself.
-
- [SEE-ALSO]
-
- WTextColor
- WTextBackGround
- WTextAttr
-
- [EXAMPLE]
-
- VAR
- i : INTEGER;
- BEGIN
-
- For i := 0 to 7 Do
- BEGIN
-
- WTextColors( 7-i, i );
- WriteLn( 'Fore & Back' );
-
- END; { For i }
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WCursorOFF;
-
- [PARAMETERS]
-
- (None)
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- Turns OFF the Text Cursor
-
- [SEE-ALSO]
-
- WCursorOn
- WCursorBig
- WCursorSmall
- WPointerOn
- WPointerOff
-
- [EXAMPLE]
-
- VAR
- ch : CHAR;
-
- BEGIN
-
- WriteLn( 'The Cursor is ON' );
- WriteLn( 'Press any key to Hide it...' );
-
- ch := WReadKey;
- WCursorOFF;
-
- WriteLn;
- WriteLn( 'Now the Cursor is Hidden' );
- WriteLn( 'Press any key to Restore it...' );
-
- ch := WReadKey;
- WCursorOn;
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WCursorON;
-
- [PARAMETERS]
-
- (None)
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- Turns ON the Text Cursor
-
- [SEE-ALSO]
-
- WCursorOff
- WCursorBig
- WCursorSmall
- WPointerOn
- WPointerOff
-
- [EXAMPLE]
-
- VAR
- ch : CHAR;
-
- BEGIN
-
- WriteLn( 'The Cursor is ON' );
- WriteLn( 'Press any key to Hide it...' );
-
- ch := WReadKey;
- WCursorOFF;
-
- WriteLn;
- WriteLn( 'Now the Cursor is Hidden' );
- WriteLn( 'Press any key to Restore it...' );
-
- ch := WReadKey;
- WCursorOn;
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WCursorSMALL;
-
- [PARAMETERS]
-
- (None)
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- Makes the Text Cursor a Standard Underline
-
- [SEE-ALSO]
-
- WCursorOn
- WCursorOff
- WCursorBig
- WPointerOn
- WPointerOff
-
- [EXAMPLE]
-
- BEGIN
-
- WCursorSMALL;
-
- { The Text Cursor is now a Normal Blinking UnderLine }
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WCursorBIG;
-
- [PARAMETERS]
-
- (None)_
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- Make the Text Cursor a large Block
-
- [SEE-ALSO]
-
- WCursorOn
- WCursorOff
- WCursorSmall
- WPointerOn
- WPointerOff
-
- [EXAMPLE]
-
- BEGIN
-
- WCursorBIG;
-
- { The Text Cursor is now a Big Blinking Block }
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WMPointerOn;
-
- [PARAMETERS]
-
- (None)
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- Turns ON the Text Mouse Pointer
-
- [SEE-ALSO]
-
- WCursorOn
- WCursorOff
- WCursorBig
- WCursorSmall
- WPointerOff
-
- [EXAMPLE]
-
- BEGIN
-
- WMPointerOn;
-
- { The Mouse Pointer is now displayed (if supported) }
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WMPointerOff;
-
- [PARAMETERS]
-
- (None)
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- Turns OFF the Text Mouse Pointer
-
- [SEE-ALSO]
-
- WCursorOn
- WCursorOff
- WCursorBig
- WCursorSmall
- WPointerOn
-
- [EXAMPLE]
-
- BEGIN
-
- WMPointerOff;
-
- { The Mouse Pointer is now Hidden (even if supported) }
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WMGetStatus( Var Buttons : INTEGER;
- Var X : INTEGER;
- Var Y : INTEGER );
-
- [PARAMETERS]
-
- Buttons VAR Returned Mouse Button Status Flags (Left,Center,Right)
- X VAR Returned Mouse X Coordinate
- Y VAR Returned Mouse Y Coordinate
-
- [RETURNS]
-
- Function : None
- (VAR : [Buttons] Mouse Button Status Flags)
- (VAR : [X] Mouse X Coordinate)
- (VAR : [Y] Mouse Y Coordinate)
-
- [DESCRIPTION]
-
- Reads and Returns the Mouse Buttons Status as well as the current
- Mouse coordinates.
-
- [SEE-ALSO]
-
- WMWaitForNoButtons
-
- [EXAMPLE]
-
- BEGIN
-
- { make button list }
-
- REPEAT
-
- { check to see where mouse is }
-
- { display report }
-
- UNTIL ch = #27;
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WMWaitForNOButtons;
-
- [PARAMETERS]
-
- (None)
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- Waits until User has released ALL Mouse Buttons before proceeding.
-
- [SEE-ALSO]
-
- WMGetStatus
-
- [EXAMPLE]
-
- VAR
- ch : CHAR;
-
- BEGIN
-
- WriteLn( 'Hold Down a Mouse Button...' );
-
- While NOT WKeyPressed Do;
-
- WriteLn;
- WriteLn( 'Now release the Button whenever you like.' );
-
- WMWaitFoNOButtons;
-
- WriteLn( 'OK, You have just released the Mouse Button' );
-
- While WKeyPressed Do; { get rid of any keys }
- Ch := WReadKey;
-
- WriteLn;
- WriteLn( 'Press any key to Quit...' );
- While NOT WKeyPressed Do;
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WError( Error : ST80 );
-
- [PARAMETERS]
-
- Error Window Error Text to display before halting pgm
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- This function displays a Window-Library Error and halts the program.
- It is mainly used by other Window Library functions when Critical Errors
- occur.
-
- [SEE-ALSO]
-
- [EXAMPLE]
-
- BEGIN
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Function WColorFromString( S : STRING ) : BYTE;
-
- [PARAMETERS]
-
- S Text color, as a string. IE: "RED"
-
- [RETURNS]
-
- Numeric Color Value
-
- [DESCRIPTION]
-
- This function converts a Text String Color Name into a Color Value.
- This function is NOT Case Sensitive.
-
- [SEE-ALSO]
-
- [EXAMPLE]
-
- CONST
- ColorNames = ARRAY[0..7] of STRING =
- ( 'BLACK','WHITE','BLUE','GREEN',
- 'RED','YELLOW','CYAN','MAGENTA' );
- VAR
- I : INTEGER;
-
- BEGIN
-
- Textbackground( WHITE );
-
- For i := 0 to 7 Do
- BEGIN
- TextColor( WColorFromString( ColorNames[i] ) );
- WriteLn( ColorNames[i] );
- END; { For i }
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WSet( S : ST80 );
-
- [PARAMETERS]
-
- S Window Environment Command String
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- Alters the Current Window Environment based upons the commands provided
- in the provided Environment Command String.
-
- The Window Environment String may contain one or more of the following
- Sub-Strings (separated by commas) :
-
- "LOOK=x" - Sets the General "Look" of the Window. Each Look
- contains such things as Window Shadows, Single or
- Double Borders, or even Altered Color Palettes.
- Basically a Look represents a predetermined
- combination of any of the following data. ("x"
- represents a look number)
-
- "NOACTIVE" - Normally the Active Window's Frame is highlighted.
- To disable this, use this call.
-
- "ACTIVE" - Normally the Active Window's Frame is highlighted.
- If this had been changed at any point, this will
- restore this condition.
-
- "BORDER=x" - Sets the Window Borders to the Style Number given
- as "x". Currently this Range is 1-9
-
- "NOSHADOW" - Disables Shadows on the Active Window.
-
- "SHADOW" - Enables Shadows on the Active Window and all Windows
- which have Shadow Locking On.
-
- "NOEVENTS" - Turns off Window Environment Event Handling. (See
- "EVENTS")
-
- "EVENTS" - Turns on Window Environment Event Handling. When
- Events are on, any key or mouse input will be flagged
- by the Window Environment as an Event. Some Input
- routines use this to jump out on Non-Input Keys.
-
- "NOLOCKSHADOW" - Turns off Window Shadow Locking. Normally only the
- Active Window is allowed to have Shadows. If this
- had been changed, it is restore by this.
-
- "LOCKSHADOW" - Turns on Window Shadow Locking. Normally only the
- Active Window is allowed to have Shadows. If you
- wish to override this and leave shadows on any window,
- use this call.
-
- "NOMOUSE" - Deactivates Mouse support (even if it exists)
-
- "MOUSE" - Activates Mouse support if it exists.
-
- "KHITS=x" - Sets the Number of Key/Mouse Hits which represent
- the User Accepting a certain action (like acting
- on a Pressed Button). Sometimes it is better to
- use a Double-Click when scrolling thru a List box
- to avoid inadvertent data selection. ("x" is the
- desired Key/Mouse Hits meaning OK - either 1 or 2).
-
- "MLBACK=x" - Establishes the Menu Line Background Color, where
- "x" represents a Color TEXT.
-
- "MLFORE=x" - Establishes the Menu Line Foreground Color, where
- "x" represents a Color TEXT.
-
- "GEMICOLOR=x" - Establishes the Dialog Box Icon Foreground Color,
- where "x" represents a Color TEXT.
-
- "GEMFORE=x" - Establishes the Dialog Box's Foreground Color,
- where "x" represents a Color TEXT.
-
- "GEMBACK=x" - Establishes the Dialog Box's Background Color,
- where "x" represents a Color TEXT.
-
- "GEMHBACK=x" - Establishes the Dialog Box's Highlighted Background
- ????????, where "x" represents a Color TEXT.
- Then
- WinEnv.GemHBack := WColorFromString( ParamData )
- Else
-
- "GEMHFORE=x" - Establishes the Dialog Box's Highlighted Foreground
- ????????, where "x" represents a Color TEXT.
- Then
- WinEnv.GemHFore := WColorFromString( ParamData )
- Else
-
- "GEMNBACK=x" - Establishes the Dialog Box's Normal Background
- ????????, where "x" represents a Color TEXT.
- Then
- WinEnv.GemNBack := WColorFromString( ParamData )
- Else
-
- "GEMNFORE=x" - Establishes the Dialog Box's Normal Foreground
- ????????, where "x" represents a Color TEXT.
- Then
- WinEnv.GemNFore := WColorFromString( ParamData )
- Else
-
- "GEMBUTTON=x" - Establishes the Dialog Box's Button Type, where "x"
- represents a Button Type Number.
-
- "GEMHBUTTON=x" - Extablishes the Dialog Box's Highlighted Button
- Type, where "x" represents a Button Type Number.
-
- One of the few things that cannot be changed afterwords is the Screen
- Resolution, or the Clock. These MUST be taken care of when the Window
- Environment System is Initialized (by a call to "WOpen").
-
- [SEE-ALSO]
-
- WOpen
-
- [EXAMPLE]
-
- BEGIN
-
- WSet( 'LOOK=2,NOACTIVE,NOMOUSE,EVENTS' );
-
- {---------------------------------------------------}
- { Sets the Display Look to #2 }
- { Disables Active Window Border Highlighting }
- { Disables Mouse support }
- { Enables Events handling for all actions hereafter }
- {---------------------------------------------------}
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Function WFExist( FName : STRING ) : BOOLEAN;
-
- [PARAMETERS]
-
- FName Name of File to search for
-
- [RETURNS]
-
- Whether the file was found to Exist
-
- [DESCRIPTION]
-
- Searches for a file of a given name and returns whether it was found.
- This is mainly used a an internal Windows function for when the Windows
- System would need to find and use a file.
-
- [SEE-ALSO]
-
- (None)
-
- [EXAMPLE]
-
- BEGIN
-
- WriteLn( 'File ENVIRON.DEF Existed : ', WFExist( 'ENVIRON.DEF' ) );
-
- { Probably won't find this file and thus report FALSE }
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WBackRefresh( S : STRING;
- FC : BYTE;
- BC : BYTE );
-
- [PARAMETERS]
-
- S Background Pattern String
- FC Foreground Color
- BC Background Color
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- This function refreshes the Screen Background Pattern
-
- [SEE-ALSO]
-
- [EXAMPLE]
-
- VAR
- ch : CHAR;
-
- BEGIN
- ╥╙╘╒╓╫╫╪┘┌█╥╤╨╧╬
- WOpen( '═', BLACK, BLUE, 'NOMOUSE' );
-
- { Now Let's mess up the screen a bit }
-
- WMessage( 'Press any Key to Refresh the Screen' ,WHITE, BLACK );
-
- TextColors( WHITE, RED );
- GotoXY( 1, 1 );
- While NOT WKeyPressed Do
- Write( Random( 255 ) );
-
- { And when a Key was pressed, Refresh the Background }
-
- ch := WReadKey;
-
- WBackRefresh( '═', BLACK, BLUE );
-
- WMessage( 'Press any key to Quit', WHITE, BLACK );
- While NOT WKeyPressed Do;
- WClose;
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WSubmitBorder( X : INTEGER;
- S : ST80;
- SBIFore : BYTE;
- SBIBack : BYTE;
- Attr : LONGINT );
-
- [PARAMETERS]
-
- X Border String Number
- S Border Definition String (1 Char Per Type)
- SBIFore (Not Currently Used)
- SBIBack (Not Currently Used)
- Attr (Not Currently Used)
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- A Border Definition String is a String of 38 Characters, each representing
- a different Border Type Character. They are as Follows:
-
- WSubmitBorder( 1, '┌┐└┘──││[]├┤┴┬╞╡╨╥─═│║ ',
- 0,0, cwbTitleLeft+cwbColorStyleAll );
-
- WSubmitBorder( 2, '╔╗╚╝══║║[]╟╢╧╤╠╣╩╦─═│║ ',
- 0,0, cwbTitleLeft+cwbColorStyleAll );
-
- WSubmitBorder( 3, '╒╕╘╛══││[]├┤╧╤╞╡╩╦─═│║ ',
- 0,0, cwbTitleLeft+cwbColorStyleAll );
-
- WSubmitBorder( 4, '╓╖╙╜──║║[]╟╢┴┬╠╣╨╥─═│║ ',
- 0,0, cwbTitleLeft+cwbColorStyleAll );
-
- WSubmitBorder( 5, '████▀▄██ ██████████│█ ',
- 0,0, cwbTitleLEft+cwbColorStyleAll );
-
- WSubmitBorder( 6, ' │ ',
- 0,0, cwbTitleLeft+cwbColorStyleAll );
-
- WSubmitBorder( 7, ' ',
- 0,0, cwbTitleLEft+cwbColorStyleAll );
-
- WSubmitBorder( 8, '++++--||[] | ',
- 0,0,cwbTitleLEft+cwbColorStyleAll );
-
- WSubmitBorder( 9, '╔╗╚╝╠═╖║[]╟╢╧╤╠╣╩╦─═│║φε╖║∩≡cc......cc',
- 0,0, cwbTitleLeft+cwbColorStyleTop );
-
- WSubmitBorder( 10, '┌┐└┘──││ ├┤┴┬╞╡╨╥─═│║ ',
- 0,0, cwbTitleLeft+cwbColorStyleAll );
-
-
- Example : S = '┌┐└┘──││[]├┤┴┬╞╡╨╥─═│║ '
-
- 1 2 3 4 5 6 7 8 9 10
-
- Char 1 = Upper Left Window Corner ┌ ╔ ╒ ╓ █ █ + ╔ ┌
- Char 2 = Upper Right Window Corner ┐ ╗ ╕ ╖ █ █ + ╗ ┐
- Char 3 = Lower Left Window Corner └ ╚ ╘ ╙ █ █ + ╚ └
- Char 4 = Lower Right Window Corner ┘ ╝ ╛ ╜ █ █ + ╝ ┘
-
- Char 5 = Upper Horizontal ─ ═ ═ ─ ▀ █ - ╠ ─
- Char 6 = Lower Horizontal ─ ═ ═ ─ ▄ █ - ═ ─
- Char 7 = Left Vertical │ ║ │ ║ █ █ | ╖ │
- Char 8 = Right Vertical │ ║ │ ║ █ █ | ║ │
-
- Char 9 = Window Text Opening Char [ [ [ [ [ [
- Char 10 = Window Text Closing Char ] ] ] ] ] ]
-
- Char 11 = Left to Internal Single Line ├ ╟ ├ ╟ █ █ ╟ ├
- Char 12 = Right toInternal Single Line ┤ ╢ ┤ ╢ █ █ ╢ ┤
- Char 13 = Bottom to Internal Single Line ┴ ╧ ╧ ┴ █ █ ╧ ┴
- Char 14 = Top to Internal Single Line ┬ ╤ ╤ ┬ █ █ ╤ ┬
-
- Char 15 = Left to Internal Double Line ╞ ╠ ╞ ╠ █ █ ╠ ╞
- Char 16 = Right to Internal Double Line ╡ ╣ ╡ ╣ █ █ ╣ ╡
- Char 17 = Bottom to Internal Double Line ╨ ╩ ╩ ╨ █ █ ╩ ╨
- Char 18 = Top to Internal Double Line ╥ ╦ ╦ ╥ █ █ ╦ ╥
-
- Char 19 = Horizontal Internal Single Line ─ ─ ─ ─ █ █ ─ ─
- Char 20 = Horizontal Internal Double Line ═ ═ ═ ═ █ █ ═ ═
- Char 21 = Vertical Internal Single Line │ │ │ │ │ │ │ | │ │
- Char 22 = Vertical Internal Double Line ║ ║ ║ ║ █ █ ║ ║
-
- Char 23 = Extended Characters φ
- Char 24 = " " ε
- Char 25 = " " ╖
- Char 26 = " " ║
- Char 27 = " " ∩
- Char 28 = " " ≡
- Char 29 = " " c
- Char 30 = " " c
- Char 31 = " " .
- Char 32 = " " .
- Char 33 = " " .
- Char 34 = " " .
- Char 35 = " " .
- Char 36 = " " .
- Char 37 = " " c
- Char 38 = " " c
-
-
-
- [SEE-ALSO]
-
- [EXAMPLE]
-
- BEGIN
-
- WSubmitBorder( 1, '┌┐└┘──││[]├┤┴┬╞╡╨╥─═│║ ',
- 0,0, cwbTitleLeft+cwbColorStyleAll );
-
- {--------------------------------------------------------}
- { Sets Window Border Type 1 to an All-Single Border Type }
- { with the Window Title Name set Left }
- {--------------------------------------------------------}
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WOpen( BackGroundCH : ST80;
- TxtColor : BYTE;
- BckColor : BYTE;
- S : ST80 );
-
- [PARAMETERS]
-
- BackGroundCH Screen Background Pattern String
- TxtColor Window Text Foreground Color
- BckColor Window Text Background Color
- S Window Environment Initialization Command String
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- The Screen Background Pattern String is a string which is displayed
- as the background of the entire Window Environment. It is repeated
- over and over on each line of the Background. This string can be
- of any length or any set of characters. If the screen is 80x25 and
- the Pattern is 1 Char, then there will be 80 of these per line.
- If the Pattern is 5 Chars (like a Name), it will be repeated 16 times
- per line, for each and every line of the background. This can result
- in some pretty interesting screen patterns.
-
- Whatever the Pattern, it is displayed in the provided screen colors.
-
- The Window Environment may contain one or more of the following
- Sub-Strings (separated by commas) :
-
- "KEEPSCREEN" - When Shelling out to other Windows Program, use
- this to keep and later restore the Parent Window
- Screen. The Child Program will look as if it were
- running right in the Parent.
-
- "SUPER-REZ" - Use this when you wish the Windows to support the
- Highest Resolution available.
-
- "MONO" - Set Display to Mono Mode (see B/W)
-
- "LOOK=X" - This establishes the "Look" of all windows.
- (Where x is If it is 1 then ...
- 1 or 2) And if it is 2 then ...
-
- "SHADOW" - Allows use of Shadows on all Active Windows Drawn
-
- "B/W" - Sets display to Black & White (Mono) Mode
-
- "HIRES" - Uses the highest Screen Resolution available
- by the monitor (See SUPER-REZ)
-
- "MOUSE" - Ensures the Mouse is Activated if Present
-
- "KHITS=X" - Establishes the number of Mouse Button Hits representing
- (Where x is a user selection. Sometimes 1 is too little or 2 too much.
- 1 or 2)
-
- "NOACTIVE" - Normally the Active Window has it's Frame Highlighted.
- This Parameter is used to disable this for all windows.
-
- "CLOCK" - This parameter activates a Clock (Date & Time) featured
- at the upper right of the screen (on the Program Name
- Bar). This Clock will thereafter display the current
- time as a background task.
-
- [SEE-ALSO]
-
- WClose
-
- [EXAMPLE]
-
- BEGIN
-
- WOpen('▒', BLACK,BLUE,'CLOCK,MOUSE,LOOK=1,SUPER-REZ');
-
- WPrgNameMsg( 'Program Name Vers 1.0', WHITE, CYAN )
- WMessage( 'This is the Window System. Press any Key to Quit', WHITE,CYAN
- While NOT WKeyPressed Do;
-
- WClose;
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WDrawBorder( TheWin : PWin );
-
- [PARAMETERS]
-
- [RETURNS]
-
- [DESCRIPTION]
-
- ****** THIS FUNCTION NOT IMPLEMENTED! ******
-
- [SEE-ALSO]
-
- [EXAMPLE]
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WinDoBox( X : INTEGER;
- Y : INTEGER;
- X2 : INTEGER;
- Y2 : INTEGER;
- WFC : INTEGER;
- WBC : INTEGER;
- FC : INTEGER;
- BC : INTEGER;
- Name : ST80;
- Style : INTEGER );
-
- [PARAMETERS]
-
- X Left Window Coordinate
- Y Top Window Coordinate
- X2 Right Window Coordinate
- Y2 Bottom Window Coordinate
- WFC Window Foreground Color
- WBC Window Background Color
- FC Border Foreground Color
- BC Border Background Color
- Name Window Title Text
- Style
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- [SEE-ALSO]
-
- WinReDoBox
-
- [EXAMPLE]
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WinReDoBox( X : INTEGER;
- Y : INTEGER;
- X2 : INTEGER;
- Y2 : INTEGER;
- FC : INTEGER;
- BC : INTEGER;
- Style : INTEGER );
-
- [PARAMETERS]
-
- X Left Window Coordinate
- Y Top Window Coordinate
- X2 Right Window Coordinate
- Y2 Bottom Window Coordinate
- FC
- BC
- Style Box Border Style
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- [SEE-ALSO]
-
- WinDoBox
-
- [EXAMPLE]
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WClear( X : INTEGER;
- Y : INTEGER;
- X2 : INTEGER;
- Y2 : INTEGER;
- FC : INTEGER;
- BC : INTEGER );
-
- [PARAMETERS]
-
- X Left Screen Coordinate of Region to Clear
- Y Top Screen Coordinate of Region to Clear
- X2 Right Screen Coordinate of Region to Clear
- Y2 Botton Screen Coordinate of Region to Clear
- FC Foreground color to Clear Region with
- BC Background color to Clear Region with
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- Clears the Specific Window Area on the Screen and Initializes it with the
- provided Foreground and Background colors.
-
- [SEE-ALSO]
-
- [EXAMPLE]
-
- BEGIN
-
- WClear( 5,2,20,7,WHITE,BLUE );
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WDefWinEventProc( Win : PWin;
- Event : TWinEvent ); Far;
-
- [PARAMETERS]
-
- Win Pointer to Window Data
- Event Handle to Window Event Data
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- ****** THIS FUNCTION NOT IMPLEMENTED! ******
-
- This is the Default Windows Event Procedure. Currently it does nothing.
-
- [SEE-ALSO]
-
- [EXAMPLE]
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WNewEx( X : INTEGER;
- Y : INTEGER;
- X2 : INTEGER;
- Y2 : INTEGER;
- FC : BYTE;
- BC : BYTE;
- BordFC : BYTE;
- BordBC : BYTE;
- Border : WORD;
- Flags : LONGINT;
- EventProc : TWinEventProc;
- Name : ST80 );
-
- [PARAMETERS]
-
- X Left Window Coordinate
- Y Top Window Coordinate
- X2 Right Window Coordinate
- Y2 Bottom Window Coordinate
- FC Window Foreground Color
- BC Window Background Color
- BordFC Window Border Foreground Color
- BordBC Window Border Background Color
- Border Border Type
- Flags Window Flags
- EventProc Default Window Event Procedure
- Name Name to Identify Window With (also in Window Title)
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- This is the actual function which creates a New Window. It is an
- Internal Function only.
-
- It takes care of everything necessary to saving the background along
- with drawing the window itself.
-
- [SEE-ALSO]
-
- WNew
- WDispose
-
- [EXAMPLE]
-
- BEGIN
-
- WNewEx( 5, 2, 20, 7,
- WHITE,BLUE,WHITE,CYAN,
- 1,cwnShadow, WDefWinEventProc,
- 'Window' );
-
- {-----------------------------------------------------------------}
- { Creates a new window at ( 5, 2, 20, 7 ) }
- { with the Window being WHITE on BLUE with a WHITE on CYAN Border }
- { The Border uses Characters from the Border 1 Definition Set }
- { The Window has Shadows and uses the Default Event Procedure }
- { And finally, the window is called "Window" }
- {-----------------------------------------------------------------}
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WNew( X : INTEGER;
- Y : INTEGER;
- X2 : INTEGER;
- Y2 : INTEGER;
- FC : BYTE;
- BC : BYTE;
- BorderFC : BYTE;
- BorderBC : BYTE;
- Name : ST80 );
-
- [PARAMETERS]
-
- X Left Screen Coordinate
- Y Top Screen Coordinate
- X2 Right Screen Coordinate
- Y2 Bottom Screen Coordinate
- FC Window Foreground Color
- BC Window Background Color
- BorderFC Window Border Foreground Color
- BorderBC Window Border Background Color
- Name Name to Identify Window with (also used in Border Title)
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- Creates a brand new window using the sizes and colors provided.
- If desired sizes are to be relative to the screen edges then the
- number of line away from the screen edge used as a negative number
- may be used in any input coordinate value. Also all references to
- this window will be the given Window Name until otherwise changed.
-
- [SEE-ALSO]
-
- WEnter
- WExit
- WGo
- WDispose
- WNewEx
-
- [EXAMPLE]
-
- BEGIN
-
- WNew( 5,2,20,7, WHITE,BLUE,WHITE,BLUE, 'Window' );
-
- WriteLn( 'Press any key to Dispose of Window...' );
- While NOT WKeyPressed Do;
-
- WDispose( 'Window' );
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WEnter( Name : ST80 );
-
- [PARAMETERS]
-
- [RETURNS]
-
- [DESCRIPTION]
-
- [SEE-ALSO]
-
- [EXAMPLE]
-
- VAR
- ch : CHAR;
-
- BEGIN
-
- WNew( 5,2,20,7, WHITE,BLUE,WHITE,BLUE, 'Window' );
-
- WriteLn( 'Press any key to Exit this Window...' );
- ch := WReadKey;
- WExit;
-
- WMessage( 'Press any key to return to the Window...', WHITE, CYAN );
- ch := WReadKey;
- WEnter( 'Window' );
-
- WMessage( 'Press any key to Quit', WHITE, CYAN );
- WriteLn( 'Press any key to Quit...' );
- ch := WReadKey;
-
- WDispose( 'Window' );
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WExit;
-
- [PARAMETERS]
-
- (None)
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- This function ensures that All Windows are considered NOT Active.
-
- [SEE-ALSO]
-
- WNew
- WEnter
- WGo
- WDispose
-
- [EXAMPLE]
-
- VAR
- ch : CHAR;
-
- BEGIN
-
- WNew( 5,2,20,7, WHITE,BLUE,WHITE,BLUE, 'Window' );
-
- WriteLn( 'Press any key to Exit this Window...' );
- ch := WReadKey;
-
- WExit;
-
- WMessage( 'Press any key to return to the Window...', WHITE, CYAN );
- ch := WReadKey;
- WGo( 'Window' );
-
- WMessage( 'Press any key to Quit', WHITE, CYAN );
- WriteLn( 'Press any key to Quit...' );
- ch := WReadKey;
-
- WDispose( 'Window' );
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WGo( Name : ST80 );
-
- [PARAMETERS]
-
- Name Name of Window to make Active/Update
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- This function makes the given Window Name the Active Window.
-
- NOTE: This function is intended for future use to allow the user to
- call up any window as the active window. However currently it's use
- is limited to simply making Window Border Frame modifications on the
- current window to update and be displayed.
-
- [SEE-ALSO]
-
- WNew
- WEnter
- WExit
- WDispose
-
- [EXAMPLE]
-
- VAR
- ch : CHAR;
-
- BEGIN
-
- WNew( 5, 2,20, 7, WHITE,BLUE,WHITE,BLUE, 'Window 1' );
- WNew( 40,15,60,20, WHITE,CYAN,WHITE,CYAN, 'Window 2' );
-
- WriteLn( 'Press any key to Go to Window 1...' );
- WMessage( 'Press any key to Go to Window 1', WHITE, CYAN );
- ch := WReadKey;
- WGo( 'Window 1' );
-
- WriteLn( 'Press any key to Go to Window 2...' );
- WMessage( 'Press any key to Go to Window 2', WHITE, BLUE );
- ch := WReadKey;
- WGo( 'Window 2' );
-
- WriteLn;
- WriteLn( 'Press any key to Quit...' );
- WMessage( 'Press any key to Quit', WHITE, CYAN );
- ch := WReadKey;
-
- WDispose( 'Window 2' );
- WDispose( 'Window 1' );
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WDispose( Name : ST80 );
-
- [PARAMETERS]
-
- Name Name of Window to Dispose of
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- This function disposes (destroys) the Window of the given Name
-
- [SEE-ALSO]
-
- WNew
- WEnter
- WExit
- WGo
-
- [EXAMPLE]
-
- BEGIN
-
- WNew( 5,2,20,7,WHITE,BLUE,WHITE,BLUE, 'Window' );
-
- WriteLn( 'Press any Key to Dispose of this Window...' );
-
- While NOT WKeyPressed Do;
-
- WDispose( 'Window' );
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WTSR_Entry;
-
- [PARAMETERS]
-
- (None)
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- If the program being Created is a TSR, then this function call MUST
- be the first thing it does upon entry.
-
- This function is to be called each time a TSR Program is popped-up.
- It reads and resets all the window and screen information so that
- the program can continue normally without having to worry about screen
- display changes.
-
- It is particularly useful for instances where the Screen MODE has been
- altered!
-
- [SEE-ALSO]
-
- [EXAMPLE]
-
- BEGIN
-
- WTSR_Entry;
-
- { Now continue with the rest of the program as normal }
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Function WGetWinPointer( Name : ST80 ) : THandle;
-
- [PARAMETERS]
-
- [RETURNS]
-
- [DESCRIPTION]
-
- [SEE-ALSO]
-
- [EXAMPLE]
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WSetHasShadow( Name : ST80;
- Bool : BOOLEAN );
-
- [PARAMETERS]
-
- Name Window Name to put or remove Shadow from
- Bool Is this to Put a Shadow on the Window?
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- Sets or Unsets the "HasShadow" Flag in the indicated Window's Definition
- Structure. Now anytime this window is active, if the Flag is TRUE then
- a shadow will be drawn below this window, otherwise no shadows will be
- drawn.
-
- [SEE-ALSO]
-
- WDrawShadowOn
- WEraseShadowFrom
-
- [EXAMPLE]
-
- BEGIN
-
- WNew( 5,2,20,7, WHITE,BLUE,WHITE,BLUE, 'Window' );
-
- WSetHasShadow( 'Window' );
- WriteLn( 'This Window has NO Shadow' );
- WriteLn( 'Press a key to add one...' );
-
- While NOT WKeyPressed Do;
- WriteLn;
- WriteLn(
-
- WSetHasShadow( 'Window', TRUE );
- WriteLn( 'Now this Window has a Shadow' );
- WriteLn( 'Press ESC to Quit...');
-
- While WReadKey <> #27 Do;
-
- WDispose( 'Window' );
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WDoBoxFrame( TheWin : PWin );
-
- [PARAMETERS]
-
- TheWin Pointer to Window Definition Structure
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- Updates the BoxFrame of the Window indicated by the provided
- Window Definition Structure.
-
- [SEE-ALSO]
-
- [EXAMPLE]
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WSubmitFrameJoint( Num : INTEGER;
- Side : INTEGER;
- Offset : INTEGER );
-
- [PARAMETERS]
-
- Num A Sequential Frame Joint Number.Frame Type
- Side Frame Side and Type Number
- (1-4 Single on Side, 11-14 Double on Side (1=Left,2=Right,3=Bottom,4=Top)
- Offset Position from the Upper or Right Corner (base=0)
- [RETURNS]
-
- [DESCRIPTION]
-
- Submits a Frame Joint (the intersection point of a Window Frame with
- an inner window line drawing character). This is used the make lines
- drawn within the window to be contiguous with the frame.
-
- A Frame Joint Number is simply an arbitrarily assign number starting
- at 1 for the First Frame Joint and running Sequentially upwards from
- there to the total number of Frame Joints to Add. Joints should be
- Submitted Sequentially in order.
-
- The Side not only represents the Side but also whether the internal end
- of the joint is a Single- or Double-Line Type. To Indicate all this
- information use the following values:
-
- Side Single Double
- ------- -------- ---------
- Top 1 11
- Left 2 12
- Bottom 3 13
- Right 4 14
-
- And the Position is the Number of Characters that place is from the
- Character on the Top or Left most Joint. The Corner Character is
- counted as 0 with the 1st Character inside the Window being 1, ...
-
- NOTE: These Frame Joints are NOT visible until the frame is updated
- thru a call to WGoCurrentWin (or other Frame updating function).
-
- [SEE-ALSO]
-
- [EXAMPLE]
-
- BEGIN
-
- WNew( 5,2,20,7,WHITE,BLUE,WHITE,BLUE, 'Window' );
-
- WSubmitFrameJoint( 1, 1, 3 ); { 1st Joint, Top/Single, at 3rd Win Column }
- WSubmitFrameJoint( 2, 3, 3 ); { 2nd Joint, Bottom/Single, 3rd Win Column }
-
- WriteLn( 'Ready to Update Current Window Frame.' );
- WriteLn( 'Press any Key to do so...' );
-
- While NOT WKeyPressed Do;
-
- WGoCurrentWin;
-
- WriteLn;
- WriteLn( 'Press ESC to Quit...' );
-
- While WReadKey = #27 Do;
-
- WDispose( 'Window' );
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WHideUnHide( Name : ST80;
- HideWin : BOOLEAN );
-
- [PARAMETERS]
-
- Name Name of Window to Hide or Unhide
- HideWin Is this to Hide the Window?
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- This functions Hides or Unhides the Window of the given Name
-
- [SEE-ALSO]
-
- WNew
- WEnter
- WExit
- WGo
- WDispose
- WGoCurrentWin
-
- [EXAMPLE]
-
- VAR
- ch : CHAR;
-
- BEGIN
-
- WNew( 5,2,20,7,WHITE,BLUE,WHITE,BLUE, 'Window' );
-
- WMessage( 'Press any key to Hide the Current Window.', WHITE, RED );
- While NOT WKeyPressed Do;
- ch := WReadKey;
-
- WHideUnhide( 'Window', TRUE );
-
- WMessage( 'Press any key to UnHide the Window' );
- While NOT WKeyPressed Do;
- ch := WReadKey;
-
- WMessage( 'Press ESC to Quit', WHITE, RED );
- WriteLn( 'Press ESC to Quit...' );
- While WReadKey = #27 Do;
-
- WDispose( 'Window' );
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WGoCurrentWin;
-
- [PARAMETERS]
-
- (None)
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- This function makes the given Window Name the Active Window.
- Unlike WGoWin, this function was never intended for anything other
- than to simply update the current window display and borders.
-
- [SEE-ALSO]
-
- WNew
- WEnter
- WExit
- WGo
- WDispose
- WHideUnHide
-
- [EXAMPLE]
-
- BEGIN
-
- WNew( 5,2,20,7,WHITE,BLUE,WHITE,BLUE, 'Window' );
-
- WSubmitFrameJoint( 1, 3, 1 );
- WSubmitFrameJoint( 3, 3, 1 );
-
- WriteLn( 'Ready to Update Current Window Frame.' );
- WriteLn( 'Press any Key to do so...' );
-
- While NOT WKeyPressed Do;
-
- WGoCurrentWin;
-
- WriteLn;
- WriteLn( 'Press ESC to Quit...' );
-
- While WReadKey = #27 Do;
-
- WDispose( 'Window' );
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WEraseShadowFrom( P : PWin );
-
- [PARAMETERS]
-
- P Pointer to Window Data Structure
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- Removes any shadow from the Window using the Pointer to the
- Window's Definition Structure provided.
-
- [SEE-ALSO]
-
- WDrawShadowOn
-
- [EXAMPLE]
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WDrawShadowOn( P : PWin );
-
- [PARAMETERS]
-
- P Pointer to Window Data Structure
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- Activates and draws a shadow on the Window using the Pointer
- to the Window's Definition Structure provided.
-
- [SEE-ALSO]
-
- WEraseShadowFrom
-
- [EXAMPLE]
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WFlushKeyBuf;
-
- [PARAMETERS]
-
- (None)
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- This Function not only deletes all Keys stored in the Window Key Buffer
- but also flushes the Keyboard Buffer.
-
- [SEE-ALSO]
-
- WKeyPressed
- WIDoReadKey
-
- [EXAMPLE]
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WRename( OrigName : ST80;
- NewName : ST80 );
-
- [PARAMETERS]
-
- OrigName Original Name of Window
- NewName New Name for Window
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- This function renames the Original Window to the provided New Name
-
- [SEE-ALSO]
-
- (None)
-
- [EXAMPLE]
-
- BEGIN
-
- WNew( 5, 2, 20, 7, WHITE, BLUE, WHITE, BLUE, 'Window' );
-
- WReName( 'Window', 'New Name' );
-
- While NOT WKeyPressed DO;
-
- WDispose( 'New Name' );
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WLoadWidgetFont;
-
- [PARAMETERS]
-
- (None)
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- Loads the Widget Fonts. These contain a whole host of drawings including
- Checkboxes with real checks in them, Circular Radio Buttons, and a bunch
- of Drawings representing Drives of various sorts.
-
- [SEE-ALSO]
-
- WLoadLook1BorderFont
-
- [EXAMPLE]
-
- BEGIN
-
- WLoadWidgetFont;
-
- { Now Checkboxes look like "real" checkboxes (square with "x" in middle) }
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WLoadLook1BorderFont;
-
- [PARAMETERS]
-
- (None)
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- Loads the Border Fonts so that Window Borders will be a colored line
- extending up to the very edge of the window boundary.
-
- Looks very slick!
-
- [SEE-ALSO]
-
- WLoadWidgetFont
-
- [EXAMPLE]
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WSetPalette( PalNum, R, G, B : BYTE );
-
- [PARAMETERS]
-
- PalNum Palette Entry Number to Modify
- R New Red Color Entry for Palette
- G New Green Color Entry for Palette
- B New Blue Color Entry for Palette
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- Writes the indicated VGA Color Palette Entry to the new RGB colors.
-
- [SEE-ALSO]
-
- WGetPalette
- WLoadBlueGrayPalette
- WLoadGreenGrayPalette
-
- [EXAMPLE]
-
- BEGIN
-
- WSetPalette( 6, 1, 2, 3 );
-
- { For Palette #6, sets Red=1, Green=2, Blue=3 }
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WGetPalette( PalNum : BYTE;
- Var R,G,B : BYTE );
-
- [PARAMETERS]
-
- PalNum Palette Entry Number to Read
- R VAR Returned Red Color Entry of Palette
- G VAR Returned Green Color Entry of Palette
- B VAR Returned Blue Color Entry of Palette
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- Reads the indicated VGA Color Palette Entry to obtain the current
- RGB colors for that Palette Entry
-
- [SEE-ALSO]
-
- WSetPalette
- WLoadBlueGrayPalette
- WLoadGreenGrayPalette
-
- [EXAMPLE]
-
- VAR
- R,G,B : BYTE;
-
- BEGIN
-
- WGetPalette( 6, R, G, B );
-
- WriteLn( 'Red = ', R );
- WriteLn( 'Green = ', G );
- WriteLn( 'Blue = ', B );
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WLoadBlueGrayPalette;
-
- [PARAMETERS]
-
- (None)
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- Loads the VGA Blue/Gray Color Palette. All display colors altered
- hereafter by this palette colors.
-
- [SEE-ALSO]
-
- WSetPalette
- WGetPalette
- WLoadGreenGrayPalette
-
- [EXAMPLE]
-
- VAR
- I : INTEGER;
-
- BEGIN
-
- For i := 0 to 15 Do
- BEGIN
- TextColor( i );
- Write( 'X' );
- END;
-
- WLoadBlueGrayPalette;
-
- For i := 0 to 15 Do
- BEGIN
- TextColor( i );
- Write( 'X' );
- END;
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WLoadGreenGrayPalette;
-
- [PARAMETERS]
-
- (None)
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- Loads the VGA Green/Gray Color Palette. All display colors altered
- hereafter by this palette colors.
-
- [SEE-ALSO]
-
- WSetPalette
- WGetPalette
- WLoadBlueGrayPalette
-
- [EXAMPLE]
-
- VAR
- I : INTEGER;
-
- BEGIN
-
- For i := 0 to 15 Do
- BEGIN
- TextColor( i );
- Write( 'X' );
- END;
-
- WLoadGreeGrayPalette;
-
- For i := 0 to 15 Do
- BEGIN
- TextColor( i );
- Write( 'X' );
- END;
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WDrawBox( X,Y,X2,Y2,F,B,Style : INTEGER );
-
- [PARAMETERS]
-
- X Left Screen Coordinate of Window Frame
- Y Upper Screen Coordinate of Window Frame
- X2 Right Screen Coordinate of Window Frame
- Y2 Bottom Screen Coordinate of Window Frame
- F Foreground Color to Draw Frame with
- B Background Color to Draw Frame with
- Style Window Frame Style to use
- As follows:
- 1 = ""
- 2 = ""
- 3 = ""
- 4 = ""
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- This routine Draws a Window Box Frame using the provided Window
- Coordinates, Text Foreground and Background colors, and using the
- given Border Style.
-
- [SEE-ALSO]
-
- WBox
-
- [EXAMPLE]
-
- BEGIN
-
- WDrawBox( 5,2, 20, 7, WHITE, BLUE );
-
- {---------------------------------------------------}
- { Draws a Box with the coordinates of 5,2 and 20,7 }
- { with the Foreground = WHITE and Background = BLUE }
- {---------------------------------------------------}
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WBox( X, Y, X2, Y2, STYLE : INTEGER );
-
- [PARAMETERS]
-
- X Left Screen Coordinate of Window Frame
- Y Upper Screen Coordinate of Window Frame
- X2 Right Screen Coordinate of Window Frame
- Y2 Bottom Screen Coordinate of Window Frame
- Style Window Frame Style to use
- As follows:
- 1 = ""
- 2 = ""
- 3 = ""
- 4 = ""
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- This routine Draws a Window Box Frame in the current colors using
- the provided Window Coordinates and the given Border Style.
-
- [SEE-ALSO]
-
- WDrawBox
-
- [EXAMPLE]
-
- BEGIN
-
- WBox( 5,2, 20, 7, 3 );
-
- { Draws a Box Frame with the coordinates of 5,2 and 20,7 using Sytle #3 }
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WEventsOn;
-
- [PARAMETERS]
-
- (None)
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- Turns on EVENTS Handling in the Window Environment.
-
- [SEE-ALSO]
-
- WEventsOff
-
- [EXAMPLE]
-
- BEGIN
-
- WEventsOn;
-
- END;
-
-
- ──────────────────────────────────────────────────────────────────────────────
-
-
- [FUNCTION]
-
- Procedure WEventsOff;
-
- [PARAMETERS]
-
- (None)
-
- [RETURNS]
-
- (None)
-
- [DESCRIPTION]
-
- Turns off EVENTS handling in the Window Environment.
-
- [SEE-ALSO]
-
- WEventsOn
-
- [EXAMPLE]
-
- BEGIN
-
- WEventsOff;
-
- END;
-
-