PDA

View Full Version : Problems combining RegisterDialogBar and add/removeSubRollout


PrefeX
06-07-2011, 07:51 PM
Hello everyone, my first time on the forum, and I got to say there is a lot of talent around here!

As I've just started learning MAXScript I was hoping you might tell me why I can't get my UI to work the way I want. The problem is that it works great until I use RegisterDialogBar. After that, all the buttons all seem to freeze up whenever i move or dock the menu.

Been searching around for an possible solution for a while now, so I would really appreciate it if any of you could help me out.

What I'm trying to do is essentially build a system that shows/hides subRollouts depending on what menu-buttons are active.

(

----------------------------------------- VARIABLES AND FUNCTIONS --------------------------------------

-- Main Dialog Window
global MyDialog

-- Window name
WindowName = "Tools Panel"


----------------------------------------------- ROLLOUTS AND BUTTONS --------------------------------------------

-- Rollouts GEO
rollout Rollout_A "Rollout A"
(
button btn_1 "btn 1" width:30
)

rollout Rollout_B "Rollout B"
(
button btn_2 "btn 2"
)

-- Rollout UV
rollout Rollout_C "Rollout C"
(
button btn_3 "btn 3"
)


--------------------------------------------------- MAIN WINDOW ------------------------------------------------

rollout MyDialog WindowName width:168
(
subRollout menuTools "" pos:[4,38] width:160 height:200


-- Sections buttons (Definition and Initialization, here we define if they are checked by default or not)
checkbutton btn_menu1 "menu1" pos:[4,4] width:30 height:30 checked:true
checkbutton btn_menu2 "menu2" pos:[38,4] width:30 height:30 checked:false
checkbutton btn_menu3 "menu3" pos:[72,4] width:30 height:30 checked:false


-- Inizialitations
on MyDialog open do
(
-- Display Sections if they are active in their definition
if (btn_menu1.state == true) then AddSubRollout MyDialog.menuTools Rollout_A
if (btn_menu3.state == true) then AddSubRollout MyDialog.menuTools Rollout_B
if (btn_menu3.state == true) then AddSubRollout MyDialog.menuTools Rollout_C
)


-- Sections actions (Checkbuttons)
-- We will hide/unhide the rollouts depending on which section is active while changing the height of the main window
on btn_menu1 changed state do
(
if state == on then
AddSubRollout MyDialog.menuTools Rollout_A
else
removeSubRollout MyDialog.menuTools Rollout_A
)

on btn_menu2 changed state do
(
if state == on then
AddSubRollout MyDialog.menuTools Rollout_B
else
removeSubRollout MyDialog.menuTools Rollout_B
)

on btn_menu3 changed state do
(
if state == on then
AddSubRollout MyDialog.menuTools Rollout_C
else
removeSubRollout MyDialog.menuTools Rollout_C
)


)

-- We finally create the window
CreateDialog MyDialog style:#(#style_titlebar, #style_toolwindow, #style_sysmenu ) height:300

cui.RegisterDialogBar MyDialog minSize:[-1,-1] maxSize:[-1,-1] style:#(#cui_dock_left, #cui_dock_right, #cui_floatable)

)

lo
06-08-2011, 12:14 AM
There is a known issue when docking under certain OS's and aero/shadows under menus.

Try disabling all fancy windows features from the control panel and check if it still freezes up.

PrefeX
06-08-2011, 12:55 AM
There is a known issue when docking under certain OS's and aero/shadows under menus.

Try disabling all fancy windows features from the control panel and check if it still freezes up.
Thanks, seems like you are on to something there :)
Changed my appearance to windows classic, and it worked right away.

Is there any known fix for this issue (other then disabling settings in windows), or is there another way I can work around it?

PrefeX
06-08-2011, 01:08 AM
Ok, after fooling around a bit, the problem seems to be that it only works when the setting "Enable Desktop Composition"is disabled (the preview windows of your start menu).

lo
06-09-2011, 07:54 AM
Ok, after fooling around a bit, the problem seems to be that it only works when the setting "Enable Desktop Composition"is disabled (the preview windows of your start menu).

I've found the triggers to be different on different machines, could not find a workaround for it yet...

PrefeX
06-09-2011, 02:51 PM
Ok, after a lot of hours bug-searching, I found a solution that works at least for this computer.

It seams that the style attribute on CreateDialog and RegisterDialogBar are in conflict, as it works (on this PC) when i comment out height and style on the CreateDialog.

CGTalk Moderation
06-09-2011, 02:51 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.