Print Page | Close Window

Double click RibbonBar to minimize it!

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Toolkit Pro
Forum Description: Topics Related to Codejock Toolkit Pro
URL: http://forum.codejock.com/forum_posts.asp?TID=10746
Printed Date: 15 November 2025 at 4:23am
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Double click RibbonBar to minimize it!
Posted By: shineryu
Subject: Double click RibbonBar to minimize it!
Date 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?



Replies:
Posted By: Oleg
Date Posted: 22 May 2008 at 10:55am
Hi,
Show all code you tried.


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: shineryu
Date 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!


Posted By: Oleg
Date Posted: 23 May 2008 at 9:57am
Hello,
try instead DECLARE_DYNCREATE
use
 
DECLATE_XTP_COMMANDBAR


-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: shineryu
Date Posted: 23 May 2008 at 11:02am
thank u, oleg!
u r so kind!
 



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