Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - switch between panes
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

switch between panes

 Post Reply Post Reply
Author
Message
jimmy View Drop Down
Senior Member
Senior Member


Joined: 11 November 2003
Location: Austria
Status: Offline
Points: 515
Post Options Post Options   Thanks (0) Thanks(0)   Quote jimmy Quote  Post ReplyReply Direct Link To This Post Topic: switch between panes
    Posted: 13 April 2004 at 9:50am
Hello,

I've 6 panes.
Always 3 panes attached togeter.
Now i have 2 tabbed panes.
How can i switch between the 3 panes on a tabbed pane.
For using CTRL-F6 to switch between the panes.
 Thanx
    Johann Obermayr
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: 14 April 2004 at 10:34am

CXTPDockingPaneTabbedContainer* GetParentContainer(CWnd* pParentWnd)

{

       if (pParentWnd == NULL || pParentWnd->GetSafeHwnd() == NULL) // no Window attached

              return NULL;

       while (pParentWnd != NULL)

       {

              if (DYNAMIC_DOWNCAST(CXTPDockingPaneTabbedContainer, pParentWnd))

                     return (CXTPDockingPaneTabbedContainer*)pParentWnd;

              pParentWnd = pParentWnd->GetParent();

       }

       return NULL;

}

BOOL CMainFrame::PreTranslateMessage(MSG* pMsg)

{

       if (pMsg->message == WM_KEYDOWN && pMsg->wParam == VK_F6 && (GetKeyState(VK_CONTROL) < 0))

       {

              CXTPDockingPaneTabbedContainer* pContainer = GetParentContainer(GetFocus());

              if (pContainer && pContainer->GetPanes().GetCount() > 1)

              {

                     CXTPDockingPane* pSelected = pContainer->GetPanes().GetHead();

                     POSITION pos = pContainer->GetPanes().GetHeadPosition();

                    

                     while (pos)

                     {

                              CXTPDockingPane* pPane = pContainer->GetPanes().GetNext(pos);

                    

                              if (pPane == pContainer->GetSelected())

                              {

                                      if (pos)

                                             pSelected = pContainer->GetPanes().GetNext(pos);

                                      break;                               

                              }

                     }

                     ASSERT(pSelected);

                     pSelected->Select();

                     return TRUE;

              }             

       }

       return  CXTPMDIFrameWnd::PreTranslateMessage(pMsg);

}



Edited by oleg
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
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.