gridLayout sizing issues

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Display Modes
  01 January 2006
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.

   //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;
 				 //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;
 				 // END SECTION I WISH TO FIX ------------------------------
 			// Pose Tab 88888888888888888888888888888888888888888888888888  88888
 			 $posecol = `columnLayout -adj true posecol`;		
 				 text -l ""; //place holder for other controls
 		 tabLayout -edit -tabLabel $animcol "Animations" -tabLabel $posecol "Poses" $tabs;
 			 scrollLayout -edit -rc "ScrollResizeCommand()" animscroll;
    //execute the script above

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 January 2006 at 12:14 AM. Reason: grammar
  01 January 2006
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

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
Society of Digital Artists

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

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

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