Print Page | Close Window

CFormView in docking pane, with command bars

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=10004
Printed Date: 29 April 2024 at 6:46am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CFormView in docking pane, with command bars
Posted By: Smucker
Subject: CFormView in docking pane, with command bars
Date 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)




Replies:
Posted By: franji1
Date 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.



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