Icon View Thread

The following is the text of the current message along with any replies.
Messages 1 to 5 of 5 total
Thread TDateEditComboBox SelectedDate issue
Wed, Aug 31 2016 10:56 AMPermanent Link

Matthew Jones

Small issue with the TDateEditComboBox. My code is in this form:

   szOption := GetValue();
   if szOption <> '' then
   begin
       dateTo.SelectedDate := xml_X2DateTime(szOption);
   end
   else
   begin
       dateTo.SelectedDate := Date;
   end;

Now, this is not working, because if I have a value, it shows the
appropriate date in the display. If I default to the Date, the text
that is set in the IDE is shown instead.

This is because the default for the SelectedDate is Date, and the
SetSelectedDate routine doesn't bother doing anything if it is not
changing.

I can't quite work out how the text of the TDateEditComboBox text
display is updated, but it would be nice for either the default to be
picked up on display, or it to not default to today.

--

Matthew Jones
Wed, Aug 31 2016 11:14 AMPermanent Link

Walter Matte

Tactical Business Corporation

When you place the control on the form it puts todays date in the text value - you can just remove it.

Leave it blank.

Walter




"Matthew Jones" wrote:

Small issue with the TDateEditComboBox. My code is in this form:

   szOption := GetValue();
   if szOption <> '' then
   begin
       dateTo.SelectedDate := xml_X2DateTime(szOption);
   end
   else
   begin
       dateTo.SelectedDate := Date;
   end;

Now, this is not working, because if I have a value, it shows the
appropriate date in the display. If I default to the Date, the text
that is set in the IDE is shown instead.

This is because the default for the SelectedDate is Date, and the
SetSelectedDate routine doesn't bother doing anything if it is not
changing.

I can't quite work out how the text of the TDateEditComboBox text
display is updated, but it would be nice for either the default to be
picked up on display, or it to not default to today.

--

Matthew Jones
Thu, Sep 1 2016 4:15 AMPermanent Link

Matthew Jones

Walter Matte wrote:

> When you place the control on the form it puts todays date in the
> text value - you can just remove it.
>
> Leave it blank.

Hmm, I guess I could do that. I'd rather it sorted itself properly
though. I like to see something in the UI at design time so I know what
it looks like.

--

Matthew Jones
Thu, Sep 1 2016 5:23 AMPermanent Link

Matthew Jones

Walter Matte wrote:

> Leave it blank.

That doesn't fix it - it stays blank at runtime when I set the
SelectedDate to Date. If I set the SelectedDate to Date - 10000 first,
and then to Date, it shows properly. I will do that for now.

--

Matthew Jones
Tue, Sep 6 2016 8:07 AMPermanent Link

Tim Young [Elevate Software]

Elevate Software, Inc.

Avatar

Email timyoung@elevatesoft.com

Matthew,

<< This is because the default for the SelectedDate is Date, and the SetSelectedDate routine doesn't bother doing anything if it is not changing. >>

Noted.

Tim Young
Elevate Software
www.elevatesoft.com
Image