Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 10 of 27 total
Thread TLabel and TCheckbox problems
Sun, Apr 12 2015 3:18 AMPermanent Link

Doc

I'm new to EWB2, just converted a simple project from EWB1.

I used a TLabel within a TPanel, set AutoSize to false, Heigth to 56, With to 216, Format Wrap to true.
That compiles and looks correct.
But next time I start the IDE the Values for Heigt and With have changed to smaller sizes.
Is this a bug or a feature ? I can set Contraints Min to these values and then it will keep the size.

Second question regarding TCheckbox.
In EWB1 I could use TCheckbox OnClick
if CheckBox1.Checked = true then
now it is
if CheckBox1.SelectionState = ssSelected then
But the OnClick event seems to check the state BEFORE the click, this ist different to EWB1 and to Delphi, where the state AFTER click is checked. When I use the OnChange Event it checks the state AFTER click. Is this an intended behavior ?
Mon, Apr 13 2015 4:02 AMPermanent Link

Matthew Jones

Doc wrote:

> In EWB1 I could use TCheckbox OnClick
> if CheckBox1.Checked = true then

Hmm, that's a major change. I went through this with some third party
Delphi library, and it wasn't really too much, but it was sort of
non-standard. My feeling is that there should be a Checked property
even though it sort of defeats the "more flexible" three state
operation. This could be done just by adding it and either having an
"allow unselected" option which is set False when Checked is used, or
the TCheckBox is "split" into TCheckBox and TMultiCheckBox. Then
someone who wants the three state mode can have it, but the simple mode
is there too.

Nothing to stop anyone else doing this, but TCheckBox is such a
staple...

Just my $0.02.
Mon, Apr 13 2015 6:21 AMPermanent Link

Uli Becker

> But next time I start the IDE the Values for Heigt and With have changed to smaller sizes.
> Is this a bug or a feature ? I can set Contraints Min to these values and then it will keep the size.

I see that here as well. Seems to be a but - please report it to Tim by
mail.

Uli
Mon, Apr 13 2015 10:47 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Doc,

<< I used a TLabel within a TPanel, set AutoSize to false, Heigth to 56,
With to 216, Format Wrap to true.  That compiles and looks correct.  But
next time I start the IDE the Values for Heigt and With have changed to
smaller sizes. Is this a bug or a feature ? I can set Contraints Min to
these values and then it will keep the size. >>

I'm not seeing this here.  Can you send me a project that reproduces what
you're seeing ?

<< if CheckBox1.Checked = true then
now it is
if CheckBox1.SelectionState = ssSelected then

But the OnClick event seems to check the state BEFORE the click, this ist
different to EWB1 and to Delphi, where the state AFTER click is checked.
When I use the OnChange Event it checks the state AFTER click. Is this an
intended behavior ? >>

Yes, you don't want to use OnClick for anything other than detecting mouse
clicks.  For state/value changes to editable controls, you *always* want to
use the OnChange event since it will trigger exactly how/when you expect it
to, and for both property assignments and changes via user interaction.

Tim Young
Elevate Software
www.elevatesoft.com
Mon, Apr 13 2015 10:51 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< Hmm, that's a major change. I went through this with some third party
Delphi library, and it wasn't really too much, but it was sort of
non-standard. My feeling is that there should be a Checked property even
though it sort of defeats the "more flexible" three state operation. >>

*You're* the one who requested the 3-state operation.  With 3-state
operation, you *can't* have a Boolean that describes the state of the
control.  It's impossible.

Tim Young
Elevate Software
www.elevatesoft.com
Mon, Apr 13 2015 10:55 AMPermanent Link

Doc

Thank you for your observation.
I think the author has a look into this forum ?

Here is just another problem:

Create a new project based on TDialog.
Put a TLabel Label1 into it with Caption "100"
Put a TLabel Label2 into int with Caption "%"
Now put them both together so it looks like "100%"
Running the project looks fine
Change the Caption of Label2 to "10" and it will look like "10  %"
So set Label1.Caption back to "100", set AutoSize to false and Format.Alignment to caRight
(this is the normal way I do it in Delphi etc.)
Now Compiling and Running the project will result in a strange position of Label1.

At the moment I can workaraound this by setting AutoSize and Format.Alignment in TDialog.OnCreate, it will not work at Design-Time.
Mon, Apr 13 2015 11:14 AMPermanent Link

Doc

Oh, thanks Tim for your replies (while I was writing the other posting).

It ist not possible to send you a project to show this behavior, because the problem is that ist is not saved correctly.
But it is simply to reproduce (just did it here)

Start a new project based on TDialog
Put into this Dialog a TPanel
Put into this Panel a TLabel

Set TLabel.AutoSize to false
Set TLabel.With to 300
Set TLabel.Heigth to 180
(Set TLabel.Format.Wrap to true, but it is not necessary to show the problem)

No compile an run. Everything is okay
Close the IDE.
Start the IDE again
Now Label.With is 69, Label.Heigth is 23 (with standard Font and Caption "Caption"), just as if AutoSize was true.
Mon, Apr 13 2015 11:14 AMPermanent Link

Matthew Jones

Tim Young [Elevate Software] wrote:

> You're the one who requested the 3-state operation

I did? Hmm, I don't recall such! Must be getting old.
Mon, Apr 13 2015 11:25 AMPermanent Link

Doc

"Tim Young [Elevate Software]" wrote:
But the OnClick event seems to check the state BEFORE the click, this ist
different to EWB1 and to Delphi, where the state AFTER click is checked.
When I use the OnChange Event it checks the state AFTER click. Is this an
intended behavior ? >>

Yes, you don't want to use OnClick for anything other than detecting mouse
clicks.  For state/value changes to editable controls, you *always* want to
use the OnChange event since it will trigger exactly how/when you expect it
to, and for both property assignments and changes via user interaction.
-----------------------------------------------------------

Yes, thats what I found out and now use. But there was no OnChange Event for TCheckBox in EWB1, so I used OnClick, now I think I'm not the only one who is irritated by this different behaviour.
Mon, Apr 13 2015 12:59 PMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< I did? Hmm, I don't recall such! Must be getting old. >>

Crap, I thought that was you.  It may be *me* getting old here. Smile

*Somebody* requested it because they were doing questionnaire software and
needed to know when someone hadn't selected a radio button, and the same
principle applies to the check boxes...

Tim Young
Elevate Software
www.elevatesoft.com


Page 1 of 3Next Page »
Jump to Page:  1 2 3
Image