3 Replies Latest reply on Nov 23, 2012 7:16 AM by philmodjunk

    Pressed Button?



      Pressed Button?


           I have a layout that includes two buttons that a user can select to be in either "Browse Mode" or "Search Mode".  They work perfect, but my question is this.  Is there a way to make the button appear pressed in and a different colour to signal which mode they are in?  In other words, if they are in browse mode the button should appear pressed in and lets say green.  The search button would appear normal.  When the user presses the "Search" button, it would then appear pressed in and green and the "Browse" button would return to normal?  I know how to do this in most situations, like between layouts etc, but I can't seem to figure out an easy way during a simple mode change as the layout is static. 

           Any Suggestions?


        • 1. Re: Pressed Button?


               What do you think of a single button instead?
               When you're in Browse Mode, it will read: Enter Find Mode and the opposite when in Find Mode.
          • 2. Re: Pressed Button?

                 - create six container fields

                 - four global and two nonglobal

                 - fill the global with the two button pressed and the two not pressed

                 - put the two nonglobal container fields on the layout

                 - put a script on it: fill a variable with the current active button and fill the two nonglobal container fields from the global





                 button::searchpressed = searchpressed.jpg

                 button::search = search.jpg


                 button::browsepressed = browsepressed.jpg

                 button::search = browse.jpg

                 button::showbrowse = ""

                 button::showsearch = ""



                 if $$status = "search" OR $$status = ""

                     $$status = "browse"

                     button::showsearch = button::search

                     button::showbrowse = button::browsepressed

                 else if $$status = "browse"

                     $$status = "search"

                     button::showsearch = button::searchpressed

                     button::showbrowse = button::browse



                 If you do not use graphics you can also do it with conditional formatting of a field: Fill the field in a certain color depending on a variable similar to the script



            • 3. Re: Pressed Button?

                   You can also use Get ( WIndowMode ) to determine whether you are in browse or find mode.