excascadetree - sample code |
How can I add multiple-views to the control? VBA (MS Access, Excell...) With CascadeTree1 .BeginUpdate .DataSource = "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Co" & _ "untry;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateNam" & _ "e;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select *" & _ " FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name" .Select = "US\AK" .EndUpdate End With VB6 With CascadeTree1 .BeginUpdate .DataSource = "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Co" & _ "untry;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateNam" & _ "e;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select *" & _ " FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name" .Select = "US\AK" .EndUpdate End With VB.NET With Excascadetree1 .BeginUpdate() .DataSource = "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Co" & _ "untry;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateNam" & _ "e;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select *" & _ " FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name" .Select = "US\AK" .EndUpdate() End With VB.NET for /COM With AxCascadeTree1 .BeginUpdate() .DataSource = "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Co" & _ "untry;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateNam" & _ "e;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select *" & _ " FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name" .Select = "US\AK" .EndUpdate() End With C++ /* Copy and paste the following directives to your header file as it defines the namespace 'EXCASCADETREELib' for the library: 'ExCascadeTree 1.0 Control Library' #import <ExCascadeTree.dll> using namespace EXCASCADETREELib; */ EXCASCADETREELib::ICascadeTreePtr spCascadeTree1 = GetDlgItem(IDC_CASCADETREE1)->GetControlUnknown(); spCascadeTree1->BeginUpdate(); spCascadeTree1->PutDataSource(_bstr_t("Source=C:\\Program Files\\Exontrol\\ExCascadeTree\\Sample\\Access\\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;") + "Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=St" + "ateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Se" + "lect * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Na" + "me"); spCascadeTree1->PutSelect(L"US\\AK"); spCascadeTree1->EndUpdate(); C++ Builder CascadeTree1->BeginUpdate(); CascadeTree1->set_DataSource(TVariant(String("Source=C:\\Program Files\\Exontrol\\ExCascadeTree\\Sample\\Access\\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;") + "Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=St" + "ateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Se" + "lect * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Na" + "me")); CascadeTree1->Select = L"US\\AK"; CascadeTree1->EndUpdate(); C# excascadetree1.BeginUpdate(); excascadetree1.DataSource = "Source=C:\\Program Files\\Exontrol\\ExCascadeTree\\Sample\\Access\\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;" + "Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=St" + "ateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Se" + "lect * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Na" + "me"; excascadetree1.Select = "US\\AK"; excascadetree1.EndUpdate(); JScript/JavaScript <BODY onload="Init()"> <OBJECT CLASSID="clsid:4DD131BB-181C-428B-B0F3-8449ADA3AF49" id="CascadeTree1"></OBJECT> <SCRIPT LANGUAGE="JScript"> function Init() { CascadeTree1.BeginUpdate(); CascadeTree1.DataSource = "Source=C:\\Program Files\\Exontrol\\ExCascadeTree\\Sample\\Access\\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;" + "Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=St" + "ateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Se" + "lect * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Na" + "me"; CascadeTree1.Select = "US\\AK"; CascadeTree1.EndUpdate(); } </SCRIPT> </BODY> VBScript <BODY onload="Init()"> <OBJECT CLASSID="clsid:4DD131BB-181C-428B-B0F3-8449ADA3AF49" id="CascadeTree1"></OBJECT> <SCRIPT LANGUAGE="VBScript"> Function Init() With CascadeTree1 .BeginUpdate .DataSource = "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Co" & _ "untry;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateNam" & _ "e;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select *" & _ " FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name" .Select = "US\AK" .EndUpdate End With End Function </SCRIPT> </BODY> C# for /COM axCascadeTree1.BeginUpdate(); axCascadeTree1.DataSource = "Source=C:\\Program Files\\Exontrol\\ExCascadeTree\\Sample\\Access\\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;" + "Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=St" + "ateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Se" + "lect * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Na" + "me"; axCascadeTree1.Select = "US\\AK"; axCascadeTree1.EndUpdate(); X++ (Dynamics Ax 2009) public void init() { str var_s; ; super(); excascadetree1.BeginUpdate(); var_s = "Source=C:\\Program Files\\Exontrol\\ExCascadeTree\\Sample\\Access\\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Cou"; var_s = var_s + "ntry;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName"; var_s = var_s + ";Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * "; var_s = var_s + "FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name"; excascadetree1.DataSource(COMVariant::createFromStr(var_s)); excascadetree1.Select("US\\AK"); excascadetree1.EndUpdate(); } Delphi 8 (.NET only) with AxCascadeTree1 do begin BeginUpdate(); DataSource := 'Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Cou' + 'ntry;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName' + ';Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * ' + 'FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name'; Select := 'US\AK'; EndUpdate(); end Delphi (standard) with CascadeTree1 do begin BeginUpdate(); DataSource := 'Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Cou' + 'ntry;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName' + ';Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * ' + 'FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name'; Select := 'US\AK'; EndUpdate(); end VFP with thisform.CascadeTree1 .BeginUpdate var_s = "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Cou" var_s = var_s + "ntry;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName" var_s = var_s + ";Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * " var_s = var_s + "FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name" .DataSource = var_s .Select = "US\AK" .EndUpdate endwith dBASE Plus local oCascadeTree oCascadeTree = form.EXCASCADETREEACTIVEXCONTROL1.nativeObject oCascadeTree.BeginUpdate() oCascadeTree.DataSource = "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name" oCascadeTree.Select = "US\AK" oCascadeTree.EndUpdate() XBasic (Alpha Five) Dim oCascadeTree as P oCascadeTree = topparent:CONTROL_ACTIVEX1.activex oCascadeTree.BeginUpdate() oCascadeTree.DataSource = "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name" oCascadeTree.Select = "US\AK" oCascadeTree.EndUpdate() Visual Objects oDCOCX_Exontrol1:BeginUpdate() oDCOCX_Exontrol1:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name" oDCOCX_Exontrol1:Select := "US\AK" oDCOCX_Exontrol1:EndUpdate() PowerBuilder OleObject oCascadeTree oCascadeTree = ole_1.Object oCascadeTree.BeginUpdate() oCascadeTree.DataSource = "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name" oCascadeTree.Select = "US\AK" oCascadeTree.EndUpdate() Visual DataFlex
XBase++ #include "AppEvent.ch" #include "ActiveX.ch" PROCEDURE Main LOCAL oForm LOCAL nEvent := 0, mp1 := NIL, mp2 := NIL, oXbp := NIL LOCAL oCascadeTree oForm := XbpDialog():new( AppDesktop() ) oForm:drawingArea:clipChildren := .T. oForm:create( ,,{100,100}, {640,480},, .F. ) oForm:close := {|| PostAppEvent( xbeP_Quit )} oCascadeTree := XbpActiveXControl():new( oForm:drawingArea ) oCascadeTree:CLSID := "Exontrol.CascadeTree.1" /*{4DD131BB-181C-428B-B0F3-8449ADA3AF49}*/ oCascadeTree:create(,, {10,60},{610,370} ) oCascadeTree:BeginUpdate() oCascadeTree:DataSource := "Source=C:\Program Files\Exontrol\ExCascadeTree\Sample\Access\cities.accdb;Member=Select * FROM Countries;Key=CountryCode;Tag=Country;Name=CountryName >>> Member=Select * FROM States WHERE CountryCode IN (<%Parent.CountryCode%>);Key=StateCode;Name=StateName;Tag=State ||| Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.CountryCode%>);Tag=City;Name=Name >>> Member=Select * FROM Cities WHERE CountryCode IN (<%Parent.Parent.CountryCode%>) AND StateCode IN (<%Parent.StateCode%>);Tag=City;Name=Name" oCascadeTree:Select := "US\AK" oCascadeTree:EndUpdate() oForm:Show() DO WHILE nEvent != xbeP_Quit nEvent := AppEvent( @mp1, @mp2, @oXbp ) oXbp:handleEvent( nEvent, mp1, mp2 ) ENDDO RETURN |