XbrHexEdit( "hilight"-Bar ?

XbrHexEdit( "hilight"-Bar ?

Postby Jimmy » Sun Apr 09, 2023 5:06 am

hi,

i have mage a copy of XbrHexEdit() for "Dark-Mode"

as you can see i got "just" a "Frame" but no "hilight"-Bar
Image
what Codeblock have to be "fill" :?:
Code: Select all  Expand view
  DEFINE DIALOG oDlg SIZE 990, 600 PIXEL FONT oFont TITLE cTitle COLOR BFcolor, BGcolor ;
         STYLE nOR( DS_MODALFRAME, WS_POPUP, WS_CAPTION, WS_SYSMENU, WS_MAXIMIZEBOX, WS_MINIMIZEBOX, WS_THICKFRAME )

      @ 30, 10 XBROWSE oBrw SIZE - 10, - 30 PIXEL OF oDlg DATASOURCE {} NOBORDER FOOTERS COLOR BFcolor, BGcolor FONT oFont

      ADD TO oBrw DATA RangeRepl( CHR( 0 ), CHR( 31 ), SUBSTR( cTmp, oBrw:nArrayAt * 16 - 15, 16 ), '.' ) ;
                                  HEADER "Text" SIZE 210

      ADD TO oBrw DATA STRTOHEX( SUBSTR( cTmp, oBrw:nArrayAt * 16 - 15, 16 ) ) ;
                                 HEADER "HexChar" PICTURE "@R" + REPLICATE( " !!", 16 ) SIZE 580

      oBrw:SetColor( BFcolor, BGcolor )
      IF BGcolor = Rgb( 0, 0, 1 )
         oBrw:SetStyle( - 2 )   // Dark-Mode
      ENDIF

      // WITH OBJECT oBrw
      oBrw:bSeek := { | c, nAt | IF( EMPTY( c ), nAt := 1, nAt := AT( UPPER( c ), cUpper ) ), ;
                      IF( nAt > 0, oBrw:nArrayAt := INT( nAt / 16 ) + 1, nil ), ;
                      nAt > 0 }
      oBrw:bKeyCount := { || nLines }
      oBrw:nHeadStrAligns := AL_CENTER
      oBrw:nColDividerStyle := 1
      oBrw:nStretchCol := 1

      oBrw:bClrStd := { || { BFcolor, BGcolor } }
      oBrw:bClrSel := { || { BFcolor, BGcolor } }
      oBrw:bClrHeader := { || { BFcolor, BGcolor } }
      oBrw:bClrFooter := { || { BFcolor, BGcolor } }
// is this for "hilight"-Bar ?
      oBrw:bClrSelFocus := {|| { CLR_WHITE, GetSysColor( COLOR_MENUHILIGHT )} }

      oBrw:bRecSelHeader := { || "LineHex" }
      oBrw:bRecSelData := { | o | NUMTOHEX( o:nArrayAt, 8 ) }
      oBrw:bRecSelFooter := { | o | NUMTOHEX( o:nLen, 8 ) }
      oBrw:nRecSelWidth := "BBBBBBBBB"

      //    WITH OBJECT :aCols[ 2 ]
      oBrw:aCols[ 2 ] :nEditType := IF( lReadOnly, EDIT_NONE, EDIT_GET )
      oBrw:aCols[ 2 ] :bEditValid := { | o | LEN( HEXTOSTR( CharRem( ' ', o:VarGet() ) ) ) == 16 }
      oBrw:aCols[ 2 ] :bClrEdit := { || { CLR_BLACK, CLR_YELLOW } }
      oBrw:aCols[ 2 ] :bOnPostEdit := { | o, x, n | IF( n == VK_ESCAPE, nil, ( ;
              x := HEXTOSTR( CharRem( ' ', x ) ), ;
              IF( x == o:Value, nil, ( cTmp := ;
              LEFT( cTmp, oBrw:nArrayAt * 16 - 16 ) + ;
              x + SUBSTR( cTmp, oBrw:nArrayAt * 16 + 1 ), ;
              oDlg:AEvalWhen() ) ;
              ) ) ) }

      //    END
      //
      oBrw:CreateFromCode()
      // END

p.s. have not used WITH OBJECT as my "click" does not know how to "format" it (yet)
greeting,
Jimmy
User avatar
Jimmy
 
Posts: 1725
Joined: Thu Sep 05, 2019 5:32 am
Location: Hamburg, Germany

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 103 guests