Possible to replace xBrw-HeaderBMP on Button-Action ?

Possible to replace xBrw-HeaderBMP on Button-Action ?

Postby ukoenig » 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

Image

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 :lol:
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany

Re: Possible to replace xBrw-HeaderBMP on Button-Action ?

Postby nageswaragunupudi » Thu May 21, 2009 2: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
User avatar
nageswaragunupudi
 
Posts: 10624
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Possible to replace xBrw-HeaderBMP on Button-Action ?

Postby ukoenig » Thu May 21, 2009 9: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: Select all  Expand view

//------------------- 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
---------
Image

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

More Tests
--------------
Image

Best Regards
Uwe :lol:
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.
User avatar
ukoenig
 
Posts: 4043
Joined: Wed Dec 19, 2007 6:40 pm
Location: Germany


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 92 guests