11 Replies Latest reply on Jun 2, 2014 10:14 AM by philmodjunk

    Script to Change TEXT colour?

    ArtL

      Title

      Script to Change TEXT colour?

      Post

           I have created a simple weekly bulletin database for a customers.  The graphic background in the Text Boxes is blue and the text inside the graphic is white.  White Text - Blue Background.

           Here is my problem.

           When you are in the INSPECTOR

           and in the APPEARANCE TAB

           You select FILL as NON. This allows the background blue graphic to show nicely.

           When you go to BROWSE and type in the field, the field opens in WHITE and ... you guessed it, WHITE on WHITE doesn't work!!

           What I would like to do is set the field text to BLACK while they type, then have a BUTTON / Script that they press that selects all the text in the field and changes it to WHITE!

           The users have no Filemaker skills so I have created buttons for them to do the various tasks to keep things simple.  In keeping with the spirit of this Bulletin Design, a button to change the TEXT from black to white would be perfect.  It would allow them to edit mistakes in black, but once satisfied, they can click the button and the script will run the change on the colour of the text.

           Is this POSSIBLE?

           How?

            

           Thanks, greatly appreciated.

           Art

            

      Example.jpg

        • 1. Re: Script to Change TEXT colour?
          RickWhitelaw

               Conditional formatting perhaps?

          • 2. Re: Script to Change TEXT colour?
            philmodjunk

                 Select a contrasting color for when the field has the focus--assuming that you are using FileMaker 12 or newer. This contrasting color can match the color of the underlying layout if it's a solid color.

            • 3. Re: Script to Change TEXT colour?
              photowyzard

                    Thanks, Rick.

                    

                   Phil,

                    

                   I am using FMPa 13. It is a solid colour. behind the text field.

                   Won't the contrasting colour show up in Browse? I would prefer to have the text field with no fill if at all possible.  Are you suggestion to fill it with the Blue in the Graphic?

              • 4. Re: Script to Change TEXT colour?
                philmodjunk

                     Only if the field has the focus and that will only be if the cursor is in the field--which would appear to be the point in time where you are getting white text on a white back ground. At least that's what I've assumed you mean by "selecting the field".

                • 5. Re: Script to Change TEXT colour?
                  photowyzard

                        Yes, you assume correct, that is what I mean by selecting the field.  It becomes the active input field.  That is when it goes white.

                  • 6. Re: Script to Change TEXT colour?
                    photowyzard

                          Curious if this could be a bug?  I asked a friend last night to have a look.  He used the inspector on the field and it worked properly.

                         I can't duplicate the results and it is as simple as selecting the field in Layout and going to Inspector, Appearance, Graphic.... NONE for fill.

                         I think the file has corrupted somehow as I cannot duplicate these rusults in that specific file?

                    • 7. Re: Script to Change TEXT colour?
                      delibebek

                           This same thing happens to me on a regular basis. My solution is to make the fill color of the input field the color that I want it to have when selected. When the field is selected it retains the fill color that was selected for the input field in the inspector. If you select "none" as you have done, you see through all the layout objects. In your case, you see the white background for that layout part.

                           For keeping the layout clean, this requires me to make sure that my input fields don't fall outside of the bounds of any background colors. In your case, I can see the field would stick out the bottom of the underlying blue box. Changing the height of the input field should work as well as changing the 'in focus' setting would work.

                           Another solution can be to set the fill color of the layout part. However, it would become the background color for any other "none-filled" input fields on your layout, at the time they are selected by the user. This is not an ideal solution for that reason.

                      • 8. Re: Script to Change TEXT colour?
                        philmodjunk

                             Check and see if the "Delineate" check box is selected in Layout Setup... See if clearing or selecting this option makes a difference in the results that you get.

                        • 9. Re: Script to Change TEXT colour?
                          photowyzard

                                I tested it, it did NOT work.  I even did a SAVE A COPY AS, changed the name, created new fields etc.

                               Still get the WHITE background! And yet, my friend had no issues at all.  I upgraded FMPa 13 to 13.0v3, so it shouldn't be an outdated software issue either.

                                Looks like a BUG to me....

                          • 10. Re: Script to Change TEXT colour?
                            philmodjunk

                                 You have the option of reporting this in Report an Issue as a possible bug if you want.

                                 But if it were a bug, you and your friend would likely see the same behavior. When an issue is specific to a particular file or a particular file, it is much less likely to be a FileMaker Bug--unless one of you are using Windows and the other a Mac.

                                 Are you and your friend opening exact same copies of the same file or different files?

                                 If these are different files, do the layouts specify the same theme?

                                 What theme are you using?

                            • 11. Re: Script to Change TEXT colour?
                              philmodjunk

                                   See this uploaded pair of images for an example of what I am describing. This is a classic themed layout open in FIleMaker 13.0v3 on a Windows 7 machine. The two blue fields are identical copies of each other save for one change in the inspector.

                                   The upper image shows what I see when I click or tab into the left hand column. The bottom image shows what I get when I tab or click into the right hand copy of the same field.

                                   Here's what is different: In layout mode, I selected the right hand copy of this field. I then selected the Appearance tab in the inspector. I then selected "in focus" from the second drop down at the top of the appearance tab. Finally, I selected a white fill color for this field while it has the focus.

                                   Here's another factor that might play a part. Is there a fill color specified either for the layout or a different layout object that this field has been placed on top of? under certain circumstances, the solid fill color of the layout back ground will "show through" when you click into a field.