Recent

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

GADZombie

  • New Member
  • *
  • Posts: 46
  • 8bitrlz
    • Zombie Mastah
Re: ZVDateTimeCtrls 1.4 is released
« Reply #30 on: October 21, 2013, 12:14:30 pm »
Now implemented. There is new property HideDateTimeParts, where you can set individual date/time parts to be hidden.

Thank you! I'll try it today!

Hello
I have tried your new features. It works very good. But I think it doesn't look too good.
When there is selected only a month and day, the user don't know what that numbers are for.
I.e. if the date was "2004 03 12" everyone knows it's 12th march 2004. But when there is only "03 12" it looks like two numbers - is it time, date or what? Which one is month and which is the day? And this is what I meant when I said there should be a possibility to show month name rather than digits.
If there is "march 12" everything is obvious. Now it's not intuitive. Of course  I could put the label near editbox and type there what the numbers mean but it's not the best way. The controls in window should be intuitive, anyone should know what every control is for without additional labels next to it.


Zoran

  • Hero Member
  • *****
  • Posts: 1831
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: ZVDateTimeCtrls 1.4 is released
« Reply #31 on: October 22, 2013, 08:39:57 am »

Hello
I have tried your new features. It works very good. But I think it doesn't look too good.
When there is selected only a month and day, the user don't know what that numbers are for.
I.e. if the date was "2004 03 12" everyone knows it's 12th march 2004. But when there is only "03 12" it looks like two numbers - is it time, date or what? Which one is month and which is the day? And this is what I meant when I said there should be a possibility to show month name rather than digits.
If there is "march 12" everything is obvious. Now it's not intuitive. Of course  I could put the label near editbox and type there what the numbers mean but it's not the best way. The controls in window should be intuitive, anyone should know what every control is for without additional labels next to it.


Yes, you are right about that.

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?

Okay, this makes sense. When I have time, I'll try to implement it.

Avishai

  • Hero Member
  • *****
  • Posts: 1021
Re: ZVDateTimeCtrls 1.4 is released
« Reply #32 on: October 22, 2013, 08:46:04 am »
I'm not sure this makes sense, but maybe you could use the Hint property to tell the user if it's month or day.
Lazarus Trunk / fpc 2.6.2 / Win32

GADZombie

  • New Member
  • *
  • Posts: 46
  • 8bitrlz
    • Zombie Mastah
Re: ZVDateTimeCtrls 1.4 is released
« Reply #33 on: October 22, 2013, 03:16:17 pm »
Okay, this makes sense. When I have time, I'll try to implement it.

It would be great! Thank you :)

GADZombie

  • New Member
  • *
  • Posts: 46
  • 8bitrlz
    • Zombie Mastah
Re: ZVDateTimeCtrls 1.4 is released
« Reply #34 on: October 22, 2013, 03:17:54 pm »
I'm not sure this makes sense, but maybe you could use the Hint property to tell the user if it's month or day.

I disagree. Different hint inside small editbox on each number? Many users will not find it and it still looks bad when it's not obvious what are the numbers for.

taazz

  • Hero Member
  • *****
  • Posts: 5368
Re: ZVDateTimeCtrls 1.4 is released
« Reply #35 on: October 22, 2013, 03:33:47 pm »
use the sort month name instead of the full name make sure that alpha characters can not be typed but typing 12 in the month field should jump to December typing 1 should do nothing but wait for the next char typing 01 should jump to January  typing 2 or 02 should go to February etc.
Good judgement is the result of experience … Experience is the result of bad judgement.

OS : Windows 7 64 bit
Laz: Lazarus 1.4.4 FPC 2.6.4 i386-win32-win32/win64

Zoran

  • Hero Member
  • *****
  • Posts: 1831
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: ZVDateTimeCtrls 1.4 is released
« Reply #36 on: November 01, 2013, 03:11:19 pm »
Quote
now I'm thinking about the system which will make it very simple to easily replace TCalendar with some other calendar component...

Zoran, thats sounds like a good idea.

Okay, now there is a system for using some custom calendar component instead of LCL's TCalendar. Please read this: http://wiki.lazarus.freepascal.org/ZVDateTimeControls_Package#Using_some_custom_calendar_control_for_drop-down

The problem with using TCalendarLite as a drop-down calendar control is that the author did not provide a way to distinguish when user clicks on date area or title. ZVDateTimePicker needs it to decide if the drop-down calendar should close (when user clicks on date), or the user should be left to continue browsing the calendar (when user clicks on title area, changes months or years).
The author made almost everything private, so the only way we can use it is to make changes to source of TCalendarLite.
Here is what you will have to do -- add
Code: [Select]
function CoordsOnDate(X, Y: Integer): Boolean to public section of TCalendarLite control and implement it this way:
Code: [Select]
function TCalendarLite.CoordsOnDate(X, Y: Integer): Boolean;
var
  Row: Integer;
begin
  Row := FCalDrawer.GetCellAt(Point(X, Y)).cy;
  Result := ((Row >= FirstDateRow) and (Row <= LastDateRow)) or (Row = TodayRow);
end;

Then you can try the application I'm attaching to this post, which demonstrates using CalendarLite as drop-down calendar in ZVDateTimePicker. There is unit CalLiteWrapper included in project source.

Zoran

  • Hero Member
  • *****
  • Posts: 1831
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: ZVDateTimeCtrls 1.4 is released
« Reply #37 on: November 15, 2013, 11:28:49 pm »
Okay, this makes sense. When I have time, I'll try to implement it.

