Page 1 of 1

To Mr Nages : change bClrStd on line

PostPosted: Wed May 18, 2011 7:19 pm
by Silvio
can I change the status of :bClrStd on line and refresh the browse ?

I made :

@ 170, 5 CHECKBOX lpijama Prompt "Pijama effect" SIZE 80, 10 PIXEL OF oDlg ;
ON CHANGE;
( IIF( lpijama ,oBrowse:bClrStd := { || { CLR_BLACK, If(oBrowse:KeyNo % 2 == 0, RGB(193,221,255), RGB(221,245,255) ) } } ,;
oBrowse:bClrStd := {|| { CLR_BLACK, GetSysColor( COLOR_WINDOW )} }),;
oBrowse:refresh())


but when I clickthe checkbox it not change , I must close the oBrowse and reopen it ( I saved the config to an ini file)

I can change the line vertical and horizontal, put also the RecordSelector on line but Inot Know how show the pijama effect on line ....






Can help me please ?

Re: To Mr Nages : change bClrStd on line

PostPosted: Wed May 18, 2011 8:34 pm
by Silvio
SORRY i RESOLVED !!!!!

Re: To Mr Nages : change bClrStd on line

PostPosted: Thu May 19, 2011 5:08 am
by nageswaragunupudi
Instead of :
oBrowse:bClrStd := { || ..}
substitute
oBrowse:bClrStds := { || ... }

Re: To Mr Nages : change bClrStd on line

PostPosted: Thu May 19, 2011 10:06 am
by Silvio
thanks
is it a new command ?

Re: To Mr Nages : change bClrStd on line

PostPosted: Thu May 19, 2011 10:17 am
by nageswaragunupudi
oBrw:bClrStds := <bBlock>
is a shortcut for
AEval( oBrw:aCols { |o| o:bClrStd := <bBlock> } )

Generic form is

oBrw:<anyColumnData>S := <u> // see the last "s" which indicates plural number
is a shortcut for
AEval( oBrw:aCols, { |o| o:<anyColumnData> := <u> } )

Also

oBrw:<anyColumnData>s := <aData>
will assign elements of aData to each column of oBrw:<anyColumnData> in the order of the columns' creation orders.

Also
aValues := oBrw:<anyColumnData>s
returns an array of the data of each column.

Examples:

aWidths := oBrw:nWidths // { 30, 40, 50, .... }

Re: To Mr Nages : change bClrStd on line

PostPosted: Thu May 19, 2011 3:32 pm
by Silvio
Mr Rao,
I'm afraid I have an old xbrowse version because I not found bClrStds command on my source

Re: To Mr Nages : change bClrStd on line

PostPosted: Thu May 19, 2011 4:05 pm
by nageswaragunupudi
This works from 10.8 onwards.
You will not find any data like bClrStds or nWidths in the class. But xbrowse interprets this inside its logic.

Here is whatsnew.txt for 10.8
* xbrowse: Improvement: It is now possible to assign data of all columns in one single statement.
Example: oBrw:nHeadStrAligns := AL_CENTER is equivalent to AEval( oBrw:aCols, { |oCol| oCol:nHeadStrAlign := AL_CENTER } ).

If an array of values is assigned, the elements are successively assigned to the column objects.

Example: oBrw:cHeaders := { 'ONE', 'TWO', 'THREE' }, assigns the headers to three columns. The assignment is made
in the order of original creation of the columns, even if the columns are rearranged by the user.
Accessing column data returns an array of values.

Example: aHeaders := oBrw:cHeaders

Re: To Mr Nages : change bClrStd on line

PostPosted: Tue Jun 25, 2013 7:51 pm
by Manuel Aranda
Hola Silvio, ¿resolviste este asunto? ¿Puedes decirme cómo? Gracias.

Re: To Mr Nages : change bClrStd on line

PostPosted: Wed Jun 26, 2013 10:28 am
by Silvio.Falconi
as Mr Nages wrote!!

Re: To Mr Nages : change bClrStd on line

PostPosted: Wed Jun 26, 2013 4:19 pm
by Manuel Aranda
Silvio, muchas gracias.

Re: To Mr Nages : change bClrStd on line

PostPosted: Mon Apr 19, 2021 6:58 am
by ukoenig
Hello

is it possible to change the list / array < aTextCol > to < AEval syntax > :?:

Image

Code: Select all  Expand view

oBrw1:bPainted  := < |hDC|  
     oBrw1:aCols[ 1 ]:bClrStd       := { || { aTextCol[ 1 ], CLR_BLACK } }
     oBrw1:aCols[ 2 ]:bClrStd       := { || { aTextCol[ 2 ], CLR_BLACK } }
     oBrw1:aCols[ 3 ]:bClrStd       := { || { aTextCol[ 3 ], CLR_BLACK } }
     oBrw1:aCols[ 4 ]:bClrStd       := { || { aTextCol[ 4 ], CLR_BLACK } }
     oBrw1:aCols[ 5 ]:bClrStd       := { || { aTextCol[ 5 ], CLR_BLACK } }
     oBrw1:aCols[ 6 ]:bClrStd       := { || { aTextCol[ 6 ], CLR_BLACK } }
     oBrw1:aCols[ 7 ]:bClrStd       := { || { aTextCol[ 7 ], CLR_BLACK } }
     oBrw1:aCols[ 8 ]:bClrStd       := { || { aTextCol[ 8 ], CLR_BLACK } }
     oBrw1:aCols[ 9 ]:bClrStd       := { || { aTextCol[ 9 ], CLR_BLACK } }
     oBrw1:aCols[ 10 ]:bClrStd       := { || { aTextCol[ 10 ], CLR_BLACK } }
     oBrw1:aCols[ 11 ]:bClrStd       := { || { aTextCol[ 11 ], CLR_BLACK } }
RETURN NIL
>
 


I would like to include the colorarray < aTextCol > in
AEval( oBrw1:aCols, { | o | o:bClrStd := { || { aTextCol[ :?: ], CLR_BLACK } } } )
instead using the listed array
a column-counter is missing
adding any column-number it works

regards
Uwe :?:

Re: To Mr Nages : change bClrStd on line

PostPosted: Mon Apr 19, 2021 10:23 am
by ukoenig
I found a working solution
but maybe there is something better

Code: Select all  Expand view

...
...
oBrw1:bPainted  := < |hDC|  
        I := 1 // column-counter
        AEval( oBrw1:aCols, { | o | o:bClrStd := CLRSTDBLOCK( I++, o ) } )
RETURN NIL
>
...
...

// -----------------

FUNCTION CLRSTDBLOCK( I, oCol )
IF I > 11 // columns
    I := 1
ENDIF
RETURN { || { aTextCol[ I ], CLR_BLACK  } } // textcolor from array

 


regards
Uwe :D