Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Task Panel
  New Posts New Posts RSS Feed - How to auto size groups
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to auto size groups

 Post Reply Post Reply
Author
Message
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post Topic: How to auto size groups
    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 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 20 March 2007 at 2:32am
Hi,
Change its behaviour to xtpTaskPanelBehaviourToolbox.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post 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 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017
Back to Top
mgampi View Drop Down
Senior Member
Senior Member
Avatar

Joined: 14 July 2003
Status: Offline
Points: 1198
Post Options Post Options   Thanks (0) Thanks(0)   Quote mgampi Quote  Post ReplyReply Direct Link To This Post 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 19.0.0, new Projects v 19.1.0
Platform: Windows 10 v 1909 (64bit)
Language: VC++ 2017
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.141 seconds.