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

Post Reply
User avatar
Sakis
Posts: 41
Joined: Fri Oct 21, 2005 2:12 pm
Location: Athens

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

Post 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
User avatar
Antonio Linares
Site Admin
Posts: 37481
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain
Contact:

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

Antonio Linares
www.fivetechsoft.com
User avatar
Sakis
Posts: 41
Joined: Fri Oct 21, 2005 2:12 pm
Location: Athens

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

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

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

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

Post by wpacheco »

Thanks Sakis. I will try :wink:
Post Reply