GetActiveView |
Post Reply |
Author | |
JamesC
Newbie Joined: 03 December 2003 Status: Offline Points: 21 |
Post Options
Thanks(0)
Posted: 12 April 2004 at 1:58pm |
I am using GetActiveView to determine what view in the docking pane has focus. Everything works fine as long as the panes are docked. but if they are floating then GetActiveView does not find the panes. The parent has changed. I am wondering if there is a better way to determine what view has focus.
What i currently ended up doing was to first get the active view and then check to see if the view is the "main" view. if it is the "main" view, then get the focus (which is either the pane or the "main" view). it just seems like alot of steps. here is the code... CView *pActiveView = pDoc->m_pFrame->GetActiveView(); CWnd *pActiveFocus = NULL; if (pActiveView->IsKindOf(RUNTIME_CLASS(CMyView))) { pActiveFocus = pDoc->m_pFrame->GetFocus(); if ((pActiveFocus != pActiveView) && (pActiveFocus->IsKindOf(RUNTIME_CLASS(CView)))) { pActiveView = dynamic_cast<CView*>(pActiveFocus); } } |
|
ipaqlinux48
Newbie Joined: 31 March 2004 Location: Belgium Status: Offline Points: 16 |
Post Options
Thanks(0)
|
I've experienced another problem. When my view is undocked, the menubar of my main window won't react om mouseclicks. Finally, I've solved this by inserting the next piece of code: But now I have another problem. When my view is undoced, it seems that it is disconnected from my document. I'll let you know something if I have fixed this problem. In the meantime, good luck with your problem. |
|
Post Reply | |
Tweet
|
Forum Jump | Forum Permissions You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |