FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour TreeView on dialog
Posts: 375
Joined: Tue Feb 10, 2015 09:48 AM
TreeView on dialog
Posted: Fri Apr 24, 2015 09:26 AM
Hello,
I have a little problem, in this code:
Code (fw): Select all Collapse
#include "FiveWin.ch" 

//----------------------------------------------------------------------------// 

function Main() 

   local oWnd, oTree, oItem1, oItem2

   DEFINE WINDOW oWnd FROM 3, 6 TO 20, 70 ; 
      TITLE "Welcome to " + FWVERSION COLOR "N/W" 


   oTree := TTreeView():New( 2, 0, oWnd ) 
   oItem1 := oTree:Add( "Page - 1", 1 )                      
   oItem1:Add( "xBase & OOPS", 1 )
   oTree:Add( "Page - 2", 1 )

   ACTIVATE WINDOW oWnd ; 
      ON INIT ( oTree:refresh(.t.) )  // required so that objects around splitter paint correctly on init 

return nil

If I change "WINDOW" with "DIALOG" the treeView is empty... why?
Many thanks
Antonino Perricone
Posts: 6755
Joined: Wed Feb 15, 2012 08:25 PM
Re: TreeView on dialog
Posted: Fri Apr 24, 2015 09:45 AM
Look

Code (fw): Select all Collapse
#include "fivewin.ch"

function Main() 

   local oWnd, oItem1, oItem2,  oTree

   DEFINE DIALOG oWnd FROM 3*2, 6*2 TO 20*2, 70*2 ; 
      TITLE "Welcome to " + FWVERSION COLOR "N/W" 

/*
   oTree := TTreeView():New( 2, 2, oWnd ) 
   oItem1 := oTree:Add( "Page - 1", 1 )                      
   oItem1:Add( "xBase & OOPS", 1 )
   oTree:Add( "Page - 2", 1 )
*/

   ACTIVATE DIALOG oWnd ; 
      ON INIT ( oTree := MiTree( oWnd ) )  // required so that objects around splitter paint correctly on init 

return nil

Function MiTree( oWnd )
local oTree
local  oItem1, oItem2
   oTree := TTreeView():New( 2, 2, oWnd ) 
   oItem1 := oTree:Add( "Page - 1", 1 )                      
   oItem1:Add( "xBase & OOPS", 1 )
   oTree:Add( "Page - 2", 1 )

Return oTree
Cristobal Navarro

Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo

El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces

Continue the discussion