Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » CalendarCtrl » DateTimeCtrl 1.06 released
DateTimeCtrl 1.06 released [message #4553] Tue, 15 August 2006 10:47 Go to next message
unodgs is currently offline  unodgs
Messages: 1353
Registered: November 2005
Location: Poland
Senior Contributor

Hi!

I developed new version of datetime ctrl. Please use it and report any bug. This version brings two importnat features: Scalability with system font size and calendar as a separate control:

index.php?t=getfile&id=201&private=0

Sources: http://dgs.pac.pl/dgs.php?page=downloads

Changelog:
- fixed crash introduced in 1.05
* DateTimePopUp class renamed to Calendar
+ calendar scales properly with used font's size
+ calendar can be now used as a separate control
+ highlighting if header date is pointed
* SetSize() method removed
* SetBorderSize() method removed
* Select All days is now default
* calendar use colors appropriate to selected gui theme
* other various fixes and improvements

PS: Mirek it seems that tips on popup windows stopped to work again..
PS2: h3l1 - I also included your translations
  • Attachment: dt_1.06.png
    (Size: 31.54KB, Downloaded 3629 times)
Re: DateTimeCtrl 1.06 released [message #4570 is a reply to message #4553] Tue, 15 August 2006 18:40 Go to previous messageGo to next message
rbmatt is currently offline  rbmatt
Messages: 90
Registered: July 2006
Location: Tennesse, USA
Member

Works great in my application. Thanks!
Re: DateTimeCtrl 1.06 released [message #4578 is a reply to message #4570] Tue, 15 August 2006 22:09 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1353
Registered: November 2005
Location: Poland
Senior Contributor

rbmatt wrote on Tue, 15 August 2006 12:40

Works great in my application. Thanks!

Good to hear that Smile
Re: DateTimeCtrl 1.06 released [message #4579 is a reply to message #4553] Tue, 15 August 2006 22:12 Go to previous messageGo to next message
Werner is currently offline  Werner
Messages: 234
Registered: May 2006
Location: Cologne / Germany
Experienced Member
Excellent work!

Might I nonetheless suggest to add an option which takes the "1st calendar week problem" into account?

There are three different ways to number the weeks of a year:

1.
The 1st week is the week containing January, 1.
This is the Microsoft Excel version.

2.
The 1st week is the 1st complete week of the year (rising the problem of the first day of the week: Sunday or Monday).

3.
The 1st week is the week containing at least four days of the new year.
This is ISO 8601.

Werner
Re: DateTimeCtrl 1.06 released [message #4580 is a reply to message #4579] Tue, 15 August 2006 22:37 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1353
Registered: November 2005
Location: Poland
Senior Contributor

Yes you're right. I just used method appropriate for europe (I think so, I'm not an expert in this topic...).
The only problem is to find proper algorithms for method:

WeekOfYear(int day, int month, int year)

if you know them please mail them to me.

I will also add ability to choose what day of week is first monday or sunday - in one of next versions..
Re: DateTimeCtrl 1.06 released [message #4584 is a reply to message #4580] Tue, 15 August 2006 23:20 Go to previous messageGo to next message
Werner is currently offline  Werner
Messages: 234
Registered: May 2006
Location: Cologne / Germany
Experienced Member
unodgs wrote on Tue, 15 August 2006 22:37

Yes you're right. I just used method appropriate for europe (I think so, I'm not an expert in this topic...).
The only problem is to find proper algorithms for method:

WeekOfYear(int day, int month, int year)

if you know them please mail them to me.

I will also add ability to choose what day of week is first monday or sunday - in one of next versions..


I'll look around. In a rush I only found the following spreadsheet formula to calculate the week of a year from a date in cell A1 according to ISO 8601:

TRUNCATE((A1-DATE(YEAR(A1-REST(A1-2;7)+3);1;REST(A1-2;7)-9)) /7)

(I hope this is clear. I had to translate the formula from German to English. And I even didn't test it Rolling Eyes )

Werner

Re: DateTimeCtrl 1.06 released [message #4599 is a reply to message #4553] Wed, 16 August 2006 10:17 Go to previous messageGo to next message
h3l1 is currently offline  h3l1
Messages: 27
Registered: August 2006
Location: Innsbruck, Austria
Promising Member
Hi,

cool work! Thanks alot Cool
Re: DateTimeCtrl 1.06 released [message #4614 is a reply to message #4580] Wed, 16 August 2006 21:48 Go to previous messageGo to next message
Werner is currently offline  Werner
Messages: 234
Registered: May 2006
Location: Cologne / Germany
Experienced Member
unodgs wrote on Tue, 15 August 2006 22:37

Yes you're right. I just used method appropriate for europe (I think so, I'm not an expert in this topic...).
The only problem is to find proper algorithms for method:

WeekOfYear(int day, int month, int year)

if you know them please mail them to me.

I will also add ability to choose what day of week is first monday or sunday - in one of next versions..


The following link is not exactly what I was looking for - it's C# ... Crying or Very Sad

Anyway I could imagine that it might prove quite useful Very Happy :

http://www.codeproject.com/cs/miscctrl/MonthCalendar.asp

As soon as I find something in C or C++ I'll let you know.

Werner
Re: DateTimeCtrl 1.06 released [message #4615 is a reply to message #4614] Wed, 16 August 2006 22:42 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1353
Registered: November 2005
Location: Poland
Senior Contributor

Werner wrote on Wed, 16 August 2006 15:48


The following link is not exactly what I was looking for - it's C# ... Crying or Very Sad

Anyway I could imagine that it might prove quite useful Very Happy :

http://www.codeproject.com/cs/miscctrl/MonthCalendar.asp

As soon as I find something in C or C++ I'll let you know.



Thanks! Unfortunately this calendar calculates week number using ISO8601 method which is already implemented in datetimectrl...

PS: Do we really need another method of week calculation??
Re: DateTimeCtrl 1.06 released [message #4638 is a reply to message #4615] Thu, 17 August 2006 18:24 Go to previous messageGo to next message
Werner is currently offline  Werner
Messages: 234
Registered: May 2006
Location: Cologne / Germany
Experienced Member

Quote:

Thanks! Unfortunately this calendar calculates week number using ISO8601 method which is already implemented in datetimectrl...

PS: Do we really need another method of week calculation??


I strongly believe so!

Please refer to http://en.wikipedia.org/wiki/Week "Week number". You can read there that at least the US uses a system different from ISO 8601. I can't imagine that a library which doesn't consider US customs will be successful - be this desirable or not.

And even more compelling: http://www.merlyn.demon.co.uk/weekinfo.htm. I only now learned that there are UK and US tax weeks. While writing an application to calculate taxes may not be the everyday job of an ordinary programmer, this is definitely a typical computer task. Providing a flexible week-of-the-year feature would be a nice unique "selling" point of Ultimate++.

Or am I too demanding?

Werner

[Updated on: Thu, 17 August 2006 21:35]

Report message to a moderator

Re: DateTimeCtrl 1.06 released [message #4642 is a reply to message #4638] Thu, 17 August 2006 18:49 Go to previous messageGo to next message
fudadmin is currently offline  fudadmin
Messages: 1298
Registered: November 2005
Location: London, UK
Senior Contributor
Administrator
I need flexible switching of weeks, too.
Re: DateTimeCtrl 1.06 released [message #4643 is a reply to message #4638] Thu, 17 August 2006 18:58 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1353
Registered: November 2005
Location: Poland
Senior Contributor

Quote:

Or am I to demanding?

Of course not. It's an easy task - just need to find algorithm. I always been week in dates calculations - that's why I'm looking for solution out of box.
Re: DateTimeCtrl 1.06 released [message #4910 is a reply to message #4553] Thu, 24 August 2006 22:29 Go to previous messageGo to next message
masu is currently offline  masu
Messages: 378
Registered: February 2006
Senior Member
I compiled your DateTimeCtrl package and it works fine after removing reference on String in line 473 in DateTimeCtrl.cpp. I compiled with version 608.r21.
By the way, I had to change the image file location #define and the layout file location #define from relative to absolute spec, because they could not be found. Is this normal or does this effect only exist due to the fact that I have the DateTimeCtrl package in a totally different directory tree as the upp sources?

Matthias


931b81e7ea53320dccc37375b34b38c3
Re: DateTimeCtrl 1.06 released [message #4912 is a reply to message #4910] Thu, 24 August 2006 23:35 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1353
Registered: November 2005
Location: Poland
Senior Contributor

masu wrote on Thu, 24 August 2006 16:29

I compiled your DateTimeCtrl package and it works fine after removing reference on String in line 473 in DateTimeCtrl.cpp. I compiled with version 608.r21.
By the way, I had to change the image file location #define and the layout file location #define from relative to absolute spec, because they could not be found. Is this normal or does this effect only exist due to the fact that I have the DateTimeCtrl package in a totally different directory tree as the upp sources?

Matthias


I'm sorry for any trouble. Yesterday I did many fixes due to gcc and linux compatibility (including that ones you're describing). When I also add ability to choose first day of week I will release 1.07
Re: DateTimeCtrl 1.06 released [message #4923 is a reply to message #4912] Fri, 25 August 2006 11:12 Go to previous messageGo to next message
masu is currently offline  masu
Messages: 378
Registered: February 2006
Senior Member
unodgs wrote on Thu, 24 August 2006 23:35

I'm sorry for any trouble. ...



No problem at all, thank you for the great control Smile.
I just wanted to let you know about the issues.

Matthias

Re: DateTimeCtrl 1.06 released [message #5411 is a reply to message #4923] Wed, 20 September 2006 00:51 Go to previous messageGo to next message
zsolt is currently offline  zsolt
Messages: 576
Registered: December 2005
Location: Budapest, Hungary
Contributor
I have found a small bug. In ReadOnly mode, user can click on drop button, dropping the calendar.
I added a line to void DateTimeCtrl::OnDrop() method as first line:
if(!IsEditable()) return;

Now it works perfectly. Btw thanks for this good work Smile
Re: DateTimeCtrl 1.06 released [message #5412 is a reply to message #5411] Wed, 20 September 2006 08:35 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1353
Registered: November 2005
Location: Poland
Senior Contributor

zsolt wrote on Tue, 19 September 2006 18:51

I have found a small bug. In ReadOnly mode, user can click on drop button, dropping the calendar.
I added a line to void DateTimeCtrl::OnDrop() method as first line:
if(!IsEditable()) return;

Now it works perfectly. Btw thanks for this good work Smile

Thanks! Your fix will be added to the next version 1.07.
Re: DateTimeCtrl 1.06 released [message #6275 is a reply to message #5412] Sun, 05 November 2006 14:51 Go to previous messageGo to next message
fallingdutch is currently offline  fallingdutch
Messages: 258
Registered: July 2006
Experienced Member
found a small "bug"

when clicking on today but you are in another month or year the calendar won't change to todays month and year:
changed Calendar::LeftDown(Point p, dword keyfile)
[...]
if(aspopup) {
[...] 
} else {
   [...]
   RefreshDay(prevday);
   if(istoday)
      SetDate(dt); //this line was changed
   else if()
      [...]
}


Bas

[Updated on: Sun, 05 November 2006 14:52]

Report message to a moderator

Re: DateTimeCtrl 1.06 released [message #6277 is a reply to message #6275] Sun, 05 November 2006 15:21 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1353
Registered: November 2005
Location: Poland
Senior Contributor

Thanks! You're right. I merged your patch with my sources.
Re: DateTimeCtrl 1.06 released [message #6295 is a reply to message #6277] Sun, 05 November 2006 23:02 Go to previous messageGo to previous message
fallingdutch is currently offline  fallingdutch
Messages: 258
Registered: July 2006
Experienced Member
you are welcome,

another "bug" when compiling with 610-dev4:
since 610-dev3 the function "IsXpStyle()" is gone, so the following line in
DateTimeCtrl.icpp should be changed:
void Calendar::PopUp(Ctrl *owner, Rect &rt) {
   Close();
   Reset();
   
   SetRect(rt);
   //Ctrl::PopUp(owner,true,true,IsXpStyle()); I am old!
   Ctrl::PopUp(owner);
   open=true;
}


Bas

[Updated on: Sun, 05 November 2006 23:02]

Report message to a moderator

Previous Topic: [EXISTS] DateTimeCtrl
Next Topic: DateTimeCtrl in new versions U++
Goto Forum:
  


Current Time: Thu Apr 18 23:06:53 CEST 2019

Total time taken to generate the page: 0.00831 seconds