Newbie needs help, Buttons on rectangular graphic
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
Newbie needs help, Buttons on rectangular graphic
Hi there,
I want to lay out a card (page?) with columns of buttons (to call various actions), each 'column' being a different coloured rectangular graphic. I can't figure out how to show the buttons with the graphic in the background - buttons forward, graphic back. Is it possible ?
I want to lay out a card (page?) with columns of buttons (to call various actions), each 'column' being a different coloured rectangular graphic. I can't figure out how to show the buttons with the graphic in the background - buttons forward, graphic back. Is it possible ?
Re: Newbie needs help, Buttons on rectangular graphic
Put a graphic and on top of it your buttons. Then group them and voila
Re: Newbie needs help, Buttons on rectangular graphic
Hi.
It could be as easy as just placing the buttons in front of the rectangular graphic.
To have the graphic behind the buttons, the layer of the graphic should just be lower than the layers of the buttons.
You can use the Project Browser to change the layer of the graphic by dragging the graphic up or down the list.
The layer property can also be changed in the property inspector, on the same tab as the width and height properties.
You can also set the layer in script.
Just be careful when changing the layer of a grouped control with the "relayer" command. If you change the layer of a grouped control (with the "relayer" command) to a value lower than the layer of the group itself, or to a value higher than the layer of the group's frontmost control, the control would be removed from the group.
It could be as easy as just placing the buttons in front of the rectangular graphic.
To have the graphic behind the buttons, the layer of the graphic should just be lower than the layers of the buttons.
You can use the Project Browser to change the layer of the graphic by dragging the graphic up or down the list.
The layer property can also be changed in the property inspector, on the same tab as the width and height properties.
You can also set the layer in script.
Just be careful when changing the layer of a grouped control with the "relayer" command. If you change the layer of a grouped control (with the "relayer" command) to a value lower than the layer of the group itself, or to a value higher than the layer of the group's frontmost control, the control would be removed from the group.
-
- Livecode Opensource Backer
- Posts: 9477
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Newbie needs help, Buttons on rectangular graphic
You should feel 100% comfortable about putting any object either
overlapping or on another object.
- -
overlapping or on another object.
- -
- Attachments
-
- Multi-storey.livecode.zip
- Stack.
- (9 KiB) Downloaded 69 times
-
- Livecode Opensource Backer
- Posts: 9477
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Newbie needs help, Buttons on rectangular graphic
It is very easy to find out the layer number of each object, and to change it if you need to.
-
- VIP Livecode Opensource Backer
- Posts: 9785
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Newbie needs help, Buttons on rectangular graphic
Hi.
Why not just use the graphic as the "button"? In other words, why have two controls when a single one will do? The graphics provide all the "visual" that you require, no?
So lose the buttons and place whatever handlers you require in the graphics themselves.
Now that said, you will likely be better served if you have a single handler in the card script that acts appropriately depending on which graphic the user clicks on. Have you ever tackled that before? It requires that each graphic be identifiable so that the card handler can use "the target" to perform its task based on the graphic of interest. You should do this even if you retain the button/graphic pairing. This method is fairly standard, very compact and much easier to manage.
If this seems like a good way forward, let me know, and I will help you.
Craig
Why not just use the graphic as the "button"? In other words, why have two controls when a single one will do? The graphics provide all the "visual" that you require, no?
So lose the buttons and place whatever handlers you require in the graphics themselves.
Now that said, you will likely be better served if you have a single handler in the card script that acts appropriately depending on which graphic the user clicks on. Have you ever tackled that before? It requires that each graphic be identifiable so that the card handler can use "the target" to perform its task based on the graphic of interest. You should do this even if you retain the button/graphic pairing. This method is fairly standard, very compact and much easier to manage.
If this seems like a good way forward, let me know, and I will help you.
Craig
-
- Livecode Opensource Backer
- Posts: 9477
- Joined: Fri Feb 19, 2010 10:17 am
- Location: Bulgaria
Re: Newbie needs help, Buttons on rectangular graphic
That's OK is the OP wants a single button, but they may need 2 or 3 overlaying a rectangular graphic.Why not just use the graphic as the "button"? In other words, why have two controls when a single one will do?
-
- VIP Livecode Opensource Backer
- Posts: 9785
- Joined: Wed May 06, 2009 2:28 pm
- Location: New York, NY
Re: Newbie needs help, Buttons on rectangular graphic
What Richmond is positing is that you have multiple buttons with multiple functionality, all lying on a single graphic.
Is that so?
If yes, then what I posted reduces to simply strongly suggesting that a single handler in the card script manage all the functionality of those several buttons, however they are distributed about.
Craig
Is that so?
If yes, then what I posted reduces to simply strongly suggesting that a single handler in the card script manage all the functionality of those several buttons, however they are distributed about.
Craig