the treeview is not correctly visible if started from an buttonbar on mdi window. This is the test:
- Code: Select all Expand view
#include "FiveWin.ch"
function Main()
LOCAL oWnd, oBar
DEFINE WINDOW oWnd MDI
DEFINE BUTTONBAR oBar 3DLOOK BUTTONSIZE 40, 40 OF oWnd
DEFINE BUTTON RESOURCE "END_END" OF oBar ;
TOOLTIP "Uscita dal sistema" ;
ACTION oWnd:END()
DEFINE BUTTON RESOURCE "Search" OF oBar ;
TOOLTIP "TestTree" ;
ACTION TestTree() // this is not good :-(
ACTIVATE WINDOW oWnd MAXIMIZED ;
ON INIT ( TestTree(),; // This is good
MsgInfo( "Good :-)", "TestTree()" ),;
MsgInfo( "No Good :-( " + CRLF +;
"if press the 2° button", "TestTree()" ) )
RETURN Nil
//------------------------------------------------------------------------------
// From here is the standard treeview sample
STATIC FUNCTION TestTree()
local oDlg, oBtn1, oBtn2
local oTree, oBmp1, oBmp2, oImageList
local oFont
DEFINE FONT oFont NAME "Ms Sans Serif" SIZE 0, -12
DEFINE DIALOG oDlg NAME "ARBOL" FONT oFont
oImageList = TImageList():New()
oBmp1 = TBitmap():Define( , "..\bitmaps\16x16\folder.bmp" , oDlg )
oBmp2 = TBitmap():Define( , "..\bitmaps\16x16\fldMask.bmp", oDlg )
oImageList:Add( oBmp1, oBmp2 )
oTree := TTreeView():Redefine( 100, oDlg )
oTree:bLDblClick := { | nRow, nCol, nKeyFlags | MyClick( nRow, nCol, oTree ) }
ACTIVATE DIALOG oDlg CENTERED ;
ON INIT FillTree( oTree, oImageList )
oImageList:End()
oBmp1:End()
oBmp2:End()
return nIL
//------------------------------------------------------------------------------------------//
function MyClick( nRow, nCol, oTree )
local oItem
oItem := oTree:HitTest( nRow, nCol )
if oItem != NIL
MsgInfo( oItem:cPrompt )
else
MsgInfo( "Not found!" )
endif
return NIL
//----------------------------------------------------------------------------//
function FillTree( oTree, oImageList )
local oItem1, oItem2, n
oTree:SetImageList( oImageList )
oItem1 := oTree:Add( "Hello world!" )
oItem1:Add( "xBase & OOPS" )
oItem2 := oItem1:Add( "Clipper 5" )
oItem2:Add( "Another" )
oItem2:Add( "item" )
oTree:Add( "FiveWin power!" )
oItem2 := oTree:Add( Time() )
oItem2:Add( Time() )
for n = 1 to 50
oItem2:Add( Str( n ) )
next
return nil
rc is testtree.rc from sample directory.
someone can confirm?
some solution?
thanks for your answers.*/