![]() |
Double click RibbonBar to minimize it! |
Post Reply
|
| Author | |
shineryu
Groupie
Joined: 02 April 2006 Location: China Status: Offline Points: 33 |
Post Options
Thanks(0)
Quote Reply
Topic: Double click RibbonBar to minimize it!Posted: 22 May 2008 at 10:43am |
|
I find this:
![]() and I also want this:
![]() I derived a class from CXTPRibbonBar and Catch the WM_LBUTTONDBCLICK message, but it doesn't work well.
so, how to catch WM_LBUTTONDBCLICK message on ribbonbar?
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 22 May 2008 at 10:55am |
|
Hi,
Show all code you tried.
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
shineryu
Groupie
Joined: 02 April 2006 Location: China Status: Offline Points: 33 |
Post Options
Thanks(0)
Quote Reply
Posted: 23 May 2008 at 8:29am |
|
in "Ribbon Sample", I add the class:
class CSmartRibbonBar : public CXTPRibbonBar
{ DECLARE_DYNCREATE(CSmartRibbonBar) public: CSmartRibbonBar(){} virtual ~CSmartRibbonBar(){} DECLARE_MESSAGE_MAP()
afx_msg void OnLButtonDblClk(UINT nFlags, CPoint point); }; IMPLEMENT_DYNCREATE(CSmartRibbonBar, CXTPRibbonBar)
BEGIN_MESSAGE_MAP(CSmartRibbonBar, CXTPRibbonBar)
ON_WM_LBUTTONDBLCLK() END_MESSAGE_MAP() void CSmartRibbonBar::OnLButtonDblClk(UINT nFlags, CPoint point)
{ SetRibbonMinimized(!IsRibbonMinimized()); CXTPRibbonBar::OnLButtonDblClk(nFlags, point); } and modified the code:
BOOL CMainFrame::CreateRibbonBar()
{ //......
CSmartRibbonBar* pRibbonBar = (CSmartRibbonBar*)pCommandBars->Add(_T("The Ribbon"), xtpBarTop, RUNTIME_CLASS(CSmartRibbonBar));
//...... }
Ribbonbar is minimized very well, but when i try to close "RibbonSample",a messagebox is shown:
An unsupported operation was attempted.
and i can't close the application!
|
|
![]() |
|
Oleg
Senior Member
Joined: 21 May 2003 Location: United States Status: Offline Points: 11234 |
Post Options
Thanks(0)
Quote Reply
Posted: 23 May 2008 at 9:57am |
|
Hello,
try instead DECLARE_DYNCREATE
use
DECLATE_XTP_COMMANDBAR
|
|
|
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS |
|
![]() |
|
shineryu
Groupie
Joined: 02 April 2006 Location: China Status: Offline Points: 33 |
Post Options
Thanks(0)
Quote Reply
Posted: 23 May 2008 at 11:02am |
![]() u r so kind!
|
|
![]() |
|
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 |