Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Docking Pane
  New Posts New Posts RSS Feed - CFormView in docking pane, with command bars
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CFormView in docking pane, with command bars

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

Joined: 02 February 2008
Status: Offline
Points: 156
Post Options Post Options   Thanks (0) Thanks(0)   Quote Smucker Quote  Post ReplyReply Direct Link To This Post Topic: CFormView in docking pane, with command bars
    Posted: 30 March 2008 at 5:08am
I have embedded a CFormView that includes a CSyntaxEditCtrl in a docking pane with some success. (I intend this for script editing, so it's not the main focus of the application. I really want to use a docking pane rather than a separate top-level window.)



However, I'm facing a couple of problems:
  1. When it has focus, how can I get the form view/syntax control to obtain keyboard messages before they are translated as main frame accelerators?
  2. If I use pCommandBars->SetSite() on the form view, it never displays. I can attach it to the parent (which is an internally-generated CFrameWnd), but then ON_XTP_CREATECONTROL() doesn't work in the form view. (I'd like to put font/size combos on the toolbar).
Here is the code I'm using in the OnInitialUpdate override to get #2 almost working:

void CPythonEditor::OnInitialUpdate()
{
    CFormView::OnInitialUpdate();
    m_pCommandBars = (CXTPCommandBars*)RUNTIME_CLASS(CXTPCommandBars)->CreateObject();
    ASSERT(m_pCommandBars);
    m_pCommandBars->SetSite(GetParent());
    m_pCommandBars->EnableDocking();
    m_pCommandBars->SetMenu(_T("Menu Bar"), MENU_PYTEXT);
    CXTPToolBar* pCommandBar = (CXTPToolBar*)m_pCommandBars->Add(_T("Standard"), xtpBarTop);
    if (!pCommandBar || !pCommandBar->LoadToolBar(MENU_PYTEXT)) {
        TRACE0("Failed to create toolbar\n");
        return;
    }
...

I am creating the CFormView-derived pane in OnDockingPaneNotify() as follows:

    case IDR_PANE_PYTHON:
        pPane->AttachView(this, RUNTIME_CLASS(CPythonEditor));
        break;


Product: Xtreme Toolkit Pro version 13.2 (Unicode, static build)

Platform: Windows 200x/XP/Vista/Win7 (32/64 bit)

Language: Visual C++ 9.0 (Studio 2008)

Back to Top
franji1 View Drop Down
Groupie
Groupie
Avatar

Joined: 28 June 2005
Status: Offline
Points: 70
Post Options Post Options   Thanks (0) Thanks(0)   Quote franji1 Quote  Post ReplyReply Direct Link To This Post Posted: 22 February 2013 at 11:54am
I am having a similar problem.  The Active MDI frame has accelerator keys for normal ASCII characters like '=' and '!' (it's a graphical editor, not text).  But then I have a docking pane that has a grid view with an edit control, so I am unable to enter these key strokes because the active MDI is "translating" these key strokes for ITS purpose (MDI view does NOT have focus, the edit contol in my docking pane does).
 
Also, when the user switches the active MDI child to a different type that DOESN'T have this accelerator table, the edit control in the docking pane behaves properly.
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.