Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / lazarus / 2015-11

Why TDateTimePicker.Checked works as Enabled?

7 messages · 2 people ·

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Gabor Boros

Hi All,

I am happy because TDateTimePicker have an internal CheckBox. But completely don't understand why Checked works as Enabled. For me Checked=Selected. Only me have this problem?

Gabor

Reply by email

Ondrej Pokorny
to Gabor Boros
Gabor Boros wrote
I am happy because TDateTimePicker have an internal CheckBox. But completely don't understand why Checked works as Enabled.

Me neither. How does Delphi behave? It has to be changed if it is not due to compatibility with Delphi.

For me Checked=Selected.

No. Selected is yet another property. Checked, Selected, Enabled - all three are independent properties.

Ondrej

Reply by email

Gabor Boros
to Ondrej Pokorny

2015.11.20. 13:21 keltez?ssel, Ondrej Pokorny ?rta:

Show quoted text 6 lines
On 20.11.2015 12:26, Gabor Boros wrote: > I am happy because TDateTimePicker have an internal CheckBox. But > completely don't understand why Checked works as Enabled. Me neither. How does Delphi behave? It has to be changed if it is not due to compatibility with Delphi.

Delphi compatibility not important for me but examined with 2010. Checked gray out the text only. Arrow button is accessible. If click on arrow Checked set to True without selection which is wrong from my POV.

Show quoted text 5 lines
> For me Checked=Selected. No. Selected is yet another property. Checked, Selected, Enabled - all three are independent properties.

Sorry. Mistyped. Checked=selected. I want to use Checked for parameterizing a query and not for disable the DateTimePicker. If I want to disable set Enabled to False.

Found an other problem. If set state of Checked at runtime in DateTimePicker1.Checked:=True form eg. in a TButton.OnClick DateTimePicker stole the focus.

Gabor

Reply by email

Ondrej Pokorny
to Gabor Boros

Feel free to provide patches. Don't forget to check different WidgetSets (Win32, Qt, Gtk2, Carbon at least). I'll review them.

Some "strange" behavior may be caused by the fact that some features are not supported on all WS and therefore it's better to keep the same "strange" behavior everywhere then to have different behavior across WS. This may be the case of a checkbox in TDateTimePicker. Also check the bug tracker, maybe the bugs have already been reported.

If the same "correct" behavior cannot be achieved in all WS, there is still a valid workaround - place an extra checkbox in front of the TDateTimePicker. (AFAIR I did the same in Delphi long time ago because I had problems with the checked property as well. I don't remember any details, though.)

Ondrej

Reply by email

Gabor Boros
to Ondrej Pokorny

2015.11.20. 15:01 keltez?ssel, Ondrej Pokorny ?rta:

Feel free to provide patches. Don't forget to check different WidgetSets (Win32, Qt, Gtk2, Carbon at least). I'll review them.

Can you review a patch which assigned to an another developer? I not see any traffic from Jesus in these weeks.

http://bugs.freepascal.org/view.php?id=28931

Show quoted text 5 lines
If the same "correct" behavior cannot be achieved in all WS, there is still a valid workaround - place an extra checkbox in front of the TDateTimePicker. (AFAIR I did the same in Delphi long time ago because I had problems with the checked property as well. I don't remember any details, though.)

I use the external checkbox trick with Delphi also.

Gabor

Reply by email