How to change / add the bitmap on the xBrowse-tree-column ?

How to change / add the bitmap on the xBrowse-tree-column ?

Postby ukoenig » Mon May 15, 2017 9:59 am

Hello,

I added the sample xBrowsetree to my sample-collector.
trying to add a bitmap on column 1 with

WITH OBJECT oBrw3:aCols[ 1 ]
:AddBmpFile( c_Path1 + "Open2.bmp" )
:bBmpData := 1
END


on column 1, doesn't work.
Using column 2, it is OK

Image

Code: Select all  Expand view

// ------------------------------------------------------------------ SECTION 1 Page 4

FUNCTION SS1_PART4( oFld1, nSavePage )
LOCAL  aRowGrad1, aRowGrad2, aSelGrad

aRowGrad1 := { { .5, nRGB( 120, 187, 221 ), nRGB( 255, 255, 255 ) }, ;
                       { .5, RGB(  232, 241, 252 ), nRGB( 120, 187, 221 ) } }

aRowGrad2 := { { .5, nRGB( 128, 255, 192 ), nRGB( 255, 255, 255 ) }, ;
                         { .5, nRGB( 255, 255, 255 ), nRGB( 128, 255, 192 ) } }

aSelGrad := { { .5, 14540253, nRGB( 255, 255, 255 ) }, ;
                     { .5, nRGB( 255, 255, 255 ), 14540253 } }

DBSELECTAREA( "CUST" )
INDEX ON Field->State TO State
SET ORDER TO "State"
Cust->(DBGOTOP())

@ 10, 20 XBROWSE oBrw3 SIZE -20, -152 PIXEL OF oFld1:aDialogs[4] LINES CELL ;
DATASOURCE "CUST" FONT oFont

oBrw3:SetTree( BuildTree(), { "open", "close", "go" } )

ADD TO oBrw3 DATA oBrw3:oTreeItem:Cargo[ 1 ] HEADER "Last"
ADD TO oBrw3 DATA oBrw3:oTreeItem:Cargo[ 2 ] HEADER "First"

oBrw3:aCols[ 1 ]:bToolTip := { | oBrw, nRow, nCol, nFlags | "Mouseclick" + CRLF + ;
                                                                                        "___________" + CRLF + ;
                                                                                        "to create the" + CRLF + ;
                                                                                        "xBrowse-tree " }

oBrw3:nMarqueeStyle = MARQSTYLE_HIGHLROW

WITH OBJECT oBrw3
    :nRecSelColor       := 16762251
    :bClrStd            := { || If( oBrw3:KeyNo() % 2 == 0, ;
                        { If( ( oBrw3:cAlias )->( Deleted() ), 255, CLR_BLACK ), aRowGrad1 }, ;
                        { If( ( oBrw3:cAlias )->( Deleted() ), 255, CLR_BLACK ), aRowGrad2 } ) }
    :bClrSel            :=  ;
    :bClrSelFocus       := { || { If( ( oBrw3:cAlias )->( Deleted() ), 255, CLR_BLACK ), aSelGrad } }
    :bClrHeader     := { || { 255, 16777088 } }
    :nRecSelHeadBmpNo := c_Path1 + "Counter.bmp"
END

// DOESN*T WORK !!!
WITH OBJECT oBrw3:aCols[ 1 ]
    :AddBmpFile( c_Path1 + "Open2.bmp" )
    :bBmpData   := 1
END

// OK
WITH OBJECT oBrw3:aCols[ 2 ]
    :AddBmpFile( c_Path1 + "Open2.bmp" )
    :bBmpData   := 1
END

oBrw3:CreateFromCode()
oBrw3:aCols[ 1 ]:cHeader = "State & City"

RETURN NIL
 


regards
Uwe :?:
Last edited by ukoenig on Tue May 16, 2017 6:29 pm, edited 1 time 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: How to change / add the bitmap on the xBrowse-tree-column ?

Postby nageswaragunupudi » Mon May 15, 2017 2:33 pm

oTree := BuildTree()

@ 10, 20 XBROWSE oBrw3 SIZE -20, -152 PIXEL OF oFld1:aDialogs[4] LINES CELL ;
DATASOURCE oTree;
COLUMNS 1,2;
HEADERS "State/City", "Last", "First" ;
CELL LINES FONT oFont

oBrw:aCols[ 1 ]:AddBitmap( { "Open", "Close", "Go" } )

Do not specify oBrw:aCols[ 1 ]:bBmpData. This is already done by xbrowse internally
Regards

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

Re: How to change / add the bitmap on the xBrowse-tree-column ?

Postby ukoenig » Tue May 16, 2017 6:32 pm

I found the problem :
( it seems to be the defined resources -> "open", "close", "go" )

changed to :
oBrw[5]:SetTree( MAKETREE(), { FWRArrow(), FWDArrow(), c_path1 + "Task.bmp" } )

// oBrw[5]:SetTree( MAKETREE(), { "open", "close", "go" } )

Image

regards
Uwe :D
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: How to change / add the bitmap on the xBrowse-tree-column ?

Postby nageswaragunupudi » Tue May 16, 2017 7:58 pm

Good
Still please try my approach.
This is better
Regards

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


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: nageswaragunupudi and 95 guests