properties and functions of THexToCanvas, a hex drawing/printing addon to THexEditor for delphi 3/4
(C) 1998-1999 Markus Stephany, mirbir.st@t-online.de

latest changes : V1.0 Beta 3 : jan 03 1999

  public

    function Draw ( aCanvas : TCanvas ; const aStart , aEnd : Integer ;
                    const TopLine , BottomLine : string ) : Integer;

             draws data of the assigned THexEditor to the given canvas aCanvas
             from position aStart up to aEnd , if TopLine and BottomLine <> '',
             then draw them to the top/bottom of the canvas (like "Page x"),
             the char field will show the chars in HexEditor's Translation mode


    procedure GetLayout;

              retrieves some layout information from the assigned THexEditor:
              Font , BytesPerColumn, OffsetSeparator, OffsetDisplay, BytesPerLine, SwapNibbles
              MemoryDisplay := odHex
              MemorySeparator := ' '
              CharDisplay := True
              CharSeparator := #0


    property TopMargin : Integer r/w

             Top position for start drawing on aCanvas in Draw


    property LeftMargin : Integer r/w

             Left position for start drawing on aCanvas in Draw


    property RightMargin : Integer r/w

             Right position for end drawing on aCanvas in Draw


    property BottomMargin : Integer r/w

             Bottom position for end drawing on aCanvas in Draw


    property LinesPerPage : Integer r

             returns number of lines after Draw has been called ( e.g. for calculating page numbers )
             !not implemented yet!


  published

    property HexEditor : THexEditor r/w

             to assign a THexEditor component to THexToCanvas


    property Font : TFont r/w

             the font that will be used while drawing, currently only one font and one color
             are implemented


    property BytesPerLine : Integer r/w

             how many bytes of data each line will display


    property OffsetDisplay : TOffsetDisplayStyle r/w

             how the offset ( data position per line ) will be displayed
             odHex : in hex format ( 64738 -> '0xFCE2' )
             odDec : in decimal format ( 64738 -> '64738' )
             odOctal : in octal format ( 64738 -> 'o 0176342' )
             odNone : no offset will b drawn


    property OffsetSeparator : Char r/w

             how the offset field will be separated from the hex field
             (':' -> '0x0000:22 33 44' )


    property MemFieldDisplay : TOffsetDisplayStyle r/w

             the memory field's layout :
             odHex : in hex format ( 15 -> '0F' )
             odDec : in decimal format ( 15 -> '015' )
             odHex : in octal format ( 15 -> '017' )
             odNone : no hex values will be drawn


    property MemFieldSeparator : Char r/w

             the separator char between hex and char field
             (';' -> "...ff 55 ;blabla..." )


    property DisplayCharField : Boolean r/w

             if true, all data will be drawn as Chars (if possible, else '.' ) to the right of the hex field


    property CharFieldSeparator : Char r/w

             if <> #0, this char will be drawn to each line's end


    property ShrinkToFit : Boolean r/w

             if true, reduce the font's size to fit the line to the range LeftMargin -> RightMargin


    property StretchToFit : Boolean r/w

             if true, increment the font's size to fit each line to the range LeftMargin -> RightMargin


    property BytesPerColumn : Integer r/w

             how many bytes build one column in the hex field
             ( 2 -> "2233 4455..." )
             ( 1 -> "22 33 44 55..." )

  // new for V1.0 Beta 2

    property SwapNibbles: Boolean r/w

             if true the Byte value 160dec will be displayed in hex field as "0A" rather than "A0"

 // new for V1.0 Beta 3

    the option odOctal has been added to OffsetDisplay and MemFieldDisplay
    to display numbers in octal system
