Message 1 of 3
Dynamic Dialog Issue when dialog is modal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Has anyone else experienced this and know a work around?
Is there a way to simulate Modal for 3ds dialogs?
The situation occurs when you dynamically create a rollout and add it to a SubRollout UI element within a rollout that is displayed in a dialog, via createDialog and that has modal set to true. The dynamically create UI is non-responsive. This was not the case in Max 2018.
(
global RenderElementsOptions
try( destroyDialog testModal ) catch()
rollout testModal ""
(
label lb01 "test dynamic rollout in modal"
subrollout REO_subrollout "Render Elements Controls" pos:[10,30] width:410 height:240
on testModal open do
(
local ControlNumber = 1
local RendElement = Z_Depth()
local AddProp = "zMin"
local exStr = "" as stringStream
local tnValue = 3
format "rollout RenderElementsOptions \"% Controls\"\n(\n" ( classof RendElement ) to:exStr
format " label LB_% \"%\" offset:[60,0] align:#left across:2 \n" (ControlNumber as string) ((AddProp as String) ) tnValue to:exStr
format " spinner spn_% \"\" width:60 type:#integer range:[0,65535,%] align:#center\n" (ControlNumber as string) tnValue to:exStr
format " on spn_% changed val do\n(\nREtest.% = val\n)\n" (ControlNumber as string) (AddProp as String) to:exStr
format "\n)\n" to:exStr
format "%\n" exStr
execute ( exStr as String )
AddSubRollout testModal.REO_subrollout RenderElementsOptions
setFocus testModal.REO_subrollout
)
)
createDialog testModal 430 400 modal:true
)
Code above will generate a dialog with a dynamic subrollout. Changing the modal:true to false will allow the interface to work, but the dialog will no longer be modal. (not desirable in my situation)
Thanks
Keith R Morrison
Max 2021