Recent

Author Topic: Questions about a new Calendar component.  (Read 71953 times)

wimogan

  • Newbie
  • Posts: 2
Re: Questions about a new Calendar component.
« Reply #45 on: September 16, 2013, 12:07:28 pm »
Thanks Avishai, this is a great calendar and i'll keep stick to any news or modifications you make in order to see how i can also help. Regards...

Avishai

  • Hero Member
  • *****
  • Posts: 1021
Re: Questions about a new Calendar component.
« Reply #46 on: September 18, 2013, 09:28:29 am »
I made a little change to ensure that the first row of Day numbers will always show some part of the previous month.

In CalendarLite.pp - I modified line 566 to:
if {(remDays > 0)}(remDays >= 0) then Inc(startRow, 1); // modified by Avishai
Lazarus Trunk / fpc 2.6.2 / Win32

Avishai

  • Hero Member
  • *****
  • Posts: 1021
Re: Questions about a new Calendar component.
« Reply #47 on: October 27, 2013, 06:37:54 am »
If anyone is still working on this, I have an idea.  I tried to do it myself but only make a mess.  The idea is:

Instead of using a PopupMenu for the Year, use a TEdit.  That would allow the user to type the year they want.  It could also allow for Up/Down Arrow keys in the OnKeyDown event.  With PopupMemu, going from 2013 to 1913 is clumsy.  Setting TEdit.BorderStyle:= bsNone and ParentColor:= True should make it look OK.

Something similar could be done for the Month using a TEdit with a TStringList so that Up/Down Arrow keys could work.

Edit: I have attached a small demo.
« Last Edit: October 27, 2013, 08:06:09 am by Avishai »
Lazarus Trunk / fpc 2.6.2 / Win32

Awesome Programmer

  • Sr. Member
  • ****
  • Posts: 460
  • Programming is FUN only when it works :)
    • Cool Technology
Re: Questions about a new Calendar component.
« Reply #48 on: August 22, 2014, 10:06:59 pm »
Wow....nice calendar.... thanks.

Ñuño_Martínez

  • Hero Member
  • *****
  • Posts: 1199
    • Burdjia
Re: Questions about a new Calendar component.
« Reply #49 on: November 13, 2014, 03:12:43 pm »
Great calendar. Thank-you.

Anyway, I need a way to tell the calendar to show that there are events.  Not only the "holidays", but different stuff (i.e. delivering dates, tasks, etc.).  I was thinking about an "onDrawDayCell" event you can use to temporary change drawing properties (background, font style, etc).   If nobody else have it done it yet, I'll add it to the component (as well as adding a "TCustomLiteCalendar" or something).  But this will be next week.
« Last Edit: November 13, 2014, 03:19:13 pm by Ñuño_Martínez »
Are you interested in game programming? Join the Pascal Game Development community!
Also visit the Game Development Portal

wp

  • Hero Member
  • *****
  • Posts: 12683