It would be great! Thank you :)


Finally implemented. :)
See new properties: ShowMonthNames and  MonthNames.

use the sort month name instead of the full name make sure that alpha characters can not be typed but typing 12 in the month field should jump to December typing 1 should do nothing but wait for the next char typing 01 should jump to January  typing 2 or 02 should go to February etc.

Typing of numbers works, to jump to right month. Please test. 8-)

GADZombie

  • New Member
  • *
  • Posts: 46
  • 8bitrlz
    • Zombie Mastah
Re: ZVDateTimeCtrls 1.4 is released
« Reply #38 on: November 22, 2013, 11:35:23 am »
Sorry for my late response
Finally implemented. :)
See new properties: ShowMonthNames and  MonthNames.

use the sort month name instead of the full name make sure that alpha characters can not be typed but typing 12 in the month field should jump to December typing 1 should do nothing but wait for the next char typing 01 should jump to January  typing 2 or 02 should go to February etc.

Typing of numbers works, to jump to right month. Please test. 8-)

I have tested it. It works fine, thank you very much! This is exactly what I needed.
I have a little problem with string encoding. Month names taken from system when "Long" is selected gives me month names without national characters (Polish). It looks like the names are as AnsiString and your component uses UnicodeString. It's very small problem, I could use my own month names, but it should be corrected if someone else wish to use it.
Selecting by typing month number is fine. I think you could only change one thing: when user is typing (as month) a digit from 2 to 9, the month could be selected immediately, because there is no more than 12 months. When user wants enter i.e. may and presses 5, month name is not shown until user will press tab, right arrow or take focus out of editbox. User must type 05 and it then works immediately.

Zoran

  • Hero Member
  • *****
  • Posts: 1831
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: ZVDateTimeCtrls 1.4 is released
« Reply #39 on: November 22, 2013, 03:59:51 pm »

I have a little problem with string encoding. Month names taken from system when "Long" is selected gives me month names without national characters (Polish). It looks like the names are as AnsiString and your component uses UnicodeString. It's very small problem, I could use my own month names, but it should be corrected if someone else wish to use it.

Thank you, GADZombie

Ugh! This means that DefaultFormatSettings aren't initialized correctly.
SysUtils is part of RTL, not LCL, so these month names are badly formated in Windows and must be converted to UTF8. In Linux, however it works, because UTF8 is system encoding there.
I'll add AnsiToUTF8 call when using these month names. I'll test it this afternoon in Linux and Windows and upload.

GADZombie

  • New Member
  • *
  • Posts: 46
  • 8bitrlz
    • Zombie Mastah
Re: ZVDateTimeCtrls 1.4 is released
« Reply #40 on: November 22, 2013, 09:46:12 pm »
Ugh! This means that DefaultFormatSettings aren't initialized correctly.
SysUtils is part of RTL, not LCL, so these month names are badly formated in Windows and must be converted to UTF8. In Linux, however it works, because UTF8 is system encoding there.
I'll add AnsiToUTF8 call when using these month names. I'll test it this afternoon in Linux and Windows and upload.

Yes, it must be true. Even if I tested it like that:
  for a := 1 to 12 do
    memo1.lines.add(formatsettings.longmonthnames[a]); 

every month name with national character shows as "?" in memo...

Zoran

  • Hero Member
  • *****
  • Posts: 1831
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: ZVDateTimeCtrls 1.4 is released
« Reply #41 on: November 23, 2013, 07:30:38 am »
Okay, I added AnsiToUTF8 calls.

Zoran

  • Hero Member
  • *****
  • Posts: 1831
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: ZVDateTimeCtrls 1.4 is released
« Reply #42 on: November 23, 2013, 05:09:38 pm »
Selecting by typing month number is fine. I think you could only change one thing: when user is typing (as month) a digit from 2 to 9, the month could be selected immediately, because there is no more than 12 months. When user wants enter i.e. may and presses 5, month name is not shown until user will press tab, right arrow or take focus out of editbox. User must type 05 and it then works immediately.

I'm not sure that it would be better. The way it works now is consistent with how other date or time parts (days, years, hours, minutes...) interact with the user. Plus, it is how months behave when no month names, but only numbers, are used (i.e. when ShowMonthNames is False).

swierzbicki

  • Full Member
  • ***
  • Posts: 177
Re: ZVDateTimeCtrls 1.4 is released
« Reply #43 on: March 19, 2014, 04:15:55 pm »
Hello Zoran,

Thank you for sharing your nice component.
I'm using it under Windows 7 and Windows CE 6.5.3. The later is throwing "TWinControl.WMSize loop" exception. This happens when AutoSize property is used.
 
Do you know how to avoid this ?
Lazarus 1.6.2
fpc 3.0.0
wince/win32/win64
delphi berlin

Zoran

  • Hero Member
  • *****
  • Posts: 1831
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: ZVDateTimeCtrls 1.4 is released
« Reply #44 on: March 19, 2014, 06:21:48 pm »
Hello Zoran,

Thank you for sharing your nice component.
I'm using it under Windows 7 and Windows CE 6.5.3. The later is throwing "TWinControl.WMSize loop" exception. This happens when AutoSize property is used.
 
Do you know how to avoid this ?

Thank you for reporting this. I do not have Win CE, but I hope someone will help.

 

TinyPortal © 2005-2018