Notifications
Clear all

[Closed] dotNet UI

ok. i’m so kind today i know:


try(form.close()) catch()
(
	global form = dotnetobject "Form"

	form.ShowInTaskbar = off
	form.AutoSize = on
	form.AutoSizeMode = form.AutoSizeMode.GrowAndShrink 
	
	images = (dotnetclass "System.Drawing.Image").FromFile (getdir #ui + @"Icons\Maintoolbar_24i.bmp")
	size = images.height
	count = images.width/size-1
	
	
	buttons = for k=0 to count-1 while k < 8 collect
	(
		imagelist = dotnetobject "ImageList"
		imagelist.ImageSize = dotNetObject "System.Drawing.Size" size size
		
		imagelist.images.Add (images.Clone (dotnetobject "System.Drawing.Rectangle" (size*2*k) 0 size size) images.PixelFormat)
		imagelist.images.Add (images.Clone (dotnetobject "System.Drawing.Rectangle" (size*2*k+size) 0 size size) images.PixelFormat)
		
		bt = dotnetobject "RadioButton"
		bt.Appearance = bt.Appearance.Button
		bt.Backcolor = bt.Backcolor.Transparent
		
		bt.Size = dotnetobject "System.Drawing.Size" (size+8) (size+8)
		bt.ImageList = imagelist
		bt.ImageIndex = 1

		bt.Location = dotnetobject "System.Drawing.Point" (2 + k*bt.Size.width) 2
		bt.name = k as string
			
		fn onMouseEnter s e = (s.ImageIndex = 0)	
		fn onMouseLeave s e = (s.ImageIndex = 1)	
	
		dotnet.addEventHandler bt "MouseEnter" onMouseEnter
		dotnet.addEventHandler bt "MouseLeave" onMouseLeave

		--ControlOps.SetSelectable bt off
		bt
	)
	images.Dispose()
	form.controls.AddRange buttons
	form.Show (dotnetobject "MaxCustomControls.Win32HandleWrapper" (dotnetobject "System.IntPtr" (windows.getmaxhwnd())))
	form
)

What’s the difference between s.tag and s.tag.value in dotNet stuff?

It is possible to store an array in a s.tag?

example

s.tag = #($Teapot_node, [5,0,10], wirecolor)

I use dotNetMXSValue for dotnet tags. I’m pretty sure you can’t put maxscript arrays or objects in dotnet tags. I usually use it for storing a link to the struct instance that contains it and all of the functions and UI the control needs to see.

I got it working.
Thanks to Paul http://forums.cgsociety.org/showpost.php?p=5299723&postcount=258
The full thread is here http://forums.cgsociety.org/showthread.php?p=5299723&highlight=store+struct+tag+property#post5299723

Now if I store a struct in a tag property how do I then call up a property of that struct?


dotNetMXSValue:[(subData node:$Editable_Mesh:Box002 @ [10.236023,-15.559731,0.000000] wirecolor:[10,100,100])]

s.tag.value!

Got it working now.
Nice.

All working now.

How do I return the index number of the item double clicked in a listview?


	on lvCtrls MouseDoubleClick s a do
	(
		clearlistener()
		if (item = s.GetItemAt a.x a.y) != undefined do 
		(
--??
		)
	)

 lo1
item.index

thank you very much

It’s been a while on updates.
How did things go/how are they going?

Page 15 / 18