Jump to content
Fivewin Brasil

como usar a classe TImageList?


Thiagodb

Recommended Posts

Por favor ... alguem sabe como usar a classe TImageList???

Tento usa-la na classe TTreeView()

oImageList := TImageList():New(16,16)

oBmp1 := TBitmap():Define( ,"fld_close.bmp",oWnd)

oBmp2 := TBitmap():Define( ,"fld_open.bmp" ,oWnd)

oImageList:Add( oBmp1, oBmp2 )

oTree:SetImageList( oImageList )

mas só aparece a imagem de 1º BMP, e em todos os níveis da Tree.

Editado por - Thiagodb on 09/08/2005 10:01:13

Link to comment
Share on other sites

Por favor ... alguem sabe como usar a classe TImageList???

Tento usa-la na classe TTreeView()

oImageList := TImageList():New(16,16)

oBmp1 := TBitmap():Define( ,"fld_close.bmp",oWnd)

oBmp2 := TBitmap():Define( ,"fld_open.bmp" ,oWnd)

oImageList:Add( oBmp1, oBmp2 )

oTree:SetImageList( oImageList )

mas só aparece a imagem de 1º BMP, e em todos os níveis da Tree.

Editado por - Thiagodb on 09/08/2005 10:01:13

Link to comment
Share on other sites

Por favor ... alguem sabe como usar a classe TImageList???

Tento usa-la na classe TTreeView()

oImageList := TImageList():New(16,16)

oBmp1 := TBitmap():Define( ,"fld_close.bmp",oWnd)

oBmp2 := TBitmap():Define( ,"fld_open.bmp" ,oWnd)

oImageList:Add( oBmp1, oBmp2 )

oTree:SetImageList( oImageList )

mas só aparece a imagem de 1º BMP, e em todos os níveis da Tree.

Editado por - Thiagodb on 09/08/2005 10:01:13

Link to comment
Share on other sites

Ai vai o exemplo do problema:

*******************

function Main()

Local oWnd,oImageList,oBmp1,oBmp2,oTree

oWnd := TWindow():New( 50 , 150 , 577.5 , 457.5 ,"TESTE" , , , , , ,.F. ,.F. ,"N/W" , , ,"NONE" , , ,.T. ,.F. , .T. )

//New( nTop, nLeft, nBottom, nRight , cTitle ,nStyle,oMenu,oBrush,oIcon,oParent,lVScroll,lHScroll,nClrFore,nClrBack,oCursor,cBorder,lSysMenu,lCaption,lMin, lMax, lPixel ) CONSTRUCTOR

oImageList = TImageList():New(16,16)

oBmp1 = TBitmap():Define( ,"fld_close.bmp", oWnd ) // imagem .bmp (16X16 pix) qdo estiver a TREE estiver fechada

oBmp2 = TBitmap():Define( ,"fld_open.bmp" , oWnd ) // imagem .bmp (16X16 pix) qdo estiver a TREE estiver aberta

oImageList:Add( oBmp1, oBmp2 )

oTree := TTreeView():New( 01 , 01 , oWnd, , , .T. , .F. , 300 , 500 , )

// New( nTop, nLeft, oWnd,nClrFore,nClrBack, lPixel, lDesign, nWidth, nHeight,cMsg )

*--------------------Cria uma nova matrix Classificada por SISTEMA + PAI-----------------------*

oTree:Add("TESTE 1")

oTree:Add("TESTE 2")

oTree:SetImageList( oImageList )

return nil

*******************

Editado por - Thiagodb on 11/08/2005 18:03:53

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...