MFMv2.0.10
Movable Feast Machine Simulator 2.0.10
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
StdPanel.h
Go to the documentation of this file.
1 /* -*- mode:C++ -*-
2  StdPanel.h Extensions for the Panel structure
3  Copyright (C) 2014 The Regents of the University of New Mexico. All rights reserved.
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Lesser General Public
7  License as published by the Free Software Foundation; either
8  version 2.1 of the License, or (at your option) any later version.
9 
10  This library 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 GNU
13  Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this library; if not, write to the Free Software
17  Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
18  USA
19 */
20 
27 #ifndef STDPANEL_H
28 #define STDPANEL_H
29 
30 #include "itype.h"
31 #include "Panel.h"
32 #include "SDL.h"
33 
34 namespace MFM {
35 
39  class StdPanel : public Panel
40  {
41  private:
42 
43  SPoint m_dragStart;
44  bool m_dragging;
45 
46  public:
47 
48  StdPanel() : m_dragging(false) { }
49 
50  virtual bool Handle(SDL_MouseButtonEvent & event) ;
51 
52  virtual bool Handle(SDL_MouseMotionEvent & event) ;
53 
54  virtual bool Click(const SPoint & position, u32 button, u32 modifiers) {
55  return false;
56  }
57 
58  virtual bool ScrollUp() {
59  return false;
60  }
61 
62  virtual bool ScrollDown() {
63  return false;
64  }
65 
66  virtual void DragStart(const SPoint & startPosition) {
67  /* empty */
68  }
69 
70  virtual void Drag(const SPoint & relativeDelta) {
71  /* empty */
72  }
73 
74  virtual void DragEnd(const SPoint & endPosition) {
75  /* empty */
76  }
77 
78  };
79 } /* namespace MFM */
80 #endif /*STDPANEL_H*/
Definition: Panel.h:115
Definition: StdPanel.h:39