Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Check if tab is selected?

Featured Replies

Hi,

Is there a way to check if a tab is selected?

I tried GetLayoutObjectAttribute ("myTabName"; "hasFocus") but it doesn't work.

Thanks for any help

GetLayoutObjectAttribute ("myTabOBJECTName"; "isFrontTabPanel")

  • Author

This works only for the front tab panel. It doesn't return true when it's another tab.

Actually, I want to change the color of a button and activate a tab when I press on it. Using conditionnal formatting.

1 - User press button

2 - Button do a GoToObject (tabName)

3 - Button reformat with the active tab.

Edited by Guest

  • Author


Button perform step  GoToObject ("tabButtonSet_file")

Button change color : GetLayoutObjectAttribute ("tabButtonSet_file"; "isFrontTabPanel") // Doesn't work...

My last post addresses the first part of your post prior to it being edited.

As for addressing the part where you have edited, here is an example:

Let's say there are 2 tab panels on the tab control. Each tab panel object has been assigned "a", "b".

You can set the button to have a conditional format of lets say red background when:

GetLayoutObjectAttribute ("a"; "isFrontTabPanel")

The script you can use on the button is:

If [ GetLayoutObjectAttribute ("a"; "isFrontTabPanel") ]

Go to Object ["b"]

Else

Go to Object ["a"]

End If

Refresh Window []

  • Author

I've done something similar, but there is more than 2 panels in my case.

I needed to use a global variable (I hate that) to make the conditional formatting work.

The script goes like :(


Set Variable [$buttonSet; Get (ScriptParameter)]

Go To Object [Object Name : $buttonSet]

If [Get (LastError) = 0]

   Set Variable [$$currentButtonSet; Value : $buttonSet]

   Refresh Window[]

else

   Show Custom Dialog ["Error"; "Bad object name for script " & Get (ScriptName) & "."]

end if





Each tab has a button assigned to it.



Let say that there are 3 buttons a, b and c and 3 tabs named "buttonSet_A", "buttonSet_B" and "buttonSet_C".



When the user click one of the button, it changes the tab and it's color.



The conditional formatting equation it this one for button A the same applies to the others :





$$currentButtonSet = "buttonSet_A"

Do you have something that could be better?

I dont understand what the purpose is here. If you have these buttons on the tabs themselves then why dont you have the buttons be formatted the way that you want it on each tab. If you are trying to dynamically change the buttons when a USER changes the tab, then what actions repopulates your global variable?

You should probably post a copy of your file at this point.

P.S. You shouldn't need the Refresh Window if the button is on the Tab itself.

Button_ConditionalFormat.zip

Edited by Guest
added P.S.

Create an account or sign in to comment

Important Information

By using this site, you agree to our Terms of Use.

Account

Navigation

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.