![]() |
Issue with Date Picker - SetAutoSize(TRUE) |
Post Reply
|
| Author | |
amitb
Groupie
Joined: 13 September 2006 Status: Offline Points: 50 |
Post Options
Thanks(0)
Quote Reply
Topic: Issue with Date Picker - SetAutoSize(TRUE)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 ??? |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
amitb
Groupie
Joined: 13 September 2006 Status: Offline Points: 50 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
amitb
Groupie
Joined: 13 September 2006 Status: Offline Points: 50 |
Post Options
Thanks(0)
Quote Reply
Posted: 25 September 2008 at 4:16am |
|
Here is the source code attached uploads/20080925_041557_Test-Code.zip
|
|
![]() |
|
amitb
Groupie
Joined: 13 September 2006 Status: Offline Points: 50 |
Post Options
Thanks(0)
Quote Reply
Posted: 30 September 2008 at 12:29am |
|
Hello CJ Team,
Can you please provide feedback over the sample that i have attached?
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
amitb
Groupie
Joined: 13 September 2006 Status: Offline Points: 50 |
Post Options
Thanks(0)
Quote Reply
Posted: 30 September 2008 at 9:33am |
|
Thanks Oleg, It worked :) |
|
![]() |
|
mdoubson
Senior Member
Joined: 17 November 2008 Status: Offline Points: 1705 |
Post Options
Thanks(0)
Quote Reply
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 |
|
![]() |
|
Post Reply
|
|
|
Tweet
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |