[DUG] hour / minute component
Patrick Sheehan
paa at xtra.co.nz
Fri Feb 5 16:58:10 NZDT 2010
Have you tried the TDateTimeSuite from adrock.com
Patrick Anthony Associates Ltd
PO Box 31-831, Milford
Auckland, New Zealand
IMPORTANT - The information contained in this email is CONFIDENTIAL. It is
intended for the person to whom it is addressed only. If you are not that
person or his/her authorised agent please be aware that any use,
dissemination, distribution or reproduction of this email is prohibited. If
you have received this in error please notify us immediately by return email
or telephone 64 9 486 5020 and delete your copy of the email and any
attachments. Thank you.
From: delphi-bounces at delphi.org.nz [mailto:delphi-bounces at delphi.org.nz] On
Behalf Of John Bird
Sent: Friday, 5 February 2010 13:53
To: NZ Borland Developers Group - Delphi List
Subject: Re: [DUG] hour / minute component
Incidentally I have taken to doing something similar with date entry. An
edit box, but in this case I put a little arrow button at the end of it, and
clicking that superimposes a date picker over the edit box. Its rather
more work but it works really neatly, and can be easily repeated.
Date entry is flexible, as a string today could be
5-feb-10
5.2.10
5.2.2010
5/2/10
on exit the date is verified, and the date picker if clicked populates the
text field with the first format above.
Entering dates like this is very flexible, caters for those who like to use
the keyboard and those who like to use the mouse.
Using the date picker is especially cool under Vista/Windows 7 as the newer
Date picker is really really nice - anyone else noticed that?
Means doing something like:
(DateTimePicker is normally invisible)
procedure Tform1.btnStartDateClick(Sender: TObject);
begin
DateTimePicker1.left:=edtStartDate.Left;
DateTimePicker1.top:=edtStartDate.Top;
DateTimePicker1.width:=edtStartDate.width+btnStartDate.Width;
DateTimePicker1.Date:=xfAdateToDTDate(edtStartDate.Text);
DateTimePicker1.Visible:=true;
PickStartOrFin:=1;
DateTimePicker1.Perform(WM_SYSKEYDOWN, VK_DOWN, 0);
end;
//this code handles two separate edit boxes
procedure Tform1.DateTimePicker1CloseUp(Sender: TObject);
begin
if PickStartOrFin=1 then
edtStartDate.Text:=xfdtDateToAdate(DateTimePicker1.Date);
if PickStartOrFin=2 then
edtFinDate.Text:=xfdtDateToAdate(DateTimePicker1.Date);
DateTimePicker1.Visible:=false;
//redisplay data to reflect new date
Redisplay data;
end;
(the xfDTDatetoADate and xfADatetoDTDate are my library routines to convert
between string dates and TDateTime)
John
No virus found in this incoming message.
Checked by AVG - www.avg.com
Version: 9.0.733 / Virus Database: 271.1.1/2667 - Release Date: 02/05/10
08:35:00
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://listserver.123.net.nz/pipermail/delphi/attachments/20100205/06d48be5/attachment-0001.html
More information about the Delphi
mailing list