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

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

Postby Sakis » Sat Nov 26, 2005 2:05 pm

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  Expand view

#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
User avatar
Sakis
 
Posts: 42
Joined: Fri Oct 21, 2005 2:12 pm
Location: Athens

Postby Antonio Linares » Sat Nov 26, 2005 5:00 pm

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
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

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

Postby Sakis » Sun Nov 27, 2005 6:32 am

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
User avatar
Sakis
 
Posts: 42
Joined: Fri Oct 21, 2005 2:12 pm
Location: Athens

Postby wpacheco » Fri Dec 02, 2005 2:48 pm

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
User avatar
wpacheco
 
Posts: 28
Joined: Tue Nov 15, 2005 1:03 am
Location: Isla Margarita, Venezuela

Postby Sakis » Fri Dec 02, 2005 3:02 pm

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
User avatar
Sakis
 
Posts: 42
Joined: Fri Oct 21, 2005 2:12 pm
Location: Athens

Postby wpacheco » Fri Dec 02, 2005 11:46 pm

Thanks Sakis. I will try :wink:
User avatar
wpacheco
 
Posts: 28
Joined: Tue Nov 15, 2005 1:03 am
Location: Isla Margarita, Venezuela


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 59 guests