April 6, 200916 yr 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
April 6, 200916 yr 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 April 6, 200916 yr by Guest
April 6, 200916 yr Author Button perform step GoToObject ("tabButtonSet_file") Button change color : GetLayoutObjectAttribute ("tabButtonSet_file"; "isFrontTabPanel") // Doesn't work...
April 6, 200916 yr 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 []
April 6, 200916 yr 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?
April 6, 200916 yr 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 April 6, 200916 yr by Guest added P.S.
Create an account or sign in to comment