* * *

Author Topic: ZVDateTimeCtrls 1.4 is released  (Read 34295 times)

Zoran

  • Hero Member
  • *****
  • Posts: 1244
    • http://wiki.lazarus.freepascal.org/User:Zoran
ZVDateTimeCtrls 1.4 is released
« on: September 06, 2012, 07:55:50 pm »
New version 1.4 of ZVDateTimeCtrls package is released.

Apart from the released version, from now on you can also get the development version from svn trunk.

Tested on Linux (qt and gtk2 widgetsets) and Windows (win32/64 and qt widgetsets).

krzynio

  • Jr. Member
  • **
  • Posts: 67
Re: ZVDateTimeCtrls 1.4 is released
« Reply #1 on: February 26, 2013, 10:38:17 pm »
Hi!

At the beginning thanks for good job! Component looks really useful.
But I have a serious problem with it (version1.4).
OnChange event seems to be not working.
I put two controls on a form: TEdit - edit1 and TZVDateTimePicker - dtp1.

dtp1.Kind := dtkDateTime
dtp1.DateMode := dmUpDown

dtp1.OnChange looks roughly like this:

edit1.Text := TimeToStr( ZVDateTimePicker.Time)

When I click on Up or Down button then the value in dtp1 is changed but edit1.text remains unchanged.

I tried the same with different events (OnMouseDown, OnClick, OnChangeBounds etc.) but none of them works.

I tested this on Lazarus 1.1 and FPC 2.6.0 on Linux Mint and Windows 7 as well.

Could you fix the bug or explain how to make it working, please.

Best regards,
Krzysztof
Lazarus version: trunk. FPC version: 3.0.4. OS: Linux Debian Testing x64 with XFCE 4.12 and Windows 10 x64 version: 1709

Zoran

  • Hero Member
  • *****
  • Posts: 1244
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: ZVDateTimeCtrls 1.4 is released
« Reply #2 on: February 27, 2013, 11:17:47 am »
Krzysztof,

This bug (see here) which appeared in version 1.4 is already fixed in trunk — clicking up-down buttons does not fire OnChange event.

Please download the latest ZVDateTimeCtrls package from trunk, this is fixed already.
If you don't know how (or don't want) to use svn, you can download from this page (find "Download GNU Tarball" at the bottom of the page).

Zoran
« Last Edit: February 27, 2013, 11:27:59 am by Zoran »

krzynio

  • Jr. Member
  • **
  • Posts: 67
Re: ZVDateTimeCtrls 1.4 is released
« Reply #3 on: February 28, 2013, 07:35:45 pm »
Hello!

Downloaded, installed, tested - works fine!
Thank you very much Zoran.

Regards,
Krzysztof
Lazarus version: trunk. FPC version: 3.0.4. OS: Linux Debian Testing x64 with XFCE 4.12 and Windows 10 x64 version: 1709

grandehombre

  • New member
  • *
  • Posts: 38
Re: ZVDateTimeCtrls 1.4 is released
« Reply #4 on: June 21, 2013, 11:25:16 am »
Hi Zoran,

I have come across a problem with the date control.
I've dropped it onto a form and have linked it to a dataset.
When the form is populated, the control shows the correct date, as per the dataset.

If the user makes any changes within the date field (via typing or arrows), they reflect in the dataset (which goes into dsEdit state)

If the user unchecks a checked checkbox, the displayed date shows as NULL (correctly).
However, the underlying dataset's state does not go into dsEdit; it stays as dsBbrowse.

I have made a small change that overcomes this (shown below).

Code: [Select]
procedure TCustomZVDateTimePicker.CheckBoxChange(Sender: TObject);
begin
  CheckTextEnabled;
  SetFocusIfPossible;

// changes: start
if not Checked then begin
  SetDateTime(NullDate);
FUserChangedText := true;
UpdateIfUserChangedText();
// showmessage('changed');
end;
// changes: end


Cheers



