PDA

View Full Version : Simple MEL interface help


daisukem
12-11-2008, 09:05 PM
Could someone help to organize buttons in the MEL interface?
At the moment, the buttoms are displaying in the same row but I would like them in a different row. Also the text is fully not displaying and cut off.

Thanks.

window -title "Test Layout"
-maximizeButton off
-minimizeButton off
-width 616 -height 300
-sizeable 1
;
tabLayout;
shelfLayout General;
button -label "Btn 1" -c Btn1;
button -label "Btn 2" -c Btn2;
text -l "I want the btns to be in separate row";
setParent ..;
shelfLayout "Layout Process";
setParent ..;
showWindow;

pritishd
12-11-2008, 10:16 PM
Thanks for that, was a learning excercise for me too.......
Hope that is what you are looking for. If you want a bit more control, try looking in the mel reference book for "columnLayout", "rowLayout" for more info

{

window -title "Test Layout"

-maximizeButton off
-minimizeButton off
-width 616 -height 300
-sizeable 1
;
tabLayout;
shelfLayout -ch 75 General;

rowColumnLayout -numberOfColumns 1;

button -label "Btn 1" -c Btn1;
button -label "Btn 2" -c Btn2;
text -l "I want the btns to be in separate row";

setParent..;

setParent..;
shelfLayout "Layout Process";
setParent ..;
showWindow;
}

daisukem
12-12-2008, 12:12 AM
Thanks! That is close but the text and the buttons still look cut off for me.

dbiggs
12-12-2008, 03:50 AM
You need to think carefully about how you want things arranged, and what layout type works best with that arrangement. It's good to experiment and get familiar with all the layout types. row, rowColumn, grid and form are all great. Also think about how the controls layout withing the layout. EG just moving your text before the 2nd button will bump the 2nd button down to the next row like here.


window -title "Test Layout"
-maximizeButton off
-minimizeButton off
-width 700 -height 300
-sizeable 1
;
tabLayout;
rowColumnLayout -nc 2 -cw 1 50 -cw 2 500 General;
button -label "Btn 1" -c Btn1;
text -l "I want the btns to be in separate row";
button -label "Btn 2" -c Btn2;
setParent ..;
shelfLayout "Layout Process";
setParent ..;
showWindow;

Also changing the widths of each column can make a big improvement to the layout.

DOor
12-12-2008, 08:37 PM
In my honest opinion, MEL has the worst interface structure I have ever seen. I have spent more time coding an interface for many of my scripts than the actual script itself. when possible I almost always use a formLayout as this is the fastest and most customizable layout of the ones available. I usually start with a columnLayout>frameLayout>formLayout.

in some instances you may need more advanced layouts, I also like using tabs if I have TONS of options that need to be separated.

ewerybody
12-13-2008, 02:51 PM
In my honest opinion, Maya has one of the best and most flexible scriptable interface systems I've ever seen. I made interfaces with Autohotkey and Tcl/Tk and I find it awesome in Mel. I still want to do that interface builder I have in mind ... Its gonna be great ^^

DOor
12-13-2008, 03:27 PM
In my honest opinion, Maya has one of the best and most flexible scriptable interface systems I've ever seen. I made interfaces with Autohotkey and Tcl/Tk and I find it awesome in Mel. I still want to do that interface builder I have in mind ... Its gonna be great ^^

to each there own I suppose. I wont deny that it is flexible, but that does not always mean better. there are many controls that are poorly coded, I can give you an interface I made that will cause a memory leak and BSoD your computer. but poor code aside, the point I was making is that it is slow and im sure you know in this kind of industry that is not good.

I know there was a project for a visual MEL development program but I dont know if it was ever completed. If/When there is one that works with these convoluted layouts it will be a vast improvement for MEL. I would almost imagine it turning out as something similar to a dreamweaver/frontpage application substituting the table tags for layouts.


[EDIT] I just looked at the autohotkey you mentioned in your post. It looks like a nice feature but what does that have to do with MEL interface architecture?

CGTalk Moderation
12-13-2008, 03:27 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.