Newbie needs help, Buttons on rectangular graphic

Want to talk about something that isn't covered by another category?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
CAsba
Posts: 363
Joined: Fri Sep 30, 2022 12:11 pm

Newbie needs help, Buttons on rectangular graphic

Post by CAsba » Tue Oct 04, 2022 10:56 am

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 ?

andresdt
Posts: 146
Joined: Fri Aug 16, 2019 7:51 pm

Re: Newbie needs help, Buttons on rectangular graphic

Post by andresdt » Tue Oct 04, 2022 11:31 am

Put a graphic and on top of it your buttons. Then group them and voila

CAsba
Posts: 363
Joined: Fri Sep 30, 2022 12:11 pm

Re: Newbie needs help, Buttons on rectangular graphic

Post by CAsba » Tue Oct 04, 2022 11:35 am

OK, thanks.

Cairoo
Posts: 107
Joined: Wed Dec 05, 2012 5:54 pm

Re: Newbie needs help, Buttons on rectangular graphic

Post by Cairoo » Tue Oct 04, 2022 12:02 pm

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.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9384
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Newbie needs help, Buttons on rectangular graphic

Post by richmond62 » Tue Oct 04, 2022 1:26 pm

You should feel 100% comfortable about putting any object either
overlapping or on another object.
-
Screen Shot 2022-10-04 at 3.26.30 PM.png
-
Attachments
Multi-storey.livecode.zip
Stack.
(9 KiB) Downloaded 61 times

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9384
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Newbie needs help, Buttons on rectangular graphic

Post by richmond62 » Tue Oct 04, 2022 1:30 pm

Screen Shot 2022-10-04 at 3.30.36 PM.png
-
It is very easy to find out the layer number of each object, and to change it if you need to.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9658
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Newbie needs help, Buttons on rectangular graphic

Post by dunbarx » Tue Oct 04, 2022 2:34 pm

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

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9384
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Newbie needs help, Buttons on rectangular graphic

Post by richmond62 » Tue Oct 04, 2022 5:13 pm

Why not just use the graphic as the "button"? In other words, why have two controls when a single one will do?
That's OK is the OP wants a single button, but they may need 2 or 3 overlaying a rectangular graphic.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9658
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Newbie needs help, Buttons on rectangular graphic

Post by dunbarx » Tue Oct 04, 2022 7:35 pm

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

Post Reply

Return to “Off-Topic”