Print Page | Close Window

CXTPShortcutBar and CXTPDockingPane Drawing Fault

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Shortcut Bar
Forum Description: Topics Related to Codejock Shortcut Bar
URL: http://forum.codejock.com/forum_posts.asp?TID=11431
Printed Date: 25 April 2024 at 6:04am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: CXTPShortcutBar and CXTPDockingPane Drawing Fault
Posted By: iftekhar
Subject: CXTPShortcutBar and CXTPDockingPane Drawing Fault
Date Posted: 14 July 2008 at 11:03am
I have an SDI application where I have created a shorcut bar with some shortcut bar items.
 
In the main frame I also added a CXTPDockingPane and attached a simple dialog with some CEdit controls and a CButton.
 
Initially the docking pane is in Auto hide state. If I move the mouse to the docking pane tab title it shows the panel. Then I move the mouse to the right window (not the shortcut bar) and the patel disappers, which is fine.
 
But if i move the mouse the shortcut bar is drawn on the docking pane and takes some time to hide the docking pane and an unwanted partial dockinging pane is shown wor a while. See the image below.
 
 
If I click the docking pane tab name it displays the docking pane and sets focus on the first edit control. now if I click the right window it hides the docking pane, which is expected, so works fine.
 
But if I click the shortcut bar instead it draws the shorcut but without hiding the docking pane and the shorcut bar items covering the docking pane are not clickable and unexpectedly focuses on the docking pane edit control. sett the screen shot below.
 
 
How can I resolve this issue?
 
My Code:
-----------
 
I have modified the ShortcutBar sample in 1201 release and added the docking pane and attached a CDialog (CTestDlg).
 
MainFrm.h
----------

CXTPDockingPaneManager m_paneManager;

CTestDlg m_TestDlg;

afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);

LRESULT OnDockingPaneNotify(WPARAM wParam, LPARAM lParam);

MainFrm.cpp
------------
 
///////////////////////// Code of Interest ////////////////////////////////

ON_MESSAGE(XTPWM_DOCKINGPANE_NOTIFY, OnDockingPaneNotify)

/////////////////////////////////////////////////////////////////////////////
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)

{

if (CFrameWnd::OnCreate(lpCreateStruct) == -1)

return -1;

if (!m_wndStatusBar.Create(this) ||

!m_wndStatusBar.SetIndicators(indicators,

sizeof(indicators)/sizeof(UINT)))

{

TRACE0("Failed to create status bar\n");

return -1; // fail to create

}

if (!InitCommandBars())

return -1;

CXTPCommandBars* pCommandBars = GetCommandBars();

pCommandBars->SetMenu(_T("Menu Bar"), IDR_MAINFRAME);

 

CXTPToolBar* pStandardBar = (CXTPToolBar*)pCommandBars->Add(_T("Standard"), xtpBarTop);

if (!pStandardBar ||

!pStandardBar->LoadToolBar(IDR_MAINFRAME))

{

TRACE0("Failed to create toolbar\n");

}

pCommandBars->GetToolTipContext()->SetStyle(xtpToolTipOffice);

// Load the previous state for command bars.

LoadCommandBars(_T("CommandBars"));

CXTPPaintManager::SetTheme(xtpThemeRibbon);

m_wndShortcutBar.SetTheme(xtpShortcutThemeOffice2007);

EnableOffice2007Frame(GetCommandBars());

///////////////////////// Code of Interest ////////////////////////////////
 
m_paneManager.InstallDockingPanes(this);

m_paneManager.SetTheme(xtpPaneThemeOffice);

m_TestDlg.Create(CTestDlg::IDD, this);

CRect rectDlg;

m_TestDlg.GetClientRect(&rectDlg);

CXTPDockingPane* pPane = m_paneManager.CreatePane(12001, rectDlg, xtpPaneDockBottom);

pPane->SetTitle(_T("Test Pane"));

m_paneManager.ToggleAutoHide(pPane);

/////////////////////////////////////////////////////////////////////////////
 
return 0;

}

///////////////////////// Code of Interest ////////////////////////////////
 
LRESULT CMainFrame::OnDockingPaneNotify(WPARAM wParam, LPARAM lParam)

{

if (wParam == XTP_DPN_SHOWWINDOW)

{

// get a pointer to the docking pane being shown.

CXTPDockingPane* pWndDockWindow= (CXTPDockingPane*)lParam;

if (!pWndDockWindow->IsValid())

{

switch (pWndDockWindow->GetID())

{

case 12001:

pWndDockWindow->Attach(&m_TestDlg);

}

}

return TRUE; // handled

}

return FALSE;

}

/////////////////////////////////////////////////////////////////////////////


-------------
IAT



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