Recent

Author Topic: Cannot resize TCalendar  (Read 16277 times)

JD

  • Hero Member
  • *****
  • Posts: 1848
Cannot resize TCalendar
« on: August 25, 2012, 08:07:35 pm »
Hi there everyone,

It appears that it is not possible to resize the Lazarus TCalendar. That's curious because it is very possible to do that in Delphi.

Is there any way around this resizing limitation?

Ideally, I want to put the calendar in a TPanel and set the alignment of the calendar to alClient.

Thanks for your advice.

JD
Windows - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe),
Linux Mint - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe)

mORMot; Zeos 8; SQLite, PostgreSQL & MariaDB; VirtualTreeView

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Cannot resize TCalendar
« Reply #1 on: August 25, 2012, 08:21:55 pm »
It appears that it is not possible to resize the Lazarus TCalendar. That's curious because it is very possible to do that in Delphi.

Is there any way around this resizing limitation?

Ideally, I want to put the calendar in a TPanel and set the alignment of the calendar to alClient.

I don't see that limitation here. Tested with 1.0RC2 on Mac.

The Orpheus TOvcCalendar also works like you want:

http://wiki.lazarus.freepascal.org/OrphPort

Thanks.

-Phil

Avishai

  • Hero Member
  • *****
  • Posts: 1021
Re: Cannot resize TCalendar
« Reply #2 on: August 25, 2012, 08:26:33 pm »
There is a Frame based Calendar written by KpjComp that has some really nice features.  You might want to take a look.

http://www.lazarus.freepascal.org/index.php/topic,17672.0.html
Lazarus Trunk / fpc 2.6.2 / Win32

JD

  • Hero Member
  • *****
  • Posts: 1848
Re: Cannot resize TCalendar
« Reply #3 on: August 25, 2012, 11:05:44 pm »
There is a Frame based Calendar written by KpjComp that has some really nice features.  You might want to take a look.

http://www.lazarus.freepascal.org/index.php/topic,17672.0.html

I've had some difficulty putting it on a form.
Windows - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe),
Linux Mint - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe)

mORMot; Zeos 8; SQLite, PostgreSQL & MariaDB; VirtualTreeView

JD

  • Hero Member
  • *****
  • Posts: 1848
Re: Cannot resize TCalendar
« Reply #4 on: August 25, 2012, 11:06:39 pm »
It appears that it is not possible to resize the Lazarus TCalendar. That's curious because it is very possible to do that in Delphi.

Is there any way around this resizing limitation?

Ideally, I want to put the calendar in a TPanel and set the alignment of the calendar to alClient.

I don't see that limitation here. Tested with 1.0RC2 on Mac.

The Orpheus TOvcCalendar also works like you want:

http://wiki.lazarus.freepascal.org/OrphPort

Thanks.

-Phil

Maybe it works on a Mac but it certainly does not work in Win32.
Windows - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe),
Linux Mint - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe)

mORMot; Zeos 8; SQLite, PostgreSQL & MariaDB; VirtualTreeView

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Cannot resize TCalendar
« Reply #5 on: August 25, 2012, 11:18:27 pm »
Maybe it works on a Mac but it certainly does not work in Win32.

That would surprise me.

Remember that you can only resize the TPanel once the calendar's Align has been set to alClient. Select the TPanel and resize it - the calendar will resize automatically to the new TPanel size.

Thanks.

-Phil

JD

  • Hero Member
  • *****
  • Posts: 1848
Re: Cannot resize TCalendar
« Reply #6 on: August 25, 2012, 11:23:17 pm »
Maybe it works on a Mac but it certainly does not work in Win32.

That would surprise me.

Remember that you can only resize the TPanel once the calendar's Align has been set to alClient. Select the TPanel and resize it - the calendar will resize automatically to the new TPanel size.

Thanks.

-Phil

I've already tried it and it dosen't work unfortunately.
Windows - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe),
Linux Mint - Lazarus 2.1/FPC 3.2 (built using fpcupdeluxe)

