Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread Centreing Icon Buttons on a Panel.
Mon, Jun 5 2017 9:38 AMPermanent Link

Steve Gill

Avatar

I have a panel with 5 icon buttons. I have the buttons positioned so that they are centred when viewed on an iPhone (please see screen shot).

If I view the same screen on a iPad the buttons are all aligned to the left.  Is there a way I can make them appear centred no matter what screen size they are viewed on?

Thanks.

= Steve



Attachments: IconButtons.png
Mon, Jun 5 2017 9:52 AMPermanent Link

Matthew Jones

Steve Gill wrote:

> I have the buttons positioned

How? The simple answer though is that you put on a TBasicPanel and put them nicely on that. Then have that panel centred.

If you put them aligned to the left of the intermediate panel, Set their margins, and have the panel set its width to content, then it will be perfect every time.

--

Matthew Jones
Mon, Jun 5 2017 4:56 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Steve,

<< If I view the same screen on a iPad the buttons are all aligned to the left.  Is there a way I can make them appear centred no matter what screen size they are viewed on? >>

Sure, make sure that you use a container TBasicPanel, put the buttons on the panel, set the panel's AutoSize.Width property to True, and set the panel's Layout.Position property to lpCenter.

Tim Young
Elevate Software
www.elevatesoft.com
Mon, Jun 5 2017 5:41 PMPermanent Link

Steve Gill

Avatar

Thanks.  I tried that but got the effect shown in the attachment (with the background showing).  Then I realised all I needed to do was put the BasicPanel inside another BasicPanel.  Duh.  Gotta stop doing this stuff late at night. Smile

= Steve



Attachments: IconButtons2.png
Wed, Jun 7 2017 2:05 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Steve,

<< Thanks.  I tried that but got the effect shown in the attachment (with the background showing).  Then I realised all I needed to do was put the BasicPanel inside another BasicPanel.  Duh.  Gotta stop doing this stuff late at night. Smile>>

Sorry, I should have been more clear about needing *another* TBasicPanel.

The layout functionality in EWB is geared towards trying to eliminate the requirement for nested containers simply for layout purposes, but sometimes there's just no getting around it.  This is one of those times. Smile

Tim Young
Elevate Software
www.elevatesoft.com
Image