Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 5710 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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

Posted

GetLayoutObjectAttribute ("myTabOBJECTName"; "isFrontTabPanel")

Posted (edited)

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
Posted


Button perform step  GoToObject ("tabButtonSet_file")

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

Posted

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 []

Posted

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?

Posted (edited)

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.

This topic is 5710 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

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