diff options
author | Christoph Schleifenbaum <christoph.schleifenbaum@kdab.com> | 2017-10-07 12:02:58 +0200 |
---|---|---|
committer | Andras Mantia <andras@kdab.com> | 2017-10-10 17:25:20 +0000 |
commit | 71ee09416e70babeebf7e831000ebfb3b6f8bfab (patch) | |
tree | 3a57fa504a46c410be13c3fc04526c7a9c24ad5f /src/Authoring/Studio/UI | |
parent | c9d1de61e52c6bbaed8626eabe9cc1795edf764b (diff) |
MFC cleanup
Change-Id: If9a9f07ba9505712f3007a96c09a8cac42e8b0b7
Task-Id: BOUL-753
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
Diffstat (limited to 'src/Authoring/Studio/UI')
-rw-r--r-- | src/Authoring/Studio/UI/ContextMenu.h | 150 | ||||
-rw-r--r-- | src/Authoring/Studio/UI/CustomReBar.cpp | 54 | ||||
-rw-r--r-- | src/Authoring/Studio/UI/CustomReBar.h | 56 |
3 files changed, 0 insertions, 260 deletions
diff --git a/src/Authoring/Studio/UI/ContextMenu.h b/src/Authoring/Studio/UI/ContextMenu.h deleted file mode 100644 index d6b42bbb..00000000 --- a/src/Authoring/Studio/UI/ContextMenu.h +++ /dev/null @@ -1,150 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 1999-2001 NVIDIA Corporation. -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt 3D Studio. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -//============================================================================== -// Prefix -//============================================================================== -#ifndef INCLUDED_CONTEXT_MENU_H -#define INCLUDED_CONTEXT_MENU_H 1 - -#pragma once - -#ifdef WIN32 -#define MENUHANDLE HMENU -#endif - -//============================================================================== -// Includes -//============================================================================== -#include "GenericFunctor.h" -#include <vector> - -class CContextMenu; - -//============================================================================= -/** - * Class declaration for Context Menu performers. - */ -class CContextMenuPerformer -{ -public: - CContextMenuPerformer() - : m_SubMenu(nullptr) - { - } - - virtual void OnOptionSelected() = 0; - - void SetSubMenu(CContextMenu *inSubMenu) { m_SubMenu = inSubMenu; } - CContextMenu *GetSubMenu() const { return m_SubMenu; } - -protected: - CContextMenu *m_SubMenu; -}; - -//============================================================================= -/** - * Template declaration for Context Menu performers. - */ -template <class TClass> -class CSpecificCContextMenuPerformer : public CContextMenuPerformer -{ -public: - typedef void (TClass::*TFunction)(); - CSpecificCContextMenuPerformer(TClass *inObject, TFunction inFunction) - { - m_Object = inObject; - m_Function = inFunction; - } - - virtual void OnOptionSelected() { (m_Object->*m_Function)(); } - - TClass *m_Object; - void (TClass::*m_Function)(); -}; - -//============================================================================= -/** - * Cross-platform class for creating context menus. - */ -class CContextMenu -{ - typedef std::vector<CContextMenuPerformer *> TPerformerList; - typedef std::vector<Q3DStudio::CString> TOptionList; - -public: - enum ESelection { NO_SELECTION = -1 }; - - CContextMenu(); - virtual ~CContextMenu(); - - long DoPopup(CPt inLocation, HWND inParentWindow); - void AddSeparator(); - void AddOption(int inOptionNameStringID, CContextMenuPerformer *inPerformer, - bool inIsEnabled = true); - void AddOption(const Q3DStudio::CString &inOptionName, CContextMenuPerformer *inPerformer, - bool inIsEnabled = true); - - void Clear(); - void SetCheck(long inIndex, bool inChecked); - void ClearChecked(); - Q3DStudio::CString GetStringAt(long inIndex); - long GetItemCount(); - long GetSelectedOption() { return m_SelectedOption; } - /* - template< class TBase > - void AddOption( const Q3DStudio::CString& inOptionName, TBase* inClass, - CSpecificCContextMenuPerformer<TBase>::TFunction inFunction, bool inIsEnabled ) - { - AddOption( inOptionName, new CSpecificCContextMenuPerformer<TBase>( inClass, - inFunction, inIsEnabled ) ); - } - */ - - virtual void Update(); - - MENUHANDLE GetMenuHandle() const { return m_Menu; } - CContextMenuPerformer *GetSelectedMenuPerformer(long inIndex); - - void EnableOptionByIndex(long inIndex, bool inEnabledState = true); - void EnableOption(const Q3DStudio::CString &inOptionName, bool inEnabledState = true); - void EnableOption(unsigned int inOptionNameStringID, bool inEnabledState = true); - -protected: - void ProcessSelection(long inIndex); - void DeletePerformers(); - - TPerformerList m_Performers; - TOptionList m_Options; - long m_SelectedOption; - MENUHANDLE m_Menu; - long m_IndexBase; ///< Base index for command ids associated with this context menu -}; - -#endif // INCLUDED_CONTEXT_MENU_H
\ No newline at end of file diff --git a/src/Authoring/Studio/UI/CustomReBar.cpp b/src/Authoring/Studio/UI/CustomReBar.cpp deleted file mode 100644 index 31813c3b..00000000 --- a/src/Authoring/Studio/UI/CustomReBar.cpp +++ /dev/null @@ -1,54 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008 NVIDIA Corporation. -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt 3D Studio. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -//============================================================================== -// Prefix -//============================================================================== - -#include "stdafx.h" -#include "CustomReBar.h" -#include "StudioPreferences.h" - -BEGIN_MESSAGE_MAP(CCustomReBar, CReBar) -//}}AFX_MSG_MAP -ON_WM_ERASEBKGND() -END_MESSAGE_MAP() - -BOOL CCustomReBar::OnEraseBkgnd(CDC *pDC) -{ - CRect theRect; - GetClientRect(&theRect); - CColor theBaseColor(CStudioPreferences::GetToolBarBaseColor()); - CBrush theBaseColorBrush( - RGB(theBaseColor.GetRed(), theBaseColor.GetGreen(), theBaseColor.GetBlue())); - CBrush *pOld = pDC->SelectObject(&theBaseColorBrush); - BOOL bRes = pDC->PatBlt(0, 0, theRect.Width(), theRect.Height(), PATCOPY); - pDC->SelectObject(pOld); // restore old brush - return bRes; -}
\ No newline at end of file diff --git a/src/Authoring/Studio/UI/CustomReBar.h b/src/Authoring/Studio/UI/CustomReBar.h deleted file mode 100644 index 66cbf5a4..00000000 --- a/src/Authoring/Studio/UI/CustomReBar.h +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2008 NVIDIA Corporation. -** Copyright (C) 2017 The Qt Company Ltd. -** Contact: https://www.qt.io/licensing/ -** -** This file is part of Qt 3D Studio. -** -** $QT_BEGIN_LICENSE:GPL-EXCEPT$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and The Qt Company. For licensing terms -** and conditions see https://www.qt.io/terms-conditions. For further -** information use the contact form at https://www.qt.io/contact-us. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3 as published by the Free Software -** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT -** included in the packaging of this file. Please review the following -** information to ensure the GNU General Public License requirements will -** be met: https://www.gnu.org/licenses/gpl-3.0.html. -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#ifndef INCLUDED_CUSTOMTOOLBAR_H -#define INCLUDED_CUSTOMTOOLBAR_H 1 - -#pragma once - -//============================================================================== -/** - * @class CCustomReBar overrides the Win32 CReBar simply to change the background color - */ -class CCustomReBar : public CReBar -{ -public: - CCustomReBar() {} - ~CCustomReBar() {} - - // Implementation -protected: - // Generated message map functions - //{{AFX_MSG(CCustomToolBar) - //}}AFX_MSG - DECLARE_MESSAGE_MAP() - -public: - afx_msg BOOL OnEraseBkgnd(CDC *pDC); -}; - -#endif
\ No newline at end of file |