Navigation Widget

Anything beyond the basics in using the LiveCode language. Share your handlers, functions and magic here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
Daveinthebigcity
Posts: 19
Joined: Wed Aug 27, 2014 12:13 am

Navigation Widget

Post by Daveinthebigcity » Tue Jan 26, 2016 2:13 pm

I've started using the widgets as they look much nicer in my apps than using the standard buttons. I'm struggling with passing data between cards though.
I want a navigation widget that appears at the top of all of my cards, but when I click on an icon, it doesn't highlight the same button on the next card.
For example if my first card showed a navigation bar that gave:

Option 1 | Option 2| Option 3

If I clicked on Option 2 I would want the next card to show:

Option1 | Option 2 | Option 3

I've tried selecteditem and navHiliteColor but i'm not having any joy.

Thanks

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4171
Joined: Sun Jan 07, 2007 9:12 pm

Re: Navigation Widget

Post by bn » Tue Jan 26, 2016 2:21 pm

Dave,

try "navigate"

Code: Select all

on navigate pLabel
   go card pLabel
end navigate
open dictionary (in DP13) make it roughly 20 pixel wider manually (a bug) then select from the left popUp menu "navigation bar". There all messages and commands of the navbar widget are listed.

Kind regards
Bernd

Daveinthebigcity
Posts: 19
Joined: Wed Aug 27, 2014 12:13 am

Re: Navigation Widget

Post by Daveinthebigcity » Tue Jan 26, 2016 2:23 pm

Hi,
Thanks for the quick reply. I'm using navigate already. I can move between the cards using the menu fine but the highlight doesn't follow onto the next card.

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 4171
Joined: Sun Jan 07, 2007 9:12 pm

Re: Navigation Widget

Post by bn » Tue Jan 26, 2016 2:29 pm

Dave,

I had to group the navbar and set the backgroundBehavior to true in the Properties Inspector. Then when you create a new card it is automaically placed on every new card. For existing cards you have to "place" (-> dictionary) the group.

The script "on navigate" is in the group script.

Kind regards
Bernd

Daveinthebigcity
Posts: 19
Joined: Wed Aug 27, 2014 12:13 am

Re: Navigation Widget

Post by Daveinthebigcity » Tue Jan 26, 2016 2:30 pm

Thanks,
I will give that a try.
Regards
Dave

Post Reply