Forum > Third party
TDatePicker control
Zoran:
Delphi's VCL has a control TDateTimePicker.
For editing dates LCL has TDateEdit instead. It does not have TDateTimePicker, because it uses native Windows control which does not exist on other platforms.
I prefer VCL's TDateTimePicker, so I created new TDatePicker control.
I tried to create a control which would resemble TDateTimePicker as much as possible. It behaves very much like VCL's control, but derives from TCustomControl and does not use native win control.
I created it on Windows XP with win widget set, but did some test on Ubuntu 9.10 with gtk2 also.
The package DateControls which contains TDatePicker and TDBDatePicker (a data-aware version of the control) can be downloaded here: http://datepicker.000space.com
EDIT: There is now new TZVDateTimePicker control, which completely covers the behavior of TDatePicker. The main advangate is time editing, so you should use it instead. See: http://www.lazarus.freepascal.org/index.php/topic,8754.0.html
Silvio Clécio:
It worked perfectly in Linux (Ubuntu 9.10/GTK2).
Thank you very much! :D
JD:
Does not compile under Windows Vista because of these lines:
Canvas.TextStyle.Layout := tlCenter;
Canvas.TextStyle.Wordbreak := False;
Canvas.TextStyle.Opaque := False;
The compiler gives the following error message
C:\Lazarus\components_extra\DateControls\datepicker.pas(1239,19) Error: Argument can't be assigned to
What can I do to correct this error?
wOvAN:
Confirm assigning Canvas.TextStyle gives an error, I use the latest laz snapshot. fpc 2.4.1
Zoran:
On Widows XP it works perfectly. It sounds very strange to me that such a problem appears in Vista. I'm at work now and very busy, I'll look into code to try to change that part of code to something else this evening (central european time).
And yes, I use Lazarus 0.9.28.2, fpc 2.2.4 (the current stable version of Lazarus). Could problem be related to some recent changes in Lazarus/FPC, not to OS? I guess, I'll have to install new snapshot this evening.
Navigation
[0] Message Index
[#] Next page