Xbrowse Header-bmp possible to change at runtime ?

Xbrowse Header-bmp possible to change at runtime ?

Postby ukoenig » Tue Dec 08, 2015 3:13 pm

Hello,

I have 3 datasets and want to display the image that belongs to a set inside the header
I can change a set and the column-values like < oBrw:SetArray( aSet1 )
but couldn't change the header-images at runtime.

That works at startup with a selected set :

Code: Select all  Expand view

FOR nCol := 1 to 3
      WITH OBJECT oBrw:aCols[ nCol ]
          :nWidth := 190
          :lBmpTransparent := .T.
          :nDataBmpAlign := AL_CENTER
          IF nSet = 1
              :AddBmpFile( "Image1.png" )
          ELSEIF nSet = 2
              :AddBmpFile( "Image2.png" )
          ELSEIF nSet = 3
              :AddBmpFile( "Image3.png" )
          ENDIF
          :nHeadBmpNo   := 1
          :cHeader := ""
     END
NEXT
 


but doesn't work at runtime

any idea :?:

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

Re: Xbrowse Header-bmp possible to change at runtime ?

Postby nageswaragunupudi » Wed Dec 09, 2015 10:00 pm

At run-time we can change oCol:nHeadBmpNo and then either oBrw:RefreshHeaders() or oBrw:Refresh()
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India

Re: Xbrowse Header-bmp possible to change at runtime ?

Postby ukoenig » Thu Dec 10, 2015 9:57 am

With predefined images at startup it works changing < :nHeadBmpNo >
with my sample above I wanted to rearange the images with new names not calling the image-position

Image changed by position works

Code: Select all  Expand view

FOR nCol := 1 to 3
     WITH OBJECT oBrw:aCols[ nCol ]
          :nWidth := 190
          :lBmpTransparent := .T.
          :nDataBmpAlign := AL_CENTER
          :AddBmpFile( c_Path1 + "Image1.png" )
          :AddBmpFile( c_Path1 + "Image2.png" )
          :AddBmpFile( c_Path1 + "Image3.png" )
          :nHeadBmpNo := nSValue // nSValue = selected image
          :cHeader := ""
      END
NEXT
 


tested changing image-names
before I must RESET the header-image-array otherwise < :nHeadBmpNo > would be 4,5 and 6 !!!!

adding the position-number replaces the header-imge-array defined at startup ?
tested and works :idea:

:AddBmpFile( c_Path1 + "Image4.png", 1 ) // NEW image-names
:AddBmpFile( c_Path1 + "Image5.png", 2 )
:AddBmpFile( c_Path1 + "Image6.png", 3 )

Code: Select all  Expand view

oBrw:SetArray( aImage2 ) // new cell-images WORKS

FOR nCol := 1 to 3
     WITH OBJECT oBrw:aCols[ nCol ]
          :nWidth := 190
          :lBmpTransparent := .T.
          :nDataBmpAlign := AL_CENTER
          :AddBmpFile( c_Path1 + "Image4.png", 1 ) // NEW image-names
          :AddBmpFile( c_Path1 + "Image5.png", 2 )
          :AddBmpFile( c_Path1 + "Image6.png", 3 )
          :nHeadBmpNo   := { || nsValue[ 1 ] } // nSValue = new selected image
          :cHeader := ""
      END
NEXT
oBrw:RefreshHeaders()
oBrw:Refresh()
 


best regards
Uwe :?:
Last edited by ukoenig on Thu Dec 10, 2015 12:32 pm, edited 11 times in total.
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: Xbrowse Header-bmp possible to change at runtime ?

Postby nageswaragunupudi » Thu Dec 10, 2015 10:03 am

You better assign nHeadBmp with a codeblock
Eg
Code: Select all  Expand view
oCol:nHeadBmpNo := { || nsValue[ 1 ] }
Regards

G. N. Rao.
Hyderabad, India
User avatar
nageswaragunupudi
 
Posts: 10620
Joined: Sun Nov 19, 2006 5:22 am
Location: India


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 92 guests