Page 1 of 1

A Switch for the new oLbx:aCols[2]:oBrush := oBrush ?

Posted: Sat Apr 19, 2008 12:34 pm
by ukoenig
Hello,

In the new Tools, i added the new FWH 8.04 option
to select a brush for a defined Col.
Because everything can be done at runtime with preview,
it must be possible, that the user can switch the brush On and Off
like with transparent .T. or .F.

The normal code is just :

DEFINE BRUSH oBrush RESOURCE "WALL"
oLbx:aCols[2]:oBrush := oBrush

Is it possible, to make the brush visible or not visible ?

Regards

Uwe

Posted: Sat Apr 19, 2008 1:29 pm
by nageswaragunupudi
During runtime it is possible to assign a brush, change a brush or remove brush ( by assigning ocol:obrush := nil ).

On studying the code, the intention is that even a codeblock can be assigned to oBrush so that different rows can be painted with different brushes. Example oBrush := { || If( ordkeyno() % 2 == 0, oBrush1, oBrush2 }.
But due to a small bug this is now giving an error.

Mr Antonio.
This small correction given below will rectify the error and codeblocks will work for oBrush correctly.

Code: Select all

Present line 5360
      hBrush      := ::oBrush:hBrush
should be changed as
      hBrush      := oBrush:hBrush
With this correction CodeBlocks can be assigned to oCol:oBrush and it works perfectly. I made this correction in my copy and I am using this in my applications.

Switching Brushes ON / OFF in xBrowse

Posted: Sat Apr 19, 2008 3:42 pm
by ukoenig
Thank you very much,

I included the option and it works fine.
Now the user can choose a brush and test,
how it looks in relation to the rest of his settings.

Regards

Uwe