home *** CD-ROM | disk | FTP | other *** search
/ DP Tool Club 21 / CD_ASCQ_21_040595.iso / dos / prg / pas / tvgr70 / refer20.doc < prev    next >
Text File  |  1995-01-11  |  127KB  |  2,961 lines

  1. September 1994  (v2.02 December 1994)
  2.  
  3. If you use the IDE, keep this file in a window for convenient reference.
  4.  
  5. v2.02 Note: all views in TVGraphic v2.0 or greater have the
  6.             ofVersion20 flag set in Options field.
  7.  
  8.  
  9. REFERENCE SECTION   Ver2.0
  10.  
  11.  { Other Documentation files:
  12.      BitMaps, BitButtons and related views in file BitMap.DOC.
  13.      Editors documentation in file Editors.DOC.
  14.      TV Help system GHelp (Borland HelpFile.Pas) in file GHelp.DOC.
  15.      TextView documentation in file TextView.DOC.
  16.      Other .DOC files cover specialized areas.
  17.        Fonts.DOC
  18.        European.DOC }
  19.  
  20.  NOTES
  21.    Changes are relative to Turbo Vision 2.0 unless otherwise noted.
  22.    Turbo Vision 2.0 comes with Pascal 7.0 and expands on TV 1.0,
  23.    adding additional objects and methods.
  24.  
  25.    TVGraphic incorporates published bug fixes for Turbo Vision including
  26.    those incorporated in the "maintanence" release of BP7.0.
  27.  
  28.    Significant areas of Turbo Vision not presently in TVGraphic:
  29.      Outline unit
  30.  
  31.    If your compiler does not recognize some TV syntax when
  32.    using TVGraphic, check this file under the appropriate
  33.    unit name and the object,method,variable,etc. name to see
  34.    if there is a syntax difference between TV and TVGraphic.
  35.  
  36.  
  37.    Included in this file :
  38.      For objects that are analogous to Turbo Vision objects,
  39.      usually only methods that have been added/deleted/modified
  40.      are listed in this section. Assume unlisted methods are unchanged.
  41.      However, where the changes in a View's method
  42.        1. are solely to use graphic coords instead of text coords
  43.        and/or
  44.        2. only involve limiting redrawing area or frequency
  45.      then the method may be not listed.
  46.  
  47.  
  48.  Unit Version Numbers:
  49.       Each unit exports a version number string constant under
  50.    the name of GVersion. This number could be important when describing
  51.    problems and requesting support for TVGraphic.
  52.    GVersion can be checked by using the IDE's Evaluation window -
  53.    for example include GObjects in a uses statement, compile and then
  54.    evaluate GObjects.GVersion to get the version of the GObjects unit.
  55.  
  56. ------------------------
  57.  
  58. Application Palette
  59.     With v2.02 the scrollbars have changed.
  60.     They now draw buttons for the indicator and control arrows.
  61.     All Application palette entries for Scrollbar indicator/arrows
  62.     have been changed from cyan on blue to black on light gray.
  63.  
  64.     {See individual objects for TVGraphic palette definitions.}
  65.  
  66.     Format
  67.         Foreground color = lower 4 bits, background = upper 4 bits.
  68.         TVGraphic allows all 16 colors for background.
  69.         There is no inherent "blink" in graphic mode.
  70.     Notes
  71.         Windows
  72.           TVGraphic windows use the wpBlueWindow palette unless you change
  73.           the window's Palette entry.  The "Blue" window portion of the
  74.           Application palette starts at entry 8. A TVGraphic Blue window
  75.           has blue border, title block and scrollbars, otherwise lightgray.
  76.           The wpCyanWindow palette is used by the help window in unit GHelp.
  77.               (GHelp corresponds to Borland HelpFile.Pas.)
  78.           The wpGrayWindow palette is not used by the standard views.
  79.           The Window palettes have been extended. See TWindow.
  80.  
  81.         Dialogs
  82.           TVGraphic v2.0 Dialogs use the palette specified in
  83.           DefaultDialogPalette. This is dpCyanDialog unless changed.
  84.           Colors for the dpBlueDialog palette have not been changed from TV.
  85.           TV2.0 dpXXXX constants: IDE's Help says they run 1,2,3
  86.           but TV2.0/TVGraphic2.0 Dialog unit exports them as 0,1,2 !
  87.  
  88.   Indices
  89.     {1   application background}
  90.     {2-7 Menus, StatusLine}
  91.     BlueWindow starts at 8, CyanWindow at 16, GrayWindow at 24.
  92.       BlueWindow
  93.        8-10 TFrame,11-12 Scrollbar,13-14 Scroller,15 reserved
  94.  
  95.     GrayDialog starts at 32, BlueDialog at 64, CyanDialog at 96.
  96.      CyanDialog  96-127
  97.              remaps local palettes below
  98.       {96-98 TFrame, 99-100 Scrollbar}
  99.       {101 StaticText, 102-104 Label}
  100.       {105-110 Buttons}
  101.       {111-113 Checkboxes and Radiobuttons}
  102.       {114-116 InputLine}
  103.       {117-120 HistoryIcon, HistoryWindow Scrollbar}
  104.       {121-124 ListViewer}
  105.       {125 InfoPane in FileDialog}
  106.  
  107.   CAppColor =
  108. {1-15}         #$3B#$70#$78#$F4#$8F#$87#$7E#$78#$7F#$70#$13#$70#$70#$F9#$1F +
  109. {16-31}    #$37#$3F#$30#$13#$70#$30#$7E#$1E#$78#$7F#$7F#$8F#$70#$70#$F9#$7E +
  110. {32-47}    #$70#$7F#$70#$13#$70#$70#$70#$7F#$7E#$70#$71#$7F#$78#$2E#$8F#$70 +
  111. {48-63}    #$7F#$8E#$70#$FE#$8A#$70#$00#$13#$70#$70#$8F#$7E#$F1#$70#$38#$00 +
  112. {64-79}    #$17#$1F#$1A#$71#$70#$1E#$17#$1F#$1E#$20#$2B#$2F#$78#$2E#$10#$30 +
  113. {80-95}    #$3F#$3E#$70#$2F#$7A#$20#$12#$31#$70#$30#$2F#$3E#$31#$13#$38#$00 +
  114. {96-111}   #$30#$3F#$30#$13#$70#$30#$30#$3F#$3E#$70#$7A#$7F#$78#$2E#$8F#$70 +
  115. {112-127}  #$7F#$8E#$70#$BE#$8A#$70#$00#$13#$70#$70#$8F#$7E#$F1#$30#$38#$00;
  116.  
  117.   CAppBlackWhite =
  118.         #$70#$70#$78#$7F#$07#$07#$0F#$07#$0F#$07#$70#$70#$07#$70#$0F +
  119.     #$07#$0F#$07#$70#$70#$07#$70#$0F#$70#$7F#$7F#$70#$07#$70#$07#$0F +
  120.     #$70#$7F#$7F#$80#$07#$70#$70#$7F#$7F#$07#$0F#$0F#$78#$0F#$0F#$07 +
  121.     #$0F#$0F#$0F#$70#$0F#$07#$70#$70#$70#$07#$70#$0F#$07#$07#$78#$00 +
  122.     #$07#$0F#$0F#$07#$70#$07#$07#$0F#$0F#$70#$78#$7F#$08#$7F#$08#$70 +
  123.     #$7F#$7F#$7F#$0F#$70#$70#$07#$70#$70#$70#$07#$7F#$70#$07#$78#$00 +
  124.     #$70#$7F#$7F#$80#$07#$70#$70#$7F#$7F#$07#$0F#$0F#$78#$0F#$0F#$07 +
  125.     #$0F#$0F#$0F#$70#$0F#$07#$70#$70#$70#$07#$70#$0F#$07#$07#$78#$00;
  126.  
  127. ------------------------
  128.   unique to TVGraphic
  129.  
  130. BMPDRVR Unit  - see file BITMAP.DOC
  131.  
  132.   PutBitMap, WinToTVColor and other bitmap procedures
  133.  
  134.  
  135. COMBOBOX Unit - see file ComboBox.Pas
  136.                 supplied upon registration
  137.   A combobox is a TInputLine with an associated TListBox, similar to
  138.   a THistory. The listbox displays choices the user may select for
  139.   the inputline.
  140.  
  141. ------------------------
  142. * = unique to TVGraphic
  143. + = emulates TV with exceptions noted
  144.  
  145. GAPP Unit
  146.  
  147. const
  148.   * GlobalGVersion =  {version of this copy of TVGraphic.
  149.                   string includes word "Shareware" for shareware versions.
  150.                   Shareware versions may not have all features.}
  151.  
  152.   Note: Programs in TVGraphic descend from TProgram, not TApplication.
  153.         TApplication is not defined. Most methods from TV's
  154.         TApplication have been added to TVGraphic's TProgram.
  155.  
  156.   * MessageBar : PMessageBar = nil;
  157.        points to the MessageBar if one exists
  158.  
  159.   * procedure ImprovePaletteColors;
  160.        for screens in VGA or VESA mode, modifies the values (shades) of
  161.        dark gray and brown from the BGI default values.
  162.        NOTE: if you DOSshell, then need to call this routine again after.
  163.        NOTE: During debugging in the IDE, if you break out of your
  164.              program, the standard colors will be restored unless
  165.              you enable
  166.                 Options/Environment/StartUp   EGAVGA Palette Save
  167.              from the IDE's menu.
  168.  
  169.   * procedure TProgram.SetPalette(Pal : TPalette);
  170.       see TProgram
  171.  
  172.   Standard TV commands and help contexts
  173.   commands
  174.     cmNew       = 30;
  175.     cmOpen      = 31;
  176.     cmSave      = 32;
  177.     cmSaveAs    = 33;
  178.     cmSaveAll   = 34;
  179.     cmChangeDir = 35;
  180.     cmDosShell  = 36;
  181.     cmCloseAll  = 37;
  182.   help context
  183.     hcNew        = $FF01;
  184.     hcOpen       = $FF02;
  185.     hcSave       = $FF03;
  186.     hcSaveAs     = $FF04;
  187.     hcSaveAll    = $FF05;
  188.     hcChangeDir  = $FF06;
  189.     hcDosShell   = $FF07;
  190.     hcExit       = $FF08;
  191.     hcUndo       = $FF10;
  192.     hcCut        = $FF11;
  193.     hcCopy       = $FF12;
  194.     hcPaste      = $FF13;
  195.     hcClear      = $FF14;
  196.     hcTile       = $FF20;
  197.     hcCascade    = $FF21;
  198.     hcCloseAll   = $FF22;
  199.     hcResize     = $FF23;
  200.     hcZoom       = $FF24;
  201.     hcNext       = $FF25;
  202.     hcPrev       = $FF26;
  203.     hcClose      = $FF27;
  204.  
  205. ------------------------
  206.   unique to TVGraphic
  207.  
  208. GBUT Unit    see file BITMAP.DOC
  209.  
  210.   bitmapped buttons - TIconButton, toolbar, TStaticBitMap
  211.  
  212.   procedure RegisterBitMaps;   Stream registration of views.
  213.  
  214. ------------------------
  215. * = unique to TVGraphic
  216. + = emulates TV with exceptions noted
  217.  
  218. GCOLORS Unit         TV's ColorSel
  219.  
  220.   + Adapt descriptions in standard color items to TVGraphic.
  221.   TVGraphic standard color item functions
  222.     function DesktopColorItems(Next: PColorItem): PColorItem;
  223.     function MenuColorItems(Next: PColorItem): PColorItem;
  224.     function DialogColorItems(Palette: Word; Next: PColorItem): PColorItem;
  225.     function WindowColorItems(Palette: Word; Next: PColorItem): PColorItem;
  226.   * function HelpColorItems(Next: PColorItem): PColorItem;
  227.          {the HelpWindow uses the wpCyanWindow palette}
  228.  
  229.  
  230.   TColorDisplay = object(TView)
  231.   + procedure DispSetColor(var AColor: Byte); virtual;
  232.          name of above procedure is SetColor in TV2.0. This conflicts
  233.          with Graph.SetColor so TV1.0 name is used for this method.
  234.  
  235. ------------------------
  236. * = unique to TVGraphic
  237. + = emulates TV with exceptions noted
  238.  
  239. GDIALOGS Unit
  240.  
  241.   OBJECT Naming Convention
  242.  
  243.     Several TVGraphic Objects have an added field in their constructors
  244.     as compared to Turbo Vision.  (The added field comes last.)
  245.     These objects have different names in TVGraphic
  246.       TVGraphic        Turbo Vision
  247.         TgInputLine  =   TInputLine
  248.         TgLabel      =   TLabel
  249.         TgStaticText =   TStaticText
  250.         TgParamText  =   TParamText
  251.  
  252.   TV constants
  253.   + CDialog        = CCyanDialog {CGrayDialog};
  254.  
  255. * TVGraphic constants
  256.  
  257.     AlignVScrollBarsWithGrid : boolean = false;
  258.       If true, matches vertical scrollbar indicator travel
  259.       to vertical mouse grid of 14 pixels. See TScrollBar for details.
  260.  
  261.     TextButtonsMatchBitMapButtons : boolean = false;
  262.          {whether text based buttons should look like Turbo Vision
  263.           or look similar to TVGraphic's BitMap buttons}
  264.     DefaultButHt : integer = 20;  default button height in standard views
  265.  
  266.     DefaultDialogFont : byte = font8x14;
  267.          {Vfont set to this in TButton,TgInputLine constructors.
  268.           Also in StaticText, ParamText, Label unless
  269.           overidden in Init(..,..,.,Opts) parameter.}
  270.  
  271.     DefaultDialogPalette : byte = dpCyanDialog;
  272.        Used by TDialog.Init to set the Palette field of Dialogs.
  273.  
  274.     MouseSnapToDialogGrid : boolean = true;
  275.        causes mouse cursor to snap to a 8x14 pixel grid while a
  276.        modal Dialog is visible
  277.  
  278.     StaticTextOffset : byte = 0;
  279.        TStaticText, TLabel: Offset of text into the view.
  280.        Was 4 pixels prior to v2.02. 0 matches TurboVision.
  281.  
  282.     VOptions constants:
  283.  
  284.       DefaultOpts = 0;    {= behavior most like Turbo Vision}
  285.  
  286.       Text objects set VOptions to match options in the Opts field
  287.            of their constructor.
  288.  
  289.         Opts := DefaultOpts  for no options
  290.              := option1+option2+...+ fontname {font overrides default font}
  291.  
  292.             Note: using txCentered automatically adjusts the
  293.                   width of the view to match the centered text.
  294.             Note: TgLabel's always have background. txBackground
  295.                                   and txCentered have no effect.
  296.         TgStaticText,TgParamText
  297.           txDrawBackground               = $80;  {v2.02 no longer needed}
  298.           txCentered                     = $10;
  299.         TgStaticText,TgParamText,TgLabel
  300.           txAdjustSize                   = $20;
  301.           DefaultFontOverride = lower four bits of Opts = fontname
  302.  
  303.       TgInputLine sets VOptions to value of Opts field in its constructor.
  304.         TgInputLine
  305.           KillInstantErase     = $01; {prevent first keystroke from erasing}
  306.           lnRightJustify       = $02; {right justify the inputline,
  307.                   Note: right justified line may not exceed width of view.}
  308.  
  309.       TDialog    {user must set these VOptions after construction}
  310.         dgReturnOnAnyButton  = $01;  {modal dialog returns on any command}
  311.         dgHelp               = $02;  {non-modal dialog issues cmClose
  312.                                       if it receives cmCancel.
  313.                                       i.e. closes if ESC key pressed}
  314.  
  315.  
  316.   Stream Registration numbers
  317.       CancelButton: gRegBase + 1001;
  318.       OKButton:     gRegBase + 1002;
  319.  
  320.   Palette Name Changes
  321.    * CgInputLine
  322.    * CgLabel
  323.    * CgStaticText
  324.  
  325.   Palettes
  326.    see THistoryWindow for modified palette
  327.  
  328.   TV2.0 Palette constants
  329.     dpBlueDialog = 0;
  330.     dpCyanDialog = 1;
  331.     dpGrayDialog = 2;
  332.  
  333.     dpTV1Dialog = 3   Used in earlier versions of TVGraphic.
  334.            No longer defined. Use dpCyanDialog for default dialog colors.
  335.  
  336. ------------------------
  337. * = unique to TVGraphic
  338.  
  339. GDRIVERS Unit
  340.  
  341.   MOUSE
  342.   type
  343.       Used with mouse cursor grid, TMCur.GetGrid returns this type.
  344.       X,Y are size of grid. Xoff,Yoff are the offset of grid from
  345.       upper left screen corner.
  346.  *  MGridRec = record
  347.       X : byte; Y : byte; Xoff : word;  Yoff : word;
  348.     end;
  349.  
  350. * EXTENDED KEYBOARD  {thanks to Jim Mischel}
  351.     TVGraphic will detect if an extended (101) keyboard is present.
  352.     To enable detection of the extra KeyCodes of an extended keyboard,
  353.     add this line at the end of your TApplication.Init.
  354.        KeyMode := SetKeyboardMode(kbmExtended);  {KeyMode : byte}
  355.     if KeyMode = kbmExtended, then 101 keyboard was detected.
  356.  
  357.  Keyboard mode flags
  358.     kbmStandard = 0;
  359.     kbmExtended = $10;
  360.  101 Keyboard Extended KeyCodes
  361.   kbAltEsc    = $0100;  kbAltTab    = $A500;  kbAltEnter  = $1C00;
  362.   kbAltTilde  = $2900;  kbAltLBrack = $1A00;  kbAltRBrack = $1B00;
  363.   kbAltBSlash = $2B00;  kbAltColon  = $2700;  kbAltQuote  = $2800;
  364.   kbAltIns    = $A200;  kbAltDel    = $A300;  kbAltLeft   = $9B00;
  365.   kbAltHome   = $9700;  kbAltEnd    = $9F00;  kbAltUp     = $9800;
  366.   kbAltDown   = $A000;  kbAltPgUp   = $9900;  kbAltPgDn   = $A100;
  367.   kbAltRight  = $9D00;  kbF11       = $8500;  kbF12       = $8600;
  368.   kbShiftF11  = $8700;  kbShiftF12  = $8800;  kbCtrlF11   = $8900;
  369.   kbCtrlF12   = $8A00;  kbAltF11    = $8B00;  kbAltF12    = $8C00;
  370.   kbCtrlGrayMinus = $8E00; kbCtrlGrayPlus = $9000;
  371.   kbAltGrayMinus  = $4A00; kbAltGrayPlus = $4E00;
  372.   kbGraySlash = $E02F;     kbCtrlGraySlash = $9500; kbAltGraySlash = $A400;
  373.   kbCtrlGrayStar = $9600;  kbAltGrayStar = $3700;
  374.   kbAltComma  = $3300;  kbAltPeriod = $3400;  kbAltSlash  = $3500;
  375.   kbCtrlUp    = $8D00;  kbCtrlDown  = $9100;  kbGrayStar  = $372A;
  376.  
  377.  
  378.   EVENTS
  379.  
  380.  * procedure SwallowControlKeys;
  381.      The DOS keyboard buffer can overflow if a key is held down that
  382.      calls a long Draw method repeatedly. This procedure removes
  383.      control keystrokes from the keyboard buffer until it reaches some
  384.      other keystroke.
  385.      If you have this problem, call at beginning of your Draw.
  386.  
  387.   TEvent.Buttons
  388.     TVGraphic returns the button number in Event.Buttons when a
  389.     mouse button is released (evMouseUp event).
  390.     Turbo Vision returns zero.
  391.  
  392.  * Timer Tick Event
  393.  
  394.     evTimerTick = $0080;  {an evXXXX Event constant}
  395.  
  396.     procedure GetBiosTickEvent(var Event : TEvent);
  397.         if the DOS timer count differs from count at previous call to
  398.         GetBiosTickEvent, then Event returns a TVGraphic event catagory
  399.               Event.What := evTimerTick;
  400.               Event.Infolong := value return by GetBiosTicks;
  401.         otherwise Event.What is set to evNothing;
  402.  
  403.     function GetBiosTicks : longint;
  404.         returns DOS timer count stored at address $40:$6C;
  405.  
  406.  
  407.   DOS CRITICAL ERROR handler
  408.     TV's text mode critical error handler has been modified to do nothing
  409.     except return "Abort". {As if user selected Abort from Abort/Retry.}
  410.  
  411.     In any serious program, you should replace the critical error handler
  412.     with TVGraphic's GSystemError or by one you write.
  413.  
  414.  *  function GSystemError(ErrorCode: Integer; Drive: Byte): Integer; far;
  415.       Note: To avoid needing to allocate memory to save a portion
  416.       of the screen, GSystemError assumes that a MenuBar exists
  417.       in your application. You do not need a StatusLine.
  418.       DO NOT overlay the critical error handler.
  419.       GSystemError's source code is located in the large demo program.
  420.  
  421.     To replace TV's handler, place following line in your
  422.     application's .Init
  423.                   SysErrorFunc := GSystemError;
  424.  
  425.     The following functions are called by the Critical Error handler:
  426.  
  427.  *  function FarSelectKey : integer;
  428.              {returns user keystroke without calling DOS}
  429.  *  function GetCritErrorStr(ErrorCode : integer) : string;
  430.              {returns the error message}
  431.  
  432.  
  433.   DELETED
  434.     procedure PrintStr(S: String);  {text mode only}
  435.   SHELL ONLY - these procedures match Turbo Vision but do nothing. They
  436.       are included to make stepwise conversion from TV easier.
  437.     procedure MoveBuf(var Dest; var Source; Attr: Byte; Count: Word);
  438.     procedure MoveChar(var Dest; C: Char; Attr: Byte; Count: Word);
  439.     procedure MoveCStr(var Dest; Str: String; Attrs: Word);
  440.     procedure MoveStr(var Dest; Str: String; Attr: Byte);
  441.  
  442. ------------------------
  443.  
  444. GEDITORS Unit    see file Editors.Doc
  445.  
  446.  
  447. GHELP    Unit    TV's HelpFile.Pas - see file GHelp.Doc
  448.                  supplied upon registration
  449.  
  450. ------------------------
  451.  
  452. GHISTLST Unit        TV's HistList
  453.  
  454.   This unit is essentially unchanged in TVGraphic.
  455.   The unit name is changed to GHistLst.
  456.   The Uses clause is modified to use TVGraphic unit names.
  457.   For use with compiled TVGraphic: you may modify the source code
  458.     in the Implementation section of HistList if you also make the
  459.     changes above. Then your GHistLst unit will compile with TVGraphic.
  460.  
  461. ------------------------
  462. * = unique to TVGraphic
  463.  
  464. GMENUS Unit   (was unit GMenu6 in v1.5)
  465.  
  466.  Behavior
  467.    The choice of how menus respond to mouse button clicks depends
  468.    on the two booleans exported by GViews unit.
  469.  
  470.      AllowBothMButtons      {from GViews}
  471.         false:  left button selects and right cancels.
  472.         true :  both buttons select
  473.      ViewsRespondToMouseUp  {from GViews}
  474.         false:  TVGraphic style of versions prior to 2.0,
  475.                    select on button press.
  476.         true :  Turbo Vision style menu behavior,
  477.                    select on button release.
  478.  
  479.  
  480.  * const  {user changable}
  481.     MenuBarheight : integer = 15;
  482.         height of the MenuBar in pixels,
  483.         minimum value is 15 if using Font8x14 as assigned in Init.
  484.         set BEFORE initializing the menubar.
  485.     MenuBoxheight : integer = Boxheight;
  486.         vertical line spacing in Box menus
  487.     MouseSnapToMenuGrid : boolean = false;  {true in v1.5}
  488.         causes mouse cursor to snap to a properly located Charlen
  489.         by Boxheight grid while a BoxMenu executes.
  490.         Set false to use current grid with BoxMenus.
  491.     DefaultMenuFont : byte = Font8x14;
  492.  
  493.   VOptions flags
  494.     mnFatBorder = $80;
  495.         menu draws a fat border. Set by TMenuPopUp.Init.
  496.     mnCloseOnDouble = $40;
  497.         menu issues cmClose if it receives a double mouse click outside
  498.         of menu selections. Set by TWindowMenu.Init.
  499.  
  500.   Palette
  501.     CWindowMenu = #128#129#130#131#132#133;
  502.         maps thru extended TWindow palettes which duplicate
  503.         CMenuView at 128-133
  504.  
  505.  
  506.  * PMessageBar= ^TMessageBar;
  507.  * TMessageBar = object(TView)
  508.  
  509.      {for use in TWindow}
  510.  * PWindowMenu = ^TWindowMenu;
  511.  * TWindowMenu = object(TMenuPopup)
  512.  
  513.   Stream Registration Numbers
  514.     RMenuBar    : gRegBase + 40;
  515.     RMenuBox    : gRegBase + 41;
  516.     RStatusLine : gRegBase + 42;
  517.     RMenuPopup  : gRegBase + 43;
  518.  *  RMessageBar : gRegBase + 1100;
  519.  *  RWindowMenu : gRegBase + 1101;
  520.  
  521.  
  522. ------------------------
  523. * = unique to TVGraphic
  524.  
  525. GMSGBOX Unit
  526.  
  527. mfxxxx  constants
  528.  * mfMakeTaller   = $1000;  {increase height of MessageBox by two lines}
  529.  
  530.  * procedure DOSErrorMessageBox(DOSErrNum : integer; FileName : string);
  531.  
  532.    DosErrorMessageBox displays appropriate DOS error message
  533.    and file name using a MessageBox. Pass the global variable DosError
  534.    as parameter DOSErrNum (or pass TStream.ErrorInfo if using a Stream).
  535.    Pass the file name as FileName.
  536.       DOSErrNum
  537.         0 :  no error, Exit
  538.         1 : S := 'Invalid DOS function number.';
  539.         2 : S := 'File not found.';
  540.         3 : S := 'Path not found.';
  541.         4 : S := 'Too may open files.';
  542.         5 : S := 'File access denied.';
  543.         6 : S := 'Invalid file handle.';
  544.         8 : S := 'Insufficient memory.';
  545.         10: S := 'Invalid environment.';
  546.         11: S := 'Invalid format.';
  547.         12: S := 'Invalid file access code.';
  548.         15: S := 'Invalid drive number.';
  549.         16: S := 'Cannot remove current directory.';
  550.         17: S := 'Cannot rename across drives.';
  551.         18: S := 'No more files.';
  552.         else
  553.             S := 'Unspecified DOS error.'
  554.  
  555.  
  556.  * procedure LowMemMsgBox;      {Out of memory Messagebox}
  557.       MessageBox('Not enough memory available.',
  558.                nil, mfError + mfOkButton);
  559.  
  560.  + function MessageBox(..; ..; AOptions: Word): Word;
  561.      if AOptions and mfMakeTaller <> 0
  562.      then increases height of box by two lines for longer messages.
  563.  
  564.  + function MessageBoxRect(): Word;
  565.      MessageBoxRect will be automatically centered in Owner view if
  566.      the origin of the rectangle is 0,0. Centering works with any
  567.      mouse grid in use.
  568.        Dialog^.Options := Dialog^.Options or OfCentered;
  569.  
  570.  + function InputBoxRect: Word;
  571.      InputBoxRect will be automatically centered in Owner view if
  572.      the origin of the rectangle is 0,0. Centering works with any
  573.      mouse grid in use.
  574.        Dialog^.Options := Dialog^.Options or OfCentered;
  575.  
  576.      TV bug fix - Buttons adjust position to match box size.
  577.  
  578. ------------------------
  579. * = unique to TVGraphic
  580.  
  581. GOBJECTS Unit
  582.  
  583. * UpCase capitalization function
  584.     To allow for capitalization in non-English alphabets:
  585.       type
  586.         UpCaseFuncType = function(Ch : Char): Char;
  587.  
  588.       function TVUpCase(Ch : Char): Char;
  589.                {TVUpCase := System.UpCase(Ch);}
  590.  
  591.       const
  592.         UpCase : UpCaseFuncType = TVUpCase;
  593.  
  594.     This overrides the Pascal system UpCase function in every unit which
  595.       lists GObjects in its USES clause!   (all views of TVGraphic).
  596.     The TVUpCase function calls the standard Pascal UpCase function.
  597.  
  598.     To modify capitalization,
  599.       1. write your function MyUpCase matching the UpCaseFuncType type.
  600.       2. assign it to UpCase at the start of your program.
  601.                 UpCase := MyUpCase;
  602.  
  603.  
  604. const
  605.  * Str80 = string[80];
  606.  
  607. const
  608.  Stream (TStream) Registration numbers
  609.  * gRegBase = 60000;
  610.          Used to offset the stream registration numbers of all
  611.          objects descended from TView.
  612.             TVGraphic Reg number := TV's Reg number + gRegBase.
  613.  
  614.          Also used with objects unique to TVGraphic
  615.          such as TUnSortedStringCollection.
  616.  
  617.  * TUnSortedStringCollection: gRegBase + 51;
  618.  
  619.  TCollection  -    Error code for method TCollection.Valid
  620.  * coTruncationErr = -100;   {not enough mem to load all items from disk}
  621.  
  622.  
  623.  TMemoryStream - TV2.0 object
  624.    present in TVGraphic units. Borland doc is in a Borland disk file.
  625.  
  626. ------------------------
  627. * = unique to TVGraphic
  628. + = emulates TV with exceptions noted
  629.  
  630. GSTDDLG Unit
  631.  
  632.   VOptions constants
  633.  *  lbRestartSearch = $01;   TSortedListBox and descendants
  634.        don't restart their alphabetical search if they lose the
  635.        Focus and regain it.
  636.        Set this flag in VOptions to force restart of search.
  637.  
  638.  
  639.  + TFileDialog/TChDirDialog
  640.      The instant erase feature of the Inputline has been disabled.
  641.      It can be enabled by clearing the KillInstantErase flag bit in
  642.      the MyFileDialogPointer^.FileName^.VOptions field.
  643.  
  644.  + TFileDialog.GetFileName
  645.      TV bug fix -  when are on non-current drive and enter path
  646.      starting with root directory (\.......), GetFileName uses the
  647.      current drive.  Fix prepends actual drive to path.
  648.  + TFileList.HandleEvent
  649.      TV bug fix -  modified to record History if selection is made
  650.      by double clicking the mouse.
  651.  + function ValidFileName used by File dialogs
  652.      TV bug fix - modified so it checks that length of a filename
  653.      and extension is valid, that path can be parsed.
  654.  + TDirListBox.SetState
  655.      rewritten due to different way TVGraphic handles default button
  656.  
  657.   Protected mode
  658.      GetShiftState substituted for ShiftState variable
  659.  
  660. * HourGlass cursor
  661.     FileList.ReadDirectory and TDirListBox.NewDir make calls to the
  662.     mouse cursor to switch it to the hourglass shape and back.
  663.     To disable, set EnableHourGlass (in MCursor unit) to false.
  664.  
  665. * GStdDlg Text strings, Character set
  666.     Changing - See file EUROPEAN.DOC.
  667.  
  668. ------------------------
  669.  
  670. GVALIDAT Unit         TV's Validate
  671.  
  672.   This unit is essentially unchanged in TVGraphic.
  673.   The unit name is changed to GValidat.
  674.   Both Uses clauses are modified to use TVGraphic unit names.
  675.   The constant GVersion = 'G2.00'; is added as the first constant
  676.     declared in the unit's Interface section.
  677.   For use with compiled TVGraphic: you may modify the source code
  678.     in the Implementation section of Validate if you also make the
  679.     changes above. Then your GValidat unit will compile with TVGraphic.
  680.  
  681. ------------------------
  682. * = unique to TVGraphic
  683. + = emulates TV with exceptions noted
  684.  
  685. GVIEWS Unit
  686.  
  687. type
  688.  + SelectMode = (NormalSelect, EnterSelect, LeaveSelect,
  689.                                DrawLater, EraseLater);
  690.  
  691. const
  692.  + MaxViewWidth = 132*Charlen;
  693.  + MinWinSize: TPoint = (X: 16*Charlen; Y: 6*Boxheight);
  694.  
  695.  * LoadVersion : word = 0;  set by TView.Load to (Options and ofVersion).
  696.                         {used by .Load methods to control updating}
  697.  
  698.  + Window Palettes extended. Dialog and Menu palettes added to end.
  699.      See TWindow
  700.  
  701.  
  702.  * TVGraphic constants
  703.  
  704.     Redraw Control for TListViewer,TScroller
  705.      uvDrawView  = $04;       {same value as ufView in TEditors}
  706.      uvFocused   = $02;
  707.      uvScrollBar = $08;
  708.      uvNotDrawByLines = $10;
  709.  
  710.     Blinking Text Cursor
  711.       Constants that determine maximum size for blinking cursor.
  712.         (Cursor sizes itself to font stored in VFont.)
  713.      MaxCurWidth  = 2*Charlen;
  714.      MaxCurHeight = 2*Boxheight;
  715.  
  716.    Scrollbar widths
  717.     (*v1.5  ScrollBarWidth = 11;   {0 to 11 = 12 pixels total width}*)
  718.     HScrollBarWidth = 11;  {different so TFrame interior is on 8x14 pitch}
  719.     VScrollBarWidth = 10;
  720.  
  721.  
  722.     DefaultListViewerFont : byte = font8x14;
  723.  
  724.     TVColor        = $FFFF;
  725.       This constant is used only by other units.
  726.       It is used in VColor field of some views to indicate
  727.       that the drawing colors should come from the palette
  728.       and not from the VColor field.
  729.  
  730.     Mouse Button Behavior - Global
  731.       AllowBothMButtons : boolean = false;
  732.           Used by all standard views.
  733.         When false
  734.           right mouse button follows TVGraphic rules - cancels
  735.           current operation including modal dialog boxes.
  736.         When true
  737.           right mouse button follows Turbo Vision 2.0 behavior - selects,
  738.           will not cancel modal dialog box.
  739.  
  740.       ViewsRespondToMouseUp : boolean = false;
  741.           Used by all standard views (Frames, Buttons, Menus, etc.)
  742.         When false
  743.           views respond immediately to evMouseDown   (mouse button press)
  744.         When true
  745.           views wait for evMouseUp before responding (mouse button release)
  746.           This gives mouse button behavior like Turbo Vision.
  747.  
  748.    TView DrawFlags masks
  749.      dfPanning         = $01; view pans in a TPanWindow - set by TView
  750.      dfAlternateRedraw = $02; Use in a TGroup descendant.
  751.               Group draws from top view down, rather than bottom up.
  752.               Better redraws where several views overlap.
  753.      dfTransparent     = $04; Set if view does not draw its own background.
  754.               Note: A view's Draw must still draw its background if its
  755.               Owner has dfAlternateRedraw set.
  756.         Do not alter the following flags in DrawFlags
  757.      dfIsWindow        = $08; identifies group as a TWindow descendant
  758.      dfDrawUnder       = $80;  {temporary use bit}
  759.  
  760.    TView VOptions constants           {redefined by each view}
  761.     TWindow
  762.       constant NO LONGER DEFINED - use dfIsWindow in DrawFlags field.
  763.         twIsWindow       = $80;  {identifies group as a TWindow descendant}
  764.  
  765.     TFrame drawing control
  766.       tfDrawBackground = $01;       {fill entire view with background}
  767.         {values of next two constants were incorrectly documented in v1.5}
  768.         TWindow.StandardScrollBar sets the TFrame.VOptions scrollbar flags.
  769.       tfVScrollBar     = $04 {02};   set if bar is present in Window
  770.       tfHScrollBar     = $02 {04};
  771.       tfMarginsForText = $08;        Do not alter flag
  772.            TFrame.GetInteriorSize sets/clears this flag according
  773.            to the type of margins specified by user in
  774.            call to TWindow.GetMaxSubViewSize.
  775.            See TFrame.GetInteriorSize.
  776.  
  777.   type
  778.     This is the record type used for field TView.Hook and method UserHook.
  779.    *  TUserRec = record
  780.        case word of
  781.          0 : (R : TRect);
  782.          1 : (P1,P2 : pointer);
  783.          2 : (X1,Y1,X2,Y2 : integer);
  784.        end;
  785.  
  786.  
  787.  * function ASHR(AnInt : integer; Places : byte) : integer;
  788.       {does arithmetic shift right of Places on AnInt}
  789.  * function ASHL(AnInt : integer; Places : byte) : integer;
  790.       {does arithmetic shift left of Places on AnInt}
  791.  
  792. -----------------------
  793. * = unique to TVGraphic
  794.  
  795. * GWINDOW Unit
  796.  
  797.   Commands
  798.     const     used to communicate between TPanWindow and TShiftView
  799.       cmScreenShifted    = gRegBase + 2000;
  800.       cmShiftScreenDown  = gRegBase + 2001;
  801.       cmShiftScreenUp    = gRegBase + 2002;
  802.  
  803.     const                  for TPanWindow
  804.       NormalMode = 0;
  805.       ScrnShiftX : word = Grid * 20;
  806.       ScrnShiftY : word = Grid * 15;
  807.            Number of pixels to shift screen when mouse
  808.            cursor hits edge of a Panning window.
  809.            These values are not directly referenced by TVGraphic.
  810.            Ignore or Change to suit your needs:
  811.              if using a mouse grid, be sure to shift by even
  812.              multiples of the your grid.  'Grid' used here is fixed
  813.              constant from MCur unit. Grid = 10.
  814.  
  815.     const
  816.       ShiftViewPtr : PShiftView = nil;  {Global}
  817.         If you create a TShiftView, must set ShiftViewPtr to point to it.
  818.  
  819.  
  820.   Stream Registration Numbers
  821.       ShiftView:  gRegBase + 2000;
  822.       SubWindow:  gRegBase + 2001;
  823.       PanWindow:  gRegBase + 2002;
  824.       WinBackground:  gRegBase + 2003;
  825.  
  826.   procedure RegisterWindows;
  827.  
  828. -----------------------
  829. * = unique to TVGraphic
  830.  
  831. * MCURSOR Unit
  832.  
  833.   There are many methods for the cursor but the average user
  834.   will use only these:
  835.     Show, Hide
  836.     LockShow, LockHide
  837.     RePosition       move mouse cursor to new position on screen
  838.     RestoreSettings (use after DOS shell)
  839.     SetGrid          if you want to specify a grid other than single pixel
  840.  
  841.   Cursor Image, HotSpot
  842.     The mouse cursor has a "HotSpot" TPoint variable to indicate the
  843.     offset of the active point in the cursor image from the upper left
  844.     corner of the image.
  845.  
  846.     The image is stored in two arrays, CurImageArray for the main image
  847.     and ShadowImageArray for the outline shadow. These images are 16x16
  848.     pixels. The first word of the array is the top line of the image.
  849.     The high order bit of each word is the leftmost pixel.
  850.     The main image is drawn in white and the shadow in black.
  851.  
  852.     If you change the image arrays below after calling TProgram.Init,
  853.     call      SelectStdCursor    to display the new image.
  854.  
  855.     type
  856.       TCurImageArray = array[0..15] of word;
  857.     const
  858.       HotSpot : TPoint = (x:0; y:0);
  859.                          {location of Active point in the cursor}
  860.     var
  861.       CurImageArray, ShadowImageArray : TCurImageArray;
  862.  
  863.  
  864.   HourGlass cursor shape  (not user changable)
  865.      Switch to it with MCur.SelectHourGlass, back with MCur.SelectStdCursor.
  866.      HourGlass is intended to indicate waiting only - buttons are disabled.
  867.  
  868.  
  869.   At Startup:
  870.     MyCursor
  871.       the mouse grid is set to (1,1,0,0) by a call to SetGrid.
  872.                    {was set to (10,10,0,0) prior to v2.0}
  873.     GMenu
  874.       MouseSnapToMenuGrid is set false    {was true in v1.5}
  875.     GDialogs
  876.       MouseSnapToDialogGrid is set false  {was true in v1.5}
  877.  
  878.  
  879.   Note: This type is declared in GDrivers and used by TMCur.GetGrid.
  880.     type
  881.       MGridRec = record
  882.         X : byte; Y : byte; Xoff : word;  Yoff : word;
  883.       end;
  884.  
  885.   const
  886.     EnableHourGlass : boolean = true; {hourglass shape will not appear
  887.                                        if false}
  888.     Grid = 10;         {size of coarse drawing grid spacing in pixels}
  889.     FineGrid = 5;      {size of fine drawing grid}
  890.  
  891.   var
  892.     MCur : TMCur;       Global mouse cursor object
  893.  
  894.   procedure FlushMouseQue;  NOTE - Flushes ALL types of mouse events
  895.                              from the event que.
  896.  
  897.   PMCur = ^TMCur;
  898.   TMCur  = object(TPoint)
  899.     READ only
  900.       MinGridX, MinGridY : integer; {min screen coords of mouse travel}
  901.       MaxGridX, MaxGridY : integer; {max screen coords for mouse travel}
  902.     constructor Init;
  903.           SetGrid(1,1,0,0);   set to 1x1 pixel grid
  904.           SetSpeed(12,12);    reduce mouse sensitivity, "normal" is 8,8
  905.           SelectStdCursor;
  906.     destructor Done;
  907.     procedure CenterIt;
  908.         Computes center of screen and then calls RePosition(center)
  909.     procedure CurWhere(var Pt : TPoint);
  910.         returns cursor position
  911.     procedure GetGrid(var AGrid : MGridRec);
  912.         sets AGrid to equal the current values of the mouse grid
  913. >   {  procedure Limithorz(minpos,maxpos : integer);}
  914.         method replaced by RestrictMove
  915. >   {  procedure Limitvert(minpos,maxpos : integer);}
  916.         method replaced by RestrictMove
  917.     procedure LockShow;
  918.         decrements lock count, show cursor if 0
  919.     procedure LockHide;
  920.         hide cursor if visible, increment lock count.
  921.         while lock count > 0, Show and Hide have no effect.
  922.     procedure Move(P : TPoint);
  923.         moves cursor to Pt, even if hidden.
  924.     function  OverLapsCursor(R : TRect) : boolean;
  925.         true if R overlaps the cursor.
  926.     procedure RePosition(var Pt : TPoint);
  927.         Moves the cursor and calls FlushMouseQue.
  928.         If Pt is outside the area specified for the cursor travel,
  929.         then moves cursor to edge of specified area.
  930.     procedure RestoreSettings;
  931.         restores position,speed and limits of travel after DOS shell
  932. >   procedure RestoreMove;              {was RestoreYMove;}
  933.         Restores cursor movement to full screen.
  934.         Use after a call to RestrictMove.
  935. >   procedure RestrictMove(R : TRect);  {was RestrictYMove;}
  936.         restricts cursor movement to the rectangle R
  937.     procedure SelectHourGlass;
  938.         if EnableHourGlass is true, cursor shape is set to the hourglass
  939.     procedure SelectStdCursor;
  940.         cursor shape is set to the arrow
  941.     procedure SetGrid(XGrid,YGrid : byte; XGridOffset,YGridOffset : word);
  942.         SetGrid not only sets the specified grid but also sets
  943.         the limit of mouse travel so the cursor won't disappear
  944.         off the right screen edge or the bottom.
  945.         It also repositions the mouse to be on the new grid.
  946.     procedure SetSpeed(Mickx, Micky : integer);
  947.         set cursor movement speed  (ratio of mickeys/pixel)
  948.     procedure Show;
  949.         shows the cursor      TV's ShowMouse calls this method
  950.     procedure Hide;
  951.         hides the cursor      TV's HideMouse calls this method
  952.   end;
  953.  
  954. ------------------------
  955. * = unique to TVGraphic
  956. + = calls Graph unit with exceptions noted
  957.  
  958. * MYGRAPH Unit
  959.  
  960.   This unit traps some BGI calls before passing them to the Graph unit.
  961.   It also contains the TVGraphic bitmap fonts and their driver
  962.   plus various utility functions.
  963.  
  964. Fonts        (To use your own bitmapped fonts see file FONTS.DOC.)
  965.   Unit contains the two pixel-clippable bit-mapped fonts used throughout
  966.   TVGraphic.
  967.     Font8x8 appears the same as the Graph unit Default font.
  968.     Font8x14 is the same size as and looks like an EGA text mode font.
  969.   These fonts have only one size and can only be horizontal.
  970.  
  971.   NOTE: if you install enough custom stroke fonts, eventually the BGI
  972.   will assign font numbers equal to or higher than Font8x8. You will
  973.   not be able to access custom font numbers equal to and above Font8x8.
  974.   Example: Borland Pascal 7.0 has fonts defined at numbers 0 thru 10
  975.   so you will only be able to access three custom stroke fonts.
  976.  
  977.  
  978. const      {for graphics mode programs}
  979.   Charlen = 8;       {width of a standard graphic char in pixels}
  980.   BoxHeight = 14;    {height of the standard TVGraphic text line}
  981.  
  982.     font numbers for TVGraphic clippable, bit-mapped Fonts
  983.   Font8x8       = 14;      {8 by 8 pixels}
  984.   Font8x14      = 15;      {8 by 14 - same size as text on EGA}
  985.   MouseFont     = 16;      {reserved}
  986.  
  987.   BYOff8x8       = 4;      {offset down into Boxheight to center 8x8 text}
  988.   BYOffSmallFont = 0;      {offset down to center BGI SmallFont}
  989.   DefaultBYOff8x14 = 1;
  990.    {Change BYOff8x14 to 0 when using a European font from DOS code
  991.     page - Euro alpha chars are one pixel lower than US code page.}
  992.   BYOff8x14 : integer = DefaultBYOff8x14;   {menus use CalcVertTextOffset}
  993.  
  994.     {font dependent offset into Boxheight to center text vertically}
  995.   BYOffset : integer = 0;
  996.     The value of BYOffset is set by SetTextStyle to BYOff8x8, BYOff8x14
  997.     or BYOffSmallFont according to the selected font. (It is 0 for all
  998.     BGI fonts.) It can be used when spacing lines of text vertically
  999.     using Boxheight to properly center the text font vertically within
  1000.     each box. Add BYOffset to the box's upper edge when using
  1001.     OutTextXY, WriteCStrXY or MyGraph.MoveTo and OutText.
  1002.  
  1003.   BXOffset = 4;    {offset from left edge of box}
  1004.  
  1005. Utility functions
  1006.  
  1007.   procedure WriteCStr(AStr : string; TxColor,HighlightColor : word);
  1008.      Writes AStr as a single line. Text is in TxColor but anything
  1009.      enclosed with  ~ ~ is written in the highlight color. Can use
  1010.      multiple pairs of  ~ ~.
  1011.      Does not draw a background under the text.
  1012.   procedure WriteCStrXY(X,Y : integer; AStr : string;
  1013.                               TxColor,HighlightColor : word);
  1014.      X,Y are Viewport relative BGI coordinates. Moves the
  1015.      BGI "current pointer" to X,Y and then calls WriteCStr.
  1016.      Text is written at X,Y.
  1017.  
  1018.   function ConstStr(C : Char; N : Integer) : String;
  1019.      ConstStr returns a string with N characters of value C
  1020.  
  1021.   function CalcVertTextOffset(ViewYSize : integer) : integer;
  1022.           {was named VertTextOffset in versions prior to 1.5}
  1023.      Used by MenuBar,StatusLine,etc. to calc vertical offset to
  1024.      center a line of text in a view. Pass view's Size.y as ViewYSize.
  1025.      Font dependent - Must set font BEFORE calling this routine!
  1026.      Tested with Smallfont,Font8x8,Font8x14 in 10,15,20 pixel high
  1027.      boxes.
  1028.   begin
  1029.     CalcVertTextOffset := (ViewYSize +1 - TextHeight(' ')) div 2 +1;
  1030.   end;
  1031.  
  1032. Driver function
  1033.  + function DetectVesa16: Integer; far;
  1034.      from Borland's BGIDemo program. Used to detect presence of VESA
  1035.      compatible video BIOS. Note that some VESA cards must have their
  1036.      utility program run to enable or load the VESA BIOS on the card.
  1037.      If this is not done, these cards will not be recognized as
  1038.      VESA compatible.
  1039.      This function is modified to always return 0 if VESA is detected.
  1040.      This corresponds to the 16 color 800x600 mode which is supported
  1041.      by TVGraphic. Returns grError if VESA not detected.
  1042.  
  1043. BGI functions
  1044.  + procedure SetTextStyle(Font, Direction : word; CharSize : word);
  1045.      For font numbers less than Font8x8
  1046.        calls the Graph unit SetTextStyle. If that call fails
  1047.        (font not found), then sustitutes Font8x8.
  1048.        Sets BYOffset to BYOffSmallFont.
  1049.      For fonts Font8x8,Font8x14, sets font selection in this unit
  1050.      to selected font. Sets BYOffset to matching BYOff constant.
  1051.  
  1052.      Note that you can select the Graph unit DefaultFont (Font = 0)
  1053.      but it doesn't clip at pixel level - see BGI/Graph unit doc.
  1054.  
  1055.  + function TextHeight(TextString : string) : word;
  1056.      returns 8 for Font8x8 and 14 for Font8x14.
  1057.      If you have replaced Font8x14 with a font of a different
  1058.      height, then returns height specified in font header - see FONT.DOC.
  1059.  + function TextWidth(TextString : string) : word;
  1060.      uses character width of 8 for fonts Font8x8 and Font8x14
  1061.      to calculate width. This includes replacement fonts.
  1062.  
  1063.   The following BGI calls are also intercepted
  1064.      Bar
  1065.      Bar3d
  1066.      OutText
  1067.      OutTextXY
  1068. ------------------------
  1069.  
  1070. ofXXXX constants
  1071.  
  1072.   These correspond to bits in the TView.Options field.
  1073.  
  1074.   ofVersion20 : all views have this bit set in TVGraphic 2.0.
  1075.  
  1076.   ofFramed    :
  1077.     TV frame behavior:
  1078.        TFrame draws frame for each window subview where this bit is set.
  1079.     TVGraphic frame behavior:
  1080.       Due to different redraw order in TVGraphic, TFrame may draw first
  1081.       and therefore cannot draw frames for other (yet to be drawn) views.
  1082.         InputLines and ListBoxes - always framed. ofFramed has no effect.
  1083.         TgStaticText, TgParamText, TgLabel - view will draw its own frame
  1084.           if ofFramed is set in its Options field. Default = no frame.
  1085.         TCheckBoxes, TRadioButtons - view will draw its own frame
  1086.           if ofFramed is set in its Options field. Default = framed.
  1087.  
  1088.   ofBuffered : buffers are not used in TVGraphic
  1089.  
  1090. ------------------------
  1091.  
  1092. sfXXXX constants
  1093.  
  1094.   These correspond to bits in the TView.State field.
  1095.  
  1096.   sfShadow
  1097.     Do not use sfShadow in releases of GViews prior to 1.02.
  1098.     In 1.02 and after, sfShadow has no effect in TVGraphic and is
  1099.     available as a spare state for you to play with.
  1100.  
  1101.   sfExposed  {same as TV}
  1102.     true if view is Inserted directly or thru other views into the
  1103.     Application AND the sfVisible bit is true. While reseting states,
  1104.     TVGraphic sometimes momentarily changes this bit.
  1105.  
  1106.   sfActive versus sfSelected - Windows versus Views
  1107.     {a little different from TV}
  1108.     TV background:
  1109.       all TGroups can have a Selected subview but only windows and
  1110.       subviews within windows can be Active. When a window is
  1111.       selected, it and all of its subviews are set active.
  1112.       Deselection of the window sets everything inActive.
  1113.       Note that a subview may not be selectable (ofSelectable not set)
  1114.       but it will still become Active if it is in an active window.
  1115.     TVGraphic
  1116.       To allow nesting of windows, a window (unlike other views)
  1117.       does not respond to SetState(sfActive,...).
  1118.       It sets all its subviews'sfActive bit to match its own
  1119.       sfSelected bit. In GView versions prior to 1.02, a window
  1120.       never sets its own sfActive bit. For 1.02 and after, it sets
  1121.       its sfActive bit to match its sfSelected bit.
  1122.  
  1123.       Note that when windows are nested, there can be an Selected
  1124.       subWindow (whose subViews will be Active) plus
  1125.       additional subWindows all in an Selected Window (the selected
  1126.       Window's subviews, other than subwindows, will also be Active).
  1127.       In GView versions prior to 1.02, none of the window/subwindows will
  1128.       have its sfActive bit set while for 1.02 and after, the selected
  1129.       window and subWindow will have their sfActive bits set.
  1130.  
  1131. ------------------------
  1132.  
  1133. TApplication
  1134.   In TVGraphic, Applications descend from TProgram, not TApplication !
  1135.  
  1136.     See TProgram.
  1137.  
  1138.   Example:
  1139.     TDemoApp is derived in each DEMO program (TVGDemo1, TinyDemo, etc.).
  1140.  
  1141.     TDemoApp = object(TProgram)
  1142.               only those methods that are of general interest are
  1143.               listed here. See TDemoApp for code/descriptions.
  1144.       constructor Init;
  1145.       destructor Done;
  1146.       procedure DosShell;
  1147.       procedure GetEvent;          hooks for Help windows
  1148.       procedure HandleEvent;
  1149.       procedure InitMenuBar;
  1150.       procedure InitMessageBar;    message that covers over the MenuBar
  1151.       procedure InitStatusLine;
  1152.       procedure InitToolBar;
  1153.       procedure SaveDeskTop;
  1154.       procedure LoadDeskTop;
  1155.       procedure ShowHelp;
  1156.     end;
  1157.  
  1158. ------------------------
  1159.  
  1160. TBackground = object(TView)    DeskTop background
  1161.     Pattern - Not used.
  1162.        In TVGraphic, TBackground obtains its fillstyle (texture) from the
  1163.        background color of its palette entry.
  1164.        The fillstyle passed to the BGI's SetFillStyle procedure is
  1165.        (BackgroundColor mod 4 +8) for color value less than 8.
  1166.        v2.0 : For 8 and above, fillstyle is set to solidfill which
  1167.        gives a solid background.
  1168.   end;
  1169.  
  1170. ------------------------
  1171. * = unique to TVGraphic
  1172. + = emulates TV with exceptions noted
  1173.  
  1174. TButton = object(TView)
  1175.   + AmDefault: Boolean;     modified usage - true if button is selected
  1176.   + constructor Init(var Bounds: TRect; ATitle: TTitleStr; ACommand: Word;
  1177.       AFlags: Word);
  1178.         bfxxxx options in AFlags saved in Flags as usual.
  1179.         does NOT set AmDefault
  1180.         sets VFont := DefaultDialogFont
  1181.     procedure Draw; virtual;              unchanged - calls DrawState
  1182.   + procedure DrawState(Down: Boolean); virtual;
  1183.         rewritten for graphic drawing. Button outline is always in black.
  1184.         centers text vertically for any font
  1185.         made virtual
  1186.         when TextButtonsMatchBitMapButtons is false:
  1187.           draws text buttons similar to TV. Background is black if pressed.
  1188.         when TextButtonsMatchBitMapButtons is true:
  1189.           TButtons draw to match appearance of TVGraphic bitmapped
  1190.           TIconButtons.
  1191.             The text and button background is always drawn in the
  1192.               Button Text Normal colors.
  1193.             A shadow frame is drawn using the Shadow colors.
  1194.               If ((Size.x > 2*Boxheight) and (Size.y >= 2*Boxheight))
  1195.               or the button is the default button, this frame is
  1196.               drawn thicker.
  1197.             If a button is selected and there is more than one button
  1198.               in the view, the outline of the selected button is dotted
  1199.               using the background color of Text Normal.
  1200.             An unselected button which is the default button has a
  1201.               thicker dark border using the Shadow colors.
  1202.             When the button is pressed, the background is XOR'd with $FF.
  1203.   + procedure HandleEvent(var Event: TEvent); virtual;
  1204.         heavily altered
  1205.         summary:
  1206.           If button's command is disabled, its sfDisabled State flag
  1207.             is set and it cannot be pressed. Redraws as necessary.
  1208.           A button will not select itself if clicked with mouse unless
  1209.             the bfGrabFocus (TV2.0) flag is set in Flags.
  1210.           Mouse - evMouseDown presses button unless global
  1211.             ViewsRespondToMouseUp is true.
  1212.             No action for right mouse button unless global
  1213.             AllowBothMButtons is true.
  1214.           Enter key presses the Default button. The Default button is
  1215.             either the Focused button, or if no button is focused,
  1216.             the button with bfDefault set in Flags.
  1217.           cmDefault will press the button if bfDefault is set in Flags.
  1218.           not using cmGrabDefault, cmReleaseDefault:
  1219.           usual HotKey behavior.
  1220.           Draws the button press if Hotkey is pressed or default button
  1221.             is pressed. TV does not draw in these situations.
  1222.   + procedure MakeDefault(Enable: Boolean);
  1223.         routine's code is commented out.
  1224.   + procedure Press(DrawIt : boolean); virtual;
  1225.         parameter DrawIt added.
  1226.           if DrawIt true, then draws button pressed then unpressed again.
  1227.         Usual TV code/behavior.
  1228.   + procedure SetState(AState: Word; Enable: Boolean); virtual;
  1229.         for AState=sfFocused, sets AmDefault to Enable and redraws
  1230.         the view. Does not call MakeDefault.
  1231.   end;
  1232.  
  1233.   To change the Default Button after initialization:
  1234.     change which button has the bfDefault flag set in its Flags field
  1235.     (only one button should have this flag set at a time),
  1236.     then call DrawView for the old and new Default buttons.
  1237.  
  1238.  
  1239. * TVGraphic predefined buttons
  1240.      Button Size is fixed at 10*Charlen long by DefaultButHt tall.
  1241.      Only the Button's Origin is specified in Init.
  1242.  
  1243. * PCancelButton = ^TCancelButton;
  1244. * TCancelButton = object(TButton)      Issues the cmCancel command.
  1245.     constructor Init(var Org : TPoint);
  1246.   end;
  1247.  
  1248. * POKButton = ^TOKButton;
  1249. * TOKButton = object(TButton)          Issues the cmOK command.
  1250.     constructor Init(var Org : TPoint; DefaultButton : boolean);
  1251.         if DefaultButton is true, then call to TButton sets
  1252.         Turbo Vision bfDefault button flag in Flags field.
  1253.   end;
  1254.  
  1255.  
  1256. + Button Palette
  1257.     background is drawn in the background color of entries 1-4
  1258.       depending on State of button.
  1259.     background while pressed - see DrawState
  1260.     button outline/shadow:
  1261.       left and top = foreground color of entry 8
  1262.       right and bottom = background color of entry 8
  1263.     all text - same entries as TV
  1264.  
  1265. ------------------------
  1266.  
  1267. PCheckBoxes = ^TCheckBoxes
  1268. TCheckBoxes = object(TCluster)
  1269.   + methods Mark, Press   TV Bug fix for 16 box checkbox
  1270.  
  1271. ------------------------
  1272. * = unique to TVGraphic
  1273. + = emulates TV with exceptions noted
  1274.  
  1275.   TCluster:
  1276.     TV bug in handling nil strings in TCluster.DrawMultiBox is corrected.
  1277.     This means you can have a Checkbox or RadioButton view without
  1278.     individual box labels.
  1279.  
  1280. PCluster = ^TCluster
  1281. TCluster = object(TView)
  1282.   + constructor Init(var Bounds: TRect; AStrings: PSItem);
  1283.         sets  ofFramed in Options
  1284.         sets  VFont := font8x8
  1285.   + constructor Load(var S: TStream);
  1286.         TV Bug will set ofSelectable in Option field even if it
  1287.         has been cleared in the stream object.
  1288.         modified code
  1289.           if (Options and ofSelectable <> 0) then
  1290.             SetButtonState(0, True);
  1291.   + procedure MultiDrawBox(Icon: String; Marker: Char); virtual;
  1292.         fix TV 1.0 bug for single line horizontal Clusters
  1293.         rewritten for graphics
  1294.         made virtual
  1295.   + procedure HandleEvent(var Event: TEvent); virtual;
  1296.         convert to graphics coords
  1297.  
  1298.   Following Methods are Private in TV.
  1299.   In TVGraphic they are public and virtual.
  1300.   + function FindSel(P: TPoint): Integer; virtual;
  1301.         convert to graphic coords
  1302.   + function Column(Item: Integer): Integer; virtual;
  1303.         handle nil strings
  1304.         convert to graphic coords
  1305.   + function Row(Item: Integer): Integer; virtual;
  1306.         convert to graphic coords
  1307.   end;
  1308.  
  1309.  
  1310. + Cluster Palette
  1311.     background is drawn in the background color of entry 1.
  1312.     cluster outline uses background color of entry 3
  1313.     all text - same entries as TV
  1314.  
  1315. ------------------------
  1316. * = unique to TVGraphic
  1317. + = emulates TV with exceptions noted
  1318.  
  1319. TCollection = object(TObject)
  1320.   + constructor Load(var S: TStream);
  1321.         checks LowMemory before loading each item. If true, sets
  1322.         Count equal to number of items loaded and exits.
  1323.         The partially loaded collection is usable.
  1324.         With Ver1.5, Sets error flag in above case. Also checks for
  1325.         large enough block of memory to allocate Items, the array of
  1326.         pointers (will not dip into the Safety Pool).
  1327.         If not, sets error flag and constructs an empty
  1328.         Collection with Limit=1 and Count =0.
  1329.     procedure AtFree(Index: Integer);
  1330.         missing from TV 1.0 manual
  1331.         deletes and disposes of item at index.
  1332.   * function Valid : integer; virtual;
  1333.         returns 0 if complete collection successfully loaded,
  1334.         error code otherwise. See GObject unit descript for error code(s).
  1335.         See main doc file for discussion of loading and safety in
  1336.         using Collections.
  1337.     private
  1338.       TruncationErr : boolean;
  1339.   end;
  1340.  
  1341. ------------------------
  1342. * = unique to TVGraphic
  1343. + = emulates TV with exceptions noted
  1344.  
  1345. TColorGroupList = object(TListViewer)
  1346.   + procedure FocusItem(Item: Integer); virtual;
  1347.         modify to send message only if color has changed
  1348.   end;
  1349.  
  1350. TColorDialog = object(TDialog)
  1351.   + constructor Init  modify to allow 16 colors for background.
  1352.         delete mono selector, rearrange control locations.
  1353.   end;
  1354.  
  1355. TColorDisplay = object(TView)
  1356.   + procedure DispSetColor(var AColor: Byte); virtual;
  1357.         name of above procedure is SetColor in TV2.0. This conflicts
  1358.         with Graph.SetColor so TV1.0 name is used for this method.
  1359.  
  1360. ------------------------
  1361. * = unique to TVGraphic
  1362. + = emulates TV with exceptions noted
  1363.  
  1364. TDeskTop = object(TGroup)         ALL methods listed
  1365.     BackGround : PBackground;
  1366.     TileColumnsFirst: Boolean;            {new in TV2.0}
  1367.   + constructor Init(var Bounds: TRect);
  1368.         Select alternative redraw algorithm
  1369.           DrawFlags := dfAlternateRedraw;
  1370.   + constructor Load(var S : TStream);
  1371.         if LoadVersion >= ofVersion20 then
  1372.           S.Read(TileColumnsFirst, Sizeof(TileColumnsFirst));
  1373.         else
  1374.           DrawFlags := DrawFlags or dfAlternateRedraw;
  1375.   + procedure Cascade(var R: TRect);
  1376.         use TVGraphic coords
  1377.         call DrawView at end
  1378.   + procedure HandleEvent(var Event: TEvent); virtual;
  1379.         cmPrev: put Current view in front of the foremost
  1380.                 non-selectable view. This is usually the Background.
  1381.     procedure InitBackground; virtual;
  1382.     procedure Store(var S : TStream);
  1383.     procedure Tile(var R: TRect);
  1384.     procedure TileError; virtual;
  1385.   end;
  1386.  
  1387. ------------------------
  1388. * = unique to TVGraphic
  1389. + = emulates TV with exceptions noted
  1390.  
  1391. TDialog = object(TWindow)
  1392.   + constructor Init(var Bounds: TRect; ATitle: TTitleStr);
  1393.         {versions prior to v1.5 had an additional parameter after ATitle.
  1394.          constructor is now identical to TV.}
  1395.          Set any options in the VOptions field after construction.
  1396.            see GDialog Unit section for options
  1397.  
  1398.         sets Palette := DefaultDialogPalette;
  1399.         sets Frame^.VOptions := tfDrawBackground;
  1400.           which causes Dialog's Frame to draw a complete background
  1401.           for the view.
  1402.   + constructor Load(var S: TStream);
  1403.         if TV1.0 Dialog on the Stream,
  1404.           sets Palette := DefaultDialogPalette;
  1405.   * function Execute : word; virtual;  NEW-ADDED
  1406.         calls TGroup.Execute
  1407.       if global MouseSnapToDialogGrid is true then Execute sets the
  1408.       mouse grid to a Charlen by Boxheight grid before the call to
  1409.       TGroup.Execute and resets grid to previous values afterwards.
  1410.       If set, grid is relative to top of DeskTop - Dialog grid assumes
  1411.       you will insert Dialog into DeskTop.
  1412.       When inserting a Dialog, easiest way is to use the ofCentered
  1413.       option in the Dialog.Options field (not VOptions field). This
  1414.       will center the Dialog and match it to the grid if you dimension
  1415.       the Dialog vertically using the Boxheight constant and
  1416.       horizontally using the Charlen constant.
  1417.              (i.e. Size.x := I*Charlen
  1418.              (     Size.y := N*Boxheight  where I,N : integer)
  1419.  
  1420.     function GetPalette: PPalette;
  1421.         In v1.5, method was modified to return an altered palette if dialog
  1422.         is non-modal and dialog's Owner has a palette.
  1423.         In v2.0, the Window palettes are extended to duplicate dialog
  1424.         palettes and this method is identical to Turbo Vision 2.0.
  1425.   + procedure HandleEvent(var Event: TEvent); virtual;
  1426.         When a modal dialog receives a right mouse button event, it
  1427.           issues cmCancel to close itself (unless AllowBothMButtons
  1428.           is true). This is the standard TVGraphic behavior.
  1429.         If (VOptions and dgReturnOnAnyButton <> 0) then dialog
  1430.           calls EndModal for ANY Event.Command. This closes the dialog and
  1431.           returns the Command as the result of Execute/ExecuteDialog.
  1432.   end;
  1433.  
  1434. ------------------------
  1435. * = unique to TVGraphic
  1436. + = emulates TV with exceptions noted
  1437.  
  1438.   NOTE on TFrame
  1439.     The VOptions tfDrawBackground flag controls whether the Frame draws
  1440.     a complete background for the window. This flag is set automatically
  1441.     in TDialog.Init but NOT in TWindow.Init. For windows, if you do not
  1442.     fill up the area inside the Frame completely with view(s), then set
  1443.     the flag. There will be less flicker when drawing if it is not set.
  1444.     Drawing Outlines of views:
  1445.     TVGraphic TFrames do not draw outlines of other views. This is due
  1446.     to the different order of drawing views in TVGraphic. Many TVGraphic
  1447.     views draw their own outlines if their ofFramed Options flag is set.
  1448.  
  1449.  
  1450. TFrame = object(TView)                        ALL methods listed
  1451.   + constructor Init(var Bounds: TRect);
  1452.         VFont is set to Font8x8. TFrame assumes this size font is used.
  1453.         DrawFlags := DrawFlags and not dfPanning;
  1454.   * constructor Load(var S: TStream);
  1455.         clear dfPanning flag in DrawFlags if LoadVersion = ofVersion10
  1456.   + procedure Draw; virtual;
  1457.       NOTE: The Frame's VOptions tfDrawBackground flag is automatically
  1458.             set in TDialog.Init but NOT in TWindow.Init !
  1459.             User may set after window's construction if desired.
  1460.         Draws a complete background if State sfDragging flag or
  1461.           the VOptions tfDrawBackground flag is set. Uses the background
  1462.           color of the palette's Active Frame entry.
  1463.         Otherwise checks VOptions flags tfVScrollBar and tfHScrollBar
  1464.           (set by TWindow.StandardScrollBar) and draws background under
  1465.           the standard scrollbar positions for each flag set.
  1466.         Also checks VOptions tfMarginsForText. If set, draws background
  1467.           in the extra margin area.
  1468.         Finally calls DrawFrame.
  1469.   * procedure DrawFrame; virtual;
  1470.         Draws a background under top bar of window. Draws a rectangle
  1471.         around the view and an inner rectangle if the view is active.
  1472.         These border rectangles extend offscreen if the view has an
  1473.         Interior larger then the screen. (Calls TGroup.GetFullPanSize
  1474.            to get size for these outline rectangles.)
  1475.         If the window number is 1 thru 9, draws a Next Window button
  1476.         with number inside.
  1477.         Next, if active, checks Flags field and draws usual icons
  1478.         whose flags are set in Flags. Finally draws title, shortening
  1479.         it as necessary to fit. Windows numbered 1..9 draw a blue
  1480.         background under the title using the background of
  1481.         palette entry 6.
  1482.   {* function Exposed : boolean; virtual;
  1483.         v2.02 uses revised TView.Exposed that tests dfPanning flag}
  1484.   * procedure GetInteriorSize(var R: TRect; MarginsForText: boolean);
  1485.                                                              virtual;
  1486.         {MarginsForText added v2.0}
  1487.         Usually called through TWindow.GetMaxSubViewSize, not directly.
  1488.         Returns in R the size of the rectangle inside the frame that you
  1489.           should fill with view(s). If MarginsForText is true, then the
  1490.           margin from R to the frame's left and right edges will be a
  1491.           multiple of Charlen - for use with text based views, similar
  1492.           spacing to Turbo Vision. Otherwise R extends up to inner frame
  1493.           border line - this was the default in v1.5 and earlier.
  1494.         Sets and clears the tfMarginsForText flag in VOptions field
  1495.           based on parameter MarginsForText.
  1496.         The size of R also reflects whether the VOptions flags tfVScrollBar
  1497.           and tfHScrollBar are set. (They are set automatically if you add
  1498.           scrollbar(s) using TWindow.StandardScrollBar).
  1499.  
  1500.         Note that if you set TFrame's tfDrawBackground in the VOptions
  1501.         field, it will fill this area R with the TFrame background color.
  1502.     function GetPalette: PPalette; virtual;
  1503.   + procedure HandleEvent(var Event: TEvent); virtual;
  1504.         Handles mouse events.
  1505.         If the NextWindow button is pressed, issues a command event
  1506.         with Event.Command := cmNext to advance to next window.
  1507.         If Close Icon is pressed and Frames's Owner has a pull down
  1508.         menu, then has its Owner ExecView the menu. When menu closes,
  1509.         does a PutEvent of the menu command. If no menu then issues
  1510.         cmClose as usual.
  1511.         Otherwise emulates TV.
  1512.   {* procedure MakeLocal(Source: TPoint; var Dest: TPoint); virtual;
  1513.         v2.02 uses revised TView.MakeLocal that tests dfPanning flag}
  1514.   + procedure SetState(AState: Word; Enable: Boolean); virtual;
  1515.         Calls DrawView when setting sfDragging.
  1516.         If changing sfActive or leaving sfDragging,
  1517.         calls DrawFrame if view is Exposed.
  1518.   end;
  1519.  
  1520. + TFrame Palette
  1521.   { TFrame Palette layout }
  1522.   { 1 = Passive frame }
  1523.   { 2 = Passive title }
  1524.   { 3 = Active frame }
  1525.   { 4 = Active title }
  1526.   { 5 = Icons, Dragging frame }
  1527.   {*6 = highlight outline, background for title of numbered windows}
  1528.   CFrame      = #1#1#2#2#3#4;   {add #4 to map to dialog box
  1529.                                 scrollbar background}
  1530.  
  1531.   The background of entry #3 is used in cases where the frame
  1532.     draws a complete background for a window.
  1533.   Numbered,Active frames draw their inner border and their
  1534.     background under the Title using background of entry 6.
  1535.      {entry 6 points to same color as scrollbar's entry 1}
  1536.   Icon buttons draw background with background of entry 5,
  1537.     Icon uses foreground of entry 5.
  1538.   Other items follow TV.
  1539. ------------------------
  1540. * = unique to TVGraphic
  1541. + = emulates TV with exceptions noted
  1542.  
  1543.  
  1544. TGroup = object(TView)
  1545.   + {Buffer: PVideoBuf;}     deleted
  1546.   + constructor Init(var Bounds: TRect);
  1547.         does not set ofBuffered in Options field
  1548.  !+ constructor Load(var S: TStream);
  1549.         Calls LowMemory after loading each view and Exits if true.
  1550.         This prevents TV's runtime halt with out of memory error.
  1551.         See section on TGroup.Load in main doc file.
  1552.  !    Warning: when Load exits due to LowMemory=true, the Group is
  1553.         not complete - inter view pointers are not restored.
  1554.         If you insert the Group, the computer will probably crash!
  1555.           To check for incomplete Load, follow the TV recommended
  1556.           practice of using TProgram.ValidView on the pointer
  1557.           returned by S.Get. If LowMemory, ValidView will display
  1558.           an insufficient memory message, dispose the Group and
  1559.           return a nil pointer to you.
  1560.  
  1561.         After loading, does not call Awaken function if LowMemory.
  1562.         Load also calls SetClipToMax.
  1563.  
  1564.   * function CurAtEdge(Event : TEvent; var Delta : TPoint;
  1565.                     AllowMenuAccess : boolean) : boolean; virtual;
  1566.         Returns false with no other action here.
  1567.         Overridden in descendents if panning with mouse cursor.
  1568.   + procedure ChangeBounds(var Bounds: TRect); virtual;
  1569.         calls SetClipToMax rather than GetExtent(Clip);
  1570.         call to DrawView when Size does not change is deleted.
  1571.   + procedure Draw; virtual;
  1572.         sets Clip by calling GetClipRect(Clip), calls Redraw and
  1573.         resets Clip with SetClipToMax {rather than GetExtent(Clip)}.
  1574.   * procedure GetClip(var MyClip : TRect);
  1575.         sets MyClip equal to Clip field.
  1576.   * procedure GetFullPanSize(var ISize : TPoint); virtual;
  1577.         ISize is set to Size here. Overridden by descendents with
  1578.         larger then the screen Interiors to return size of
  1579.         their Interior. Called by TFrame.DrawFrame to determine
  1580.         what size to draw its outline rectangle around.
  1581.   + procedure InsertBefore(P, Target: PView);
  1582.         same as TV except:
  1583.         If P's ofCenterX or ofCenterY Option flags are set, then
  1584.         P is centered but P's Origin is adjusted so that
  1585.           if ofCenterX then P's Origin.x is a multiple of Charlen
  1586.           if ofCenterY then P's Origin.y is a multiple of Boxheight.
  1587.   + procedure Lock;
  1588.         always increments the LockFlag
  1589.   + procedure Redraw;
  1590.         calls MCur.LockHide to lock the mouse cursor off
  1591.         redraws the views as usual
  1592.         calls MCur.LockShow;
  1593.   * procedure SetClip(R : TRect);
  1594.         allows you to set the Clip variable which is used in TVGraphic
  1595.         by TView.Exposed. If a view is outside the Clip rectangle,
  1596.         Exposed will be false and calls to DrawView (or TGroup.Redraw
  1597.         which eventually calls DrawView for each view) will not draw.
  1598.   * procedure SetClipToMax;
  1599.         Calls GetExtent(R) then R.Move(VOffset.x,VOffset.y) and
  1600.         finally SetClip(R).
  1601.         This sets the Clip variable to the full size of the group
  1602.         while taking into account VOffset. Clip is maintained
  1603.         in local (group interior) coordinates. See Clip below.
  1604.   + procedure SetState(AState: Word; Enable: Boolean); virtual;
  1605.         Lock and UnLock are Not called when AState =sfActive,sfDragging:
  1606.   * procedure SetVOffset(VX,VY : integer); virtual;
  1607.         sets VOffset.x = VX, VOffset.y = VY and shifts Clip to
  1608.         match the change in VOffset. Always set VOffset by calling
  1609.         SetVOffset so Clip will be updated!
  1610.   * procedure SetZoomLevel(ZL : byte);
  1611.         reserved
  1612.   * function ShiftScreen(var Event : TEvent; var Shift : TPoint) : boolean;
  1613.                              virtual;
  1614.         returns false with no other action. Overridden in descendents
  1615.         such as TPanWindow that shift or Pan the screen.
  1616.   + procedure Unlock;
  1617.         if the LockFlag > 0 then decrements the LockFlag as usual.
  1618.         Does not make any drawing calls! {DrawView not called}
  1619.   private
  1620.     Clip: TRect;            in use in TVGraphic
  1621.         Maintained in local coordinates, not absolute screen coords!
  1622.         For a group with an Interior that is shifted by VOffset,
  1623.         Clip is maintained in the Interior's coordinate system by
  1624.         shifting its x coords by VOffset.x and shifting its y
  1625.         coords by VOffset.y. This is handled by SetVOffset.
  1626.         {If VOffset = (0,0), the group's Interior is unshifted by
  1627.          definition. Then SetClipToMax will set Clip.A to (0,0) and
  1628.          Clip.B to (Size.x,Size.y)}
  1629.     LockFlag: Byte;         in use in TVGraphic
  1630.   + procedure DrawSubViews(P, Bottom: PView);
  1631.         TV draws subviews from First (top view) to Last (bottom view).
  1632.         TVGraphic draws subviews in this order only if group's DrawFlag
  1633.         dfAlternateRedraw is set. Otherwise draws subviews from Last
  1634.         to First.
  1635.   + procedure FreeBuffer;
  1636.         returns with no action
  1637.   + procedure GetBuffer;
  1638.         returns with no action
  1639.   * procedure ResetCurrentDrawLater;
  1640.         variant of ResetCurrent
  1641.   * procedure ResetCurrentEraseLater;
  1642.         variant of ResetCurrent
  1643.   + procedure ResetCursor(Eraseit : boolean); virtual;
  1644.         returns with no action
  1645.   + procedure SetCurrent(P: PView; Mode: SelectMode);
  1646.         does not call Lock and UnLock.
  1647.         handles new values of Mode parameter
  1648.   end;
  1649.  
  1650. ------------------------
  1651. + = emulates TV with exceptions noted
  1652.  
  1653.   PHistoryViewer = ^THistoryViewer;
  1654.   THistoryViewer = object(TListViewer)
  1655.   + constructor Init(var Bounds: TRect;
  1656.       AHScrollBar, AVScrollBar: PScrollBar; AHistoryId: Word);
  1657.         XSize := (Size.x+1) div Charlen;
  1658.         HScrollBar^.SetRange(1, HistoryWidth-XSize + 2{3});
  1659.  
  1660. ------------------------
  1661. * = unique to TVGraphic
  1662. + = emulates TV with exceptions noted
  1663.  
  1664.   PHistoryWindow = ^THistoryWindow;
  1665.   THistoryWindow = object(TWindow)
  1666.   * procedure HandleEvent(var Event : TEvent); virtual;
  1667.         if not AllowBothMButtons and view is modal and a right
  1668.         mouse button press, then converts the Event to a Command
  1669.         event with cmCancel. This will close the window.
  1670.         Calls TWindow.HandleEvent.
  1671.   + procedure InitViewer(HistoryId: Word); virtual;
  1672.         rewritten so can use Window's GetMaxSubViewSize(R, false) to
  1673.         size the viewer. Same end result as TV.
  1674.  
  1675.   Palette
  1676.   + CHistoryWindow = #19#19#19#24#25#26#27;
  1677.       Third entry was #21, now #19. Used for Frame Icon.
  1678.       The last two entries are for HistoryViewer Selected and Normal
  1679.       text. They have been changed from pointing to TgInputLine
  1680.       entries to pointing to TListViewer entries.
  1681.  
  1682. ------------------------
  1683. + = emulates TV with exceptions noted
  1684.  
  1685.   PHistory = ^THistory;
  1686.   THistory = object(TView)
  1687.   + constructor Init(var Bounds: TRect; ALink: PgInputLine;
  1688.                          AHistoryId: Word);
  1689.         VFont := font8x14;
  1690.   + procedure HandleEvent(var Event: TEvent); virtual;
  1691.         position HistoryWindow so user can see the label of the InputLine
  1692.  
  1693. ------------------------
  1694. * = unique to TVGraphic
  1695.  
  1696.      button with .BMP bitmap face       unit GBUT
  1697. * PIconButton = ^TIconButton;
  1698. * TIconButton = Object(TButton)
  1699.  
  1700.   see file BITMAP.DOC for full detail
  1701.  
  1702. ------------------------
  1703. + = emulates TV with exceptions noted
  1704.  
  1705. PgInputLine = ^TgInputLine                      TV's TInputLine
  1706. TgInputLine = object(TView)
  1707.   + constructor Init(var Bounds: TRect; AMaxLen: Integer; Opts : byte);
  1708.         Opts parameter added
  1709.           DefaultOpts        DefaultOpts matches TV
  1710.           KillInstantErase   prevent first keystroke from erasing
  1711.           lnRightJustify     right justify the inputline
  1712.              Note: right justified line may not exceed width of view:
  1713.                         AMaxLen <= ((Size.x+1) div Charlen) - 2
  1714.         VOptions := Opts;
  1715.         EventMask := EventMask + evTimerTick;
  1716.         Vfont := DefaultDialogFont;
  1717.   + procedure Draw; virtual;
  1718.         rewritten
  1719.   + procedure HandleEvent(var Event: TEvent); virtual;
  1720.         Ctrl-Del deletes line
  1721.         if KillInstantErase set in VOptions, then
  1722.           first keystroke does not erase focused/highlighted line.
  1723.         handles right justified input lines.
  1724.   + procedure SelectAll(Enable: Boolean);
  1725.         if KillInstantErase, positions cursor at end of selected block
  1726.   + function Valid(Command: Word): Boolean; virtual;
  1727.         for non-registered versions of TVGraphic, warns that Validators
  1728.         are not active.
  1729.   private
  1730.   * function RightJustify: integer;
  1731.         returns the number of spaces to push text to the right.
  1732.   end;
  1733.  
  1734. + InputLine Palette
  1735.     overall background is drawn in the background color of entries 1-2.
  1736.     background of selected text uses background of entry 3.
  1737.     InputLine outline uses background color of entry 4
  1738.     arrows indicating text extends beyond view use foreground
  1739.       color of entry 4
  1740.     text - uses entries 1-2. (If selected uses entry 2, not 3.)
  1741.  
  1742. ------------------------
  1743. * = unique to TVGraphic
  1744. + = emulates TV with exceptions noted
  1745.  
  1746. PgLabel = ^TgLabel                              TV's TLabel
  1747. TgLabel = object(TgStaticText)
  1748.   + constructor Init(var Bounds : TRect; AText : String;
  1749.                          ALink : PView; Opts : byte);
  1750.        Opts: added parameter.
  1751.             Opts = DefaultOpts then matches TV
  1752.          Works like Opts parameter in StaticText except
  1753.             txCentered - flag is ignored.
  1754.             txDrawBackground - ignored, background always drawn
  1755.             txAdjustSize
  1756.                 The view's Origin will be set to Bounds.A
  1757.               The view's Size.x will be adjusted to the length of
  1758.               AText * Charlen plus StaticTextOffset. Size.y will be set
  1759.               to Boxheight-1. Will handle text with highlighted
  1760.               characters.
  1761.                 Note that parameter Bounds will NOT be changed if this
  1762.               flag is set - you can supply a Bounds based on a
  1763.               TgInputline, for example, and then later reuse the width
  1764.               of Bounds for setting another matching TgInputLine.
  1765.                 Font must be uniformly spaced, 8 pixels/char such as
  1766.               Font8x8,Font8x14,SmallFont.
  1767.   + procedure Draw; virtual;
  1768.         Color and Font selection same as StaticText Draw.
  1769.         Uses BYOffset in vertical positioning of text within the view.
  1770. >       Text is indented by StaticTextOffset pixels from left edge of view,
  1771.           value was 4 up to v2.0, 0 for v2.02 and up (matches TurboVision).
  1772.         If Options has ofFramed set, then draws frame around itself.
  1773.   end;
  1774.  
  1775. ------------------------
  1776.  
  1777. For TgMenu object see section following TMenuView
  1778.  
  1779. ------------------------
  1780. * = unique to TVGraphic
  1781. + = emulates TV with exceptions noted
  1782.  
  1783. TListBox = object(TListViewer)
  1784.   + function GetText();
  1785.         returns empty string if nil pointer in the List
  1786.   + procedure NewList(AList: PCollection); virtual;
  1787.         modified to use Lock, UpDate(uvDrawView), UnLock
  1788.         instead of calling DrawView directly
  1789.   + procedure SetData(var Rec); virtual;
  1790.         modified to use Lock, UpDate(uvDrawView), UnLock
  1791.         instead of calling DrawView directly
  1792.   end;
  1793.  
  1794. ------------------------
  1795. * = unique to TVGraphic
  1796. + = emulates TV with exceptions noted
  1797.  
  1798. TListViewer = object(TView)       ALL methods listed
  1799.     HScrollBar: PScrollBar;
  1800.     VScrollBar: PScrollBar;
  1801.     NumCols: Integer;
  1802.     TopItem: Integer;
  1803.     Focused: Integer;
  1804.     Range: Integer;
  1805.   + constructor Init(var Bounds: TRect; ANumCols: Word;
  1806.       AHScrollBar, AVScrollBar: PScrollBar);
  1807.           VFont := DefaultListViewerFont
  1808.     constructor Load(var S: TStream);
  1809.     procedure ChangeBounds(var Bounds: TRect); virtual;
  1810.   + procedure Draw; virtual;
  1811.         Draws the complete view or just the previous and
  1812.         new Focused items depending on boolean PartialRedraw.
  1813.         Sets OldFocused := Focused, OldTopItem := TopItem.
  1814.   * procedure DrawSelf;
  1815.         decides whether partial or complete redraw of the view
  1816.         is needed using UpdateFlags and OldTopItem. Sets boolean
  1817.         PartialRedraw and calls DrawView.
  1818.         Then sets UpdateFlags = 0 and PartialRedraw to false.
  1819.     function GetPalette: PPalette; virtual;
  1820.     function GetText(Item: Integer; MaxLen: Integer): String; virtual;
  1821.     function IsSelected(Item: Integer): Boolean; virtual;
  1822.   + procedure HandleEvent(var Event: TEvent); virtual;
  1823.         Same functionality as TV but uses Lock,UnLock,Update drawing
  1824.         control methods instead of calling DrawView.
  1825.     procedure SelectItem(Item: Integer); virtual;
  1826.     procedure SetRange(ARange: Integer);
  1827.   + procedure SetState(AState: Word; Enable: Boolean); virtual;
  1828.         Calls TView.SetState then
  1829.         if AState is sfSelected or sfActive, calls UpDate(uvFocused).
  1830.         Does not talk to or affect scrollbars.
  1831.     procedure Store(var S: TStream);
  1832.   * procedure Lock;
  1833.         drawing control -   Inc(LockCount);
  1834.   * procedure Unlock;
  1835.         drawing control - decrements LockCount and calls
  1836.         DrawSelf if LockCount = 0.
  1837.   * procedure UpDate(AFlags: Byte);
  1838.         UpDateFlags := UpdateFlags or AFlags.
  1839.         If LockCount = 0 then calls DrawSelf.
  1840.   private
  1841.   * LockCount: Byte;
  1842.   * UpdateFlags: Byte;
  1843.   * PartialRedraw : boolean;   {temp var}
  1844.   * OldFocused : integer; {temp variable, used with partial redraws}
  1845.   * OldTopItem : integer; {temp variable, used with partial redraws}
  1846.     procedure FocusItemNum(Item: Integer); virtual;
  1847.   end;
  1848.  
  1849. + ListViewer Palette
  1850.       background drawn in background color of entry 1
  1851.       outline of view uses background of entry 5
  1852.       vertical divider uses foreground of entry 5
  1853.       text - same as TV
  1854.  
  1855. ------------------------
  1856. * = unique to TVGraphic
  1857. + = emulates TV with exceptions noted
  1858.  
  1859.         Menus are some the most convoluted code in TV.
  1860.         The Execute method does most of the work. Unless you have
  1861.         source code, don't expect to understand or modify.
  1862.  
  1863. PMenuView = ^TMenuView;
  1864. TMenuView = object(TView)                  ALL methods listed
  1865.     ParentMenu: PMenuView;
  1866.     Menu: PMenu;
  1867.     Current: PMenuItem;
  1868.   * Target : PMenuView;   {temp var, pointer to child menu, nil if none}
  1869.     constructor Init(var Bounds: TRect);
  1870.     constructor Load(var S: TStream);
  1871.   + function Execute: Word; virtual;
  1872.         heavily modified
  1873.     function FindItem(Ch: Char): PMenuItem;
  1874.     procedure GetItemRect(Item: PMenuItem; var R: TRect); virtual;
  1875.     function GetHelpCtx: Word; virtual;
  1876.     function GetPalette: PPalette; virtual;
  1877.   + procedure HandleEvent(var Event: TEvent); virtual;
  1878.         added ability to snap mouse cursor to grid in BoxMenus if
  1879.         MouseSnapToMenuGrid is true. Previous grid is saved and restored.
  1880.         Prevents redrawing if cmCommandSetChanged arrives while the
  1881.         menu is open but not modal (Help window is popped up).
  1882.     function HotKey(KeyCode: Word): PMenuItem;
  1883.   + function NewSubView(var Bounds: TRect; AMenu: PMenu;
  1884.                        AParentMenu: PMenuView): PMenuView; virtual;
  1885.         code commented out - moved to TGMenu
  1886.     procedure Store(var S: TStream);
  1887.   private
  1888.   * OldCurrent  : PMenuItem;   {temp var, used in redrawing}
  1889.   * DrawPartial : boolean;     {temp var, used in redrawing}
  1890.   end;
  1891.  
  1892.  
  1893. * PGMenu = ^TGMenu;       {Ancestor of graphical menus}
  1894. * TGMenu = object(TMenuView)               ALL methods listed
  1895.     Xsep    : integer;
  1896.         number of char spaces (not pixels) between bar menu items.
  1897.     constructor Init(var Bounds : TRect; AMenu : PMenu);
  1898.     constructor Load(var S: TStream);
  1899.     procedure FillWindow(BorderColor,AColor : integer;FatBorder : boolean);
  1900.         draws a Bar3d the size of the menu with border
  1901.     function NewSubView(var Bounds: TRect; AMenu: PMenu;
  1902.                             AParentMenu: PMenuView): PMenuView; virtual;
  1903.         code moved here from TMenuView.NewSubView
  1904.     procedure Store(var S: TStream);
  1905.   end;
  1906.  
  1907.  
  1908.   PMenuBar = ^TMenuBar;             {TV's Bar Menu}
  1909.   TMenuBar = object(TGMenu)               ALL methods listed
  1910.   + Constructor Init(var Bounds : TRect; AMenu : PMenu);
  1911.         Adjusts Bounds using global MenuBarHeight
  1912.           Bounds.B.Y := Bounds.A.y + MenuBarHeight -1;
  1913.         legend separation Xsep - if there are few enough entries,
  1914.           the separation between menu items will be set at 3 spaces,
  1915.           otherwise to BarMenuLegendOffset (2) as in TV.
  1916.         VFont := DefaultMenuFont;
  1917.     destructor Done; virtual;  {new in TV2.0}
  1918.     procedure Draw; virtual;
  1919.         if the Viewport does not overlap any portion of menu, then
  1920.         sets the ViewPort before drawing and restores it afterwards.
  1921.   + procedure GetItemRect(Item: PMenuItem; var R : TRect); virtual;
  1922.   end;
  1923.  
  1924.  
  1925.   PMenuBox = ^TMenuBox;             {TV's Box menu}
  1926.   TMenuBox = object(TGMenu)               ALL methods listed
  1927.   * Indent  : integer;  legend starts this many pixels left of window edge
  1928.   + constructor Init(var Bounds : TRect; AMenu : PMenu;
  1929.                          AParentMenu : PMenuView);
  1930.         vertical size set to (number of entries +2) times MenuBoxHeight
  1931.         Indent := Charlen;
  1932.         VFont := DefaultMenuFont;
  1933.   * constructor Load(var S: TStream);
  1934.   * destructor Done; virtual;    {new in TVGraphic 2.0}
  1935.         fix TV bug by disposing Menu list for standalone menus
  1936.           (for menus where ParentMenu = nil)
  1937.   + procedure Draw; virtual;
  1938.         draws fat border if mnFatBorder is set in VOptions
  1939.   + procedure GetItemRect(Item: PMenuItem; var R : TRect); virtual;
  1940.   * procedure Store(var S: TStream);
  1941.   end;
  1942.  
  1943.  
  1944.   PMenuPopup = ^TMenuPopup;         {TV's Popup Menu}
  1945.   TMenuPopup = object(TMenuBox)          ALL methods listed
  1946.   + constructor Init(var Bounds: TRect; AMenu: PMenu);
  1947.         sets mnFatBorder in VOptions
  1948.     procedure HandleEvent(var Event: TEvent); virtual;
  1949.   end;
  1950.  
  1951.        {for use in TWindow}
  1952. * PWindowMenu = ^TWindowMenu;          ALL methods listed
  1953. * TWindowMenu = object(TMenuPopup)
  1954.     constructor Init(AMenu: PMenu);
  1955.       sets the Bounds to place the menu under the window's Close Icon.
  1956.       calls TMenuPopup.Init
  1957.       sets mnCloseOnDouble in VOptions.
  1958.     function GetPalette: PPalette; virtual;
  1959.       uses CWindowMenu palette
  1960.   end;
  1961.  
  1962.  
  1963.   Menu Palette (TV's CMenuView) - used by all menus except TWindowMenu
  1964.       CMenuView   = #2#3#4#5#6#7;
  1965.     + menu background color uses background of entry 1
  1966.     + menu border color uses background of entry 3
  1967.       text - same as TV
  1968.  
  1969. +   CWindowMenu = #128#129#130#131#132#133;
  1970.         maps thru extended TWindow palettes which duplicate
  1971.         CMenuView at entries 128-133
  1972.  
  1973. ------------------------
  1974. * = unique to TVGraphic
  1975.  
  1976.   Unit GMenu
  1977.   TVGraphic view for temporarily displaying instructions at
  1978.      top edge of screen - covers MenuBar while visible.
  1979. * PMessageBar= ^TMessageBar;
  1980. * TMessageBar = object(TView)
  1981.     MessageText : Str80;         {temp var, not saved}
  1982.     constructor Init;
  1983.         View's Bounds are set so it will cover the MenuBar
  1984.         State := State and not sfVisible;    {set invisible!}
  1985.         EventMask handles broadcast events.
  1986.         VFont := DefaultMenuFont;
  1987.     procedure Busy;
  1988.         shows message 'WORKING...'
  1989.     procedure Draw; virtual;
  1990.         uses separate color to draw text enclosed with  ~ ~ .
  1991.         see palette below for text colors.
  1992.     function GetPalette : PPalette; virtual;
  1993.         returns CMenuView palette   {starting in TVGraphic v2.0}
  1994.     procedure HandleEvent(var Event : TEvent); virtual;
  1995.         responds to any cmCancel or mouse button presses by calling Hide.
  1996.     procedure Hide;
  1997.         calls MenuBar to redraw itself.
  1998.     procedure ShowText(AText : Str80);
  1999.         centers AText in the view and calls Draw.
  2000.         AText may contain sections highlighted with  ~'s.
  2001.   end;
  2002.  
  2003.   MessageBar Palette  = CMenuView
  2004.     background drawn in background color of entry 1
  2005.     outline uses background of entry 3
  2006.     normal text uses foreground of entry 4
  2007.     highlighted text uses foreground of entry 6
  2008.  
  2009. ------------------------
  2010.  
  2011.  
  2012. PMultiCheckBoxes = ^TMultiCheckBoxes;
  2013. TMultiCheckBoxes = object(TCluster)      unmodified
  2014.  
  2015.  
  2016. ------------------------
  2017. * = unique to TVGraphic
  2018.  
  2019.   Note on TPanWindow     (Unit GWindow)
  2020.   TPanWindow is a window with a viewable Interior larger than its
  2021.     Size. It is designed to pan (shift) its Interior when
  2022.     the mouse cursor reaches the edges of the screen.
  2023.  
  2024. >   To use Panning
  2025.        {v2.02 significant changes to panning
  2026.               methods SetMode and Mode added,
  2027.               method CurAtEdge details have changed.}
  2028.   In Event loops, pass the event to function CurAtEdge. If it returns
  2029.   true then call ShiftScreen which shifts and redraws the screen.
  2030.   If TPanWindow's Mode = NormalMode {=0} AND CurAtEdge's parameter
  2031.   AllowMenuAccess is true, then window pans automatically
  2032.   at left and right edges but requires mouse click at top and bottom
  2033.   of screen. Otherwise the window pans automatically at all its edges.
  2034.   This allows drawing or dragging with the mouse cursor over the
  2035.   window's entire Interior.
  2036.   Call SetMode(AMode) to change/set the mode. SetMode restricts mouse
  2037.   movement to within Window's boundary if Mode <> NormalMode.
  2038.  
  2039.     The usual way to use this window is to size it to fill the
  2040.     entire DeskTop
  2041.         DeskTop^.GetExtent(Bounds)
  2042.         PanWindow.Init(Bounds,...
  2043.     and then insert other TViews,TGroups,TSubWindows into the window.
  2044.     Nesting of TPanWindows is not defined, but you can insert
  2045.     more than one into the DeskTop. Select with F6 or the window's
  2046.     number button.
  2047.     TPanWindow requires a MenuBar but not a StatusLine.
  2048.     The selected TPanWindow receives evCommand Events from the
  2049.     application's invisible ShiftViewPtr view when ShiftView detects
  2050.     the mouse cursor in the MenuBar or the StatusLine.
  2051.     TPanWindow calls ShiftViewPtr^.HandleEvent to update it when
  2052.     the Interior shifts or the window's State changes.
  2053.     (The ShiftViewPtr view displays messages about panning
  2054.     by calling the MessageBar view. Your application must create
  2055.     a ShiftView and a MessageBar. See TVGDemo1.PAS)
  2056.  
  2057.     Sizing the PanWindow's Interior
  2058.       When the mouse cursor is on a grid greater than one pixel,
  2059.       use the following rules to avoid offset from grid after
  2060.       the window pans:
  2061.         Make the TPanWindow.ScrnShiftSize (set in the constructor)
  2062.         an integral multiple of the mouse cursor grid size.
  2063.         Make the TPanWindow.InteriorSize an integral multiple of the
  2064.         mouse cursor grid size minus 1.  {InteriorSize.x := N*grid -1}
  2065.  
  2066.   Important Note:
  2067.     TVGraphic's boolean   AllowBothMButtons  must be false
  2068.     for TShiftView to operate correctly. See note at TShiftView.
  2069.  
  2070.  
  2071. * PPanWindow = ^TPanWindow;
  2072. * TPanWindow = object(TWindow)
  2073.     InteriorSize : TPoint;     {size of interior in pixels}
  2074.     > now private  Mode : byte;   {initialized to 0 = NormalMode}
  2075.         use function Mode to read, method SetMode to set.
  2076.     ScrnShiftSize : TPoint;    {number of pixels to shift by}
  2077.     constructor Init(var Bounds : TRect; ATitle : TTitleStr;
  2078.         ANumber : integer; TheInteriorSize : TPoint; ThePanSteps : TPoint);
  2079.         calls TWindow.Init, then sets
  2080.           GrowMode := 0;             {Size is fixed}
  2081.           Flags := wfClose;          {window can close, not move}
  2082.           Frame^.VOptions := tfDrawBackground;
  2083.               causes Frame to draw a background for the window
  2084.           InteriorSize := TheInteriorSize;
  2085.               The size of the Interior in pixels
  2086.           ScrnShiftSize := ThePanSteps;
  2087.               The number of pixels to shift by when panning
  2088.           Select top down redraw algorithm
  2089.             DrawFlags := DrawFlags or dfAlternateRedraw;;
  2090.     constructor Load(var S : TStream);
  2091.         loads the view from a stream, then sets dfAlternateRedraw
  2092.         in DrawFlags if LoadVersion = ofVersion10.
  2093. >   function CurAtEdge(Event : TEvent; var Delta : TPoint;
  2094.                       AllowMenuAccess : boolean) : boolean; virtual;
  2095.         Note: function completely rewritten for v2.02.
  2096.         Returns true if Event is a screen shifting event as defined
  2097.         below AND the Interior is able to shift in the indicated
  2098.         direction, otherwise false.
  2099.         Sets Delta with number of pixels to pan by. This will
  2100.         be either the +-X or +-Y value of ScrnShiftSize. (If the
  2101.         Interior is closer than ScrnShiftSize to its edge, Delta
  2102.         will be set with number of pixels needed to pan to the edge.)
  2103.         MouseMove Events
  2104.           If Mode = NormalMode {=0} and AllowMenuAccess is true,
  2105.           then CurAtEdge returns true if mouse cursor is in the window
  2106.           and within one mouse grid division of the left or right edge
  2107.           of the window. If no StatusLine, then true within one mouse
  2108.           grid of bottom also.
  2109.           If Mode <> NormalMode or  AllowMenuAccess is false,
  2110.           then returns true if mouse cursor is inside and within one
  2111.           grid of any edge of the window, or if outside window.
  2112.             Note: A mouse grid may be 1 pixel or larger.
  2113.             Note that the detection point at the right side of the
  2114.             screen is four pixels in for a window that fills the DeskTop.
  2115.         Command Events
  2116.           Responds to commands cmShiftScreenDown and cmShiftScreenUp
  2117.           from the hidden ShiftView in the application.
  2118.           Returns true if screen can shift in direction of
  2119.           the command.
  2120.     procedure GetFullPanSize(var ISize : TPoint); virtual;
  2121.         ISize is set to InteriorSize. Called by Frame to get
  2122.         coords for outline rectangle.
  2123.     procedure HandleEvent(var Event : TEvent); virtual;
  2124.         calls TWindow.HandleEvent and then
  2125.         if Event.What is evMouseMove or evCommand, calls
  2126.           CurAtEdge. If CurAtEdge returns true, then calls
  2127.           ShiftScreen (with value of Delta from CurAtEdge
  2128.           as parameter Shift) to shift the Interior.
  2129.         Handles window commands cmNext and cmPrev.
  2130.             cmNext: SelectNext(False); (same as TV DeskTop)
  2131.             cmPrev: puts current view in front of foremost
  2132.                     non-selectable view. (usually the frame)
  2133.    function Mode : byte;
  2134.         Returns Mode value. Use SetMode to set Mode. NormalMode = 0.
  2135.    procedure SetMode(AMode : byte); virtual;
  2136.         Sets the Mode. SetMode will retrict the mouse cursor
  2137.         to the bounds of the view if Mode <> NormalMode. If called
  2138.         with NormalMode , then restores the mouse travel to full screen.
  2139.     procedure SetState(AState : word; Enable : boolean); virtual;
  2140.         Calls ShiftViewUpDate if AState = sfSelected.
  2141.         Calls TWindow.SetState.
  2142.     procedure SetVOffset(VX,VY : integer); virtual;
  2143.         resets Vx,Vy to be multiples of the current mouse grid,
  2144.         then calls TGroup.SetVOffset.
  2145.     function ShiftScreen(var Event : TEvent;
  2146.                       var Shift : TPoint) : boolean; virtual;
  2147.         Uses Shift to change VOffset by calling SetVOffset.
  2148.         Calls ShiftViewUpdate for vertical shifts.
  2149.         Draws the window with its interior in the new position.
  2150.         Moves the mouse cursor by the amount the Interior has
  2151.         shifted so it will be over the same spot of the Interior.
  2152.         Always returns true.
  2153.     procedure ShiftViewUpdate;
  2154.         Creates a Broadcast Event where Event.Command =
  2155.         cmScreenShifted and calls ShiftViewPtr^.HandleEvent;
  2156.     procedure Store(var S : TStream);
  2157.         stores the view to a stream
  2158.   end;
  2159.  
  2160. ------------------------
  2161. + = emulates TV with exceptions noted
  2162.  
  2163. PgParamText = ^TgParamText                 TV's TParemText
  2164. TgParamText = object(TgStaticText)
  2165.   + constructor Init(var Bounds: TRect; AText: String;
  2166.                      AParamCount: Integer; Opts : byte);
  2167.       Opts: added parameter - see TgStaticText description
  2168.  
  2169.     If Options has ofFramed set, then draws frame around itself.
  2170.   end;
  2171.  
  2172. ------------------------
  2173. * = unique to TVGraphic
  2174. + = emulates TV with exceptions noted
  2175.  
  2176. TProgram = object(TGroup)         ALL methods listed
  2177.   + constructor Init;
  2178.         call order changed,
  2179.           call InitDeskTop after InitStatusLine,InitMenuBar.
  2180.         initialize mouse cursor.
  2181.         set Viewport to size of DeskTop if it exists,
  2182.           otherwise full screen.
  2183.         Select alternative redraw algorithm
  2184.           DrawFlags := dfAlternateRedraw;
  2185.   + destructor Done; virtual;
  2186.         added call to MCur.Done
  2187.     function CanMoveFocus: Boolean;
  2188.     procedure Cascade;                             from TV's TApplication
  2189.     function ExecuteDialog(P: PDialog; Data: Pointer): Word;
  2190.     procedure GetEvent(var Event: TEvent); virtual;
  2191.         If event is Mouse event, update MCur position.
  2192.         If there are no pending,mouse or key events, see if there is
  2193.         a TimerTick event. If so, distribute it by calling HandleEvent,
  2194.         otherwise call Idle.
  2195.     function GetPalette: PPalette; virtual;
  2196.     procedure GetTileRect(var R: TRect); virtual;  from TV's TApplication
  2197.     procedure HandleEvent(var Event: TEvent); virtual;
  2198.     procedure Idle; virtual;
  2199.   + procedure InitDeskTop; virtual;
  2200.         Sizes DeskTop to fill space between the MenuBar and the StatusLine
  2201.         if they exist. Otherwise fills screen.
  2202.         User does not have to have a MenuBar or StatusLine.
  2203.     procedure InitMenuBar; virtual;
  2204.         default menu reminds you to override this method.
  2205.     procedure InitScreen; virtual;
  2206.   + procedure InitStatusLine; virtual;
  2207.         sets vertical size to MenuBoxheight. Usually overridden.
  2208.     function InsertWindow(P: PWindow): PWindow;
  2209.   + procedure OutOfMemory; virtual;
  2210.         calls procedure LowMemMsgBox;   {Out of memory Messagebox}
  2211.     procedure PutEvent(var Event: TEvent); virtual;
  2212.     procedure Run; virtual;
  2213.   * procedure SetPalette(Pal : TPalette);
  2214.        replaces the Application palette (the colors) for the
  2215.        current screen mode (color, black and white) with palette Pal
  2216.   ! procedure SetScreenMode(Mode: Word);
  2217.         set text screen mode - NOT DEFINED in TVGraphic
  2218.     procedure Tile;                                from TV's TApplication
  2219.     function ValidView(P: PView): PView;
  2220.   end;
  2221.  
  2222. ------------------------
  2223.  
  2224. PRadioButtons = ^TRadioButtons;    unmodified
  2225. TRadioButtons = object(TCluster)
  2226.  
  2227. ------------------------
  2228. + = emulates TV with exceptions noted
  2229.  
  2230. TRect
  2231.   + procedure Intersect(R: TRect);
  2232.       adjust to match graphic coord system
  2233.   + function  Empty : boolean;
  2234.       adjust to match graphic coord system
  2235.       Note - a rectangle with all four coords equal is NOT empty
  2236.         in TVGraphic. It is a point.
  2237.       An empty rectangle is not set to all zeros -
  2238.         Always call Empty function to check for empty.
  2239.   + function Contains : boolean;
  2240.       adjust to match graphic coord system
  2241.  
  2242. ------------------------
  2243. * = unique to TVGraphic
  2244. + = emulates TV with exceptions noted
  2245.  
  2246.   NOTE on TScrollBar
  2247.     With v2.02 the scrollbars have changed.
  2248.     They now draw buttons for the indicator and control arrows.
  2249.     All Application palette entries for Scrollbar indicator/arrows
  2250.     have been changed from cyan on blue to black on light gray.
  2251.     Scrollbars can now position the indicator at any point along
  2252.     the bar, rather than only at text coordinates as before.
  2253.  
  2254.     Note: If you have chosen to use a text based (8x14) mouse grid
  2255.     for your DeskTop or Dialogs, you should set the following
  2256.     variable true in your TApplication.Init:
  2257.         AlignVScrollBarsWithGrid : boolean = false;
  2258.     This matches vertical scrollbar indicator travel to a vertical
  2259.     mouse grid of 14 pixels.
  2260.  
  2261.  
  2262. TScrollBar = object(TView)                    ALL methods listed
  2263.     Value: Integer;
  2264.     Min: Integer;
  2265.     Max: Integer;
  2266.     PgStep: Integer;
  2267.     ArStep: Integer;
  2268.   + constructor Init(var Bounds: TRect);
  2269.         If Bounds is wider than it is tall, the scrollbar will be
  2270.         initialized as a Horizontal scrollbar, otherwise as Vertical.
  2271.         The thickness of the scrollbar is set using the constants
  2272.         HScrollBarWidth or VScrollBarWidth  independent of Bounds.
  2273.         The actual thickness of the Scrollbar is the constant plus
  2274.           one pixel.
  2275.         Refer to TV documentation for the rest.
  2276.         VFont is set to Font8x8. Do not change this.
  2277.         OldPos is set to the value of function GetPos.
  2278.         DrawFlags := DrawFlags and not dfPanning;
  2279.   + constructor Load(var S: TStream);
  2280.         OldPos := GetPos;
  2281.         clear dfPanning flag in DrawFlags if LoadVersion = ofVersion10
  2282.     procedure Draw; virtual;     unchanged
  2283.   {* function Exposed : boolean; virtual;
  2284.         v2.02 uses revised TView.Exposed that tests dfPanning flag}
  2285.     function GetPalette: PPalette; virtual;
  2286.   + procedure HandleEvent(var Event: TEvent); virtual;
  2287.         same functionality as TV except forces a redraw
  2288.         after user moves indicator with mouse. This fixes TV bug.
  2289.   {* procedure MakeLocal(Source: TPoint; var Dest: TPoint); virtual;
  2290.         v2.02 uses revised TView.MakeLocal that tests dfPanning flag}
  2291.     procedure ScrollDraw; virtual;
  2292.     function ScrollStep(Part: Integer): Integer; virtual;
  2293.   + procedure SetParams(AValue, AMin, AMax, APgStep, AArStep: Integer);
  2294.         redraws if FullDraw is true, otherwise limits redrawing
  2295.     procedure SetRange(AMin, AMax: Integer);
  2296.   * procedure SetState(AState: Word; Enable: Boolean); virtual;
  2297.         calls TView.SetState and then calls DrawView if AState=sfActive.
  2298.         Note that this means a scrollbar changes its sfActive State
  2299.         independently and DOES NOT require a TScroller or TListViewer
  2300.         view be present.
  2301.     procedure SetStep(APgStep, AArStep: Integer);
  2302.     procedure SetValue(AValue: Integer);
  2303.     procedure Store(var S: TStream);
  2304.   private
  2305.     Chars: TScrollChars;
  2306.   * PartialRedraw, FullDraw : boolean;
  2307.   * OldPos : integer;
  2308.   + procedure DrawPos(Pos: Integer);
  2309.         does the actual drawing, modified for graphics.
  2310.         Draws only the scrollbar background if not Active.
  2311.   + function GetPos: Integer;
  2312.   + function GetSize: Integer;
  2313.   * function IndicatorSize : integer;
  2314.         if vertical bar, returns Indicator height, else Indicator width
  2315.   end;
  2316.  
  2317. + ScrollBar Palette
  2318.     overall background is drawn in background of entry 1
  2319.     indicators and arrows - same as TV
  2320.     outline and shadow of indicator and arrow buttons is fixed.
  2321.  
  2322. ------------------------
  2323. * = unique to TVGraphic
  2324. + = emulates TV with exceptions noted
  2325.  
  2326. TScroller = object(TView)         ALL methods listed
  2327.     HScrollBar: PScrollBar;
  2328.     VScrollBar: PScrollBar;
  2329.     Delta: TPoint;
  2330.     Limit: TPoint;
  2331.   * Spacing : TPoint;  READ only        {new v2.0}
  2332.         contains the number of pixels the view will scroll/step by.
  2333.         Use SetLimit to set this field.
  2334. > * DrawBackgroundByLines : boolean;    {new v2.02}
  2335.         can use in .Draw - see TVGDemo1.  CheckDraw sets false if view
  2336.         has scrolled vertically by more than one step, true otherwise.
  2337.   * PartialRedraw : boolean;
  2338.         can use in .Draw, CheckDraw sets true if view has not scrolled.
  2339.   + constructor Init(var Bounds: TRect;
  2340.                          AHScrollBar, AVScrollBar: PScrollBar);
  2341.         Set Spacing to 1,1 to prevent divide by zero error if SetLimit
  2342.         is not called. Always call SetLimit after construction.
  2343.   + constructor Load(var S: TStream);
  2344.         if LoadVersion >= ofVersion20 then loads Spacing,
  2345.         otherwise sets Spacing to default values
  2346.             Spacing.x := Charlen; Spacing.y := Boxheight;
  2347.   + procedure ChangeBounds(var Bounds: TRect); virtual;
  2348.         does NOT redraw the view
  2349.   > procedure Draw   Defined in descendants of TScroller.
  2350.         See TMyScroller.Draw in main demo program TVGDemo1.Pas.
  2351.     function GetPalette: PPalette; virtual;
  2352.     procedure HandleEvent(var Event: TEvent); virtual;
  2353.   * procedure PartOfSetLimit(X, Y :integer);  virtual;
  2354.         PartOfSetLimit was introduced in v1.5 - user had to override.
  2355.         It is no longer necessary or recommended to override this method.
  2356.         Scroll step size is now set with SetLimit's added parameters
  2357.           XSpacing and YSpacing.
  2358.         Method sets Limit field to X,Y and calls SetParams for vertical
  2359.         and horizontal scrollbars, if present. Uses values stored
  2360.         in Spacing to set scrollbars.
  2361.   + procedure ScrollDraw; virtual;
  2362.         if view has scrolled vertically by more than one line then
  2363.         UpDate(uvDrawView), else UpDate(uvDrawByLines).
  2364.   + procedure ScrollTo(X, Y: Integer);
  2365.      {procedure SetLimit(X, Y: Integer);   TV version}
  2366.   + procedure SetLimit(X, Y: Integer; XSpacing, YSpacing : byte);
  2367.         Sets Spacing.x := XSpacing; Spacing.y := YSpacing;
  2368.         and then calls PartOfSetLimit(X,Y);
  2369.         Call this method before using a TScroller or descendant.
  2370.         For a text based scroller using Font8x14, use constants
  2371.           Charlen and Boxheight for parameters XSpacing,YSpacing.
  2372.   + procedure SetState(AState: Word; Enable: Boolean); virtual;
  2373.         Only calls TView.SetState. Does not have any affect on
  2374.         scrollbars pointed to by fields HScrollBar or VScrollBar.
  2375.         See TVGraphic's TScrollBar.SetState
  2376.   + procedure Store(var S: TStream);
  2377.         also stores Spacing field
  2378.   * procedure Lock;
  2379.         drawing control -   Inc(LockCount);
  2380.   * procedure Unlock;
  2381.         drawing control - decrements LockCount and calls
  2382.         CheckDraw if LockCount = 0.
  2383.   * procedure UpDate(AFlags: Byte);
  2384.         ors AFlags with UpdateFlags. Calls CheckDraw if LockCount = 0.
  2385.   private
  2386.   * LockCount: Byte;
  2387.   * UpdateFlags: Byte;
  2388.     {DrawLock: Byte;      deleted}
  2389.     {DrawFlag: Boolean;   deleted}
  2390.   + procedure CheckDraw;
  2391.        sets/clears DrawBackgroundByLines and PartialRedraw based on
  2392.        UpDateFlags,  calls DrawView then sets UpdateFlags = 0.
  2393.   end;
  2394.  
  2395. ------------------------
  2396. * = unique to TVGraphic
  2397.  
  2398.   TShiftView,  Unit GWindow
  2399.  
  2400.   Special view for sensing mouse position at top edge of the
  2401.   screen and within the StatusLine, if one exists.
  2402.   If mouse cursor enters these areas and the selected window is a
  2403.   TPanWindow whose interior can shift {pan}, then Shiftview uses
  2404.   the MessageBar to display a message about panning to the user.
  2405.   If the right button is clicked in these areas, ShiftView issues
  2406.   commands targeted at TPanWindow.HandleEvent. These commands will
  2407.   cause the TPanWindow's Interior to shift down if cursor is at top
  2408.   of screen or up if cursor is in StatusLine.
  2409.   ShiftView can also respond to arrow keys - see HandleEvent.
  2410.  
  2411.   ShiftView uses the MessageBar to display its messages -
  2412.     so your application must initialize the MessageBar.
  2413.  
  2414.   Important Note: TShiftView needs to respond to right mouse button
  2415.     while the mouse cursor is within the StatusLine. This is not
  2416.     compatible with standard TV behavior which has the StatusLine
  2417.     respond to the right button.
  2418.     TVGraphic's boolean   AllowBothMButtons  (unit GViews) must be false
  2419.     to prevent the StatusLine from responding to the right button.
  2420.     This will also prevent other views from responding to the right
  2421.     button. This is the default behavior in TVGraphic and the Pascal IDE.
  2422.  
  2423.  
  2424. * PShiftView = ^TShiftView;
  2425. * TShiftView = object(TView)
  2426.     ScreenIsShiftedDown : boolean;   read only
  2427.     ScreenIsShiftedUp : boolean;     read only
  2428.     MessageDisplayed : boolean;      read only
  2429.     constructor Init(var Bounds: TRect);
  2430.         calls TView.Init which sets the boolean fields false.
  2431.         then sets EventMask := EventMask or evMouseMove or evBroadcast;
  2432.     procedure HandleEvent(var Event : TEvent); virtual;
  2433.         responds to broadcasts of (Event.Command = cmScreenShifted)
  2434.         by checking the InfoWord. If upper or lower byte = 'T' then
  2435.         sets either ScreenIsShiftedDown,ScreenIsShiftedUp.
  2436.           Behavior below occurs only if screen can shift/pan.
  2437.         MouseEvents
  2438.           evMousemove
  2439.             if cursor is at top of screen or in StatusLine,
  2440.             then displays message
  2441.                'CLICK RIGHT BUTTON TO PAN SCREEN'
  2442.             Clears the message if cursor moves out of these
  2443.             areas.
  2444.           evMouseDown and right button
  2445.             if cursor is at top of screen or in StatusLine,
  2446.             then issues a evCommand event with either
  2447.             Command = cmShiftScreenDown or cmShiftScreenUp
  2448.           evMouseDown and left button
  2449.             clears the pan message.
  2450.         KeyEvents
  2451.            {useful if you remap the arrow keys to mouse cursor movement}
  2452.           evKeyDown
  2453.             if up/down arrow key and cursor at top or in StatusLine
  2454.             then displays message 'PRESS ESC TO PAN SCREEN'.
  2455.             if message is displayed and key is ESC,
  2456.             then issues a evCommand event with either
  2457.             Command = cmShiftScreenDown or cmShiftScreenUp
  2458.         Uses the MessageBar to display its messages.
  2459.     constructor Load(var S : TStream);
  2460.     procedure Store(var S : TStream);
  2461.   end;
  2462.  
  2463. ------------------------
  2464. + = emulates TV with exceptions noted
  2465.  
  2466. TSortedListBox
  2467.   + There is a flag to force a restart of the alphabetical search
  2468.     whenever the view regains the Focus. See GSTDDLG heading.
  2469.  
  2470. ------------------------
  2471. * = unique to TVGraphic
  2472. + = emulates TV with exceptions noted
  2473.  
  2474.   Note on TStaticText
  2475.       For maximum speed and minimum flicker, StaticText
  2476.       does not normally draw its own background in Dialogs (its
  2477.       DrawFlag dfTransparent causes the view under the text to
  2478.       provide the background).
  2479.       It does draw one if its Owner's DrawFlag dfAlternateRedraw
  2480.       is set (DeskTop,TPanWindow, TApplication).
  2481.  
  2482. PgStaticText = ^TgStaticText               TV's TStaticText
  2483. TgStaticText = object(TView)
  2484.   + constructor Init(var Bounds : TRect; AText : String; Opts : byte);
  2485.   *   OPts:  added parameter
  2486.            examples:  Opts := DefaultOpts;  {DefaultOpts matches TV}
  2487.                       Opts := txCentered + txDrawBackground;
  2488.         DefaultOpts -  no options
  2489.         txCentered - if AText will fit (on one line) in the view's Bounds
  2490.                    centers text horizontally in Bounds and then
  2491.                    shrinks Bounds.A.x,Bounds.B.x to just contain AText.
  2492.                    Works with any font.
  2493.         txAdjustSize - if AText will fit (on one line) in the view's Bounds
  2494.                    adjusts Bounds.B.x to just contain AText.
  2495.                    Takes StaticTextOffset into account.
  2496.                    Works with any font.
  2497. >       txDrawBackground - Force view to draw its background.
  2498.                    With v2.02 this flag is not necessary.
  2499.                    StaticText background is drawn automatically if needed.
  2500.                    See "Note on StaticText" above.
  2501.  
  2502.    *  VColor is set to TVColor which causes Draw to use the palette
  2503.           instead of VColor for color slection. To override, after Init
  2504.           set VColor to desired color pair (byte). Format is the same as
  2505.           Application palette entries.
  2506.    *  Font selection - if lower 4 bits of Opts are not 0, then VFont
  2507.           is set to equal to the lower four bits which represent a font
  2508.           number. If 0, then VFont is set to DefaultDialogFont.
  2509.           (Note this precludes your using the BGI DefaultFont which does
  2510.           not clip properly.)
  2511. >  *  DrawFlags := DrawFlags or dfTransparent; set since view does not
  2512.           draw its own background in default redraw algorithm.   v2.02
  2513.  
  2514.       String Formating
  2515.           AText may have the usual embedded formating characters ^M and ^C.
  2516.             ^C centers following text (up to a ^M) in the view.
  2517.             ^M causes following text to start on a new line.
  2518.           The automatic line wrapping at the right side of the view and
  2519.             the ^C centering of text assume the selected text font
  2520.             is 8 pixels wide/character.
  2521.  
  2522.   + procedure Draw; virtual;
  2523.       If multiple lines, view will draw them spaced Boxheight apart.
  2524.       Uses the palette for colors unless VColor is not equal to TVColor.
  2525.         Then uses the color pair in the lower byte of VColor for
  2526.         text color and background.
  2527.       Uses the text font stored in VFont.
  2528.       Uses BYOffset in vertical positioning of text within the view.
  2529.       Background drawing - see "Note on StaticText" above.
  2530. >     Text is indented by StaticTextOffset pixels from left edge of view,
  2531.         value was 4 up to v2.02, 0 for v2.02 and up (matches TurboVision).
  2532.       If Options has ofFramed set, then draws frame around itself.
  2533.       String Formating - see notes under .Init
  2534.   end;
  2535.  
  2536. ------------------------
  2537. * = unique to TVGraphic
  2538.  
  2539.     simple view for .BMP format bitmap      unit GBUT
  2540. * PStaticBitMap = ^TStaticBitMap;
  2541. * TStaticBitMap = object(TView)
  2542.  
  2543.   see file BITMAP.DOC for full detail
  2544.  
  2545. ------------------------
  2546. * = unique to TVGraphic
  2547. + = emulates TV with exceptions noted
  2548.  
  2549. TStatusLine = object(TView)              {TV's StatusLine}
  2550.   + constructor Init(var Bounds: TRect; ADefs: PStatusDef);
  2551.         VFont := DefaultMenuFont;
  2552.     procedure Draw; virtual;             {unmodified - calls DrawSelect}
  2553.   + procedure HandleEvent(var Event: TEvent); virtual;
  2554.          passes right mouse button presses through with no action unless
  2555.            AllowBothMButtons is true. This pass through is required for
  2556.            panning if using a TPanWindow in your program.
  2557.          NOTE: when the StatusLine issues a command Event due to keypresses
  2558.            or mouse buttons, TVGraphic sets the InfoPtr to Ptr(0000,0001)
  2559.            versus TV which sets it to nil.
  2560.            The change enables future implementation of TVGraphic features.
  2561.   private
  2562.   + procedure DrawSelect(Selected: PStatusItem);   {rewritten for graphics}
  2563.   end;
  2564.  
  2565. ------------------------
  2566. * = unique to TVGraphic
  2567. + = emulates TV with exceptions noted
  2568.  
  2569.   TSubWindow,  Unit GWindow
  2570.  
  2571.   TSubWindow is an ordinary window except for its GetPalette function.
  2572.   Use TSubWindow (or a descendant) when inserting a window into another
  2573.   window to get correct drawing colors. TSubWindow will also work in
  2574.   any situation where a regular TWindow works.
  2575.  
  2576.   NOTE: With version 1.5, it is no longer necessary or desirable to
  2577.         override GetPalette if you create a descendent of TSubWindow.
  2578.         Previous overrides should be removed or modified.
  2579.  
  2580. * PSubWindow = ^TSubWindow;     {can be inserted into a window}
  2581. * TSubWindow = object(TWindow)
  2582.     function GetPalette : PPalette; virtual;
  2583.         usual behavior unless window's owner is a TWindow or
  2584.         descendant. This is identified as follows:
  2585.               v1.5: Owner^.VOptions and twIsWindow <> 0
  2586.               v2.0: Owner^.DrawFlags and dfIsWindow <> 0.
  2587.         In these cases, GetPalette returns nil.
  2588.   end;
  2589.  
  2590.  
  2591. ------------------------
  2592. * = unique to TVGraphic
  2593.  
  2594.      toolbar for bitmap buttons (TIconButton)   unit GBUT
  2595. * PToolBar = ^TToolBar;
  2596. * TToolBar = object(TDialog)
  2597.  
  2598.   see file BITMAP.DOC for full detail
  2599.  
  2600. ------------------------
  2601. * = unique to TVGraphic
  2602. + = emulates TV with exceptions noted
  2603.  
  2604.   TUnSortedStringCollection,     unit GObjects.
  2605.   A simple collection of strings using PString pointers.
  2606.   Use function NewStr(AString) to create a string and return
  2607.   a PString pointer. Insert the pointer into the collection.
  2608.   The collection knows how to store, load and dispose of strings.
  2609.  
  2610. * PUnSortedStringCollection = ^TUnSortedStringCollection;
  2611. * TUnSortedStringCollection = object(TCollection)
  2612.     procedure FreeItem(Item : Pointer); virtual;
  2613.         same as TStringCollection
  2614.     function GetItem(var S : TStream) : pointer; virtual;
  2615.         same as TStringCollection
  2616.     procedure PutItem(var S : TStream; Item : pointer); virtual;
  2617.         same as TStringCollection
  2618.   end;
  2619.  
  2620. ------------------------
  2621. * = unique to TVGraphic
  2622. + = emulates TV with exceptions noted
  2623.  
  2624.    see also unit GViews section
  2625.  
  2626. TView = object(TObject)
  2627.   * Hook   : TUserRec;   not used by TVGraphic - use in your program
  2628.   * VColor : word;       color pair(s) if overriding palette selection
  2629.   * VFont    : byte;     for text font storage
  2630.   * VOptions : byte;     TVGraphic options field-bits redefined in each view
  2631.   * VOffset : TPoint;    READ ONLY - use SetVOffset to set
  2632.                            {used to offset the screen across a graphical
  2633.                             view that is larger then the screen.
  2634.                             Used by MakeLocal,MakeGlobal,Exposed}
  2635.   * ZoomLevel : byte;    {reserved by TVGraphic}
  2636.   * DrawFlags : byte;    added v2.0, controls drawing properties of view
  2637.   + constructor TView.Init(var Bounds: TRect);
  2638.         Options := Options or ofVersion20;
  2639.         DrawFlags := dfPanning;
  2640.           indicates view should pan with its Owner's Interior
  2641.   + constructor Load(var S: TStream);
  2642.         loads added fields except DrawFlags
  2643.         sets global variable LoadVersion to (Options or ofVersion).
  2644.           {LoadVersion is referenced by descendant .Loads.}
  2645.         if ofVersion > ofVersion10, then loads DrawFlags
  2646.         else sets   DrawFlags := dfPanning;
  2647.                     Options := Options or ofVersion20;
  2648.   + destructor Done; virtual;
  2649.         disposes of text cursor memory if allocated.
  2650.   * procedure AllocateCursorMemory; virtual;
  2651.         allocates memory for text cursor. Do not call directly.
  2652.   * function BackColor(Color: Word): byte;
  2653.         Expects Color to be a color pair or quad returned by GetColor.
  2654.         returns bits 4-7 of Color in lower 4 bits of the byte.
  2655.         See ForeColor.
  2656. ! + procedure ChangeBounds(var Bounds: TRect); virtual;
  2657.         ChangeBounds does NOT redraw the view. Merely calls SetBounds.
  2658.   + procedure DragView(Event: TEvent; Mode: Byte;
  2659.         var Limits: TRect; MinSize, MaxSize: TPoint);
  2660.         Hide cursor while dragging, calls DrawView after dragging.
  2661.         When using arrow keys to move or change size of view, the size
  2662.         of the move or change is based on size of the current mouse grid.
  2663.   + procedure Draw; virtual;
  2664.         does nothing
  2665.   * procedure DrawCursorNow;
  2666.         rarely needed. forces text cursor to redraw immediately.
  2667.   + procedure DrawView;
  2668.         calls ResetCursor(true) before calling Draw.
  2669.   + function Exposed: Boolean; virtual;
  2670.         made virtual;
  2671.         true if (Owner <> nil) and (sfExposed and sfVisible are set) and
  2672.            Owner^.LockFlag = 0 and
  2673.            intersection of view outline with Owner^.Clip <> empty.
  2674.         {Takes view's dfPanning flag in DrawFlags into account when
  2675.          calculating the intersection with Owner^.Clip}
  2676.   * function ForeColor(Color: Word): byte;
  2677.         Expects Color to be a color pair or quad returned by GetColor.
  2678.         returns bits 0-3 of Color in lower 4 bits of the byte.
  2679.         See BackColor.
  2680.   + procedure GetClipRect(var Clip: TRect);
  2681.         returns Clip in local coordinates, modified to work with VOffset.
  2682.   * procedure GetScreenCoords(var R : TRect);
  2683.         Sets R to the absolute screen coords of the outline of the view.
  2684.             (same coord system as the mouse)
  2685.         Takes VOffset of all Owners in the view chain into account.
  2686.         R.A is upper left corner, R.B is lower right corner.
  2687.         These coords are useful for setting the BGI Viewport to match
  2688.         the outline of the view.
  2689.   * procedure GetVPRelCoords(var R : TRect);
  2690.         Sets R to the outline of the view in ViewPort relative coords.
  2691.            (view's Origin in R.A and its lower right corner in R.B)
  2692.          Example: Passing R obtained with this method to the BGI Rectangle
  2693.          call will draw a rectangle outlining the view. This rectangle
  2694.          will not move on screen as the Viewport's origin moves.
  2695.        ALWAYS IN EVERY DRAW METHOD:  add R.A.x, R.A.y to the view's
  2696.        local x,y coords of every line, circle, text, etc., then pass the
  2697.        sum to the BGI drawingfunction! This is critical since TVGraphic
  2698.        changes theViewport as it redraws.
  2699.        If the Viewport is set to full screen, GetVPRelCoords returns
  2700.        the same values as GetScreenCoords.
  2701.   + procedure HandleEvent(var Event: TEvent);
  2702.         handles evTimerTick to blink the text cursor and controls
  2703.         mouse button behavior. Otherwise same as TV2.0
  2704.     procedure HideCursor;
  2705.         same code as TV but the effect is to erase the blinking
  2706.         cursor And Restore the Background Underneath It.
  2707.         See also ResetCursor.
  2708.   * function HorzTextOffset : integer; virtual;
  2709.         returns 0. Used by ResetCursor to position text cursor.
  2710.         Override in descendants that use the text cursor if view's text
  2711.         is offset horizontally.
  2712.   + procedure Locate(var Bounds: TRect);
  2713.         Changes the bounds of view to Bounds as in TV. Major design
  2714.         changes in way view is redrawn.
  2715.   + procedure MakeGlobal(Source: TPoint; var Dest: TPoint);
  2716.         rewritten, v2.02 modified to ignore Self.VOffset.
  2717.         coordinate transformation Source to Dest.
  2718.         Source should be in view's local coordinate system.
  2719.         Dest is in absolute screen coords (mouse coords).
  2720.         {Takes VOffset of all Owners in the view chain into account
  2721.         unless view's dfPanning flag in DrawFlags is cleared. Then
  2722.         ignores VOffset of direct Owner so Dest (and view) won't pan with
  2723.         Owner's Interior.}
  2724.   * procedure MakeInteriorGlobal(Source: TPoint; var Dest: TPoint);
  2725.         new v2.02 - functions as MakeGlobal did prior to v2.02.
  2726.         Use if view is a descendent of TGroup, you are setting view's
  2727.         VOffset AND you want to transform coordinate points
  2728.         of the view's Interior to absolute screen coords.
  2729.           (If VOffset = 0,0  then local and Interior coords match
  2730.            and procedure gives same results as MakeGlobal.)
  2731.   + procedure MakeLocal(Source: TPoint; var Dest: TPoint); Virtual;
  2732.         rewritten, made virtual;
  2733.         coordinate transformation Source to Dest.
  2734.         Source should be in absolute screen coords (mouse coords).
  2735.         Dest is in coordinate system of view, not of the view's Interior.
  2736.         {Takes VOffset of all Owners in the view chain into account
  2737.         unless view's dfPanning flag in DrawFlags is cleared. Then
  2738.         ignores VOffset of direct Owner so Dest (and view) won't pan with
  2739.         Owner's Interior.}
  2740.   * procedure MakeLocalToInterior(Source: TPoint; var Dest: TPoint);
  2741.         new v2.02
  2742.         Use if view is a descendent of TGroup, you are setting view's
  2743.         VOffset AND you want to transform absolute screen coords to
  2744.         coordinate points of the view's Interior.
  2745.           (If VOffset = 0,0  then local and Interior coords match
  2746.             and procedure gives same results as MakeLocal.)
  2747.   + function MouseInView(Mouse: TPoint): Boolean; virtual;
  2748.         made virtual;
  2749.   + procedure PutInFrontOf(Target: PView);
  2750.         rewritten to work with graphic drawing
  2751.   * procedure ResetCursor(EraseIt : boolean); virtual;
  2752.        {TV private method, made public and virtual.
  2753.         Parameter EraseIt added in ver 1.5.
  2754.         Prior to ver1.5, method performed no action in TVGraphic.}
  2755.  
  2756.         Erases and Draws standard TV/TVGraphic blinking text cursor.
  2757.  
  2758.         NOTE - Text Cursor will not draw unless view's EventMask
  2759.                includes evTimerTick.
  2760.  
  2761.         You do not need to call this method except in case discussed next:
  2762.           IMPORTANT - if the cursor is visible and you are about to redraw
  2763.           your view so the background under the cursor will be different,
  2764.           AND you are not calling DrawView to redraw,
  2765.           then call ResetCursor(True) or SetCursor just before drawing.
  2766.           This will erase the cursor at its present location and
  2767.           cause it to save the background under itself when it draws next.
  2768.           (It will draw at the next evTimerTick event if the view
  2769.           is focused.)
  2770.  
  2771.         calls new virtual functions VertTextOffset and VertTextSpacing
  2772.           to know how to position cursor vertically on screen.
  2773.         calls new HorzTextOffset to help position itself horizontally.
  2774.         Looks at the font name stored in VFont to determine the
  2775.           vertical and horizontal size of the font you are using.
  2776.         Will not work with proportional fonts.
  2777.   + procedure SetCursor(X, Y: Integer);
  2778.         Erases the blinking cursor at the current location (if visible)
  2779.           by calling ResetCursor(true).
  2780.         Sets the Cursor field (cursor position) to X,Y.
  2781.         See notes under ResetCursor.
  2782.   + procedure SetState(AState: Word; Enable: Boolean); virtual;
  2783.         calls when AState = sfVisible to ResetCurrent are modified
  2784.         to work in graphics mode. Does not respond to sfShadow.
  2785.   * procedure SetViewPortToView(var SavedVP : ViewPortType);
  2786.         USE Only with views in the DeskTop.
  2787.         returns current Viewport values in SavedVP, then resets Viewport
  2788.         to cover the intersection of this view and the current Viewport.
  2789.   + procedure Store(var S: TStream);
  2790.         stores added fields
  2791.   * function  UserHook(var P : Pointer;var Hk : TUserRec):boolean; virtual;
  2792.         provided for TVGraphic users to override in descendents.
  2793.         TView version returns false and does not change its parameters.
  2794.   * function VertTextOffset : integer; virtual;
  2795.         Used by ResetCursor to position text cursor.
  2796.         Temporarily sets BGI TextStyle to font stored in field VFont,
  2797.           calls CalcVertTextOffset(VertTextSpacing) to find value to
  2798.           return, and restores previous font.
  2799.         For font8x8 and font8x14 used with VertTextSpacing = Boxheight,
  2800.           VertTextOffset returns the same value as global ByOffset.
  2801.         Override if you need a different vertical offset for the cursor.
  2802.   * function VertTextSpacing : integer; virtual;
  2803.         returns constant Boxheight.
  2804.         Used by ResetCursor to position text cursor.
  2805.         Override if your view's vertical text spacing differs from
  2806.         Boxheight and you want cursor to match.
  2807.   *Following text based methods are not present in TVGraphic:
  2808.       procedure WriteBuf(X, Y, W, H: Integer; var Buf);
  2809.       procedure WriteChar(X, Y: Integer; C: Char; Color: Byte;
  2810.                              Count: Integer);
  2811.       procedure WriteLine(X, Y, W, H: Integer; var Buf);
  2812.       procedure WriteStr(X, Y: Integer; Str: String; Color: Byte);
  2813.   private
  2814.     All the private methods concern drawing and are modified or
  2815.     rewritten for graphic mode.
  2816.  
  2817.     made public - procedure ResetCursor;
  2818.   end;
  2819.  
  2820. ------------------------
  2821. * = unique to TVGraphic
  2822.  
  2823.   TWinBackground,  Unit GWindow
  2824.  
  2825.   TWinBackground is a simple view for providing a background
  2826.   in a window. It will work with or without a Frame in the window.
  2827.  
  2828. * PWinBackground = ^TWinBackground;
  2829. * TWinBackground = object(TView)
  2830.     constructor Init(var Bounds: TRect);
  2831.         calls TView.Init, then sets
  2832.           GrowMode := gfGrowHiX + gfGrowHiY;
  2833.           EventMask := 0;
  2834.           VColor := TVColor;
  2835.           DrawFlags := DrawFlags and not dfPanning;
  2836.     procedure Draw; virtual;
  2837.           clears dfPanning DrawFlag.
  2838.         fills view with solid color.
  2839.         If VColor = TVColor, then color from palette will match
  2840.         the color that TFrame will use (if one is present) for
  2841.         its background. Otherwise will use VColor as background color.
  2842.   end;
  2843.  
  2844. ------------------------
  2845. * = unique to TVGraphic
  2846. + = emulates TV with exceptions noted
  2847.  
  2848. TWindow = object(TGroup)            ALL Methods listed
  2849.     Flags: Byte;
  2850.     ZoomRect: TRect;
  2851.     Number: Integer;
  2852.     Palette: Integer;
  2853.     Frame: PFrame;
  2854.     Title: PString;
  2855.   * Menu : PView;       Pointer to pull down window menu, nil if none.
  2856.   + constructor Init(var Bounds: TRect;
  2857.                      ATitle: TTitleStr; ANumber: Integer);
  2858.         sfShadow flag in State is not set.
  2859.         {VOptions := twIsWindow;     with v2.0, no longer set}
  2860.         DrawFlags := DrawFlags or dfIsWindow;   indicates it is a Window
  2861.   + constructor Load(var S: TStream);
  2862.         if LoadVersion >= ofVersion20 then
  2863.           load popup menu if one exists.
  2864.         else
  2865.           VOptions := 0
  2866.           DrawFlags := DrawFlags or dfIsWindow;
  2867.   + destructor Done; virtual;
  2868.         if Menu <> nil then Dispose(Menu, Done);
  2869.     procedure Close; virtual;
  2870.   * procedure Draw;  virtual;
  2871.         Hides and locks the mouse cursor.
  2872.         Sets Viewport to the intersection of Viewport and the window
  2873.         outline. Calls TFrame.Draw if dragging, otherwise TGroup.Draw.
  2874.         Restores the Viewport to previous size and unlocks the mouse
  2875.         cursor.
  2876.   * procedure DrawWindow;
  2877.         Alternative to DrawView. For special case.
  2878.         Causes correct redrawing of the window even when
  2879.         partially covered by other windows.
  2880.         (The overlapping windows must have the same Owner.)
  2881.         Use when you want to redraw a subview of a de-selected
  2882.         window that may be partially covered by other windows.
  2883.         Note: Very few applications change the contents of a
  2884.               de-selected window.
  2885.   * procedure GetMaxSubViewSize(var R: TRect;
  2886.                                 MarginsForText: boolean); virtual;
  2887.         {was GetInteriorSize prior to ver1.5, MarginsForText added v2.0.}
  2888.         if Frame <> nil then
  2889.             calls Frame^.GetInteriorSize(R, MarginsForText),
  2890.           otherwise calls GetExtent(R) and then shrinks R by one
  2891.           pixel on all four sides to allow for an outline rectangle
  2892.           for the window.
  2893.         MarginsForText: in general set true if you are filling R with
  2894.           a single view displaying text up to its border (scroller,
  2895.           editor, etc.), false for graphics. See TFrame.GetInteriorSize.
  2896.     function GetPalette: PPalette; virtual;
  2897.     function GetTitle(MaxSize: Integer): TTitleStr; virtual;
  2898.   + procedure HandleEvent(var Event: TEvent); virtual;
  2899.         if (Event.What = evKeyDown) and (Menu <> nil)
  2900.           and (Event.KeyCode = kbAltSpace) then displays pulldown menu.
  2901.           PutEvents the command returned by the menu if it is not 0.
  2902.         if broadcast of cmCommandSetChanged occurs, passes it to
  2903.           Menu^.HandleEvent.
  2904.         cmClose, cmZoom - checks if Event.InfoPtr is nil, @Self
  2905.           or Ptr(0000,0001) which indicates sender was the
  2906.           TVGraphic StatusLine.
  2907.     procedure InitFrame; virtual;
  2908.   + procedure SetState(AState: Word; Enable: Boolean); virtual;
  2909.         rewritten for nested windows. Same behavior as TV except:
  2910.         No action if AState = sfActive.
  2911.         If AState = sfSelected, sets its own and its subview's
  2912.         sfActive bits to match window's sfSelected bit.
  2913.     procedure SizeLimits(var Min, Max: TPoint); virtual;
  2914.   + function StandardScrollBar(AOptions: Word): PScrollBar;
  2915.         Complete description:
  2916.         If the window has a Frame then the Frame's VOptions field
  2917.           is set with tfVScrollBar or tfHScrollBar depending on
  2918.           (AOptions and sbVertical).
  2919.         Next the scrollbar is sized and its width is set using constants
  2920.           HScrollBarWidth or VScrollBarWidth.
  2921.     GetExtent(R);
  2922.     if AOptions and sbVertical = 0 then
  2923.       R.Assign(R.A.X + FrameInset+1, R.B.Y-FrameInset-HScrollBarWidth,
  2924.                R.B.X-2*Charlen+FrameInset+1, R.B.Y-FrameInset)
  2925.     else
  2926.       R.Assign(R.B.X-FrameInset-VScrollBarWidth,R.A.Y+Boxheight,
  2927.                R.B.X-FrameInset,R.B.Y-Boxheight);
  2928.         A new scrollbar is created and inserted into the window.
  2929.         If AOptions includes sbHandleKeyboard, the scrollbar Options are
  2930.         set to include ofPostProcess.
  2931.         Finally a pointer to the scrollbar is returned as the value
  2932.         of StandardScrollBar.
  2933.   + procedure Store(var S: TStream);
  2934.         stores the menu to the stream with S.Put(Menu);
  2935.     procedure Zoom; virtual;
  2936.   end;
  2937.  
  2938. + Window Palettes
  2939.     Window palettes are extended to duplicate the dialog palettes
  2940.       with the menu palette added to the very end.
  2941.     (CxDialog has changed from version 1.5.)
  2942.  
  2943.     CxDialog =                       #9#10#11#12#13#14#15+
  2944.          #16#17#18#19#20#21#22#23#24#25#26#27#28#29#30#31+
  2945.          #32#33#34#35#36#37#38#39#40#41#42#43#44#45#46#47+
  2946.          #48#49#50#51#52#53#54#55#56#57#58#59#60#61#62#63+
  2947.          #64#65#66#67#68#69#70#71#72#73#74#75#76#77#78#79+
  2948.          #80#81#82#83#84#85#86#87#88#89#90#91#92#93#94#95+
  2949.          #96#97#98#99#100#101#102#103#104#105#106#107#108#109#110#111+
  2950.          #112#113#114#115#116#117#118#119#120#121#122#123#124#125#126#127+
  2951.          #2#3#4#5#6#7;   {CMenuView   = #2#3#4#5#6#7;}
  2952.  
  2953.     CBlueWindow = #8#9#10#11#12#13#14#15 + CxDialog;
  2954.     CCyanWindow = #16#17#18#19#20#21#22#23 + CxDialog;
  2955.     CGrayWindow = #24#25#26#27#28#29#30#31  + CxDialog;
  2956.  
  2957.  
  2958. ------------------------
  2959.  
  2960.   END OF FILE.
  2961.