Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 8 of 8 total
Thread TColorButton Word Wrap and Margin
Mon, Mar 18 2019 1:39 AMPermanent Link

KimHJ

Comca Systems, Inc

Is there anyway to add Word Wrap to the TColorButton and a Margin so the text does not touch the edge of the button?

Thanks,
Kim
Thu, Mar 21 2019 11:30 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Kim,

<< Is there anyway to add Word Wrap to the TColorButton and a Margin so the text does not touch the edge of the button? >>

Where are you getting the TColorButton control from ?

Tim Young
Elevate Software
www.elevatesoft.com
Mon, Mar 25 2019 3:52 PMPermanent Link

KimHJ

Comca Systems, Inc

Tim Young [Elevate Software] wrote:

Where are you getting the TColorButton control from ?

From here:
https://www.elevatesoft.com/forums?action=view&category=ewb&id=ewb_components&msg=67&page=2

Thanks,
Kim
Tue, Mar 26 2019 9:56 AMPermanent Link

Walter Matte

Tactical Business Corporation



It is just descended from TButton.

You need to do it in code for TButton or TColorButton.

 button1.Caption := 'First' + chr(13) + chr(10) + 'Second'  + chr(13) + chr(10) + 'Third';


Walter
Tue, Mar 26 2019 2:57 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Kim,

There are going to be some issues doing what you want, primarily because the caption for buttons is assumed to be auto-sizing, and what you're trying to do is going to involve the caption sizing according to its container (in other words, the complete reverse of how it currently works).

I would suggest creating a new control that derives from the TButtonControl class (WebBtns unit) that behaves like you want.  You'll also need to create a new control interface to set up the Caption element accordingly.  You can use the existing TButton control source and control interface to see how this is all set up.

Tim Young
Elevate Software
www.elevatesoft.com
Tue, Mar 26 2019 4:41 PMPermanent Link

Uli Becker

Tue, Mar 26 2019 5:50 PMPermanent Link

KimHJ

Comca Systems, Inc

Tue, Mar 26 2019 5:53 PMPermanent Link

KimHJ

Comca Systems, Inc

Tim Young [Elevate Software] wrote:

>>There are going to be some issues doing what you want, primarily because the caption for buttons is assumed to be auto-sizing, and what you're trying to do is going to involve the caption sizing according to its container (in other words, the complete reverse of how it currently works).

I would suggest creating a new control that derives from the TButtonControl class (WebBtns unit) that behaves like you want.  You'll also need to create a new control interface to set up the Caption element accordingly.  You can use the existing TButton control source and control interface to see how this is all set up.<<

Thanks, I will see if I can do it, I'm a little rusty when it comes to creating controls.

Kim
Image