libcrn  3.9.5
A document image processing library
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | List of all members
GtkCRN::ProgressWindow Class Reference

Splash window with progress bars. More...

#include <GtkCRNProgressWindow.h>

+ Inheritance diagram for GtkCRN::ProgressWindow:
+ Collaboration diagram for GtkCRN::ProgressWindow:

Public Member Functions

 ProgressWindow (const Glib::ustring title, Gtk::Window *parent=nullptr, bool auto_close=false)
 Constructor. More...
 
virtual ~ProgressWindow () override
 
size_t add_progress_bar (const crn::String &name, size_t maxcount=100)
 Adds a progress bar to the window. More...
 
crn::Progressget_crn_progress (size_t id)
 Gets an existing progress bar. More...
 
Gtk::ProgressBar & get_gtk_progressbar (size_t id)
 Gets an existing progress bar widget. More...
 
void set_terminate_on_exception (bool term)
 Shall the application be terminated if the processing throws an exception? More...
 
void run (sigc::slot< void > func)
 Executes a processing. More...
 
template<typename T >
run (sigc::slot< T > func)
 Executes a processing. More...
 
sigc::signal< void > signal_done ()
 Signals that the progress reached 100%. Connect to void on_done(). More...
 

Detailed Description

Splash window with progress bars.

Definition at line 34 of file GtkCRNProgressWindow.h.

Constructor & Destructor Documentation

ProgressWindow::ProgressWindow ( const Glib::ustring  title,
Gtk::Window *  parent = nullptr,
bool  auto_close = false 
)

Constructor.

Constructor

Parameters
[in]titlethe title of the window
[in]parenta pointer to the parent window, or nullptr to use the application's default window
[in]auto_closeshall the window close when the processing reached 100%?

Definition at line 35 of file GtkCRNProgressWindow.cpp.

virtual GtkCRN::ProgressWindow::~ProgressWindow ( )
inlineoverridevirtual

Definition at line 39 of file GtkCRNProgressWindow.h.

Member Function Documentation

size_t ProgressWindow::add_progress_bar ( const crn::String name,
size_t  maxcount = 100 
)

Adds a progress bar to the window.

Adds a progress bar to the window

Parameters
[in]namethe label of the progress bar
[in]maxcountthe number of calls to Advance() needed for the progress to reach 100%
Returns
the id of the progress bar

Definition at line 97 of file GtkCRNProgressWindow.cpp.

crn::Progress * ProgressWindow::get_crn_progress ( size_t  id)

Gets an existing progress bar.

Definition at line 112 of file GtkCRNProgressWindow.cpp.

Gtk::ProgressBar & ProgressWindow::get_gtk_progressbar ( size_t  id)

Gets an existing progress bar widget.

Definition at line 127 of file GtkCRNProgressWindow.cpp.

void ProgressWindow::run ( sigc::slot< void >  func)

Executes a processing.

Executes a processing

Parameters
[in]functhe code to execute

Definition at line 137 of file GtkCRNProgressWindow.cpp.

template<typename T >
T GtkCRN::ProgressWindow::run ( sigc::slot< T >  func)
inline

Executes a processing.

Definition at line 54 of file GtkCRNProgressWindow.h.

void GtkCRN::ProgressWindow::set_terminate_on_exception ( bool  term)
inline

Shall the application be terminated if the processing throws an exception?

Definition at line 49 of file GtkCRNProgressWindow.h.

sigc::signal<void> GtkCRN::ProgressWindow::signal_done ( )
inline

Signals that the progress reached 100%. Connect to void on_done().

Definition at line 62 of file GtkCRNProgressWindow.h.


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