Print Page | Close Window

How to find the next item in a group

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=19113
Printed Date: 03 December 2024 at 12:51pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: How to find the next item in a group
Posted By: dennisV
Subject: How to find the next item in a group
Date Posted: 26 October 2011 at 5:22pm
Hello,

I'm trying to find the next item in the current group inside a task panel, but can't seem to find a way to do so.

This is the code fragment that I currently have, but obviously it's wrong:


    case XTP_PGN_AFTEREDIT:
        {
            XTP_PROPERTYGRID_NOTIFYEDIT * notify = (XTP_PROPERTYGRID_NOTIFYEDIT *)lParam;
            if(notify)
            {
                CXTPPropertyGridItem* pItem = notify->pItem;
                if (pItem)
                {
                    CXTPTaskPanelGroupItem * pGroupItem = FindItem(pItem->GetID());
                    if (pGroupItem)
                    {
                        CXTPTaskPanelItem * pNewItem = GetNextItem(pGroupItem, 1, TRUE, TRUE);
                        if (pNewItem) // this is wrong...
                        {
                        }
                    }
                }
            }
        }
        break;


Can someone tell me the right way to do this? Thanks!


-------------
// W7 64 Ultimate SP1
// VS 2008
// CodeJock 16.2.3 (MFC)



Replies:
Posted By: rdhd
Date Posted: 15 November 2011 at 2:29pm
CXTPTaskPanelGroupItem has a GetIndex member. I have code that tabs among groups (and controls in dialogs inserted into groups) in my task panel. When I need to move to from one group to another group, I get the current group, call GetIndex() and then increment the index by one and I can use that index to get the "next" group in the task panel.

I "wrap" around to the top group when I see the index is at the task panel's GetGroupCount() - 1 by setting the index to zero. And if shift-tabbing, if the current group index is zero, I set it to GetGroupCount() -1.

So try using GetIndex() and see if it works.


Posted By: dennisV
Date Posted: 07 December 2011 at 4:20pm
Thanks for the tip - I got it to work as I need :)

-------------
// W7 64 Ultimate SP1
// VS 2008
// CodeJock 16.2.3 (MFC)



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