RC menu that close dialog differently but in one click

<code> ( 
global Dialog01
global Dialog01
global MainMyRC

RcMenu MyTry
(
menuItem Cl_01 "Close"

-- function that close eachdialog separately when I pick this menu item
-- like when when in hlWorld01, I picked cl_01 it close hlWorld01 dialog only not hlWorld02
-- PS : when I pick those item, hlWorld02 also open
-- summary : all in one close button, but separately closing dialog

)

fn Dialog01 =
(
rollout hlWorld01 "Untitled" width:162 height:71
(
button btn3 "halo 01" pos:[8,10] width:144 height:32

on hlWorld01 rbuttondown mousehitpoint do (PopUpMenu MyTry)
)
createDialog hlWorld01
)

fn Dialog02 =
(
rollout hlWorld02 "Untitled" width:162 height:71
(
button btn4 "halo 02" pos:[8,10] width:144 height:32

on hlWorld02 rbuttondown mousehitpoint do (PopUpMenu MyTry)
)
createDialog hlWorld02
)

--================================================== ==================================
rollout MainMyRC "Untitled" width:150 height:59
(
button btn1 "Btn1" pos:[6,3] width:138 height:25
button btn2 "Btn 2" pos:[7,31] width:138 height:25

on btn1 pressed do
(
Dialog01()
)

on btn2 pressed do
(
Dialog02()
)
)
createDialog MainMyRC
)

</code>

Hi everyone, I need some suggestion or advice or help, I have RC menu that will pop out in different dialog (hlWorld01, hlWorld02), but I want it close dialog separately when I pick "Cl_01" in RC menu, basicly when I open hlWorld01&hlWorld02 at the same time , i right click hlWorld01 and pick CL_01, its only destroyDialog hlWorld01 , but not hlWorld02, same goes as reverse. Do you have any idea how to do that ? thanks

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
Swordslayer's picture

If I get it right, try

If I get it right, try something like this:

global MainMyRC
(
	rollout MainMyRC "Untitled" width:150 height:59
	(
		button btn1 "Btn1" pos:[6,3] width:138 height:25
		button btn2 "Btn 2" pos:[7,31] width:138 height:25
 
		-- private rollouts:
 
		local hlWorld01, hlWorld02
 
		local MyTry = rcMenu MyTry
		(
			local killRoll
 
			fn init roll =
			(
				popUpMenu MyTry
				killRoll = roll
			)
 
			menuItem Cl_01 "Close"
 
			on Cl_01 picked do destroyDialog killRoll
 
		)
 
		rollout hlWorld01 "Untitled" width:162 height:71
		(
			button btn3 "halo 01" pos:[8,10] width:144 height:32
 
			fn launch =
			(
				destroyDialog hlWorld01
				createDialog hlWorld01
			)
 
			on hlWorld01 rbuttondown mousehitpoint do MyTry.init hlWorld01
		)
 
		rollout hlWorld02 "Untitled" width:162 height:71
		(
			button btn4 "halo 02" pos:[8,10] width:144 height:32
 
			fn launch =
			(
				destroyDialog hlWorld02
				createDialog hlWorld02
			)
 
			on hlWorld02 rbuttondown mousehitpoint do MyTry.init hlWorld02
		)
 
		on btn1 pressed do hlWorld01.launch()
 
		on btn2 pressed do hlWorld02.launch()
	)
	createDialog MainMyRC
)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.