Print Page | Close Window

How to auto size groups

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Task Panel
Forum Description: Topics Related to Codejock Task Panel
URL: http://forum.codejock.com/forum_posts.asp?TID=6675
Printed Date: 24 November 2024 at 1:18pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to auto size groups
Posted By: mgampi
Subject: How to auto size groups
Date Posted: 19 March 2007 at 1:23pm
Hi;
I've created a CXTPTaskPanel within a resizable dialog, that contains only one group. When the user resizes the dialog, I want the group to be resized too, so that the group occupies the whole task panel rect (minus any margins set). The width is resized automatically, but the height stays always the same!
Any hints on how to achieve this are welcome.
 


-------------
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022



Replies:
Posted By: Oleg
Date Posted: 20 March 2007 at 2:32am
Hi,
Change its behaviour to xtpTaskPanelBehaviourToolbox.


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


Posted By: mgampi
Date Posted: 20 March 2007 at 3:45am
Originally posted by oleg oleg wrote:

Hi,
Change its behaviour to xtpTaskPanelBehaviourToolbox.
 
Thanks Oleg, this works!
But now, where's the best place to size the dialog contained within the group, so that it spans the whole group client area?
 
In my CXTPTaskPanel parent class I do it like this:
 
if (_panel.GetSafeHwnd())
{
    _panel.MoveWindow(rcClient);
    CXTPTaskPanelGroup* pGroup=_panel.FindGroup(0);
    if (pGroup!=0){
        CXTPTaskPanelPaintManager* pPainter=_panel.GetPaintManager();
        CRect rcGrpClient=pGroup->GetClientRect();
        CRect rcMargins=pPainter->GetGroupInnerMargins(pGroup);
        rcGrpClient.DeflateRect(rcMargins.left, rcMargins.top, rcMargins.right, rcMargins.bottom);
       _taskDlg.MoveWindow(rcGrpClient);
    }
}
 
But this leads to some unwanted flickering - I believe that the task panel first (re)sizes the dialog to its initial size as set in .rc file and then my code is executed.
 
Any ideas?


-------------
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022


Posted By: mgampi
Date Posted: 20 March 2007 at 3:57am
Originally posted by mgampi mgampi wrote:

Originally posted by oleg oleg wrote:

Hi,
Change its behaviour to xtpTaskPanelBehaviourToolbox.
 
Thanks Oleg, this works!
But now, where's the best place to size the dialog contained within the group, so that it spans the whole group client area?
 
In my CXTPTaskPanel parent class I do it like this:
 
if (_panel.GetSafeHwnd())
{
    _panel.MoveWindow(rcClient);
    CXTPTaskPanelGroup* pGroup=_panel.FindGroup(0);
    if (pGroup!=0){
        CXTPTaskPanelPaintManager* pPainter=_panel.GetPaintManager();
        CRect rcGrpClient=pGroup->GetClientRect();
        CRect rcMargins=pPainter->GetGroupInnerMargins(pGroup);
        rcGrpClient.DeflateRect(rcMargins.left, rcMargins.top, rcMargins.right, rcMargins.bottom);
       _taskDlg.MoveWindow(rcGrpClient);
    }
}
 
But this leads to some unwanted flickering - I believe that the task panel first (re)sizes the dialog to its initial size as set in .rc file and then my code is executed.
 
Any ideas?
 
Hi Oleg;
 
I solved it myself. I knew the CXTPTaskPanelItem::SetSize(..,AutoHeight) function but I forgot to call it.
Nevertheless thanks for a great product!


-------------
Martin

Product: Xtreme Toolkit v 22.1.0, new Projects v 24.0.0
Platform: Windows 10 v 22H2 (64bit)
Language: VC++ 2022



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