dotNetClass "System.Windows.Forms.View").

 
if (splitViewRollout != undefined) and (splitViewRollout.isDisplayed) do (destroyDialog splitViewRollout)
global splitViewRollout
rollout splitViewRollout " 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:[305,5]
 
 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 splitViewRollout open do
 (
  initTreeView tv
  fillInTreeView tv
 
  initListView lv_Properties
  fillInSpreadsheet lv_Properties
 )
)
createDialog splitViewRollout 600 525 style:#(#style_sysmenu, #style_titlebar, #style_toolwindow)
callbacks.addScript #preNodeGeneralPropChanged "splitViewRollout.fillInSpreadsheet splitViewRollout.lv_Properties"

posted on 2011-10-08 19:46  盖天00  阅读(601)  评论(0编辑  收藏  举报

导航