Print Page | Close Window

TaskPanel - AddControlItem

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=6799
Printed Date: 20 June 2025 at 2:03pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: TaskPanel - AddControlItem
Posted By: kram617
Subject: TaskPanel - AddControlItem
Date Posted: 04 April 2007 at 8:16am
Hello,
 
I am trying to use TaskPanel with Version 9.70.  I have created two groups and I use AddControlItem to add a child window to each group.  (One group has a list box, the other group has a tree control.)  I am currently using xtpTaskPanelThemeListViewOffice2003 for my theme, so I can have an Outlook 2003 look.
 
The problem I am having is that switching between groups doesn't make my child windows visible.  For example, if I have Group 1 expanded and am looking at my tree control, then I click to expand Group 2, I don't see my list box.  But I click back onto Group 1, I still see my tree control.  However, after expanding Group 2, if I resize the window, the list box will then reappear.  But then I click back to expand Group 1, and my tree control isn't visible. 
 
It's as if only one CXTPTaskPanelGroupItem can be visible at a time, regardless of whether they are in seperate groups.
 
If anybody can help me, you have my thanks.
 
----------------------------------------------------------------
 
BTW, here is my code for creating the Task Panel and contents, if this is any help....
 
 
 if (m_TaskPanel.Create(WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN , CXTPEmptyRect(),  this, IDC_TASKPANEL))
 {
      m_TaskPanel.SetTheme(xtpTaskPanelThemeListViewOffice2003); 
      m_TaskPanel.SetBehaviour(xtpTaskPanelBehaviourToolbox);
      m_TaskPanel.SetSelectItemOnFocus(TRUE);
      m_pItemLayoutGroup = m_TaskPanel.AddGroup(IDS_WORKSPACE_ITEMLAYOUT);
      m_pReportViewGroup = m_TaskPanel.AddGroup(IDS_WORKSPACE_REPORTVIEW);
      m_pReportViewGroup->SetExpanded(TRUE);

      m_treeItemLayout.Create(WS_CHILD | WS_VISIBLE | TVS_HASBUTTONS | TVS_HASLINES | TVS_LINESATROOT | TVS_INFOTIP | TVS_SHOWSELALWAYS, CXTPEmptyRect(), &m_TaskPanel, IDC_WORKSPACE_TREE_SECTIONS);
      m_pItemLayoutItem = m_pItemLayoutGroup->AddControlItem(m_treeItemLayout.GetSafeHwnd());
      m_lstReportSections.Create(WS_CHILD | WS_VISIBLE | LBS_STANDARD | WS_HSCROLL, CXTPEmptyRect(), &m_TaskPanel, IDC_WORKSPACE_LIST_REPORT);
      m_pReportViewItem = m_pReportViewGroup->AddControlItem(m_lstReportSections.GetSafeHwnd());
}
 
 
 



Replies:
Posted By: kram617
Date Posted: 05 April 2007 at 12:15pm
Looks like I found the problem.  I was calling SetSize for each item in my OnSize handler, but I wasn't checking first if that particular group was expanded.  So basically, I was resizing an item to nothing because the group height is zero when collapsed.  Thus, the next time I would expand a group the item wouldn't appear.
 
Now I don't resize until I receive a XTP_TPN_GROUPEXPANDED actions from XTPWM_TASKPANEL_NOTIFY.



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