ps: Many thanks for your great work!!!
Lazarus v1.2RC2  i386-win32-win32/win64,  FPC v2.6.2, svn43696 on Win7-64 and win8.1

Zoran

  • Hero Member
  • *****
  • Posts: 1244
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: ZVDateTimeCtrls 1.4 is released
« Reply #5 on: August 21, 2013, 01:04:47 pm »
Hello, Grandehombre, I am very sorry that I haven't answered to this post before.

If the user unchecks a checked checkbox, the displayed date shows as NULL (correctly).
No, it does not show as NULL, it has nothing to do with checkbox! The behaviour you are describing is not what I have here.
And it is not the intended behaviour, the state of the checkbox is not connected to value in database. The purpose of the checkbox (as described here) is to allow or forbid direct user interaction with date/time.

However, if you want to use the checbox for this purpose you can do it by programming OnCheckBoxChange event, something like this:

Code: [Select]
procedure TForm2.DBZVDateTimePicker3CheckBoxChange(Sender: TObject);
begin
  if (not DBZVDateTimePicker3.Checked) and (not DBZVDateTimePicker3.Field.IsNull) then begin
    DBZVDateTimePicker3.DataSource.DataSet.Edit;

    DBZVDateTimePicker3.Field.Value := Null;
  end;

end;

This should get the behaviour you want. However, I am not going to bind the check box to the value of underlying db field, it is certainly not what check box is intended to do.

GADZombie

  • New member
  • *
  • Posts: 46
  • 8bitrlz
    • Zombie Mastah
Re: ZVDateTimeCtrls 1.4 is released
« Reply #6 on: October 04, 2013, 01:16:16 pm »
Hi Zoran
I'm trying to use your datepicker. It's very good but I need one more thing. A big advantage of TDateTimePicker in Delphi is the 'Format' property. User can change the display format of date and/or time in this control. The most interesting part in this property is ability to pick some (not everyone) parts of date or time. I need picker to select only a month and day, without a year. When I did it in Delphi, I typed as Format value: 'MMMM dd' and there is a long name of month and a day, without anything else. The most important is the user can't change any other value than displayed. And the second is an ability to show full month name, not only digits.
Do you think is it possible to change your picker to have this property? If not, ofcourse I can make this on my own but it would be nice to have something like that as a standard control.
Thanks.

Zoran

  • Hero Member
  • *****
  • Posts: 1244
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: ZVDateTimeCtrls 1.4 is released
« Reply #7 on: October 05, 2013, 03:49:01 pm »
Hi Zoran
I'm trying to use your datepicker. It's very good but I need one more thing. A big advantage of TDateTimePicker in Delphi is the 'Format' property. User can change the display format of date and/or time in this control. The most interesting part in this property is ability to pick some (not everyone) parts of date or time. I need picker to select only a month and day, without a year. When I did it in Delphi, I typed as Format value: 'MMMM dd' and there is a long name of month and a day, without anything else. The most important is the user can't change any other value than displayed. And the second is an ability to show full month name, not only digits.
Do you think is it possible to change your picker to have this property? If not, ofcourse I can make this on my own but it would be nice to have something like that as a standard control.
Thanks.

Hello, GADZombie,

Yes, instead of Delphi's Format property, the format is controlled by other properties (Kind, DateDisplayOrder, TimeDisplay, TimeFormat).

I know that the control lacks the full flexibility of Delphi's Format property, but this would require huge redesign of the control's inner functionality.
For example, the Delphi's control allows the Format to be like 'MM/MM' — the month will be displayed twice. I don't even know how the control with such format behaves when editing. I don't think that this much flexibility is really needed in an editable control and implementing it would raise many problems.

So, I am not going to add the Format property with this much flexibility which the Delphi control has.

However, the two cases you mention (1. showing only parts of date/time and 2. showing month names) can be useful. Therefore I will take a look into control to see how difficult implementing of these functionalities would be.

Regards,
Zoran

GADZombie

  • New member
  • *
  • Posts: 46
  • 8bitrlz
    • Zombie Mastah
