CGTalk > Software Specific Forums > Autodesk Maya > Maya Programming
Login register
Thread Closed share thread « Previous Thread | Next Thread »  
 
Thread Tools Search this Thread Display Modes
Old 01-07-2006, 12:14 AM   #1
EigenPuff
Artist's Tool
 
EigenPuff's Avatar
Mike Gonzales
Art Tools Programmer
Crystal Dynamics
San Francisco, USA
 
Join Date: Jul 2005
Posts: 61
Send a message via ICQ to EigenPuff Send a message via AIM to EigenPuff Send a message via MSN to EigenPuff Send a message via Yahoo to EigenPuff
gridLayout sizing issues

This is a question I've had open on the MEL UI Building sticky thread since about august, and the animators that I work with are starting to get a bit ansy. I figure I should give it another shot.

I have a script that dynamically creates a palette of buttons which allow the animators to click on a button and apply an animation file to the current scene. These buttons are arranged in a gridLayout. The gridLayout in the excerpt below has an unfortunate problem in that the area that it is displayed in relative to total screen area - i.e. if your monitor displays 1600x1200, you have no problem; if you are using an lcd monitor which displays 800x600, the palette is only a button and a half tall, which is unuseable for animators.

My solution is that I am trying to figure out how to get a grid of buttons (inside of a tab, which itself is inside of a columnLayout) to either display in a screen area that is resizeable (best), or at least hard coded, like a 300x300 field (tolerable).

Here is a simplification of what I have currently. The use of a scrollLayout->frameLayout->gridLayout is merely what I did to minimize the damage. I'll do anything as long as I can place a palette of buttons without sizing issues.

Code:
//populates the grid layout with a bunch of buttons determined at runtime global proc MakeButtons() { for ($i=0; $i < 50; $i++) { string $itemname = string($i); button -al left -ann $itemname -p "griddy" -label $itemname; } } //for debugging purposes - find the area of the scroll area I am trying to fix global proc ScrollResizeCommand() { int $value[] = `scrollLayout -query -scrollAreaValue "animscroll"`; $value[2] = `scrollLayout -q -saw "animscroll"`; $value[3] = `scrollLayout -q -sah "animscroll"`; intField -e -v $value[0] scrolll; intField -e -v $value[1] scrollt; intField -e -v $value[2] scrollw; intField -e -v $value[3] scrollh; } //makes a window with a grid inside of a tab inside of a column. global proc MakeAWindow() { if (`window -q -ex layoutwin`) deleteUI layoutwin; window -t "Button Palette" -mnb on -rtf true layoutwin; columnLayout -columnAttach "both" 5 -adj true jm2al; text -l ""; //place holder for other controls $tabs = `tabLayout -cr true /*-scr true*/ -imh 5 -imw 5 -h 800 palettetab`; // Animation tab 88888888888888888888888888888888888888888888888888 $animcol = `columnLayout -adj true animcol`; rowLayout -nc 4 -cw 1 44 -cw 2 44 -cw 3 44 -cw 4 44 ; intField -ed 0 -w 32 scrolll; //place holder for other controls intField -ed 0 -w 32 scrollt; intField -ed 0 -w 32 scrollw; intField -ed 0 -w 32 scrollh; setParent..; //THIS IS THE PART THAT I WISH TO FIX --------------------- string $animscroll; $animscroll = `scrollLayout -cr true -h 800 animscroll`; frameLayout AnimPalette; gridLayout -autoGrow true -columnsResizable true -cellWidthHeight 100 25 -nr 25 griddy; setParent..; setParent..; setParent..; // END SECTION I WISH TO FIX ------------------------------ setParent..; // Pose Tab 88888888888888888888888888888888888888888888888888 88888 $posecol = `columnLayout -adj true posecol`; text -l ""; //place holder for other controls setParent..; tabLayout -edit -tabLabel $animcol "Animations" -tabLabel $posecol "Poses" $tabs; scrollLayout -edit -rc "ScrollResizeCommand()" animscroll; setParent..; setParent..; setParent..; MakeButtons(); showWindow; ScrollResizeCommand(); } //execute the script above MakeAWindow();


BTW, why is it that I can never get sections of code that are even mildly complicated to format correctly in this forum?

Last edited by EigenPuff : 01-07-2006 at 12:14 AM. Reason: grammar
 
Old 01-07-2006, 12:14 AM   #2
CGTalk Moderation
Lord of the posts
CGTalk Forum Leader
 
Join Date: Sep 2003
Posts: 1,066,481
Thread automatically closed

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.
__________________
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
 
Thread Closed share thread


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 05:11 PM.


Powered by vBulletin
Copyright ©2000 - 2016, Jelsoft Enterprises Ltd.