FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Possible to replace xBrw-HeaderBMP on Button-Action ?
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Possible to replace xBrw-HeaderBMP on Button-Action ?
Posted: Wed May 20, 2009 12:28 PM
Hello,

I want inside my Tests to make it possible, the user can change
the Header-BMP of a Column with a selected new BMP from Button-Action.
Normally the BMP is defined with the Resource-Position.
Inside the xbrowse-class I found the Information : BMP are stored in => bBmpData



oLbx0:aCols[ 2 ]:AddBmpFile( "info2.bmp" )
oLbx0:aCols[ 2 ]:AddResource("Calendar")
oLbx0:aCols[ 2 ]:AddResource("Calendar")
oLbx0:aCols[ 2 ]:AddResource("Calendar")
oLbx0:aCols[ 2 ]:AddResource("Calendar")
oLbx0:aCols[ 2 ]:bBmpData := {|| oLbx0:nArrayAt }
oLbx0:aCols[ 2 ]:bStrData := {|| oLbx0:aRow[2] }

oLbx0:aCols[ 2 ]:nHeadBmpNo := 1

Is it possible, to replace the Header-BMP from outside the Browser ?

Best Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Possible to replace xBrw-HeaderBMP on Button-Action ?
Posted: Thu May 21, 2009 02:43 AM

oBrw:aCols[2]:hHearderBmp := nNew // nNew is another number of already loaded bmp/resource of that column
oBrw:Refresh()

if you want to add a new bmp file or resource, use oCol:AddBmpfile or AddResource and give that new number

Regards



G. N. Rao.

Hyderabad, India
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Possible to replace xBrw-HeaderBMP on Button-Action ?
Posted: Thu May 21, 2009 09:25 AM
Thank You very much for the Info,

my problem :
1. I want to keep the basic-structure.
2. The user can select a new Header-Bmp from Disk for testing.
3. I have to rebuild the BMP-array after a new selection of the Header Bmp.

That clears the BMP-Array of a Column :
oLbx0:aCols[ 2 ]:bBmpData := {|| 0 }
oLbx0:Refresh()

The number of Array-Elements are still the same.
Maybe it is possible, to start with a empty array again ( Array-Reset ) ?

Code (fw): Select all Collapse
//------------------- PAINT HEADER --------------------------------//

FUNCTION xBNEWF9(oLbx0)

oLbx0:aCols[ 2 ]:AddResource("Calendar")
oLbx0:aCols[ 2 ]:AddResource("Calendar")
oLbx0:aCols[ 2 ]:AddResource("Calendar")
oLbx0:aCols[ 2 ]:AddResource("Calendar")
oLbx0:aCols[ 2 ]:AddResource("Calendar")
oLbx0:aCols[ 2 ]:AddResource("Calendar")
oLbx0:aCols[ 2 ]:AddResource("Calendar")
oLbx0:aCols[ 2 ]:AddResource("Calendar")
oLbx0:aCols[ 2 ]:AddResource("Calendar")
oLbx0:aCols[ 2 ]:AddResource("Calendar")
oLbx0:aCols[ 2 ]:AddResource("Calendar")
oLbx0:aCols[ 2 ]:AddResource("Calendar")
oLbx0:aCols[ 2 ]:AddResource("Calendar")
// Header Bmp from Disk with a position-Number
oLbx0:aCols[ 2 ]:AddBmpFile(BR_HEADBMP) // BMP-Test

oLbx0:aCols[ 2 ]:nHeadBmpNo      := 14

oLbx0:Refresh()

RETURN( NIL )


The easy way would be a straight define for the Header-Bmp : oLbx0:aCols[ 2 ]:nHeadBmp := BR_HEADBMP
but I have to use the Position-Number from the Array-list.

There seems to be also something wrong, after changing the Header-Text-Color.
The display-problem has been before in cells.
Everything is OK, changing the Gradient of the Header.
As soon the Text-Color changes, the Header-BMP is affected from the Color.

At start
---------


After Text-Color-Change
-----------------------------


More Tests
--------------


Best Regards
Uwe :-)
Since 1995 ( the first release of FW 1.9 )

i work with FW.

If you have any questions about special functions, maybe i can help.

Continue the discussion