Recent

Author Topic: TDatePicker control  (Read 50786 times)

Zoran

  • Hero Member
  • *****
  • Posts: 1829
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: TDatePicker control
« Reply #30 on: February 05, 2010, 09:15:15 am »
Haven't test yet, trying to find out how to fix that bug for gtk2.If win32 also have same order than it's wrong (in comparision with Delphi).

Actually, in Delphi's TMonthCalendar there is no OnChange event at all!
So I'd say it cannot occure neither before nor after OnClick. ;)
Or I'm missing something.

zeljko

  • Hero Member
  • *****
  • Posts: 1594
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: TDatePicker control
« Reply #31 on: February 05, 2010, 10:05:24 am »
I've tested TCalendar from Delphi 7

Zoran

  • Hero Member
  • *****
  • Posts: 1829
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: TDatePicker control
« Reply #32 on: February 05, 2010, 10:22:48 am »
I've tested TCalendar from Delphi 7

I have Delphi 6 and there is no control TCalendar, but only TMonthCalendar, which does not have OnChange event.
Now, on Delphi's official site, again, only TMonthCalendar is there, and again there is no OnChange.

So, it sounds very strange that in Delphi 7 it was different!?

zeljko

  • Hero Member
  • *****
  • Posts: 1594
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: TDatePicker control
« Reply #33 on: February 05, 2010, 10:52:08 am »
dunno, I have D7 enterprise and that control is on component pallete (installed by default)

Zoran

  • Hero Member
  • *****
  • Posts: 1829
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: TDatePicker control
« Reply #34 on: February 05, 2010, 10:52:33 am »
However, we should see in Delphi is the date actually changed before or after OnClick gets called.

I just tested in Delphi -- in OnClick event the Date is already changed!

Therefore, I'd say that TCalendar's event order should be -- OnChange before OnClick, as it is now in gtk2 and win32 widgetsets.

zeljko

  • Hero Member
  • *****
  • Posts: 1594
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: TDatePicker control
« Reply #35 on: February 05, 2010, 12:29:17 pm »
Then Delphi7 TCalendar is wrong. I'll change qt event order so it will be the same like others.

Zoran

  • Hero Member
  • *****
  • Posts: 1829
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: TDatePicker control
« Reply #36 on: February 05, 2010, 12:30:28 pm »
dunno, I have D7 enterprise and that control is on component pallete (installed by default)

Are you using CLX maybe? Not VCL?
VCL's component is named TMonthCalendar and it behaves like I described.

zeljko

  • Hero Member
  • *****
  • Posts: 1594
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: TDatePicker control
« Reply #37 on: February 05, 2010, 01:42:41 pm »
no, I've tested with TCalendar from VCL, CLX doesn't have such control, but forget it , I've already prepared patch for qt ws (currently testing on mac), and it'll be reorderd as it is with win32 and gtk2.

Zoran

  • Hero Member
  • *****
  • Posts: 1829
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: TDatePicker control
« Reply #38 on: February 05, 2010, 02:00:24 pm »
no, I've tested with TCalendar from VCL, CLX doesn't have such control, but forget it , I've already prepared patch for qt ws (currently testing on mac), and it'll be reorderd as it is with win32 and gtk2.

Okay, I see that you assigned the bug to yourself and targeted 0.9.30 Lazarus version to change the qt's calendar event order.

Is there IFDEF which can be used to examine Laz version? So that I can put something like IFDEF LCLQt and IFDEF LazVer < 0.9.30?
« Last Edit: February 05, 2010, 02:20:12 pm by Zoran »

theo

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 1927
Re: TDatePicker control
« Reply #39 on: February 05, 2010, 02:21:42 pm »
Yes. Example:
Code: [Select]
 {$if (lcl_major=0) and (lcl_minor=9) and (lcl_release<27)}
     Result := LConvEncoding.GetSystemEncoding;
  {$else}
     Result := LConvEncoding.GetDefaultTextEncoding;
  {$endif}

http://lazarus-ccr.sourceforge.net/docs/lcl/lclversion/index.html

zeljko

  • Hero Member
  • *****
  • Posts: 1594
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: TDatePicker control
« Reply #40 on: February 05, 2010, 03:15:35 pm »

Okay, I see that you assigned the bug to yourself and targeted 0.9.30 Lazarus version to change the qt's calendar event order.

Is there IFDEF which can be used to examine Laz version? So that I can put something like IFDEF LCLQt and IFDEF LazVer < 0.9.30?

But it won't be enough since it's fixed in 0.9.29 svn r 23641 , so svn revision should be taken into account somehow, or qt version will be unuseable till lazarus reaches 0.9.30

Zoran

  • Hero Member
  • *****
  • Posts: 1829
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: TDatePicker control
« Reply #41 on: February 05, 2010, 04:54:40 pm »
Yes. Example:
Code: [Select]
 {$if (lcl_major=0) and (lcl_minor=9) and (lcl_release<27)}
     Result := LConvEncoding.GetSystemEncoding;
  {$else}
     Result := LConvEncoding.GetDefaultTextEncoding;
  {$endif}

http://lazarus-ccr.sourceforge.net/docs/lcl/lclversion/index.html

Thank you.


Okay, I see that you assigned the bug to yourself and targeted 0.9.30 Lazarus version to change the qt's calendar event order.

Is there IFDEF which can be used to examine Laz version? So that I can put something like IFDEF LCLQt and IFDEF LazVer < 0.9.30?

But it won't be enough since it's fixed in 0.9.29 svn r 23641 , so svn revision should be taken into account somehow, or qt version will be unuseable till lazarus reaches 0.9.30

Hm... then I'll put lcl_revision < 29. So, the component will have problems on qt with 0.9.29 when svn revision is smaller than that. It will always work on 0.9.28 and 0.9.30. Given that 0.9.29 is not "stable" version, you are just expected to have the newest daily svn. That's the best option I came up with.

zeljko

  • Hero Member
  • *****
  • Posts: 1594
    • http://wiki.lazarus.freepascal.org/User:Zeljan
Re: TDatePicker control
« Reply #42 on: February 05, 2010, 05:32:31 pm »
I agree with you. Just check >= 0.9.29 and that's it.
....and tnx :)

Zoran

  • Hero Member
  • *****
  • Posts: 1829
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: TDatePicker control
« Reply #43 on: February 05, 2010, 05:47:11 pm »
I agree with you. Just check >= 0.9.29 and that's it.

It's done.

....and tnx :)

Thank you!
Without your help, I doubt this control would ever be fully functional for qt users. :)

Zoran

  • Hero Member
  • *****
  • Posts: 1829
    • http://wiki.lazarus.freepascal.org/User:Zoran
Re: TDatePicker control
« Reply #44 on: February 05, 2010, 06:23:34 pm »
I propose to Zoran put the code in a svn repository like Lazarus-ccr so we can follow the development closer and allow to make patches easier like the proposed changes by zeljko.

Anyway, good work Zoran. It's an useful component.

I already mentioned that I'd like to see this component in lazarus components (palette) , so better to have this basic component in lazarus/components than in lazarus-ccr. It's automatically closer to others laz developers since I'm not sure if everyone is taking an eye blink over lazarus-ccr every day (in my case it's monthly).
So my proposal would be lazarus/components instead of lazarus-ccr , just because it's very important component, and deserves default place on lazarus components tab :)

zeljko

What should I do? Where to put the code? I found some free web hosting and put it there, but I would prefer it to be as close as possible to Lazarus users.

It took me four days to figure out how to start new page on Wiki (which I finally did yesterday). :-[

 

TinyPortal © 2005-2018