Torque3D Documentation / _generateds / guiPopupMenuCtrl.h

guiPopupMenuCtrl.h

Engine/source/gui/editor/guiPopupMenuCtrl.h

More...

Classes:

Public Defines

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
47private:
48   typedef GuiTextListCtrl Parent;
49
50   GuiPopupMenuBackgroundCtrl* mBackground;
51
52public:
53   bool isSubMenu; //  Indicates that this text list is in a submenu
54   Point2I maxBitmapSize;
55   GuiMenuBar::Menu* mMenu;
56   GuiMenuBar* mMenuBar;
57   PopupMenu* mPopup;
58
59   GuiPopupMenuTextListCtrl();
60
61   // GuiControl overloads:
62   bool onKeyDown(const GuiEvent &event);
63   void onMouseDown(const GuiEvent &event);
64   void onMouseUp(const GuiEvent &event);
65   void onRenderCell(Point2I offset, Point2I cell, bool selected, bool mouseOver);
66
67   virtual void onCellHighlighted(Point2I cell); //  Added
68};
69
70class GuiPopupMenuBackgroundCtrl : public GuiControl
71{
72   typedef GuiControl Parent;
73
74protected:
75   GuiPopupMenuTextListCtrl *mTextList;
76
77public:
78   GuiPopupMenuBackgroundCtrl(GuiPopupMenuTextListCtrl* textList);
79   void onMouseDown(const GuiEvent &event);
80   void onMouseMove(const GuiEvent &event);
81   void onMouseDragged(const GuiEvent &event);
82
83   void close();
84};
85
86#endif
87