9 Replies Latest reply on Jan 4, 2010 2:31 PM by Steve Wright

    Changing Tab Title Color

    rsagall_1

      Title

      Changing Tab Title Color

      Post

      I am looking for a way to change the color of the tab name depending on the information in a field. In other words, if the field is blank then I want the tab name to be blank while if there's something in the field I want the tab name to be red.

       

      Thanks,

       

      Rich

       

        • 1. Re: Changing Tab Title Color
          csandoval
            

          I'm not aware of a function in FileMaker for this, but I have a couple of strange ideas on a way to do this.

           

          Are you using FileMaker 10?  If so, then you may be able to set a container field over your tab, but under the text layer that you may then be able to script trigger to fill the container with an object (ie: solid red square, solid blue square, etc).

           

          I'm not sure you can layer the built-in tab creation in FileMaker, but you should be able to create your own layered tab the old-fashioned way.  It's a lot more work and a bit tricky, but that's my first idea.  : )

           

          -=>Chris

          • 2. Re: Changing Tab Title Color
            philmodjunk
              

            You can simulate the affect with buttons and apply the conditional formatting to your buttons instead of the tabs they replace.

             

            Set your tabs up with widths of zero pixels.

            Use Arrange | Bring to Front to move the tab control in front of your buttons. Use the arrow keys to nudge each button down until it is positioned just above the tab and looks like the "tab" part of the control. Check to make sure that the buttons are not part of the tab control by dragging the tab control a small distance to see if the buttons move with it or stay put and then undo your move. (Buttons should stay put.)

             

            Set up your buttons to use Go To Field or Go To Object to set the focus on a field or other object in the tab it is associated with. Now, when you click the "tab" buttons they bring up the selected tab.

            • 3. Re: Changing Tab Title Color
              raybaudi
                

              rsagall wrote:

               

              I am looking for a way to change the color of the tab name depending on the information in a field.


              The simplest way is to have a blank name for the tab and a conditional formatted text object in place of the name.

              • 4. Re: Changing Tab Title Color
                philmodjunk
                  

                I tried that first on a demo file before posting, but then the layout text on top of the unselected tag isn't visible. In other words if I click tab one, I see the label on top of the tab and the label on the second tab disappears. If I click tab two, the reverse happens.

                 

                The button trick eliminated that problem.

                 

                Perhaps you know a way to make the layout text work?

                • 5. Re: Changing Tab Title Color
                  raybaudi
                    

                  Hi Phil

                   

                  did you placed the same label on every tab ?

                   

                  If I have a 3 tab pannel, I'll need to place 3 times the same label, each one on a different tab.

                  • 6. Re: Changing Tab Title Color
                    philmodjunk
                      

                    "did you placed the same label on every tab ?

                     

                    If I have a 3 tab pannel, I'll need to place 3 times the same label, each one on a different tab."

                     

                    I don't quite follow you. Here's what I did in detail:

                     

                    I created two tabs. Tab 1 was named with a single space. Tab 2 was named with two spaces. (to keep all visible text off the tab control tabs.) I specified a fixed width for the tabs. I then used the layout text tool to place an "A" on the first tab. I then placed a second text object, "B" on the second tab. The resize handles were completely enclosed by the tab boundaries and if I moved the tab control the layout text objects moved also.

                     

                    I then entered browse mode. If I click Tab 1, the "B" disappears. If I click Tab 2, The "A" disappears.

                     

                    I'm using FMP 10 adv, windows XP with sp3 if that makes a difference.

                    • 7. Re: Changing Tab Title Color
                      raybaudi
                        

                      PhilModJunk wrote:

                       

                      I then used the layout text tool to place an "A" on the first tab.


                      ... and the same "A" on the second tab. ( like the same "B" on the first tab )


                      • 8. Re: Changing Tab Title Color
                        raybaudi
                          

                        PhilModJunk wrote:

                         

                        If I resize my text objects and choose center justification I can place the text so that the selection handles are outside the bounds of the tab control and thus are not "owned" by the tab control


                        That is an usefull trick because in that way you haven't to work with the position of the "A" labels ( one for each tab ); in fact you'll have only one text object for the "A".


                        • 9. Re: Changing Tab Title Color
                          Steve Wright
                            

                          I Know this is solved, but the techniques above do not work in some situations, especially if you wish to use full width resizing tabs.

                          In that situation, the text object or field would not stay in the correct position. 

                           

                           

                          Here is a sample file which demonstrates using a repeating field for the tab controls.

                          Each repetition resizes relative to each other and because its a field, conditional formatting can be used.

                           

                          DOWNLOAD SAMPLE FILE 

                           

                           

                          There may be more elegant ways to achieve this than my example, I made it pretty quick just to test.