Page 1 of 1

xbrowse cell on two sections

Posted: Thu Oct 31, 2024 10:51 am
by Silvio.Falconi
I have this xbrowse

Image

these two columns are related to the number and late extractions (red color)

I would like to change the layout in this way: above the number and below in the same cell the late extractions

Image

will it be possible with xbrowse?

Re: xbrowse cell on two sections

Posted: Thu Oct 31, 2024 1:37 pm
by nageswaragunupudi

Code: Select all | Expand

#include "fivewin.ch"

function Main()

   local aData := { ;
      { "Bari", 43, 103, 11, 69 }, ;
      { "Roma", 53, 117, 21, 57 }, ;
      { "Toino", 70, 60, 55, 34 }, ;
      { "", 0, 0, 0, 0 } }

   XBROWSER aData SETUP TITLE "SetColsAsRows" xSetUp( oBrw )

return nil

function xSetUp( oBrw )

   local n

   oBrw:cHeaders := { "Name", "Num/Rit", "Rit", "Num/Rit", "Rit" }
   AEval( oBrw:aCols, { |oCol,i| If( i % 2 = 0, ;
      oCol:bClrStd := oCol:bClrSelFocus := { || { CLR_WHITE, CLR_HRED } }, nil ) } )
   oBrw:aCols[ 2 ]:SetColsAsRows( 2, 3 )
   oBrw:aCols[ 4 ]:SetColsAsRows( 4, 5 )

return nil
Image

Re: xbrowse cell on two sections

Posted: Thu Oct 31, 2024 5:25 pm
by Silvio.Falconi
nageswaragunupudi wrote:

Code: Select all | Expand

#include "fivewin.ch"

function Main()

   local aData := { ;
      { "Bari", 43, 103, 11, 69 }, ;
      { "Roma", 53, 117, 21, 57 }, ;
      { "Toino", 70, 60, 55, 34 }, ;
      { "", 0, 0, 0, 0 } }

   XBROWSER aData SETUP TITLE "SetColsAsRows" xSetUp( oBrw )

return nil

function xSetUp( oBrw )

   local n

   oBrw:cHeaders := { "Name", "Num/Rit", "Rit", "Num/Rit", "Rit" }
   AEval( oBrw:aCols, { |oCol,i| If( i % 2 = 0, ;
      oCol:bClrStd := oCol:bClrSelFocus := { || { CLR_WHITE, CLR_HRED } }, nil ) } )
   oBrw:aCols[ 2 ]:SetColsAsRows( 2, 3 )
   oBrw:aCols[ 4 ]:SetColsAsRows( 4, 5 )

return nil
Image

Nice job , i go to test it

Re: xbrowse cell on two sections

Posted: Thu Oct 31, 2024 7:56 pm
by Silvio.Falconi
nageswaragunupudi wrote:

Code: Select all | Expand

#include "fivewin.ch"

function Main()

   local aData := { ;
      { "Bari", 43, 103, 11, 69 }, ;
      { "Roma", 53, 117, 21, 57 }, ;
      { "Toino", 70, 60, 55, 34 }, ;
      { "", 0, 0, 0, 0 } }

   XBROWSER aData SETUP TITLE "SetColsAsRows" xSetUp( oBrw )

return nil

function xSetUp( oBrw )

   local n

   oBrw:cHeaders := { "Name", "Num/Rit", "Rit", "Num/Rit", "Rit" }
   AEval( oBrw:aCols, { |oCol,i| If( i % 2 = 0, ;
      oCol:bClrStd := oCol:bClrSelFocus := { || { CLR_WHITE, CLR_HRED } }, nil ) } )
   oBrw:aCols[ 2 ]:SetColsAsRows( 2, 3 )
   oBrw:aCols[ 4 ]:SetColsAsRows( 4, 5 )

return nil
Image

Nages ,
I have adata array differently and I was not able to set it as you wrote to me

Image


the first number is the number and the second number is the delay

on old procedure I set


ADD COLUMN TO oBrw HEADER "Ruota" DATA {|v,oCol| oCol:oBrw:aArrayData[oCol:oBrw:nArrayAt,1] } CENTER
ADD COLUMN TO oBrw HEADER "Num" DATA {|v,oCol| oCol:oBrw:aArrayData[oCol:oBrw:nArrayAt,2,1] } CENTER
ADD COLUMN TO oBrw HEADER "Rit" DATA {|v,oCol| oCol:oBrw:aArrayData[oCol:oBrw:nArrayAt,2,2] } CENTER

until

ADD COLUMN TO oBrw HEADER "Num" DATA {|v,oCol| oCol:oBrw:aArrayData[oCol:oBrw:nArrayAt,11,1] } CENTER
ADD COLUMN TO oBrw HEADER "Rit" DATA {|v,oCol| oCol:oBrw:aArrayData[oCol:oBrw:nArrayAt,11,2] } CENTER

then I make set SetGroupHeader

Code: Select all | Expand

:SetGroupHeader( "1",        2,  3 )
      :SetGroupHeader( "2",        4,  5 )
      :SetGroupHeader( "3",        6,  7 )
      :SetGroupHeader( "4",        8,  9 )
      :SetGroupHeader( "5",        10,  11 )
      :SetGroupHeader( "6",        12,  13 )
      :SetGroupHeader( "7",        14,  15 )
      :SetGroupHeader( "8",        16,  17 )
      :SetGroupHeader( "9",        18,  19 )
      :SetGroupHeader( "10",        20,  21 )

