guiPopupMenuCtrl.h
Engine/source/gui/editor/guiPopupMenuCtrl.h
Classes:
Public Defines
define
Detailed Description
Public Defines
GUI_POPUP_MENU_CTRL_H()
1 2//----------------------------------------------------------------------------- 3// Copyright (c) 2012 GarageGames, LLC 4// 5// Permission is hereby granted, free of charge, to any person obtaining a copy 6// of this software and associated documentation files (the "Software"), to 7// deal in the Software without restriction, including without limitation the 8// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or 9// sell copies of the Software, and to permit persons to whom the Software is 10// furnished to do so, subject to the following conditions: 11// 12// The above copyright notice and this permission notice shall be included in 13// all copies or substantial portions of the Software. 14// 15// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 20// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 21// IN THE SOFTWARE. 22//----------------------------------------------------------------------------- 23 24#pragma once 25 26#ifndef GUI_POPUP_MENU_CTRL_H 27#define GUI_POPUP_MENU_CTRL_H 28 29#ifndef _GUITEXTLISTCTRL_H_ 30#include "gui/controls/guiTextListCtrl.h" 31#endif 32 33#ifndef _GUIMENUBAR_H_ 34#include "gui/editor/guiMenuBar.h" 35#endif 36 37#ifndef _POPUPMENU_H_ 38#include "platform/menus/popupMenu.h" 39#endif 40 41class GuiPopupMenuBackgroundCtrl; 42 43class GuiPopupMenuTextListCtrl : public GuiTextListCtrl 44{ 45 friend class GuiPopupMenuBackgroundCtrl; 46 friend class PopupMenu; 47 48private: 49 typedef GuiTextListCtrl Parent; 50 51 GuiPopupMenuBackgroundCtrl* mBackground; 52 53public: 54 bool isSubMenu; // Indicates that this text list is in a submenu 55 Point2I maxBitmapSize; 56 57 GuiMenuBar* mMenuBar; 58 PopupMenu* mPopup; 59 60 S32 mLastHighlightedMenuIdx; 61 62 GuiPopupMenuTextListCtrl(); 63 64 // GuiControl overloads: 65 bool onKeyDown(const GuiEvent &event); 66 void onMouseDown(const GuiEvent &event); 67 void onMouseUp(const GuiEvent &event); 68 void onRenderCell(Point2I offset, Point2I cell, bool selected, bool mouseOver); 69 70 virtual void onCellHighlighted(Point2I cell); // Added 71}; 72 73class GuiPopupMenuBackgroundCtrl : public GuiControl 74{ 75 typedef GuiControl Parent; 76 77public: 78 GuiPopupMenuBackgroundCtrl(); 79 void onMouseDown(const GuiEvent &event); 80 void onMouseUp(const GuiEvent &event); 81 void onMouseMove(const GuiEvent &event); 82 void onMouseDragged(const GuiEvent &event); 83 84 void close(); 85 86 void clearPopups(); 87 88 S32 findPopupMenu(PopupMenu* menu); 89 90 Vector<PopupMenu*> mPopups; 91 GuiMenuBar* mMenuBarCtrl; 92}; 93 94#endif 95