All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
Public Member Functions | Protected Attributes
GUI::Button Class Reference

A push button. More...

#include <gui_tk.h>

Inheritance diagram for GUI::Button:
GUI::BorderedWindow GUI::ActionEventSource GUI::Window

List of all members.

Public Member Functions

 Button (Window *parent, int x, int y, int w, int h)
 Create a button with given position and size.
template<typename T >
 Button (Window *parent, int x, int y, const T text, int w=-1, int h=-1)
 Create a text button.
virtual void paint (Drawable &d) const
 Paint button.
virtual bool mouseDown (int x, int y, MouseButton button)
 Press button.
virtual bool mouseUp (int x, int y, MouseButton button)
 Release button.
virtual bool mouseClicked (int x, int y, MouseButton button)
 Handle mouse activation.
virtual bool keyDown (const Key &key)
 Handle keyboard input.
virtual bool keyUp (const Key &key)
 Handle keyboard input.
template<typename STR >
 Button (Window *parent, int x, int y, const STR text, int w, int h)

Protected Attributes

bool pressed
 true, if button is currently pressed down.

Detailed Description

A push button.

Buttons have 3D appearance and can have any child widget as content. There are convenience constructors for common forms of buttons.

Definition at line 1922 of file gui_tk.h.

Constructor & Destructor Documentation

template<typename T >
GUI::Button::Button ( Window parent,
int  x,
int  y,
const T  text,
int  w = -1,
int  h = -1 

Create a text button.

If a size is specified, text is centered. Otherwise, button size is adjusted for the text.

The documentation for this class was generated from the following files: