JX Application Framework
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | List of all members
JLatentPG Class Reference

#include <JLatentPG.h>

Inheritance diagram for JLatentPG:
[legend]

Public Member Functions

 JLatentPG (const JSize scaleFactor=1)
 
 JLatentPG (JProgressDisplay *pg, const bool ownIt, const JSize scaleFactor=1)
 
 ~JLatentPG () override
 
void UseDefaultPG ()
 
void SetPG (JProgressDisplay *pg, const bool ownIt)
 
time_t GetMaxSilentTime () const
 
void SetMaxSilentTime (const time_t max)
 
JSize GetScaleFactor () const
 
void SetScaleFactor (const JSize scaleFactor)
 
bool IncrementProgress (const JString &message=JString::empty) override
 
bool IncrementProgress (const JSize delta) override
 
bool IncrementProgress (const JString &message, const JSize delta) override
 
bool ProcessContinuing () override
 
void ProcessFinished () override
 
void DisplayBusyCursor () override
 
- Public Member Functions inherited from JProgressDisplay
 JProgressDisplay ()
 
virtual ~JProgressDisplay ()
 
void FixedLengthProcessBeginning (const JSize stepCount, const JString &message, const bool allowCancel, const bool modal)
 
void VariableLengthProcessBeginning (const JString &message, const bool allowCancel, const bool modal)
 
bool ProcessRunning () const
 
ProcessType GetCurrentProcessType () const
 
JSize GetCurrentStepCount () const
 

Protected Member Functions

void ProcessBeginning (const ProcessType processType, const JSize stepCount, const JString &message, const bool allowCancel, const bool modal) override
 
bool CheckForCancel () override
 
- Protected Member Functions inherited from JProgressDisplay
bool AllowCancel () const
 
bool IsModal () const
 
JSize GetMaxStepCount () const
 
void IncrementStepCount (const JSize delta=1)
 

Additional Inherited Members

- Public Types inherited from JProgressDisplay
enum  ProcessType {
  kNoRunningProcess ,
  kFixedLengthProcess ,
  kVariableLengthProcess
}
 

Detailed Description

Interface for the JLatentPG class.

This class encapsulates a progress display that only pops up after
N seconds (default 3) and only redraws itself every M increments
(default 1).

This allows one to write a loop that doesn't waste time creating
a progress display unless it takes a while and doesn't waste time
redrawing every time through the loop.

The scale factor is especially useful when one has a loop whose contents
execute very quickly on each pass, so that redrawing the screen after every
pass adds a huge overhead.

Constructor & Destructor Documentation

◆ JLatentPG() [1/2]

JLatentPG::JLatentPG ( const JSize  scaleFactor = 1)

◆ JLatentPG() [2/2]

JLatentPG::JLatentPG ( JProgressDisplay pg,
const bool  ownIt,
const JSize  scaleFactor = 1 
)

◆ ~JLatentPG()

JLatentPG::~JLatentPG ( )
override

Member Function Documentation

◆ CheckForCancel()

bool JLatentPG::CheckForCancel ( )
overrideprotectedvirtual

Implements JProgressDisplay.

◆ DisplayBusyCursor()

void JLatentPG::DisplayBusyCursor ( )
overridevirtual

Implements JProgressDisplay.

◆ GetMaxSilentTime()

time_t JLatentPG::GetMaxSilentTime ( ) const
inline

◆ GetScaleFactor()

JSize JLatentPG::GetScaleFactor ( ) const
inline

◆ IncrementProgress() [1/3]

bool JLatentPG::IncrementProgress ( const JSize  delta)
overridevirtual

Implements JProgressDisplay.

◆ IncrementProgress() [2/3]

bool JLatentPG::IncrementProgress ( const JString message,
const JSize  delta 
)
overridevirtual

Implements JProgressDisplay.

◆ IncrementProgress() [3/3]

bool JLatentPG::IncrementProgress ( const JString message = JString::empty)
overridevirtual

Implements JProgressDisplay.

◆ ProcessBeginning()

void JLatentPG::ProcessBeginning ( const ProcessType  processType,
const JSize  stepCount,
const JString message,
const bool  allowCancel,
const bool  modal 
)
overrideprotectedvirtual

Initialize the data members. Derived classes should create some sort of display to represent the progress.

Reimplemented from JProgressDisplay.

◆ ProcessContinuing()

bool JLatentPG::ProcessContinuing ( )
overridevirtual

Derived classes should give the system some background time (system dependent) without updating the progress display.

Returns false if process was cancelled by user.

Reimplemented from JProgressDisplay.

◆ ProcessFinished()

void JLatentPG::ProcessFinished ( )
overridevirtual

Derived classes must call this and then clean up the display they created.

Reimplemented from JProgressDisplay.

◆ SetMaxSilentTime()

void JLatentPG::SetMaxSilentTime ( const time_t  max)
inline

◆ SetPG()

void JLatentPG::SetPG ( JProgressDisplay pg,
const bool  ownIt 
)

If ownIt == true, we delete the progress display when we no longer need it.

This can only be called when a process is not running.

◆ SetScaleFactor()

void JLatentPG::SetScaleFactor ( const JSize  scaleFactor)
inline

◆ UseDefaultPG()

void JLatentPG::UseDefaultPG ( )

Use a progress display obtained from JNewPG().

This can only be called when a process is not running.


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