Print Page | Close Window

Issue with Date Picker - SetAutoSize(TRUE)

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Calendar
Forum Description: Topics Related to Codejock Calendar
URL: http://forum.codejock.com/forum_posts.asp?TID=12230
Printed Date: 21 November 2024 at 4:14pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Issue with Date Picker - SetAutoSize(TRUE)
Posted By: amitb
Subject: Issue with Date Picker - SetAutoSize(TRUE)
Date Posted: 22 September 2008 at 8:24am
I am using SetAutoSize(TRUE).
Now when i resize the window to a normal size it looks like



Now if i resize this to medium size it looks like :



The PROBLEM IS WITH THE FOLLOWING:
If i resize it to a max size, then i can see only 1 line of minimonths...when actually i expect it to be filled properly and show me 12 months (which is my range) . WHAT should i do to see the 12 months in this size ???




Replies:
Posted By: Oleg
Date Posted: 23 September 2008 at 2:22am
Hi,
Maybe you call SetAutoSize(FALSE) later ?  Can't reproduce it with our sample :(


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: amitb
Date Posted: 25 September 2008 at 4:13am
Please find the code attached and also the .exe file.

If you execute this and try to resize the window (which contains a date picker control), then you can reproduce the problem of resizing.

When you maximize the windows, it only shows one row for months, where actually there is ample space to display 12 months.

Works fine in following case :



NOT WORKING in following case :


uploads/20080925_041324_TestEXE.zip - uploads/20080925_041324_TestEXE.zip


Posted By: amitb
Date Posted: 25 September 2008 at 4:16am
Here is the source code attached  uploads/20080925_041557_Test-Code.zip - uploads/20080925_041557_Test-Code.zip


Posted By: amitb
Date Posted: 30 September 2008 at 12:29am
Hello CJ Team,
 
Can you please provide feedback over the sample that i have attached?


Posted By: Oleg
Date Posted: 30 September 2008 at 6:18am
Hello,
 
I checked code and actually it is designed :(  Don't use SerRange if you don't need it
. Second row need show same months but it will go out your range.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: Oleg
Date Posted: 30 September 2008 at 6:22am
Hi,
 
Lets patch CSize CXTPDatePickerControl::SetGridDimentions(CRect rcClient) method for 12 months case:
 
add this
if (nTotalMaxRangeMonths == 12 && m_nColumns >= 6 && m_nRows >= 2)
   {
    m_nColumns = 6;
    m_nRows = 2;   
   }
 
before while (m_nRows * m_nColumns > nTotalMaxRangeMonths).


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: amitb
Date Posted: 30 September 2008 at 9:33am

Thanks Oleg,

It worked :)



Posted By: mdoubson
Date Posted: 10 March 2009 at 8:07am
Unfortunately this algo it not works properly in many cases.
I modified it and add new function

//allow scrolling between FirstDay and LastDay and try to show initial visible range between FirstVisibleDay and LastVisibleDay

virtual void SetDesiredVisibleAndFullRange(COleDateTime FirstVisibleDay, COleDateTime LastVisibleDay,

COleDateTime FirstDay, COleDateTime LastDay);

and modified version of virtual void SetGridSize(int nRows, int nCols, BOOL bRestrictMode = FALSE);

if bRestrictMode Picker keep given matrix nRows x nCols as max for layout

Be in Release 13.1
 


-------------
Mark Doubson, Ph.D.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net