zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Zeni::Widget_Input_Repeater Class Reference

An Input Repeater Class. More...

#include <Widget.h>

Inherits Zeni::Widget.

Public Member Functions

 Widget_Input_Repeater (Widget &widget_, const int &repeat_delay_=SDL_DEFAULT_REPEAT_DELAY, const int &repeat_interval_=SDL_DEFAULT_REPEAT_INTERVAL)
 Pass in the Widget to have input "repeated" to. More...
 
const intget_repeat_delay () const
 
const intget_repeat_interval () const
 
Widget *constget_widget () const
 
virtual void on_key (const SDL_Keysym &keysym, const bool &down)
 on_key input is repeated More...
 
virtual void on_mouse_button (const Point2i &pos, const bool &down, const int &button)
 on_mouse_button deactivates the repeater (if active) and then passes input to the Widget More...
 
virtual void on_mouse_motion (const Point2i &pos)
 on_mouse_motion input is simply passed through More...
 
virtual void perform_logic ()
 Call this function in your perform_logic function to get this Widget to actually do its job. More...
 
virtual void render_impl () const
 
void set_repeat_delay (const int &repeat_delay_=SDL_DEFAULT_REPEAT_DELAY)
 
void set_repeat_interval (const int &repeat_interval_=SDL_DEFAULT_REPEAT_INTERVAL)
 
void set_widget (Widget &widget_)
 
- Public Member Functions inherited from Zeni::Widget
 Widget ()
 
virtual ~Widget ()
 
void fax_Renderer (const Widget_Render_Function *const &renderer)
 Set the current Widget_Render_Function, giving the Widget a copy. More...
 
const float & get_layer () const
 
const Widget_Render_Functionget_Renderer () const
 Get the current Widget_Render_Function. More...
 
void give_Renderer (Widget_Render_Function *const &renderer)
 Set the current Widget_Render_Function, giving the Widget ownership. More...
 
const bool & is_busy () const
 
const bool & is_editable () const
 
void lend_Renderer (const Widget_Render_Function *const &renderer)
 Set the current Widget_Render_Function, giving the Widget no ownership. More...
 
void on_event (const SDL_KeyboardEvent &event)
 
void on_event (const SDL_MouseButtonEvent &event)
 
void on_event (const SDL_MouseButtonEvent &event, const Projector2D &projector)
 
void on_event (const SDL_MouseMotionEvent &event)
 
void on_event (const SDL_MouseMotionEvent &event, const Projector2D &projector)
 
void render () const
 
void set_busy (const bool &busy_)
 
virtual void set_editable (const bool &editable_)
 
void set_layer (const float &layer_=0.0f)
 

Detailed Description

An Input Repeater Class.

This will repeat keypresses for anything looking for text-editor-like keyboard behavior.

Author
bazald

Contact: bazal.nosp@m.d@ze.nosp@m.nipex.nosp@m..com

Definition at line 969 of file Widget.h.

Constructor & Destructor Documentation

Zeni::Widget_Input_Repeater::Widget_Input_Repeater ( Widget widget_,
const int repeat_delay_ = SDL_DEFAULT_REPEAT_DELAY,
const int repeat_interval_ = SDL_DEFAULT_REPEAT_INTERVAL 
)
inline

Pass in the Widget to have input "repeated" to.

Definition at line 634 of file Widget.hxx.

Member Function Documentation

const int & Zeni::Widget_Input_Repeater::get_repeat_delay ( ) const
inline

Definition at line 646 of file Widget.hxx.

const int & Zeni::Widget_Input_Repeater::get_repeat_interval ( ) const
inline

Definition at line 647 of file Widget.hxx.

Widget *const & Zeni::Widget_Input_Repeater::get_widget ( ) const
inline

Definition at line 645 of file Widget.hxx.

void Zeni::Widget_Input_Repeater::on_key ( const SDL_Keysym keysym,
const bool &  down 
)
virtual
void Zeni::Widget_Input_Repeater::on_mouse_button ( const Point2i pos,
const bool &  down,
const int button 
)
virtual

on_mouse_button deactivates the repeater (if active) and then passes input to the Widget

Implements Zeni::Widget.

Definition at line 1429 of file Widget.cpp.

References Zeni::Widget::is_busy(), Zeni::Widget::is_editable(), Zeni::Widget::on_mouse_button(), and Zeni::Widget::set_busy().

void Zeni::Widget_Input_Repeater::on_mouse_motion ( const Point2i pos)
virtual

on_mouse_motion input is simply passed through

Implements Zeni::Widget.

Definition at line 1440 of file Widget.cpp.

References Zeni::Widget::is_busy(), Zeni::Widget::is_editable(), Zeni::Widget::on_mouse_motion(), and Zeni::Widget::set_busy().

void Zeni::Widget_Input_Repeater::perform_logic ( )
virtual

Call this function in your perform_logic function to get this Widget to actually do its job.

Reimplemented from Zeni::Widget.

Definition at line 1449 of file Widget.cpp.

References Zeni::Time::get_ticks_since(), Zeni::Timer::get_time(), Zeni::get_Timer(), int, and Zeni::Widget::on_key().

void Zeni::Widget_Input_Repeater::render_impl ( ) const
virtual

Reimplemented from Zeni::Widget.

Definition at line 1467 of file Widget.cpp.

References Zeni::Widget::render().

void Zeni::Widget_Input_Repeater::set_repeat_delay ( const int repeat_delay_ = SDL_DEFAULT_REPEAT_DELAY)
inline

Definition at line 650 of file Widget.hxx.

void Zeni::Widget_Input_Repeater::set_repeat_interval ( const int repeat_interval_ = SDL_DEFAULT_REPEAT_INTERVAL)
inline

Definition at line 651 of file Widget.hxx.

void Zeni::Widget_Input_Repeater::set_widget ( Widget widget_)
inline

Definition at line 649 of file Widget.hxx.

References Zeni::Widget::is_busy(), and Zeni::Widget::set_busy().


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