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 » U++ Widgets - General questions or Mixed problems » Problem with Calendar control
Problem with Calendar control [message #29483] Sat, 23 October 2010 15:02 Go to next message
frankdeprins is currently offline  frankdeprins
Messages: 99
Registered: September 2008
Location: Antwerp - Belgium
Member
Hello,

I have a question related to the Calendar control.
When I put a Calendar control on a layout window, using the designer, I can resize it and it scales perfecly, even when I make it smaller than the 'standard' size (the size which it has when I drop it on a layout window).
However, when I run the application with a Calendar control that I made smaller than the standard size, it does not scale, but gets clipped.
Should I call some method to make the scaling happen? I already tried Layout and Refresh, even SetRect, but to no avail. It just remains clipped, rather than scaled.

Regards

frank
Re: Problem with Calendar control [message #29491 is a reply to message #29483] Sat, 23 October 2010 22:57 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Great Frank!

Waiting for unodgs opinion, it seems that resize is more versatile in layout designer than in real C++ code Smile

I explain you Frank: Calendar control, as many controls in U++, has two functions for the drawing (including resizing):

1. In void Calendar::Paint(Draw &w) in DateTimeCtrl.cpp
This one is programmed in C++

2. In ctrl Calendar function in CtrlLib.usc
This one is programmed in Esc.

The 1st is for the main program and the 2nd is for the layout designer.

It seems 2nd resizing is richer than 1st one.


Best regards
Iñaki
Re: Problem with Calendar control [message #29492 is a reply to message #29491] Sat, 23 October 2010 23:20 Go to previous messageGo to next message
frankdeprins is currently offline  frankdeprins
Messages: 99
Registered: September 2008
Location: Antwerp - Belgium
Member
Hye koldo,

Thanks for the explanation.
Yes, I know about these two distinct and separate drawing 'modes' and, from a technical point of view, I did not think the runtime behaviour was tightly linked to the designtime behaviour. However, from an ergonomical useage point of view... Smile As you jokingly point out: it is not 'normal' to see the designer behave in a more 'sophisticated' way than the real thing.
Besides, when you use a DropDate control, the dropped Calendar is actually also smaller than the 'fixed' one. And yet, that one is scaled perfectly. So, it must be possible. I only do not see where the difference in behaviour between the fixed and the dropped one, finds its root in the code.

frank

[Updated on: Sat, 23 October 2010 23:21]

Report message to a moderator

Re: Problem with Calendar control [message #29512 is a reply to message #29492] Mon, 25 October 2010 16:01 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Hello Frank

After reading the code I am sure that Calendar::Paint does not adjust to control Rect.

And it is the same for DropDate. See this:

index.php?t=getfile&id=2908&private=0
  • Attachment: dib.PNG
    (Size: 14.54KB, Downloaded 485 times)


Best regards
Iñaki
Re: Problem with Calendar control [message #29515 is a reply to message #29512] Mon, 25 October 2010 16:39 Go to previous messageGo to next message
frankdeprins is currently offline  frankdeprins
Messages: 99
Registered: September 2008
Location: Antwerp - Belgium
Member
Hello Koldo,

Does this mean that there currently is no way to make the Calendar control smaller?

Best regards,

frank
Re: Problem with Calendar control [message #29517 is a reply to message #29515] Mon, 25 October 2010 22:53 Go to previous messageGo to next message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Hello Frank

Yes. Actual Calendar::Paint() has fixed size.

Method Calendar::ComputeSize() calculates parameters for Paint(). Between them there are colw and rowh, that are the base to locate the calendar days. They depend on GetTextSize("WW", fnt.NoBold().NoUnderline());.

To get a smaller Calendar control would require to reprogram Paint().



Best regards
Iñaki
Re: Problem with Calendar control [message #29518 is a reply to message #29517] Mon, 25 October 2010 23:24 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

I'll take a look at calendar soon and see if I can make it more flexible in easy way.
Re: Problem with Calendar control [message #29519 is a reply to message #29518] Tue, 26 October 2010 07:00 Go to previous messageGo to next message
frankdeprins is currently offline  frankdeprins
Messages: 99
Registered: September 2008
Location: Antwerp - Belgium
Member
That's great, thanks a lot.
Re: Problem with Calendar control [message #29520 is a reply to message #29519] Tue, 26 October 2010 08:40 Go to previous message
koldo is currently offline  koldo
Messages: 3355
Registered: August 2008
Senior Veteran
Smile

Best regards
Iñaki
Previous Topic: How can I detect Button press / release
Next Topic: CDialog::OnInitDialog (MFC) like method?
Goto Forum:
  


Current Time: Thu Mar 28 15:29:24 CET 2024

Total time taken to generate the page: 0.01559 seconds