mORMot; Zeos 8; SQLite, PostgreSQL & MariaDB; VirtualTreeView

Avishai

  • Hero Member
  • *****
  • Posts: 1021
Re: Cannot resize TCalendar
« Reply #7 on: August 25, 2012, 11:23:53 pm »
TCalendar does not resize on Windows OS in the expected manner.  The only way I have found that changes the size is to change the Font.Size and that isn't very practical.
Lazarus Trunk / fpc 2.6.2 / Win32

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Cannot resize TCalendar
« Reply #8 on: August 25, 2012, 11:25:42 pm »
I've already tried it and it dosen't work unfortunately.

Try the Orpheus TOvcCalendar. Quite frankly it looks and behaves a bit nicer than the fairly generic looking TCalendar.

Thanks.

-Phil

Avishai

  • Hero Member
  • *****
  • Posts: 1021
Re: Cannot resize TCalendar
« Reply #9 on: August 25, 2012, 11:34:05 pm »
@Phil.  Orpheus was good stuff back in the days.  But do you know if it supports RightToLeft or any aspects of globalization?  Considering it's age, I'm guessing it doesn't.
Lazarus Trunk / fpc 2.6.2 / Win32

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Cannot resize TCalendar
« Reply #10 on: August 25, 2012, 11:43:44 pm »
@Phil.  Orpheus was good stuff back in the days.  But do you know if it supports RightToLeft or any aspects of globalization?  Considering it's age, I'm guessing it doesn't.

That's a good question; the best way of answering it would be to test it, I suppose.

I note that it includes the ovcintl.pas unit for localization.

I'm pretty sure it does not work in when compiled for 64-bit for the simple reason that I did not add support for 64-bits the way I did to the THtmlPort package. But that wasn't too bad if anyone is interested.

I don't see anything about right-to-left in TCalendar.

Thanks.

-Phil

Avishai

  • Hero Member
  • *****
  • Posts: 1021
Re: Cannot resize TCalendar
« Reply #11 on: August 25, 2012, 11:48:11 pm »
You are right :(  TCalendar does not support RightToLeft at all.  That's one of the reasons I was asking.
Lazarus Trunk / fpc 2.6.2 / Win32

KpjComp

  • Hero Member
  • *****
  • Posts: 680
Re: Cannot resize TCalendar
« Reply #12 on: August 25, 2012, 11:58:33 pm »
Quote
I've had some difficulty putting it on a form.

In what way?, if you add the units to your project and then click on the TFrame on the standard palette, you should get a dialog for selecting.   Btw.  Don't do it from the Components Search, inserting a TFrame from here doesn't pop up the dialog, looks like a bug in Lazarus.

Avishai

  • Hero Member
  • *****
  • Posts: 1021
Re: Cannot resize TCalendar
« Reply #13 on: August 26, 2012, 12:02:13 am »
Hey KpjComp!  I was hoping you would show up.  I wanted to answer but I was afraid I would mislead someone.  I figured you were the best person to answer the question.  I hope you're doing well. :)
Lazarus Trunk / fpc 2.6.2 / Win32

Phil

  • Hero Member
  • *****
  • Posts: 2737
Re: Cannot resize TCalendar
« Reply #14 on: August 26, 2012, 12:05:33 am »
You are right :(  TCalendar does not support RightToLeft at all.  That's one of the reasons I was asking.

Let me make sure I understand. With RightToLeft, would the days ascend from right to left and days of week start on right instead of left? If so, that should be fairly straightforward to add to a calendar, I would think. In the Orph ovccal.pas, everything is done in the Paint method - the code looks fairly simple (compared to code elsewhere in Orph, that is).

I notice that in a number of places in the Orph source I have BiDiMode and ParentBiDiMode IFDEF'd out. Are those properties supported now in LCL? I don't recall now, but when I first started on porting it back in 2006 (I think), LCL did not support those.

Thanks.

-Phil

 

TinyPortal © 2005-2018