Re: Questions about a new Calendar component.
« Reply #50 on: November 04, 2016, 01:04:14 am »
I want to bring up this old thread. It would be pity if the light-weight component, TCalLite, that had been developed here would be lost. Therefore, I uploaded it to Lazarus CCR (https://sourceforge.net/projects/lazarus-ccr/files/CalLite/)

jwdietrich

  • Hero Member
  • *****
  • Posts: 1245
    • formatio reticularis
Re: Questions about a new Calendar component.
« Reply #51 on: November 06, 2016, 05:01:07 pm »
It looks very promising. Thanks for uploading to Lazarus CRR.

Is there any documentation available?
function GetRandomNumber: integer; // xkcd.com
begin
  GetRandomNumber := 4; // chosen by fair dice roll. Guaranteed to be random.
end;

http://www.formatio-reticularis.de

Lazarus 3.7.0 | FPC 3.2.2 | PPC, Intel, ARM | macOS, Windows, Linux

wp

  • Hero Member
  • *****
  • Posts: 12683
Re: Questions about a new Calendar component.
« Reply #52 on: November 06, 2016, 05:15:35 pm »
Is there any documentation available?
No, I thought it is pretty much self-explanatory.

jwdietrich

  • Hero Member
  • *****
  • Posts: 1245
    • formatio reticularis
Re: Questions about a new Calendar component.
« Reply #53 on: November 06, 2016, 05:23:56 pm »
Well, in fact most is self-explanatory, and the attached demo projects are helpful, too.

I didn't find out, however, how to assign different colors to holidays, if a month has more than one.
function GetRandomNumber: integer; // xkcd.com
begin
  GetRandomNumber := 4; // chosen by fair dice roll. Guaranteed to be random.
end;

http://www.formatio-reticularis.de

Lazarus 3.7.0 | FPC 3.2.2 | PPC, Intel, ARM | macOS, Windows, Linux

wp

  • Hero Member
  • *****
  • Posts: 12683
Re: Questions about a new Calendar component.
« Reply #54 on: November 06, 2016, 11:35:41 pm »
There is only one holiday color used for all holidays.

In order to add some flexibility I added an OnPrepareCanvas event which overrides the canvas for day painting. It gets the parameters for the date being painted, as well as state flags indicating whether the currently painted day is selected, is today or belongs to the previous or next month - see demo2 (check "Override font of 1st day").

Graeme

  • Hero Member
  • *****
  • Posts: 1428
    • Graeme on the web
Re: Questions about a new Calendar component.
« Reply #55 on: November 07, 2016, 11:12:53 am »
License notice: The Licence for TCalendarLite is LGPL2, thus there is no static linking exception like for Free Pascal's RTL or Lazarus's LCL. So if you include that component in your software, your complete software must be GPL2 licensed. The license is listed in the unit header comment.

That is not necessarily a bad thing, but if you write commercial or any closed source software, don't touch it!
Just thought I would put it out there.
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

wp

  • Hero Member
  • *****
  • Posts: 12683
Re: Questions about a new Calendar component.
« Reply #56 on: November 07, 2016, 11:28:16 am »
I'm on extremely thin ice as all these license details are very confusing to me.

Of course, this component should have the same license as LCL. In order to enable static linking exception I had added this paragraph to the license header before uploading to ccr: this paragraph is copied from the LCL license text COPYING.modifiedLGL.txt:

"As a special exception, the copyright holders of this library give you
  permission to link this library with independent modules to produce an
  executable, regardless of the license terms of these independent modules,and
  to copy and distribute the resulting executable under terms of your choice,
  provided that you also meet, for each linked independent module, the terms
  and conditions of the license of that module. An independent module is a
  module which is not derived from or based on this library. If you modify
  this library, you may extend this exception to your version of the library,
  but you are not obligated to do so. If you do not wish to do so, delete this
  exception statement from your version."

What's wrong with it?

minesadorada

  • Sr. Member
  • ****
  • Posts: 452
  • Retired
Re: Questions about a new Calendar component.
« Reply #57 on: November 07, 2016, 12:58:00 pm »
I used callite in an application a couple of years ago.  A very capable component, and easy to tweak.  I wanted dates highlighted that had valid data, so I tweaked the 'holiday' feature to show them and make them clickable.
The app was LGPL so licensing wasn't an issue.
GPL Apps: Health MonitorRetro Ski Run
OnlinePackageManager Components: LazAutoUpdate, LongTimer, PoweredBy, ScrollText, PlaySound, CryptINI

Graeme

  • Hero Member
  • *****
  • Posts: 1428
    • Graeme on the web
Re: Questions about a new Calendar component.
« Reply #58 on: November 07, 2016, 02:10:14 pm »
I'm on extremely thin ice as all these license details are very confusing to me.
Indeed, that is why I'm marking all my future work as BSD licensed - use it as you see fit.

Quote
Of course, this component should have the same license as LCL. In order to enable static linking exception I had added this paragraph to the license header before uploading to ccr: this paragraph is copied from the LCL license text COPYING.modifiedLGL.txt:
You are not the owner of the component (judging by your forum user name), so you are not entitled to change the license. From this message in this thread, howardpc is the owner and original author of the component. Only he can change the license. Strictly speaking, anybody that contributed to that component in this thread, there are a few people, need to give permission as well - the joys of GPL software.  Coming back to the point of how much of a pain software licenses are! :-/

ps:
  I looked at the latest copy of TCalendarLite from this forum thread, not from CCR.
« Last Edit: November 07, 2016, 02:14:06 pm by Graeme »
--
fpGUI Toolkit - a cross-platform GUI toolkit using Free Pascal
http://fpgui.sourceforge.net/

wp

  • Hero Member
  • *****
  • Posts: 12683
Re: Questions about a new Calendar component.
« Reply #59 on: November 07, 2016, 02:41:14 pm »
I had contacted howardpc before uploading the component and got his permission to do so and to modify the license.

I looked at the latest copy of TCalendarLite from this forum thread, not from CCR.
The version in this thread is outdated, the ccr version has some improvements and will be maintained by myself.

 

TinyPortal © 2005-2018