Notifications
Clear all

[Closed] reduceKeys and rollout

hello everyone,

I have a script that open a dialog and use a reduceKeys function. My problem is that after applying the reduceKeys, the dialog is closed. I tried adding another “createDialog “, but it doesn’t work.

here is an exemple

(
 toto = point ()
 animate on at time 100 toto.position = [100 , 100 , 100]
  
 global  testRollout
 try(destroyDialog  keyReducerMan) catch()
 rollout testRollout "Collapse Reduced Keys" width:150 height:240
 	(
 		button btnPick "pick tracks" pos:[10,20] width:127 height:20	
 		/* button action */
 		on  btnPick pressed do (	
 				reduceKeys  toto.position.controller 0.5 1f
 		)
 	)
 createDialog testRollout 150 250
 )

any idea to keep the dialog opened or reopen it ?

Anyhelp will be greatly appreciated !

Jerome

6 Replies
1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

to display the dialog back you need to do two things:

  1. to get the dialog’s hwnd
  2. restore the dialog

global  testRollout
try(destroyDialog  testRollout) catch()
(
--	toto = point name:"toto"
--	animate on at time 100 $toto.position = [100 , 100 , 100]
  
	rollout testRollout "Collapse Reduced Keys" width:150 height:240
	 (
		 button btnPick "pick tracks" pos:[10,20] width:127 height:20	
		 /* button action */
		 on  btnPick pressed do 
		(
			reduceKeys $toto.position.controller 0.5 1f
			hwnd = windows.getChildHWND 0 testRollout.title
			windows.sendMessage hwnd[1] 0x0112 0xF120 0 [color=Lime]-- restore[/color]
		)
	 )
	createDialog testRollout 150 250
)
 

 JHN

Yes I have had this problem too, i think I moved the dialog offscreen first (get/setDialogPos) then do the reducekeys and then move it back. The actual problem is not the reduceKeys but the progresbar running, it hides all active dialogs and returns only the ones that aren’t scripted. It’s a know issue… I need to look into a script I have how I fixed it exactly. Createdialog probably works when you destroy it first.

-Johan

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

it’s a known issue but it can be solved. (see my previous post)

 JHN

Alright, great stuff! Out of curiosity what happens to the window exactly, does it get hidden, or moved offscreen or something else?

Thanks Denis,
-Johan

1 Reply
(@kachoudas)
Joined: 11 months ago

Posts: 0

Thank you very much ! it works like a charm.

Me too, I’m curious about this. I have read the documentation about sendMessage and getChildHWND, but I must admit it’s a bit obscureto me.

in short the window gets hidden.