Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Shortcut Bar
  New Posts New Posts RSS Feed - CXTPShortcutBar and CXTPDockingPane Drawing Fault
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

CXTPShortcutBar and CXTPDockingPane Drawing Fault

 Post Reply Post Reply
Author
Message
iftekhar View Drop Down
Groupie
Groupie


Joined: 25 June 2007
Location: United Kingdom
Status: Offline
Points: 10
Post Options Post Options   Thanks (0) Thanks(0)   Quote iftekhar Quote  Post ReplyReply Direct Link To This Post Topic: CXTPShortcutBar and CXTPDockingPane Drawing Fault
    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
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.203 seconds.