5 Replies Latest reply on Apr 30, 2008 3:58 PM by Wolfgang Herold

    Moving tabs

    Level 7
      Okay, this is an interesting one - I want to precisely place the tabs in a
      text member, but the Text Editor window won't allow you to move them in
      increments of less than 5, and the columns are horribly mis-aligned this
      way. (I'm admittedly anal about pixel-accuracy sometimes, but it really
      does look bad). I tried moving them through script:

      member("Text Member").tabs[n].position = X

      But no luck. I can see the list of tabs by doing a "put member("Text
      Member").tabs" command, and I can even access the properties of the
      individual tabs, but it seems like I'm not allowed to change them by any
      means except by manually dragging them in the Text Editor, which is not
      giving me the precision I need. Keep in mind I do NOT need to be able to
      move tabs dynamically or anything like that. I just need to get them into
      the right place so they line up properly. But the text itself DOES change
      dynamically, so I can't just use a flattened bitmap either. So far, the
      only other option I can think of is to split the whole thing into separate
      columns and just move the sprites where I want them. Is there any other way
      to make these tabs function with a little more accuracy before I do that?


        • 1. Re: Moving tabs
          stephen_ Level 1
          You should be able to set the tabs as a list.

          my_tabs = []
          my_tabs.add( [#type: #left, #position: 20] )
          my_tabs.add( [#type: #center, #position: 40] )
          my_tabs.add( [#type: #right, #position: 60] )
          my_tabs.add( [#type: #decimal, #position: 80] )

          member( "Text Member" ).tabs = my_tabs

          • 2. Re: Moving tabs
            Level 7
            > You should be able to set the tabs as a list.
            >
            > my_tabs = []
            > my_tabs.add( [#type: #left, #position: 20] )
            > my_tabs.add( [#type: #center, #position: 40] )
            > my_tabs.add( [#type: #right, #position: 60] )
            > my_tabs.add( [#type: #decimal, #position: 80] )
            >
            > member( "Text Member" ).tabs = my_tabs

            So... You can't move already existing tabs? You have to create them from
            scratch? That's mildly annoying, but let's see if it works...


            • 3. Re: Moving tabs
              Level 7
              > So... You can't move already existing tabs? You have to create them from
              > scratch? That's mildly annoying, but let's see if it works...

              The change is made to a duplicate of the tabs list, so:
              lTabs = member("text").tabs
              lTabs[tabIndex][#position] = anInteger
              member("text").tabs = lTabs
              • 4. Re: Moving tabs
                Level 7
                > The change is made to a duplicate of the tabs list, so:
                > lTabs = member("text").tabs
                > lTabs[tabIndex][#position] = anInteger
                > member("text").tabs = lTabs

                Thanks - still mildly annoying, but at least I only had to do it once.
                Strange these little idioscyncracies, you'd think it could be done with just
                one line of code, but whatever.


                • 5. Re: Moving tabs
                  Wolfgang Herold Level 2
                  make yourself a function in a moviescript

                  you wanted "member("Text Member").tabs[n].position = X"

                  you get:
                  set_tab(member_name,tab_n,pos)
                  eg. set_tab("textmember",5,75)

                  on set_tab(member_name,tab_n,pos)
                  -- do
                  -- it
                  -- yourself
                  end

                  Where is the problem?