Type | Description | |||
Tree as FaceTree | A FaceTree object where the user expands or collapses an item | |||
Item as Long | A Long expression that indicates the index of the item being expanded or collapsed. |
A face that contains a Tree control may fire any of the following events ( CreateTree, Type on exFaceTree ):
Syntax for FaceTreeExpandItem event, /NET version, on:
private void FaceTreeExpandItem(object sender,exontrol.EXTREECUBELib.FaceTree Tree,int Item) { } Private Sub FaceTreeExpandItem(ByVal sender As System.Object,ByVal Tree As exontrol.EXTREECUBELib.FaceTree,ByVal Item As Integer) Handles FaceTreeExpandItem End Sub |
private void FaceTreeExpandItem(object sender, AxEXTREECUBELib._ITreeCubeEvents_FaceTreeExpandItemEvent e) { } void OnFaceTreeExpandItem(LPDISPATCH Tree,long Item) { } void __fastcall FaceTreeExpandItem(TObject *Sender,Extreecubelib_tlb::IFaceTree *Tree,long Item) { } procedure FaceTreeExpandItem(ASender: TObject; Tree : IFaceTree;Item : Integer); begin end; procedure FaceTreeExpandItem(sender: System.Object; e: AxEXTREECUBELib._ITreeCubeEvents_FaceTreeExpandItemEvent); begin end; begin event FaceTreeExpandItem(oleobject Tree,long Item) end event FaceTreeExpandItem Private Sub FaceTreeExpandItem(ByVal sender As System.Object, ByVal e As AxEXTREECUBELib._ITreeCubeEvents_FaceTreeExpandItemEvent) Handles FaceTreeExpandItem End Sub Private Sub FaceTreeExpandItem(ByVal Tree As EXTREECUBELibCtl.IFaceTree,ByVal Item As Long) End Sub Private Sub FaceTreeExpandItem(ByVal Tree As Object,ByVal Item As Long) End Sub LPARAMETERS Tree,Item PROCEDURE OnFaceTreeExpandItem(oTreeCube,Tree,Item) RETURN |
<SCRIPT EVENT="FaceTreeExpandItem(Tree,Item)" LANGUAGE="JScript"> </SCRIPT> <SCRIPT LANGUAGE="VBScript"> Function FaceTreeExpandItem(Tree,Item) End Function </SCRIPT> Procedure OnComFaceTreeExpandItem Variant llTree Integer llItem Forward Send OnComFaceTreeExpandItem llTree llItem End_Procedure METHOD OCX_FaceTreeExpandItem(Tree,Item) CLASS MainDialog RETURN NIL void onEvent_FaceTreeExpandItem(COM _Tree,int _Item) { } function FaceTreeExpandItem as v (Tree as OLE::Exontrol.TreeCube.1::IFaceTree,Item as N) end function function nativeObject_FaceTreeExpandItem(Tree,Item) return |
How do I add a hierarchy?
VBA (MS Access, Excell...)
' FaceTreeExpandItem event - Notifies that an item has been expanded/collapsed into a face of tree type. Private Sub TreeCube1_FaceTreeExpandItem(ByVal Tree As Object,ByVal Item As Long) With TreeCube1 Debug.Print( Item ) End With End Sub With TreeCube1 .BeginUpdate With .FrontFace.CreateTree .ExpandOnDblClick = True .ItemPadding = 10 .HeaderVisible = False .LinesAtRoot = 2 .DrawGridLines = -2 .Columns.Add("").Alignment = 0 With .Items With .Add("Root 1").Items .Add "Child 1" .Add "Child 2" .Add "Child 3" End With With .Add("Root 2").Items .Add "Child 1" .Add "Child 2" .Add "Child 3" End With .ExpandAll End With End With .EndUpdate End With
VB6
' FaceTreeExpandItem event - Notifies that an item has been expanded/collapsed into a face of tree type. Private Sub TreeCube1_FaceTreeExpandItem(ByVal Tree As EXTREECUBELibCtl.IFaceTree,ByVal Item As Long) With TreeCube1 Debug.Print( Item ) End With End Sub With TreeCube1 .BeginUpdate With .FrontFace.CreateTree .ExpandOnDblClick = True .ItemPadding = 10 .HeaderVisible = False .LinesAtRoot = exGroupLines .DrawGridLines = exRowLines .Columns.Add("").Alignment = LeftAlignment With .Items With .Add("Root 1").Items .Add "Child 1" .Add "Child 2" .Add "Child 3" End With With .Add("Root 2").Items .Add "Child 1" .Add "Child 2" .Add "Child 3" End With .ExpandAll End With End With .EndUpdate End With
VB.NET
' FaceTreeExpandItem event - Notifies that an item has been expanded/collapsed into a face of tree type. Private Sub Extreecube1_FaceTreeExpandItem(ByVal sender As System.Object,ByVal Tree As exontrol.EXTREECUBELib.FaceTree,ByVal Item As Integer) Handles Extreecube1.FaceTreeExpandItem With Extreecube1 Debug.Print( Item ) End With End Sub With Extreecube1 .BeginUpdate() With .FrontFace.CreateTree() .ExpandOnDblClick = True .ItemPadding = 10 .HeaderVisible = False .LinesAtRoot = exontrol.EXTREECUBELib.LinesAtRootEnum.exGroupLines .DrawGridLines = exontrol.EXTREECUBELib.GridLinesEnum.exRowLines .Columns.Add("").Alignment = exontrol.EXTREECUBELib.AlignmentEnum.LeftAlignment With .Items With .Add("Root 1").Items .Add("Child 1") .Add("Child 2") .Add("Child 3") End With With .Add("Root 2").Items .Add("Child 1") .Add("Child 2") .Add("Child 3") End With .ExpandAll() End With End With .EndUpdate() End With
VB.NET for /COM
' FaceTreeExpandItem event - Notifies that an item has been expanded/collapsed into a face of tree type. Private Sub AxTreeCube1_FaceTreeExpandItem(ByVal sender As System.Object, ByVal e As AxEXTREECUBELib._ITreeCubeEvents_FaceTreeExpandItemEvent) Handles AxTreeCube1.FaceTreeExpandItem With AxTreeCube1 Debug.Print( e.item ) End With End Sub With AxTreeCube1 .BeginUpdate() With .FrontFace.CreateTree() .ExpandOnDblClick = True .ItemPadding = 10 .HeaderVisible = False .LinesAtRoot = EXTREECUBELib.LinesAtRootEnum.exGroupLines .DrawGridLines = EXTREECUBELib.GridLinesEnum.exRowLines .Columns.Add("").Alignment = EXTREECUBELib.AlignmentEnum.LeftAlignment With .Items With .Add("Root 1").Items .Add("Child 1") .Add("Child 2") .Add("Child 3") End With With .Add("Root 2").Items .Add("Child 1") .Add("Child 2") .Add("Child 3") End With .ExpandAll() End With End With .EndUpdate() End With
C++
// FaceTreeExpandItem event - Notifies that an item has been expanded/collapsed into a face of tree type. void OnFaceTreeExpandItemTreeCube1(LPDISPATCH Tree,long Item) { /* Copy and paste the following directives to your header file as it defines the namespace 'EXTREECUBELib' for the library: 'ExTreeCube 1.0 Control Library' #import <ExTreeCube.dll> using namespace EXTREECUBELib; */ EXTREECUBELib::ITreeCubePtr spTreeCube1 = GetDlgItem(IDC_TREECUBE1)->GetControlUnknown(); OutputDebugStringW( L"Item" ); } EXTREECUBELib::ITreeCubePtr spTreeCube1 = GetDlgItem(IDC_TREECUBE1)->GetControlUnknown(); spTreeCube1->BeginUpdate(); EXTREECUBELib::IFaceTreePtr var_FaceTree = spTreeCube1->GetFrontFace()->CreateTree(); var_FaceTree->PutExpandOnDblClick(VARIANT_TRUE); var_FaceTree->PutItemPadding(10); var_FaceTree->PutHeaderVisible(VARIANT_FALSE); var_FaceTree->PutLinesAtRoot(EXTREECUBELib::exGroupLines); var_FaceTree->PutDrawGridLines(EXTREECUBELib::exRowLines); var_FaceTree->GetColumns()->Add(L"")->PutAlignment(EXTREECUBELib::LeftAlignment); EXTREECUBELib::IItemsPtr var_Items = var_FaceTree->GetItems(); EXTREECUBELib::IItemsPtr var_Items1 = var_Items->Add("Root 1")->GetItems(); var_Items1->Add("Child 1"); var_Items1->Add("Child 2"); var_Items1->Add("Child 3"); EXTREECUBELib::IItemsPtr var_Items2 = var_Items->Add("Root 2")->GetItems(); var_Items2->Add("Child 1"); var_Items2->Add("Child 2"); var_Items2->Add("Child 3"); var_Items->ExpandAll(); spTreeCube1->EndUpdate();
C++ Builder
// FaceTreeExpandItem event - Notifies that an item has been expanded/collapsed into a face of tree type. void __fastcall TForm1::TreeCube1FaceTreeExpandItem(TObject *Sender,Extreecubelib_tlb::IFaceTree *Tree,long Item) { OutputDebugString( L"Item" ); } TreeCube1->BeginUpdate(); Extreecubelib_tlb::IFaceTreePtr var_FaceTree = TreeCube1->FrontFace->CreateTree(); var_FaceTree->ExpandOnDblClick = true; var_FaceTree->ItemPadding = 10; var_FaceTree->HeaderVisible = false; var_FaceTree->LinesAtRoot = Extreecubelib_tlb::LinesAtRootEnum::exGroupLines; var_FaceTree->DrawGridLines = Extreecubelib_tlb::GridLinesEnum::exRowLines; var_FaceTree->Columns->Add(L"")->Alignment = Extreecubelib_tlb::AlignmentEnum::LeftAlignment; Extreecubelib_tlb::IItemsPtr var_Items = var_FaceTree->Items; Extreecubelib_tlb::IItemsPtr var_Items1 = var_Items->Add(TVariant("Root 1"))->Items; var_Items1->Add(TVariant("Child 1")); var_Items1->Add(TVariant("Child 2")); var_Items1->Add(TVariant("Child 3")); Extreecubelib_tlb::IItemsPtr var_Items2 = var_Items->Add(TVariant("Root 2"))->Items; var_Items2->Add(TVariant("Child 1")); var_Items2->Add(TVariant("Child 2")); var_Items2->Add(TVariant("Child 3")); var_Items->ExpandAll(); TreeCube1->EndUpdate();
C#
// FaceTreeExpandItem event - Notifies that an item has been expanded/collapsed into a face of tree type. private void extreecube1_FaceTreeExpandItem(object sender,exontrol.EXTREECUBELib.FaceTree Tree,int Item) { System.Diagnostics.Debug.Print( Item.ToString() ); } //this.extreecube1.FaceTreeExpandItem += new exontrol.EXTREECUBELib.exg2antt.FaceTreeExpandItemEventHandler(this.extreecube1_FaceTreeExpandItem); extreecube1.BeginUpdate(); exontrol.EXTREECUBELib.FaceTree var_FaceTree = extreecube1.FrontFace.CreateTree(); var_FaceTree.ExpandOnDblClick = true; var_FaceTree.ItemPadding = 10; var_FaceTree.HeaderVisible = false; var_FaceTree.LinesAtRoot = exontrol.EXTREECUBELib.LinesAtRootEnum.exGroupLines; var_FaceTree.DrawGridLines = exontrol.EXTREECUBELib.GridLinesEnum.exRowLines; var_FaceTree.Columns.Add("").Alignment = exontrol.EXTREECUBELib.AlignmentEnum.LeftAlignment; exontrol.EXTREECUBELib.Items var_Items = var_FaceTree.Items; exontrol.EXTREECUBELib.Items var_Items1 = var_Items.Add("Root 1").Items; var_Items1.Add("Child 1"); var_Items1.Add("Child 2"); var_Items1.Add("Child 3"); exontrol.EXTREECUBELib.Items var_Items2 = var_Items.Add("Root 2").Items; var_Items2.Add("Child 1"); var_Items2.Add("Child 2"); var_Items2.Add("Child 3"); var_Items.ExpandAll(); extreecube1.EndUpdate();
JScript/JavaScript
<BODY onload="Init()"> <SCRIPT FOR="TreeCube1" EVENT="FaceTreeExpandItem(Tree,Item)" LANGUAGE="JScript"> alert( Item ); </SCRIPT> <OBJECT CLASSID="clsid:13A5B44B-DBB7-42F2-AE2B-943A6CF6C8B9" id="TreeCube1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { TreeCube1.BeginUpdate(); var var_FaceTree = TreeCube1.FrontFace.CreateTree(); var_FaceTree.ExpandOnDblClick = true; var_FaceTree.ItemPadding = 10; var_FaceTree.HeaderVisible = false; var_FaceTree.LinesAtRoot = 2; var_FaceTree.DrawGridLines = -2; var_FaceTree.Columns.Add("").Alignment = 0; var var_Items = var_FaceTree.Items; var var_Items1 = var_Items.Add("Root 1").Items; var_Items1.Add("Child 1"); var_Items1.Add("Child 2"); var_Items1.Add("Child 3"); var var_Items2 = var_Items.Add("Root 2").Items; var_Items2.Add("Child 1"); var_Items2.Add("Child 2"); var_Items2.Add("Child 3"); var_Items.ExpandAll(); TreeCube1.EndUpdate(); } </SCRIPT> </BODY>
VBScript
<BODY onload="Init()"> <SCRIPT LANGUAGE="VBScript"> Function TreeCube1_FaceTreeExpandItem(Tree,Item) With TreeCube1 alert( Item ) End With End Function </SCRIPT> <OBJECT CLASSID="clsid:13A5B44B-DBB7-42F2-AE2B-943A6CF6C8B9" id="TreeCube1"></OBJECT> <SCRIPT LANGUAGE="VBScript"> Function Init() With TreeCube1 .BeginUpdate With .FrontFace.CreateTree .ExpandOnDblClick = True .ItemPadding = 10 .HeaderVisible = False .LinesAtRoot = 2 .DrawGridLines = -2 .Columns.Add("").Alignment = 0 With .Items With .Add("Root 1").Items .Add "Child 1" .Add "Child 2" .Add "Child 3" End With With .Add("Root 2").Items .Add "Child 1" .Add "Child 2" .Add "Child 3" End With .ExpandAll End With End With .EndUpdate End With End Function </SCRIPT> </BODY>
C# for /COM
// FaceTreeExpandItem event - Notifies that an item has been expanded/collapsed into a face of tree type. private void axTreeCube1_FaceTreeExpandItem(object sender, AxEXTREECUBELib._ITreeCubeEvents_FaceTreeExpandItemEvent e) { System.Diagnostics.Debug.Print( e.item.ToString() ); } //this.axTreeCube1.FaceTreeExpandItem += new AxEXTREECUBELib._ITreeCubeEvents_FaceTreeExpandItemEventHandler(this.axTreeCube1_FaceTreeExpandItem); axTreeCube1.BeginUpdate(); EXTREECUBELib.FaceTree var_FaceTree = axTreeCube1.FrontFace.CreateTree(); var_FaceTree.ExpandOnDblClick = true; var_FaceTree.ItemPadding = 10; var_FaceTree.HeaderVisible = false; var_FaceTree.LinesAtRoot = EXTREECUBELib.LinesAtRootEnum.exGroupLines; var_FaceTree.DrawGridLines = EXTREECUBELib.GridLinesEnum.exRowLines; var_FaceTree.Columns.Add("").Alignment = EXTREECUBELib.AlignmentEnum.LeftAlignment; EXTREECUBELib.Items var_Items = var_FaceTree.Items; EXTREECUBELib.Items var_Items1 = var_Items.Add("Root 1").Items; var_Items1.Add("Child 1"); var_Items1.Add("Child 2"); var_Items1.Add("Child 3"); EXTREECUBELib.Items var_Items2 = var_Items.Add("Root 2").Items; var_Items2.Add("Child 1"); var_Items2.Add("Child 2"); var_Items2.Add("Child 3"); var_Items.ExpandAll(); axTreeCube1.EndUpdate();
X++ (Dynamics Ax 2009)
// FaceTreeExpandItem event - Notifies that an item has been expanded/collapsed into a face of tree type. void onEvent_FaceTreeExpandItem(COM _Tree,int _Item) { ; print( _Item ); } public void init() { COM com_Column,com_Columns,com_FaceTree,com_Item,com_Items,com_Items1,com_Items2; anytype var_Column,var_Columns,var_FaceTree,var_Item,var_Items,var_Items1,var_Items2; ; super(); extreecube1.BeginUpdate(); var_FaceTree = extreecube1.FrontFace().CreateTree(); com_FaceTree = var_FaceTree; com_FaceTree.ExpandOnDblClick(true); com_FaceTree.ItemPadding(10); com_FaceTree.HeaderVisible(false); com_FaceTree.LinesAtRoot(2/*exGroupLines*/); com_FaceTree.DrawGridLines(-2/*exRowLines*/); var_Columns = COM::createFromObject(com_FaceTree.Columns()); com_Columns = var_Columns; var_Column = COM::createFromObject(com_Columns).Add(""); com_Column = var_Column; com_Column.Alignment(0/*LeftAlignment*/); var_Items = com_FaceTree.Items(); com_Items = var_Items; var_Item = COM::createFromObject(com_Items.Add("Root 1")); com_Item = var_Item; var_Items1 = com_Item.Items(); com_Items1 = var_Items1; com_Items1.Add("Child 1"); com_Items1.Add("Child 2"); com_Items1.Add("Child 3"); var_Item = COM::createFromObject(com_Items.Add("Root 2")); com_Item = var_Item; var_Items2 = com_Item.Items(); com_Items2 = var_Items2; com_Items2.Add("Child 1"); com_Items2.Add("Child 2"); com_Items2.Add("Child 3"); com_Items.ExpandAll(); extreecube1.EndUpdate(); }
Delphi 8 (.NET only)
// FaceTreeExpandItem event - Notifies that an item has been expanded/collapsed into a face of tree type. procedure TWinForm1.AxTreeCube1_FaceTreeExpandItem(sender: System.Object; e: AxEXTREECUBELib._ITreeCubeEvents_FaceTreeExpandItemEvent); begin with AxTreeCube1 do begin OutputDebugString( e.item ); end end; with AxTreeCube1 do begin BeginUpdate(); with FrontFace.CreateTree() do begin ExpandOnDblClick := True; ItemPadding := 10; HeaderVisible := False; LinesAtRoot := EXTREECUBELib.LinesAtRootEnum.exGroupLines; DrawGridLines := EXTREECUBELib.GridLinesEnum.exRowLines; Columns.Add('').Alignment := EXTREECUBELib.AlignmentEnum.LeftAlignment; with Items do begin with Add('Root 1').Items do begin Add('Child 1'); Add('Child 2'); Add('Child 3'); end; with Add('Root 2').Items do begin Add('Child 1'); Add('Child 2'); Add('Child 3'); end; ExpandAll(); end; end; EndUpdate(); end
Delphi (standard)
// FaceTreeExpandItem event - Notifies that an item has been expanded/collapsed into a face of tree type. procedure TForm1.TreeCube1FaceTreeExpandItem(ASender: TObject; Tree : IFaceTree;Item : Integer); begin with TreeCube1 do begin OutputDebugString( Item ); end end; with TreeCube1 do begin BeginUpdate(); with FrontFace.CreateTree() do begin ExpandOnDblClick := True; ItemPadding := 10; HeaderVisible := False; LinesAtRoot := EXTREECUBELib_TLB.exGroupLines; DrawGridLines := EXTREECUBELib_TLB.exRowLines; Columns.Add('').Alignment := EXTREECUBELib_TLB.LeftAlignment; with Items do begin with Add('Root 1').Items do begin Add('Child 1'); Add('Child 2'); Add('Child 3'); end; with Add('Root 2').Items do begin Add('Child 1'); Add('Child 2'); Add('Child 3'); end; ExpandAll(); end; end; EndUpdate(); end
VFP
*** FaceTreeExpandItem event - Notifies that an item has been expanded/collapsed into a face of tree type. *** LPARAMETERS Tree,Item with thisform.TreeCube1 DEBUGOUT( Item ) endwith with thisform.TreeCube1 .BeginUpdate with .FrontFace.CreateTree .ExpandOnDblClick = .T. .ItemPadding = 10 .HeaderVisible = .F. .LinesAtRoot = 2 .DrawGridLines = -2 .Columns.Add("").Alignment = 0 with .Items with .Add("Root 1").Items .Add("Child 1") .Add("Child 2") .Add("Child 3") endwith with .Add("Root 2").Items .Add("Child 1") .Add("Child 2") .Add("Child 3") endwith .ExpandAll endwith endwith .EndUpdate endwith
dBASE Plus
/* with (this.EXTREECUBEACTIVEXCONTROL1.nativeObject) FaceTreeExpandItem = class::nativeObject_FaceTreeExpandItem endwith */ // Notifies that an item has been expanded/collapsed into a face of tree type. function nativeObject_FaceTreeExpandItem(Tree,Item) oTreeCube = form.EXTREECUBEACTIVEXCONTROL1.nativeObject ? Str(Item) return local oTreeCube,var_Column,var_FaceTree,var_Items,var_Items1,var_Items2 oTreeCube = form.EXTREECUBEACTIVEXCONTROL1.nativeObject oTreeCube.BeginUpdate() var_FaceTree = oTreeCube.FrontFace.CreateTree() var_FaceTree.ExpandOnDblClick = true var_FaceTree.ItemPadding = 10 var_FaceTree.HeaderVisible = false var_FaceTree.LinesAtRoot = 2 var_FaceTree.DrawGridLines = -2 // var_FaceTree.Columns.Add("").Alignment = 0 var_Column = var_FaceTree.Columns.Add("") with (oTreeCube) TemplateDef = [dim var_Column] TemplateDef = var_Column Template = [var_Column.Alignment = 0] endwith var_Items = var_FaceTree.Items var_Items1 = var_Items.Add("Root 1").Items var_Items1.Add("Child 1") var_Items1.Add("Child 2") var_Items1.Add("Child 3") var_Items2 = var_Items.Add("Root 2").Items var_Items2.Add("Child 1") var_Items2.Add("Child 2") var_Items2.Add("Child 3") var_Items.ExpandAll() oTreeCube.EndUpdate()
XBasic (Alpha Five)
' Notifies that an item has been expanded/collapsed into a face of tree type. function FaceTreeExpandItem as v (Tree as OLE::Exontrol.TreeCube.1::IFaceTree,Item as N) oTreeCube = topparent:CONTROL_ACTIVEX1.activex ? Item end function Dim oTreeCube as P Dim var_Column as local Dim var_FaceTree as P Dim var_Items as P Dim var_Items1 as P Dim var_Items2 as P oTreeCube = topparent:CONTROL_ACTIVEX1.activex oTreeCube.BeginUpdate() var_FaceTree = oTreeCube.FrontFace.CreateTree() var_FaceTree.ExpandOnDblClick = .t. var_FaceTree.ItemPadding = 10 var_FaceTree.HeaderVisible = .f. var_FaceTree.LinesAtRoot = 2 var_FaceTree.DrawGridLines = -2 ' var_FaceTree.Columns.Add("").Alignment = 0 var_Column = var_FaceTree.Columns.Add("") oTreeCube.TemplateDef = "dim var_Column" oTreeCube.TemplateDef = var_Column oTreeCube.Template = "var_Column.Alignment = 0" var_Items = var_FaceTree.Items var_Items1 = var_Items.Add("Root 1").Items var_Items1.Add("Child 1") var_Items1.Add("Child 2") var_Items1.Add("Child 3") var_Items2 = var_Items.Add("Root 2").Items var_Items2.Add("Child 1") var_Items2.Add("Child 2") var_Items2.Add("Child 3") var_Items.ExpandAll() oTreeCube.EndUpdate()
Visual Objects
METHOD OCX_Exontrol1FaceTreeExpandItem(Tree,Item) CLASS MainDialog // FaceTreeExpandItem event - Notifies that an item has been expanded/collapsed into a face of tree type. OutputDebugString(String2Psz( AsString(Item) )) RETURN NIL local var_FaceTree as IFaceTree local var_Items,var_Items1,var_Items2 as IItems oDCOCX_Exontrol1:BeginUpdate() var_FaceTree := oDCOCX_Exontrol1:FrontFace:CreateTree() var_FaceTree:ExpandOnDblClick := true var_FaceTree:ItemPadding := 10 var_FaceTree:HeaderVisible := false var_FaceTree:LinesAtRoot := exGroupLines var_FaceTree:DrawGridLines := exRowLines var_FaceTree:Columns:Add(""):Alignment := LeftAlignment var_Items := var_FaceTree:Items var_Items1 := var_Items:Add("Root 1"):Items var_Items1:Add("Child 1") var_Items1:Add("Child 2") var_Items1:Add("Child 3") var_Items2 := var_Items:Add("Root 2"):Items var_Items2:Add("Child 1") var_Items2:Add("Child 2") var_Items2:Add("Child 3") var_Items:ExpandAll() oDCOCX_Exontrol1:EndUpdate()
PowerBuilder
/*begin event FaceTreeExpandItem(oleobject Tree,long Item) - Notifies that an item has been expanded/collapsed into a face of tree type.*/ /* oTreeCube = ole_1.Object MessageBox("Information",string( String(Item) )) */ /*end event FaceTreeExpandItem*/ OleObject oTreeCube,var_FaceTree,var_Items,var_Items1,var_Items2 oTreeCube = ole_1.Object oTreeCube.BeginUpdate() var_FaceTree = oTreeCube.FrontFace.CreateTree() var_FaceTree.ExpandOnDblClick = true var_FaceTree.ItemPadding = 10 var_FaceTree.HeaderVisible = false var_FaceTree.LinesAtRoot = 2 var_FaceTree.DrawGridLines = -2 var_FaceTree.Columns.Add("").Alignment = 0 var_Items = var_FaceTree.Items var_Items1 = var_Items.Add("Root 1").Items var_Items1.Add("Child 1") var_Items1.Add("Child 2") var_Items1.Add("Child 3") var_Items2 = var_Items.Add("Root 2").Items var_Items2.Add("Child 1") var_Items2.Add("Child 2") var_Items2.Add("Child 3") var_Items.ExpandAll() oTreeCube.EndUpdate()
Visual DataFlex
// Notifies that an item has been expanded/collapsed into a face of tree type. Procedure OnComFaceTreeExpandItem Variant llTree Integer llItem Forward Send OnComFaceTreeExpandItem llTree llItem Showln llItem End_Procedure Procedure OnCreate Forward Send OnCreate Send ComBeginUpdate Variant voFace Get ComFrontFace to voFace Handle hoFace Get Create (RefClass(cComFace)) to hoFace Set pvComObject of hoFace to voFace Variant voFaceTree Get ComCreateTree of hoFace to voFaceTree Handle hoFaceTree Get Create (RefClass(cComFaceTree)) to hoFaceTree Set pvComObject of hoFaceTree to voFaceTree Set ComExpandOnDblClick of hoFaceTree to True Set ComItemPadding of hoFaceTree to 10 Set ComHeaderVisible of hoFaceTree to False Set ComLinesAtRoot of hoFaceTree to OLEexGroupLines Set ComDrawGridLines of hoFaceTree to OLEexRowLines Variant voColumns Get ComColumns of hoFaceTree to voColumns Handle hoColumns Get Create (RefClass(cComColumns)) to hoColumns Set pvComObject of hoColumns to voColumns Variant voColumn Get ComAdd of hoColumns "" to voColumn Handle hoColumn Get Create (RefClass(cComColumn)) to hoColumn Set pvComObject of hoColumn to voColumn Set ComAlignment of hoColumn to OLELeftAlignment Send Destroy to hoColumn Send Destroy to hoColumns Variant voItems Get ComItems of hoFaceTree to voItems Handle hoItems Get Create (RefClass(cComItems)) to hoItems Set pvComObject of hoItems to voItems Variant voItem Get ComAdd of hoItems "Root 1" to voItem Handle hoItem Get Create (RefClass(cComItem)) to hoItem Set pvComObject of hoItem to voItem Variant voItems1 Get ComItems of hoItem to voItems1 Handle hoItems1 Get Create (RefClass(cComItems)) to hoItems1 Set pvComObject of hoItems1 to voItems1 Get ComAdd of hoItems1 "Child 1" to Nothing Get ComAdd of hoItems1 "Child 2" to Nothing Get ComAdd of hoItems1 "Child 3" to Nothing Send Destroy to hoItems1 Send Destroy to hoItem Variant voItem1 Get ComAdd of hoItems "Root 2" to voItem1 Handle hoItem1 Get Create (RefClass(cComItem)) to hoItem1 Set pvComObject of hoItem1 to voItem1 Variant voItems2 Get ComItems of hoItem1 to voItems2 Handle hoItems2 Get Create (RefClass(cComItems)) to hoItems2 Set pvComObject of hoItems2 to voItems2 Get ComAdd of hoItems2 "Child 1" to Nothing Get ComAdd of hoItems2 "Child 2" to Nothing Get ComAdd of hoItems2 "Child 3" to Nothing Send Destroy to hoItems2 Send Destroy to hoItem1 Send ComExpandAll of hoItems Send Destroy to hoItems Send Destroy to hoFaceTree Send Destroy to hoFace Send ComEndUpdate End_Procedure
XBase++
PROCEDURE OnFaceTreeExpandItem(oTreeCube,Tree,Item) DevOut( Transform(Item,"") ) RETURN #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oFaceTree LOCAL oItems,oItems1,oItems2 LOCAL oTreeCube oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oTreeCube := XbpActiveXControl():new( oForm:drawingArea ) oTreeCube:CLSID := "Exontrol.TreeCube.1" /*{13A5B44B-DBB7-42F2-AE2B-943A6CF6C8B9}*/ oTreeCube:create(,, {10,60},{610,370} ) oTreeCube:FaceTreeExpandItem := {|Tree,Item| OnFaceTreeExpandItem(oTreeCube,Tree,Item)} /*Notifies that an item has been expanded/collapsed into a face of tree type.*/ oTreeCube:BeginUpdate() oFaceTree := oTreeCube:FrontFace():CreateTree() oFaceTree:ExpandOnDblClick := .T. oFaceTree:ItemPadding := 10 oFaceTree:HeaderVisible := .F. oFaceTree:LinesAtRoot := 2/*exGroupLines*/ oFaceTree:DrawGridLines := -2/*exRowLines*/ oFaceTree:Columns():Add(""):Alignment := 0/*LeftAlignment*/ oItems := oFaceTree:Items() oItems1 := oItems:Add("Root 1"):Items() oItems1:Add("Child 1") oItems1:Add("Child 2") oItems1:Add("Child 3") oItems2 := oItems:Add("Root 2"):Items() oItems2:Add("Child 1") oItems2:Add("Child 2") oItems2:Add("Child 3") oItems:ExpandAll() oTreeCube:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN