1 // TortoiseMerge - a Diff/Patch program
3 // Copyright (C) 2013 - TortoiseSVN
5 // This program is free software; you can redistribute it and/or
6 // modify it under the terms of the GNU General Public License
7 // as published by the Free Software Foundation; either version 2
8 // of the License, or (at your option) any later version.
10 // This program is distributed in the hope that it will be useful,
11 // but WITHOUT ANY WARRANTY; without even the implied warranty of
12 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 // GNU General Public License for more details.
15 // You should have received a copy of the GNU General Public License
16 // along with this program; if not, write to the Free Software Foundation,
17 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22 * \ingroup TortoiseMerge
23 * a custom MFC Ribbon Button to avoid the click delay
26 class CCustomMFCRibbonButton
: public CMFCRibbonButton
29 CCustomMFCRibbonButton() : CMFCRibbonButton() {}
30 CCustomMFCRibbonButton(UINT nID
, LPCTSTR lpszText
, int nSmallImageIndex
= -1, int nLargeImageIndex
= -1, BOOL bAlwaysShowDescription
= FALSE
)
31 : CMFCRibbonButton(nID
, lpszText
, nSmallImageIndex
, nLargeImageIndex
, bAlwaysShowDescription
) {}
32 CCustomMFCRibbonButton(UINT nID
, LPCTSTR lpszText
, HICON hIcon
, BOOL bAlwaysShowDescription
= FALSE
, HICON hIconSmall
= NULL
, BOOL bAutoDestroyIcon
= FALSE
, BOOL bAlphaBlendIcon
= FALSE
)
33 : CMFCRibbonButton(nID
, lpszText
, hIcon
, bAlwaysShowDescription
, hIconSmall
, bAutoDestroyIcon
, bAlphaBlendIcon
) {}
36 // override the OnLButtonUp method because the original one
37 // does nothing if the button is still marked as pressed or highlighted:
38 // that behavior prevents fast clicks because after each click
39 // the window first needs to process various messages until it clears
40 // those pressed and highlighted flags.
41 virtual void OnLButtonUp(CPoint point
)
45 CMFCRibbonBaseElement::OnLButtonUp(point
);
54 if (!m_rectCommand
.IsRectEmpty () && m_rectCommand
.PtInRect (point
) && IsMenuMode ())
61 if (!m_rectCommand
.IsRectEmpty() && !m_rectCommand
.PtInRect(point
))