The Battle for Wesnoth  1.15.12+dev
Classes | Public Member Functions | Private Member Functions | Private Attributes | List of all members
gui2::dialogs::debug_clock Class Reference

Clock to test the draw events. More...

#include <debug_clock.hpp>

Inheritance diagram for gui2::dialogs::debug_clock:

Classes

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

Public Member Functions

 debug_clock ()
 
- Public Member Functions inherited from gui2::dialogs::modeless_dialog
 modeless_dialog ()
 
virtual ~modeless_dialog ()
 
void show (const bool allow_interaction=false, const unsigned auto_close_time=0)
 Shows the window. More...
 
void hide ()
 Hides the window. More...
 
windowget_window () const
 Returns a pointer to the dialog's window. More...
 

Private Member Functions

virtual const std::string & window_id () const override
 The id of the window to build. More...
 
virtual void pre_show (window &window) override
 Actions to be taken before showing the window. More...
 
virtual void post_show (CVideo &video)
 
void update_time (const bool force)
 The callback for the drawing routine. More...
 

Private Attributes

progress_barhour_percentage_
 Progress bar for displaying the hours as a percentage. More...
 
progress_barminute_percentage_
 Progress bar for displaying the minutes as a percentage. More...
 
progress_barsecond_percentage_
 Progress bar for displaying the seconds as a percentage. More...
 
integer_selectorhour_
 An integer selector to display the total seconds. More...
 
integer_selectorminute_
 An integer selector to display the total seconds this hour. More...
 
integer_selectorsecond_
 An integer selector to display the seconds this minute. More...
 
panepane_
 
styled_widgetclock_
 A widget that can display the time. More...
 
event::signal_function signal_
 The signal patched in the drawing routine. More...
 
time time_
 The `current' time. More...
 

Additional Inherited Members

- Protected Attributes inherited from gui2::dialogs::modeless_dialog
std::unique_ptr< windowwindow_
 The window, used in show. More...
 

Detailed Description

Clock to test the draw events.

This shows the dialog for keeping track of the drawing events related to the current time. (This window is used for debug purposes only.)

Key Type MandatoryDescription
hour_percentage progress_bar no This shows the hours as a percentage, where 24 hours is 100%.
minute_percentage progress_bar no This shows the minutes as a percentage, where 60 minutes is 100%.
second_percentage progress_bar no This shows the seconds as a percentage, where 60 seconds is 100%.
hour integer_selector no This shows the seconds since the beginning of the day. The control should have a minimum_value of 0 and a maximum_value of 86399 (246060 - 1).
minute integer_selector no This shows the seconds since the beginning of the current hour. The control should have a minimum_value of 0 and a maximum_value of 3599 (6060 - 1).
second integer_selector no This shows the seconds since the beginning of the current minute. The control should have a minimum_value of 0 and a maximum_value of 59.
clock control no A control which will have set three variables in its canvas: The control can then show the time in its own preferred format(s).

Definition at line 48 of file debug_clock.hpp.

Constructor & Destructor Documentation

◆ debug_clock()

gui2::dialogs::debug_clock::debug_clock ( )
inline

Definition at line 51 of file debug_clock.hpp.

Member Function Documentation

◆ post_show()

void gui2::dialogs::debug_clock::post_show ( CVideo video)
privatevirtual

◆ pre_show()

void gui2::dialogs::debug_clock::pre_show ( window window)
overrideprivatevirtual

Actions to be taken before showing the window.

Parameters
windowThe window to be shown.

Reimplemented from gui2::dialogs::modeless_dialog.

Definition at line 36 of file debug_clock.cpp.

References gui2::event::connect_signal_on_draw(), and update_time().

◆ update_time()

void gui2::dialogs::debug_clock::update_time ( const bool  force)
private

◆ window_id()

virtual const std::string& gui2::dialogs::debug_clock::window_id ( ) const
overrideprivatevirtual

The id of the window to build.

Implements gui2::dialogs::modeless_dialog.

Member Data Documentation

◆ clock_

styled_widget* gui2::dialogs::debug_clock::clock_
private

A widget that can display the time.

Definition at line 88 of file debug_clock.hpp.

Referenced by update_time().

◆ hour_

integer_selector* gui2::dialogs::debug_clock::hour_
private

An integer selector to display the total seconds.

Definition at line 77 of file debug_clock.hpp.

Referenced by update_time().

◆ hour_percentage_

progress_bar* gui2::dialogs::debug_clock::hour_percentage_
private

Progress bar for displaying the hours as a percentage.

Definition at line 68 of file debug_clock.hpp.

Referenced by update_time().

◆ minute_

integer_selector* gui2::dialogs::debug_clock::minute_
private

An integer selector to display the total seconds this hour.

Definition at line 80 of file debug_clock.hpp.

Referenced by update_time().

◆ minute_percentage_

progress_bar* gui2::dialogs::debug_clock::minute_percentage_
private

Progress bar for displaying the minutes as a percentage.

Definition at line 71 of file debug_clock.hpp.

Referenced by update_time().

◆ pane_

pane* gui2::dialogs::debug_clock::pane_
private

Definition at line 85 of file debug_clock.hpp.

Referenced by update_time().

◆ second_

integer_selector* gui2::dialogs::debug_clock::second_
private

An integer selector to display the seconds this minute.

Definition at line 83 of file debug_clock.hpp.

Referenced by update_time().

◆ second_percentage_

progress_bar* gui2::dialogs::debug_clock::second_percentage_
private

Progress bar for displaying the seconds as a percentage.

Definition at line 74 of file debug_clock.hpp.

Referenced by update_time().

◆ signal_

event::signal_function gui2::dialogs::debug_clock::signal_
private

The signal patched in the drawing routine.

Definition at line 91 of file debug_clock.hpp.

Referenced by post_show().

◆ time_

time gui2::dialogs::debug_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 138 of file debug_clock.hpp.

Referenced by update_time().


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