The Battle for Wesnoth  1.13.4+dev
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
gui2::tdebug_clock Class Reference

Clock to test the draw events. More...

#include <debug_clock.hpp>

Inheritance diagram for gui2::tdebug_clock:
Inheritance graph

Classes

struct  ttime
 Helper struct to keep track of the time. More...
 

Public Member Functions

 tdebug_clock ()
 
- Public Member Functions inherited from gui2::tpopup
 tpopup ()
 
virtual ~tpopup ()
 
void show (CVideo &video, const bool allow_interaction=false, const unsigned auto_close_time=0)
 Shows the window. More...
 
void hide ()
 Hides the window. More...
 

Private Member Functions

virtual const std::stringwindow_id () const
 Inherited from tdialog, implemented by REGISTER_DIALOG. More...
 
void pre_show (twindow &window)
 Inherited from tdialog. More...
 
void post_show (CVideo &video)
 Inherited from tdialog. More...
 
void update_time (const bool force)
 The callback for the drawing routine. More...
 

Private Attributes

tprogress_barhour_percentage_
 Progress bar for displaying the hours as a percentage. More...
 
tprogress_barminute_percentage_
 Progress bar for displaying the minutes as a percentage. More...
 
tprogress_barsecond_percentage_
 Progress bar for displaying the seconds as a percentage. More...
 
tinteger_selector_hour_
 An integer selector to display the total seconds. More...
 
tinteger_selector_minute_
 An integer selector to display the total seconds this hour. More...
 
tinteger_selector_second_
 An integer selector to display the seconds this minute. More...
 
tpanepane_
 
tcontrolclock_
 A widget that can display the time. More...
 
twindowwindow_
 The window being shown. More...
 
event::tsignal_function signal_
 The signal patched in the drawing routine. More...
 
ttime time_
 The `current' time. More...
 

Detailed Description

Clock to test the draw events.

Definition at line 31 of file debug_clock.hpp.

Constructor & Destructor Documentation

gui2::tdebug_clock::tdebug_clock ( )
inline

Definition at line 34 of file debug_clock.hpp.

Member Function Documentation

void gui2::tdebug_clock::post_show ( CVideo video)
private

Inherited from tdialog.

Definition at line 114 of file debug_clock.cpp.

References gui2::event::tdispatcher::disconnect_signal(), gui2::event::DRAW, signal_, and window_.

void gui2::tdebug_clock::pre_show ( twindow window)
privatevirtual

Inherited from tdialog.

Reimplemented from gui2::tpopup.

Definition at line 78 of file debug_clock.cpp.

References gui2::event::DRAW, gui2::event::tdispatcher::front_child, and update_time().

void gui2::tdebug_clock::update_time ( const bool  force)
private

The callback for the drawing routine.

It updates the `time' in the various controls.

Parameters
forceForce an update even it the time didn't change? (This is used to set the clock initially.)

Definition at line 119 of file debug_clock.cpp.

References gui2::tcontrol::canvas(), clock_, gui2::tpane::create_item(), gui2::tdebug_clock::ttime::hour, hour_, hour_percentage_, gui2::tdebug_clock::ttime::minute, minute_, minute_percentage_, pane_, gui2::tdebug_clock::ttime::second, second_, second_percentage_, gui2::twidget::set_is_dirty(), gui2::tprogress_bar::set_percentage(), gui2::tinteger_selector_::set_value(), gui2::tdebug_clock::ttime::step(), and time_.

Referenced by pre_show().

virtual const std::string& gui2::tdebug_clock::window_id ( ) const
privatevirtual

Inherited from tdialog, implemented by REGISTER_DIALOG.

Implements gui2::tpopup.

Member Data Documentation

tcontrol* gui2::tdebug_clock::clock_
private

A widget that can display the time.

Definition at line 72 of file debug_clock.hpp.

Referenced by update_time().

tinteger_selector_* gui2::tdebug_clock::hour_
private

An integer selector to display the total seconds.

Definition at line 61 of file debug_clock.hpp.

Referenced by update_time().

tprogress_bar* gui2::tdebug_clock::hour_percentage_
private

Progress bar for displaying the hours as a percentage.

Definition at line 52 of file debug_clock.hpp.

Referenced by update_time().

tinteger_selector_* gui2::tdebug_clock::minute_
private

An integer selector to display the total seconds this hour.

Definition at line 64 of file debug_clock.hpp.

Referenced by update_time().

tprogress_bar* gui2::tdebug_clock::minute_percentage_
private

Progress bar for displaying the minutes as a percentage.

Definition at line 55 of file debug_clock.hpp.

Referenced by update_time().

tpane* gui2::tdebug_clock::pane_
private

Definition at line 69 of file debug_clock.hpp.

Referenced by update_time().

tinteger_selector_* gui2::tdebug_clock::second_
private

An integer selector to display the seconds this minute.

Definition at line 67 of file debug_clock.hpp.

Referenced by update_time().

tprogress_bar* gui2::tdebug_clock::second_percentage_
private

Progress bar for displaying the seconds as a percentage.

Definition at line 58 of file debug_clock.hpp.

Referenced by update_time().

event::tsignal_function gui2::tdebug_clock::signal_
private

The signal patched in the drawing routine.

Definition at line 78 of file debug_clock.hpp.

Referenced by post_show().

ttime gui2::tdebug_clock::time_
private

The `current' time.

Note
Since the dialog is used to test the drawing routine by keeping track of the calls to the drawing routine, the clock might be off.

Definition at line 125 of file debug_clock.hpp.

Referenced by update_time().

twindow* gui2::tdebug_clock::window_
private

The window being shown.

Definition at line 75 of file debug_clock.hpp.

Referenced by post_show().


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