Re: ZVDateTimeCtrls 1.4 is released
« Reply #8 on: October 05, 2013, 10:42:29 pm »
Great, that will be enough. Month names and displaying date without a year is the most important for me. I don't need full flexibility of Format property, like you said.
When year is not displayed there is a little problem, how many days february should have (28 or 29). In Format property there is a year hidden, and number of days depends on given year also.

Windsurfer

  • Sr. Member
  • ****
  • Posts: 326
    • Windsurfer
Re: ZVDateTimeCtrls 1.4 is released
« Reply #9 on: October 06, 2013, 10:48:01 am »
Thanks for a great control. It has greatly simplified date/time validation within a stringgrid.

If you plan to add anymore features, a nice to have woud be Max and Min Time settings, like MaxDate and MinDate.

GADZombie

  • New member
  • *
  • Posts: 46
  • 8bitrlz
    • Zombie Mastah
Re: ZVDateTimeCtrls 1.4 is released
« Reply #10 on: October 08, 2013, 01:46:39 pm »
Zoran, could you please tell (more/less) when do you plan to make mentioned features?

Zoran

  • Hero Member
  • *****
  • Posts: 1244
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: ZVDateTimeCtrls 1.4 is released
« Reply #11 on: October 08, 2013, 06:49:45 pm »
Zoran, could you please tell (more/less) when do you plan to make mentioned features?

I am working on feature of hiding of date/time parts and for this I will need several days I think (at work I have no spare time these days and at home I can only get my time late at night).
About the idea of month names, I must admit that I'm giving it up. Introducing user editing of words instead of numbers requires too big changes.

Thanks for a great control. It has greatly simplified date/time validation within a stringgrid.

If you plan to add anymore features, a nice to have woud be Max and Min Time settings, like MaxDate and MinDate.

I'll see to add these.

GADZombie

  • New member
  • *
  • Posts: 46
  • 8bitrlz
    • Zombie Mastah
Re: ZVDateTimeCtrls 1.4 is released
« Reply #12 on: October 09, 2013, 09:01:05 am »
I am working on feature of hiding of date/time parts and for this I will need several days I think (at work I have no spare time these days and at home I can only get my time late at night).

Great! Thank you very much.

About the idea of month names, I must admit that I'm giving it up. Introducing user editing of words instead of numbers requires too big changes.

Maybe it will be enough when the user can change month value by pressing up/down cursor key or mouse wheel instead of typing full name?

Zoran

  • Hero Member
  • *****
  • Posts: 1244
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: ZVDateTimeCtrls 1.4 is released
« Reply #13 on: October 12, 2013, 09:23:49 pm »
I am working on feature of hiding of date/time parts and for this I will need several days I think (at work I have no spare time these days and at home I can only get my time late at night).

Great! Thank you very much.

Now implemented. There is new property HideDateTimeParts, where you can set individual date/time parts to be hidden.

About the idea of month names, I must admit that I'm giving it up. Introducing user editing of words instead of numbers requires too big changes.

Maybe it will be enough when the user can change month value by pressing up/down cursor key or mouse wheel instead of typing full name?

Maybe...
« Last Edit: October 12, 2013, 09:41:25 pm by Zoran »

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 3412
  • I like bugs.
Re: ZVDateTimeCtrls 1.4 is released
« Reply #14 on: October 12, 2013, 10:00:26 pm »
New version 1.4 of ZVDateTimeCtrls package is released.

How compatible is your component with VCL TDateTimePicker?
What would you say if this component was added to LCL and maintained in Lazarus repository? Maybe somebody has mentioned this possibility already, don't know. Then you would have write access to that directory obviously.
What about changing the name to TDateTimePicker then?

This would require acceptance from other developers, too. Now only me and Zeljan have mentioned this idea.

 

Recent

Get Lazarus at SourceForge.net. Fast, secure and Free Open Source software downloads Open Hub project report for Lazarus