Re: xbrowse cell on two sections

Posted: Thu Oct 31, 2024 8:22 pm
by Silvio.Falconi
there is an error

Image

the last 5 headers are bad

I made

Code: Select all | Expand

AEval( oBrw:aCols, { |oCol,i| If( i % 2 = 0, ;
      oCol:bClrStd := oCol:bClrSelFocus := { || {CLR_WHITE,CLR_HRED } }, nil ) } )


      :cHeaders := { "Name", "Num/Rit", "Num/Rit", "Num/Rit",;
                             "Num/Rit","Num/Rit", "Num/Rit",;
                             "Num/Rit", "Num/Rit","Num/Rit", "Num/Rit" }

      :aCols[ 1 ]:nWidth   := 130
      :aCols[ 1 ]:nDataStrAlign   := AL_LEFT
      :aCols[ 2 ]:SetColsAsRows( 2, 3 )
      :aCols[ 4 ]:SetColsAsRows( 4, 5 )
      :aCols[ 6 ]:SetColsAsRows( 6, 7 )
      :aCols[ 8 ]:SetColsAsRows( 8, 9 )
      :aCols[ 10 ]:SetColsAsRows( 10, 11 )
      :aCols[ 12 ]:SetColsAsRows( 12, 13 )
      :aCols[ 14 ]:SetColsAsRows( 14, 15 )
      :aCols[ 16 ]:SetColsAsRows( 16, 17 )
      :aCols[ 18 ]:SetColsAsRows( 18, 19 )
      :aCols[ 20 ]:SetColsAsRows( 20, 21 )

Re: xbrowse cell on two sections

Posted: Thu Oct 31, 2024 8:39 pm
by Silvio.Falconi
Perhaps...

Image

why the line (red) is more big than line of numbers ?

I made

Code: Select all | Expand

FOR i := 1 TO LEN(:aCols)
        oCol := :aCols[ i ]
        if i >1  .and. hb_bitand(i,1)>0
         oCol:bClrStd := {|| { CLR_WHITE, RGB(255,0,0) } }
         oCol:bClrSelFocus := {|| { CLR_BLACK, { { 1, RGB( 252, 235, 220  ), RGB( 255, 0,0  ) } }}}
        endif
      NEXT

:cHeaders := { "Ruote", "Num/Rit", "Num/Rit", "Num/Rit",;
                             "Num/Rit", "Num/Rit", "Num/Rit",;
                             "Num/Rit", "Num/Rit", "Num/Rit",;
                             "Num/Rit", "Num/Rit", "Num/Rit",;
                             "Num/Rit", "Num/Rit", "Num/Rit","Num/Rit",;
                             "Num/Rit", "Num/Rit", "Num/Rit","Num/Rit"  }


      :aCols[ 1 ]:nWidth   := 130
      :aCols[ 1 ]:nDataStrAlign   := AL_LEFT
      :aCols[ 2 ]:SetColsAsRows( 2, 3 )
      :aCols[ 4 ]:SetColsAsRows( 4, 5 )
      :aCols[ 6 ]:SetColsAsRows( 6, 7 )
      :aCols[ 8 ]:SetColsAsRows( 8, 9 )
      :aCols[ 10 ]:SetColsAsRows( 10, 11 )
      :aCols[ 12 ]:SetColsAsRows( 12, 13 )
      :aCols[ 14 ]:SetColsAsRows( 14, 15 )
      :aCols[ 16 ]:SetColsAsRows( 16, 17 )
      :aCols[ 18 ]:SetColsAsRows( 18, 19 )
      :aCols[ 20 ]:SetColsAsRows( 20, 21 )





 

Re: xbrowse cell on two sections

Posted: Thu Nov 14, 2024 9:37 am
by Silvio.Falconi
nageswaragunupudi wrote:

Code: Select all | Expand

#include "fivewin.ch"

function Main()

   local aData := { ;
      { "Bari", 43, 103, 11, 69 }, ;
      { "Roma", 53, 117, 21, 57 }, ;
      { "Toino", 70, 60, 55, 34 }, ;
      { "", 0, 0, 0, 0 } }

   XBROWSER aData SETUP TITLE "SetColsAsRows" xSetUp( oBrw )

return nil

function xSetUp( oBrw )

   local n

   oBrw:cHeaders := { "Name", "Num/Rit", "Rit", "Num/Rit", "Rit" }
   AEval( oBrw:aCols, { |oCol,i| If( i % 2 = 0, ;
      oCol:bClrStd := oCol:bClrSelFocus := { || { CLR_WHITE, CLR_HRED } }, nil ) } )
   oBrw:aCols[ 2 ]:SetColsAsRows( 2, 3 )
   oBrw:aCols[ 4 ]:SetColsAsRows( 4, 5 )

return nil
Image

Nages,
I made this

Image

But I need a feature

when the number below goes over 100 I would like it like this

Image

when instead the number below does not exceed 100 I would like it this way

Image


I made oCol:bClrStd := {|i| { RGB( 255, 0,0 ),IF (oBrw:aCols[ i ]:Value >100, CLR_BLUE,CLR_WHITE) } }
but make error

Re: xbrowse cell on two sections

Posted: Fri Nov 15, 2024 9:41 am
by Silvio.Falconi
corrected

oCol:bClrStd := {|oCol,i| { RGB( 255, 0,0 ),IF (val(i:Value) >=100, CLR_BLUE,CLR_WHITE) } }


Image


How can I outline each square, that is, put a space on the side and below each square?