Print Page | Close Window

switch between panes

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Docking Pane
Forum Description: Topics Related to Codejock Docking Pane
URL: http://forum.codejock.com/forum_posts.asp?TID=619
Printed Date: 04 May 2024 at 12:09am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: switch between panes
Posted By: jimmy
Subject: switch between panes
Date 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



Replies:
Posted By: Oleg
Date 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);

}



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



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