FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Xbrowse Header-bmp possible to change at runtime ?
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Xbrowse Header-bmp possible to change at runtime ?
Posted: Tue Dec 08, 2015 03: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 (fw): Select all Collapse
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.
Posts: 10733
Joined: Sun Nov 19, 2006 05:22 AM
Re: Xbrowse Header-bmp possible to change at runtime ?
Posted: 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
Posts: 4043
Joined: Wed Dec 19, 2007 06:40 PM
Re: Xbrowse Header-bmp possible to change at runtime ?
Posted: Thu Dec 10, 2015 09: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 (fw): Select all Collapse
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 :-)

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

Code (fw): Select all Collapse
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 :-)
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: Xbrowse Header-bmp possible to change at runtime ?
Posted: Thu Dec 10, 2015 10:03 AM
You better assign nHeadBmp with a codeblock
Eg
Code (fw): Select all Collapse
oCol:nHeadBmpNo := { || nsValue[ 1 ] }
Regards



G. N. Rao.

Hyderabad, India

Continue the discussion