Tabs

I would like to create a dialog with tabs. I have seen them used in plugins like Anything Grows and I was hoping someone can give me some guidance on how to implement this.

Thanks.

Comments

  • Hi Sighman, I've pasted in some of my own notes on this for you.

    how do I setup a user interface with tabs ?

    The Light sample in the SDK implements tabs so you can refer to that to figure it out.  It's tabs are switched with icons rather than the tabs we are familiar with though.  There is still only one pMap spread between all the contents of the tabs.

    Start with the .rsr and add a new node resource.  The number ID value of this will be the one returned by the plugin when calling ::GetResID() and the one used in the .r COMP,pMap where the single interface node would be - so change those to match it.  Select the empty node in the rsr and change its class name to TMFTabPart.  When adding the custom token TABS N the number is not the ID number of the resource but a unique number.  Set the size to be 225x275 for a tidy interface at standard Carrara size.
        Use the tokens:
    TABS 128
    icoT 0
    Page 1


        Next add a TMFNodePart into the tabs UI and change its class name to TMFTabArea and its ID must be 'TabA'.  Size it to a height of 55 for icons and 25 for normal tabs.  Add another TMFNodePart to the UI below the tabs area and change only its ID to 'Host'.  Set both to have an x offset of 0.  Best height for the host area is 250 below the 25 tab line.
        Add any other nodes as though they were separate plugins but the id's of the elements will be spread over the pMap.
        In the .r file all you have to do is add a TABS resource, its number is the unique number and not the main ID of the plugin.  First is the ID of the 
    resource 'TABS' (128)
      {
        {      
          143, "main", 0,
          147, "next", 0,   
        }
      };

    If these instructions are not clear enough I can go through it slower for you.  Refer to the Light (Light Source) sample UI in the rsr and its .r resource file.

     

  • SighmanSighman Posts: 56

    I am indebted to you Sparrowhawk3D, that is just the info I needed. I've looked at the sample code often and never noticed that the light source sample used tabs. Thanks again.

Sign In or Register to comment.