Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Task Panel
  New Posts New Posts RSS Feed - How to find the next item in a group
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

How to find the next item in a group

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

Joined: 07 October 2004
Location: Australia
Status: Offline
Points: 242
Post Options Post Options   Thanks (0) Thanks(0)   Quote dennisV Quote  Post ReplyReply Direct Link To This Post Topic: How to find the next item in a group
    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)
Back to Top
rdhd View Drop Down
Senior Member
Senior Member
Avatar

Joined: 13 August 2007
Location: United States
Status: Offline
Points: 886
Post Options Post Options   Thanks (0) Thanks(0)   Quote rdhd Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
dennisV View Drop Down
Senior Member
Senior Member
Avatar

Joined: 07 October 2004
Location: Australia
Status: Offline
Points: 242
Post Options Post Options   Thanks (0) Thanks(0)   Quote dennisV Quote  Post ReplyReply Direct Link To This Post 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)
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.