Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > Visual C++ MFC > Toolkit Pro
  New Posts New Posts RSS Feed - Double click RibbonBar to minimize it!
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Double click RibbonBar to minimize it!

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


Joined: 02 April 2006
Location: China
Status: Offline
Points: 33
Post Options Post Options   Thanks (0) Thanks(0)   Quote shineryu Quote  Post ReplyReply Direct Link To This Post 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?
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 22 May 2008 at 10:55am
Hi,
Show all code you tried.
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
shineryu View Drop Down
Groupie
Groupie


Joined: 02 April 2006
Location: China
Status: Offline
Points: 33
Post Options Post Options   Thanks (0) Thanks(0)   Quote shineryu Quote  Post ReplyReply Direct Link To This Post 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!
Back to Top
Oleg View Drop Down
Senior Member
Senior Member


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 23 May 2008 at 9:57am
Hello,
try instead DECLARE_DYNCREATE
use
 
DECLATE_XTP_COMMANDBAR
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
shineryu View Drop Down
Groupie
Groupie


Joined: 02 April 2006
Location: China
Status: Offline
Points: 33
Post Options Post Options   Thanks (0) Thanks(0)   Quote shineryu Quote  Post ReplyReply Direct Link To This Post Posted: 23 May 2008 at 11:02am
thank u, oleg!
u r so kind!
 
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.063 seconds.