Clock to test the draw events. More...
#include <debug_clock.hpp>
Classes | |
struct | time |
Helper struct to keep track of the time. More... | |
Public Member Functions | |
debug_clock () | |
![]() | |
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... | |
window * | get_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_bar * | hour_percentage_ |
Progress bar for displaying the hours as a percentage. More... | |
progress_bar * | minute_percentage_ |
Progress bar for displaying the minutes as a percentage. More... | |
progress_bar * | second_percentage_ |
Progress bar for displaying the seconds as a percentage. More... | |
integer_selector * | hour_ |
An integer selector to display the total seconds. More... | |
integer_selector * | minute_ |
An integer selector to display the total seconds this hour. More... | |
integer_selector * | second_ |
An integer selector to display the seconds this minute. More... | |
pane * | pane_ |
styled_widget * | clock_ |
A widget that can display the time. More... | |
event::signal | signal_ |
The signal patched in the drawing routine. More... | |
time | time_ |
The `current' time. More... | |
Additional Inherited Members | |
![]() | |
std::unique_ptr< window > | window_ |
The window, used in show. More... | |
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 | Mandatory | Description |
---|---|---|---|
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:
|
Definition at line 49 of file debug_clock.hpp.
|
inline |
Definition at line 52 of file debug_clock.hpp.
|
privatevirtual |
Definition at line 70 of file debug_clock.cpp.
References gui2::event::dispatcher::disconnect_signal(), gui2::event::DRAW, gui2::dialogs::modeless_dialog::get_window(), and signal_.
|
overrideprivatevirtual |
Actions to be taken before showing the window.
window | The window to be shown. |
Reimplemented from gui2::dialogs::modeless_dialog.
Definition at line 37 of file debug_clock.cpp.
References gui2::event::connect_signal_on_draw(), and update_time().
|
private |
The callback for the drawing routine.
It updates the `time' in the various controls.
force | Force an update even it the time didn't change? (This is used to set the clock initially.) |
Definition at line 75 of file debug_clock.cpp.
References clock_, gui2::pane::create_item(), gui2::styled_widget::get_canvases(), gui2::dialogs::debug_clock::time::hour, hour_, hour_percentage_, gui2::dialogs::debug_clock::time::minute, minute_, minute_percentage_, pane_, gui2::dialogs::debug_clock::time::second, second_, second_percentage_, gui2::widget::set_is_dirty(), gui2::progress_bar::set_percentage(), gui2::integer_selector::set_value(), gui2::canvas::set_variable(), gui2::dialogs::debug_clock::time::step(), and time_.
Referenced by pre_show().
|
overrideprivatevirtual |
The id of the window to build.
Implements gui2::dialogs::modeless_dialog.
|
private |
A widget that can display the time.
Definition at line 89 of file debug_clock.hpp.
Referenced by update_time().
|
private |
An integer selector to display the total seconds.
Definition at line 78 of file debug_clock.hpp.
Referenced by update_time().
|
private |
Progress bar for displaying the hours as a percentage.
Definition at line 69 of file debug_clock.hpp.
Referenced by update_time().
|
private |
An integer selector to display the total seconds this hour.
Definition at line 81 of file debug_clock.hpp.
Referenced by update_time().
|
private |
Progress bar for displaying the minutes as a percentage.
Definition at line 72 of file debug_clock.hpp.
Referenced by update_time().
|
private |
Definition at line 86 of file debug_clock.hpp.
Referenced by update_time().
|
private |
An integer selector to display the seconds this minute.
Definition at line 84 of file debug_clock.hpp.
Referenced by update_time().
|
private |
Progress bar for displaying the seconds as a percentage.
Definition at line 75 of file debug_clock.hpp.
Referenced by update_time().
|
private |
The signal patched in the drawing routine.
Definition at line 92 of file debug_clock.hpp.
Referenced by post_show().
|
private |
The `current' time.
Definition at line 139 of file debug_clock.hpp.
Referenced by update_time().