So i want to dock my rollout on open and remember where it was docked on close
but run into problem, it seems that on close the dialog is undocked and the status is #cui_floatable which make it always float on start and not docked. :/ is there any work around for that?
<code>
try (
cui.UnRegisterDialogBar TestDialog
destroyDialog TestDialog
) catch ()
rollout TestDialog "Title"
(
local DialogDock
local scriptpath = @"D:\MAX - Script\"
local INIfile = scriptpath + "Settings.ini"
button btn "Button"
function dockstatus = (
DialogDock = getINISetting INIfile "Dialog" "Dock"
TestDock = case DialogDock of (
("cui_dock_left"): #cui_dock_left
("cui_dock_right"): #cui_dock_right
("cui_dock_bottom"): #cui_dock_bottom
("cui_dock_top"): #cui_dock_top
("cui_floatable"): #cui_floatable
)
return TestDock
)
on TestDialog open do (
format "Open %\n" (dockstatus())
cui.RegisterDialogBar TestDialog maxsize:[-1,-1] style:#(#cui_dock_all, #cui_floatable, #cui_handles )
cui.DockDialogBar TestDialog (dockstatus())
)
on TestDialog moved pos do (
if TestDialog.dialogbar do (
TestDock = (cui.getDockState TestDialog)
setINISetting INIfile "Dialog" "Dock" TestDock forceUTF16:false
format "Move %\n" (dockstatus())
)
)
on btn pressed do (
cui.UnRegisterDialogBar TestDialog
destroyDialog TestDialog
)
on TestDialog close do (
format "Close %\n" (dockstatus())
)
)
createdialog TestDialog width:275 height:74 style:#()
</code>
By timo.ink · 2016-12-23
miauu · 2016-12-25