![]() |
HOWTO resize MarkupStatic / move other controls |
Post Reply
|
| Author | |
mgampi
Senior Member
Joined: 14 July 2003 Status: Offline Points: 1210 |
Post Options
Thanks(0)
Quote Reply
Topic: HOWTO resize MarkupStatic / move other controlsPosted: 24 February 2011 at 4:31am |
|
Hi;
I created a CXTPResizeDialog derived class containing a CMarkupStatic control on top and immediately below the CMarkupStatic control a CXTPReportControl class. Whenever the dialog is resized the content of the CMarkupStatic is partly invisible. How can I ensure, that the size of the control is always big enough to show the whole content and how do I know the new position of the report control? Here's a picture of what I mean: ![]() Any help is very welcome... |
|
|
Martin Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022 |
|
![]() |
|
mgampi
Senior Member
Joined: 14 July 2003 Status: Offline Points: 1210 |
Post Options
Thanks(0)
Quote Reply
Posted: 25 February 2011 at 3:05am |
|
Hello;
No solution for this? I can't believe it. |
|
|
Martin Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022 |
|
![]() |
|
cpede
Senior Member
Joined: 13 August 2004 Location: Denmark Status: Offline Points: 683 |
Post Options
Thanks(0)
Quote Reply
Posted: 25 February 2011 at 5:43am |
|
Well, if you just places controls on a Dialog or Form there is no build-in automatic moving and resizing of the individual controls, and Dialog and Form sizes etc.
If you want to have control, you can read the size of the Markup context object and then manually move your Report control up or down accordingly.
That is at least the way I do it.
-cpede
|
|
|
Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64) Language: Visual Studio 2017 (C++) |
|
![]() |
|
mgampi
Senior Member
Joined: 14 July 2003 Status: Offline Points: 1210 |
Post Options
Thanks(0)
Quote Reply
Posted: 25 February 2011 at 5:52am |
|
But how can I read the size of the Markup content. That's what I was looking for...
|
|
|
Martin Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022 |
|
![]() |
|
cpede
Senior Member
Joined: 13 August 2004 Location: Denmark Status: Offline Points: 683 |
Post Options
Thanks(0)
Quote Reply
Posted: 25 February 2011 at 5:58am |
|
I use code like this:
if (m_ctrl.GetSafeHwnd())
{ if (m_ctrl.GetUIElement()) { CDC* pDC = m_ctrl.GetDC(); if (pDC) { CSize sizeAvailable(rc.Width(),rc.Height()); CXTPMarkupDrawingContext dc(pDC->m_hDC); m_ctrl.GetUIElement()->Measure(&dc,sizeAvailable); CSize sizeDesired = m_ctrl.GetUIElement()->GetDesiredSize(); m_ctrl.ReleaseDC(pDC); m_nHeight = sizeDesired.cy; } } m_ctrl.SetWindowPos(NULL,0,rc.Height()-m_nHeight,rc.Width(),m_nHeight,SWP_NOZORDER); } I don't know if the code is optimal, but it works
-cpede
|
|
|
Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64) Language: Visual Studio 2017 (C++) |
|
![]() |
|
mgampi
Senior Member
Joined: 14 July 2003 Status: Offline Points: 1210 |
Post Options
Thanks(0)
Quote Reply
Posted: 25 February 2011 at 6:01am |
|
Hi;
Thanks, that's what I was looking for! |
|
|
Martin Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022 |
|
![]() |
|
mgampi
Senior Member
Joined: 14 July 2003 Status: Offline Points: 1210 |
Post Options
Thanks(0)
Quote Reply
Posted: 25 February 2011 at 6:40am |
|
Hi;
I included the suggested code into my OnSize() message handler. But now the report control flickers while resizing. What can I do to prevent this? Here's the code of my OnSize handler:
|
|
|
Martin Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022 |
|
![]() |
|
cpede
Senior Member
Joined: 13 August 2004 Location: Denmark Status: Offline Points: 683 |
Post Options
Thanks(0)
Quote Reply
Posted: 25 February 2011 at 6:56am |
|
You probable need to play with the WS_CLIPCHILDREN and WS_CLIPSIBLINGS styles on your Dialog or Form and control.
And if owner draw, then remember to return correctly in the OnEraseBkgnd(CDC* pDC) method.
|
|
|
Product: Xtreme ToolkitPro (24.0.0)
Platform: Windows 10 (x64) Language: Visual Studio 2017 (C++) |
|
![]() |
|
mgampi
Senior Member
Joined: 14 July 2003 Status: Offline Points: 1210 |
Post Options
Thanks(0)
Quote Reply
Posted: 25 February 2011 at 7:12am |
|
Hi;
I think it's because of using a CXTPResizeDialog. The CLIP* styles are all set as expected. When I remove my additional code from OnSize() the flicker goes away. Perhaps Oleg has an idea how to integrate this resize into the CXTPResize() concept. Nevertheless, thanks for your help. |
|
|
Martin Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022 |
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 25 February 2011 at 8:31am |
|
Hi,
if you manually position controls, just don't use CXTPResize
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
mgampi
Senior Member
Joined: 14 July 2003 Status: Offline Points: 1210 |
Post Options
Thanks(0)
Quote Reply
Posted: 25 February 2011 at 8:51am |
|
Thanks Oleg!
![]() Now it works like a charm... |
|
|
Martin Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0 Platform: Windows 10 v 22H2 (64bit) Language: VC++ 2022 |
|
![]() |
|
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 |