12/12/2022 8:26 AM | |
Joined: 10/31/2019 Last visit: 3/16/2023 Posts: 4 Rating:
|
export function HighlightButton(ButtonName) { // Highlights the active menu button and set all other buttons to default colors. const number = ButtonName.replace(/^\D+/g, ''); const BtnName = ButtonName.slice(0, ButtonName.lastIndexOf(number)); let highlightColor = HMIRuntime.Math.RGB(0,161,209,255); let defaultColor = HMIRuntime.Math.RGB(181,190,197,255); if (BtnName === "txtMainNav") { defaultColor = HMIRuntime.Math.RGB(38,39,41,255); } for(let i = 1; i < 20; i++) { const currentButton = Screen.Items(BtnName + i); if (!currentButton) { break; } if(ButtonName === currentButton.Name) { currentButton.BackColor = highlightColor; } else { currentButton.BackColor = defaultColor; } } } ////// Question: So do you know how to change this function so it will always work in my sreen window called "~/swSubNavigation", instead of always looking for items in current screen, no matter wich screen it is called from ------------------------------------------------------------------------------------------ |
Last edited by: Jen_Moderator at: 12/12/2022 12:30:26New subject after splitting |
|
Follow us on