If (splitviewrolout! = Undefined) and (splitviewrolout. isdisplayed) Do (destroydialog splitviewrolout)
Global splitviewrolout
Rolout splitviewrolout "modifiers"
(
-- Treeview
FN inittreeview TV =
(
TV. checkboxes = true
TV. Sorted = true
)
FN addmodifiers thenode themodifiers =
(
For m in themodifiers do
(
Newnode = thenode. nodes. Add M. Name
Newnode. Tag = dotnetmxsvalue m
Newnode. Checked = M. Enabled
)
)
FN addobjects thenode theobjects =
(
For C in theobjects do
(
Newnode = thenode. nodes. Add C. Name
Newnode. Tag = dotnetmxsvalue C
Newnode. Checked = Not C. ishidden
Newnode. forecolor = (dotnetclass "system. Drawing. Color"). fromargb 200 0 0
Addmodifiers newnode C. Modifiers
)
)
FN fillintreeview TV =
(
Theroot = TV. nodes. Add "(objects )"
Rootnodes = for o in objects collect o
Addobjects theroot rootnodes
)
-- Listview
FN initlistview Lv =
(
LV. gridlines = true
LV. view = (dotnetclass "system. Windows. Forms. View"). Details
LV. fullrowselect = true
Layoutdef = # ("property", 120), # ("value", 60 ))
For I in layoutdef do (LV. Columns. Add I [1] I [2])
)
FN fillinspreadsheet Lv =
(
LV. Items. Clear ()
Therange = #()
If selection. Count = 1 and mynode! = Undefined do
(
Propnamesarray = getpropnames mynode
For I = 1 to propnamesarray. Count do
(
Li = dotnetobject "system. Windows. Forms. listviewitem" (propnamesarray [I]) as string)
Sub_li = Li. subitems. Add (getproperty mynode propnamesarray [I]) as string)
Append therange Li
)
LV. Items. addrange therange
)
)
Dotnetcontrol TV "Treeview" width: 290 Height: 490 pos: [5, 5]
Dotnetcontrol lv_properties "system. Windows. Forms. listview" width: 290 Height: 490 pos: []
On TV click Arg do
(
Hitnode = TV. getnodeat (dotnetobject "system. Drawing. Point" Arg. x Arg. Y)
If hitnode! = Undefined do
(
Try
(
If superclassof hitnode. Tag. value = modifier then (select hitnode. Parent. Tag. value)
Else (select hitnode. Tag. value)
Global mynode = hitnode. Tag. Value
)
Catch (max select none)
Fillinspreadsheet lv_properties
)
)
On splitviewrolout open do
(
Inittreeview TV
Fillintreeview TV
Initlistview lv_properties
Fillinspreadsheet lv_properties
)
)
Createdialog splitviewrolout 600 525 style: # (# style_sysmenu, # style_titlebar, # style_toolwindow)
Callbacks. addscript # prenodegeneralpropchanged "splitviewrolout. fillinspreadsheet splitviewrolout. lv_properties"