ROLAND  0.70
Amstrad Emulator based on Caprice Source rewritten in C++.
button.h
Go to the documentation of this file.
1 /***************************************************************************
2  * Copyright (C) by Fred Klaus *
3  * development@fkweb.de *
4  * *
5  * This program is free software; you can redistribute it and/or modify *
6  * it under the terms of the GNU General Public License as published by *
7  * the Free Software Foundation; either version 2 of the License, or *
8  * (at your option) any later version. *
9  * *
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. *
14  * *
15  * You should have received a copy of the GNU General Public License *
16  * along with this program; if not, write to the *
17  * Free Software Foundation, Inc., *
18  * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
19  ***************************************************************************/
20 #ifndef SDLTK_BUTTON_H
21 #define SDLTK_BUTTON_H
22 
23 #include "def.h"
24 #include "label.h"
25 #include "SDL.h"
26 
27 namespace sdltk
28 {
29 
30  class Color;
31 
33  class Button : public Label
34  {
35 
36  public:
37  Button();
38  virtual ~Button() ROLAND_DEFAULT
39 
40  virtual void draw();
41 
42  virtual void onMouseMotion (SDL_MouseMotionEvent * event);
43  virtual void onMouseButton (SDL_MouseButtonEvent * event);
44 
46 
47  bool isDown() const {return mDown;}
48  void setDown(bool down) {mDown = down;}
49 
50  protected:
52  bool mDown;
53 
54  };
55 
56 } // sdltk
57 
58 #endif // SDLTK_BUTTON_H
virtual void onMouseButton(SDL_MouseButtonEvent *event)
Catch MouseButton events.
Definition: button.cpp:41
void setDown(bool down)
Definition: button.h:48
Color color() const
Returns the Color of the Widget.
Definition: widget.h:79
A Widget with text and background color or image.
Definition: label.h:33
virtual void draw()
Definition: label.cpp:158
void setHighlightColor(const Color &color)
Definition: button.h:45
Button()
Definition: button.cpp:25
virtual void onMouseMotion(SDL_MouseMotionEvent *event)
Catch MouseMotion events.
Definition: button.cpp:31
#define ROLAND_DEFAULT
Definition: compspec.h:46
virtual ~Button() ROLAND_DEFAULT virtual void draw()
RGBA Color Type.
Definition: color.h:30
Definition: button.h:33
the SDL based Stuff
Definition: audio.cpp:22
bool mDown
Definition: button.h:52
Color mHighlightColor
Definition: button.h:51
bool isDown() const
Definition: button.h:47