ROLAND  0.70
Amstrad Emulator based on Caprice Source rewritten in C++.
listitem.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_LIST_ITEM_H
21 #define SDLTK_LIST_ITEM_H
22 
23 #include "button.h"
24 
25 namespace sdltk
26 {
27 
28  class Point;
29 
31  class ListItem : public Button
32  {
33 
34  public:
35  ListItem();
36  virtual ~ListItem() ROLAND_DEFAULT
37 
38  void setOrigin(Sint16 x, Sint16 y) {mOrigin.set(x, y);}
39  void reset() {mRect.setPos(mOrigin.x(), mOrigin.y());}
40 
41  virtual void onMouseButton (SDL_MouseButtonEvent * event);
42 
43  protected:
45 
46  };
47 
48 } // sdltk
49 
50 #endif // SDLTK_LIST_ITEM_H
void setPos(Sint16 x, Sint16 y)
Definition: rect.h:85
void reset()
Definition: listitem.h:39
virtual void onMouseButton(SDL_MouseButtonEvent *event)
Catch MouseButton events.
Definition: listitem.cpp:37
Point mOrigin
Definition: listitem.h:44
Sint16 y() const
Returns the y position of the upper left corner.
Definition: widget.h:100
Represents an item which can be hold by a List.
Definition: listitem.h:31
Sint16 x() const
Returns the x position of the upper left corner.
Definition: widget.h:98
ListItem()
Definition: listitem.cpp:28
virtual ~ListItem() ROLAND_DEFAULT void setOrigin(Sint16 x
#define ROLAND_DEFAULT
Definition: compspec.h:46
Defines a 2D point (x, y)
Definition: point.h:28
Rect mRect
Definition: widget.h:122
Sint16 y
Definition: point.h:35
Definition: button.h:33
the SDL based Stuff
Definition: audio.cpp:22