Notifications
Clear all

[Closed] Undo bug in max 2011?

I found a strange undo behavior in max 2011. In max 2010 this works just fine.
This is the problematic code:

try(destroydialog testR)catch()
rollout testR ""
(	
	local listItems = #("Translate X","Translate Y","Translate Z","Rotate X","Ratate Y","Rotate Z","Scale X","Scale Y","Scale Z")
	dotNetControl attribListLV "System.Windows.Forms.Listbox" height:170 width:96 pos:[2,20]
	fn initAttribListLV = (
		attribListLV.items.addrange ListItems
	)
	on attribListLV MouseDown _button do
	(
		if _button.button==_button.button.right do
		(
			print "Undo"
			max undo
		)
	)
	on testR open do
	(
		initAttribListLV()
	)
)
createdialog testR pos:[200,200]

But when I evaluate “max undo” as the button event, it works:

try(destroydialog testR2)catch()
rollout testR2 ""
(	
	button testB "Press Me"
	on testB pressed do(
		print "Undo"
		max undo
	)
)
createdialog testR2

This looks like bug to me. But maybe there is a workaround of this?

6 Replies

if _button.button==_button.button.right do…

it’s probably never TRUE

if _button.button==_button.button.right
It is true when user right click on the Listbox, but even if we use this instead:


	on attribListLV MouseDown _button do
	(
		print "Undo"
		max undo
	)

It still does nothing with undo.

1 Reply
(@denist)
Joined: 1 year ago

Posts: 0

Do you want to say that a Listbox control doesn’t fire MouseDown event in MAX 2011?

It fires everything exept ‘undo max’.
I put the print command before and after undo to be sure that max read this command. It looks like max only cann’t run ‘max undo’ from dotNet listbox.

2 Replies
(@denist)
Joined: 1 year ago

Posts: 0

strange… i have no idea how it might be possible. Does it do Undo on MouseUp or MouseClick events?

(@pchela1313)
Joined: 1 year ago

Posts: 0

Yes MouseUp works, but also only without any mouse button check. Others events doesn’t work.