Page 1 of 1

To ANTONIO :Help on TtreeView Class PLEASE URGENT !!!!

Posted: Sat Nov 26, 2005 2:05 pm
by Sakis
Hello

I try to include a TreeView inside a dialog that included in a 32bits Dll. The problem i faced is when ctivate the dialog i get an empty TreeView window. The treeview declared as "SysTreeView32" in the dialog as the manual says.

Code: Select all


#include "FiveWin.ch"

STATIC TEstDlg,Tree

PROCEDURE MAIN()

LOCAL ImageList
LOCAL Brance1,Brance2,Brance3


SET RESOURCES TO "TEST32.DLL" // Here is the TreeView Dialog


 
DEFINE DIALOG TestDlg RESOURCE "TEST" 

   
  
   ImageList := TImageList():New()
      ImageList:Add( TBitmap():Define( "DISCOUNT",,TestDlg))
      ImageList:Add( TBitMap():Define( "MONEY",,TestDlg))
      ImageList:Add( TBitMap():Define( "TACK",,TestDlg))
      ImageList:Add( TBitMap():Define( "TACKED",,TestDlg))
      
      Tree = TTreeView():Redefine (4001,TestDlg)
     
     WITH OBJECT Tree
      :SetImageList( ImageList)
       Brance1:= :Add( "THIS IS THE FIRST",0)
         Brance1:Add("This is an Item inside the 1st Brance",0)
       Brance2:= :Add( "THIS IS THE SECOND",1)
       Branc3:=  :Add( "This is the THIRD",2)
     END WITH 
   
   ACTIVATE DIALOG TestDlg CENTERED

This code as a result gives the dialog with 2 buttons and an empty TreeView window.

Any help would be appreciate.

Thanks In Advance
Dionisis

Posted: Sat Nov 26, 2005 5:00 pm
by Antonio Linares
Dionisis,

On a dialog, a control does not really exists until the dialog is activated, so please modify the code this way:

ACTIVATE DIALOG TestDlg CENTERED ;
ON INIT FillTree( oTree, ImageList )

function FillTree( Tree, ImageList )

local Brance...

WITH OBJECT Tree
:SetImageList( ImageList)
Brance1:= :Add( "THIS IS THE FIRST",0)
Brance1:Add("This is an Item inside the 1st Brance",0)
Brance2:= :Add( "THIS IS THE SECOND",1)
Branc3:= :Add( "This is the THIRD",2)
END WITH

return nil

To ANTONIO :Help on TtreeView Class PLEASE URGENT !!!!

Posted: Sun Nov 27, 2005 6:32 am
by Sakis
Antonio

Many many thanks this change make the code to work. For once again you gave me a valued help.


:lol:
Greetings from Greece

Dionisis

Posted: Fri Dec 02, 2005 2:48 pm
by wpacheco
Hi Sakis

This code seems to be works for you. I understand you have the SysTreeView32 control defined in a DLL. Could you tell me in the DLL how the control was defined?

I've defined in this way

CONTROL "", 1007, "SysTreeView32", WS_CHILD | WS_VISIBLE | WS_BORDER, 12, 72, 206, 100

But I can't see the lines neither the (+)(-) signs even the rest works fine

Thanks

Posted: Fri Dec 02, 2005 3:02 pm
by Sakis
Hi wpacheco

Sorry but i use the pellesc IDE and i get the resources directly into the DLL. So i can't answer to your question because I dont use any RC file . Others advantages to use this IDE is to let you assign other control characteristics like HasButtons HasLines etc.etc.

This is very easy and quick way to make your 32 resources DLL's.

Here is a link to see more


http://www.smorgasbordet.com/pellesc/

Greetings
Dionisis

Posted: Fri Dec 02, 2005 11:46 pm
by wpacheco
Thanks Sakis. I will try :wink: