Getting a toolbar to open in a defined location and size


© 2005-2006 Rob Wuijster aka XSIBase/Rork, september 2007



Introduction:

When you create a toolbar, like a "shader presets" toolbar for instance, you might like to open it up at the same location and the same size the next time you open it again. How to do that?


So here it goes:

If you have a look at the code of your newly created toolbar, we can see a set of coordinates in the top part of the XML coding:

<?xml version="1.0" encoding="iso-8859-1"?>

<xsi_file type="Shelf" xsi_version="5.11.2006.0529" syntax_version="1.0">
<shelf_view name="mia_presets" clsid="{7EA70760-167C-475F-A105-FF235C6FA556}">
<definition maxinstances="10000" acceptfocus="true" private="false" defaultsize="107,47,607,457" cmdmap="{00000000-0000-0000-0000-000000000000}" supportedtypes="6" category=""></definition>


The "defaultsize=107,47,607,475" is what we're after.
The first set of coordinates; 107,47 is the topleft corner of the toolbar.
The second set of coordinates; 607,457 places the bottomright corner of the toolbar. It's absolute coordinates, not a given width/height value.

Note:
Be aware that the coordinates are influenced by the height of the windowbar and frame, or better said the windows interface settings. So if you changed any of the values in the "Advanced appeareance" window of the windows desktop, you'll have to subtract the amount of these pixels to line it up properly. So the real 0,0 starting point will be the topleft corner of the XSI interface itself.

So with this information we see our toolbar in this case will start 107 pixels from the left and 47 pixels from the top of the interface, and ends at 607 pixels from the left and 457 from the top, making the toolbar occupying 500x410 pixels of screenspace in total. The simplest way of doing things is probably to screendump the XSI interface into Photoshop and check out the pixelvalues.

Edit the toolbar file coordinates, save it, restart XSI and see your toolbar open at the correct location and size.




Hope you find this usefull,

cheers,

rob