JX Application Framework
Loading...
Searching...
No Matches
Classes | Public Member Functions | Static Public Attributes | Protected Member Functions | List of all members
JXProgressDisplay Class Reference

#include <JXProgressDisplay.h>

Inheritance diagram for JXProgressDisplay:
[legend]

Classes

class  CancelRequested
 

Public Member Functions

 JXProgressDisplay ()
 
 ~JXProgressDisplay () override
 
void SetItems (JXTextButton *cancelButton, JXStaticText *counter, JXProgressIndicator *indicator, JXTEBase *label=nullptr)
 
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
 
- Public Member Functions inherited from JBroadcaster
 JBroadcaster ()
 
virtual ~JBroadcaster ()
 
JBroadcasteroperator= (const JBroadcaster &source)
 
bool HasSenders () const
 
JSize GetSenderCount () const
 
bool HasRecipients () const
 
JSize GetRecipientCount () const
 
virtual JString ToString () const
 
template<class T >
void ListenTo (const JBroadcaster *sender, const std::function< void(const T &)> &f)
 

Static Public Attributes

static const JUtf8BytekCancelRequested = "CancelRequested::JXProgressDisplay"
 

Protected Member Functions

void ProcessBeginning (const ProcessType processType, const JSize stepCount, const JString &message, const bool allowCancel, const bool modal) override
 
virtual void AppendToMessageWindow (const JString &message)
 
bool CheckForCancel () override
 
void Receive (JBroadcaster *sender, const Message &message) override
 
- Protected Member Functions inherited from JProgressDisplay
bool AllowCancel () const
 
bool IsModal () const
 
JSize GetMaxStepCount () const
 
void IncrementStepCount (const JSize delta=1)
 
- Protected Member Functions inherited from JBroadcaster
 JBroadcaster (const JBroadcaster &source)
 
void ListenTo (const JBroadcaster *sender)
 
void StopListening (const JBroadcaster *sender)
 
void ClearWhenGoingAway (const JBroadcaster *sender, void *pointerToMember)
 
void StopListening (const JBroadcaster *sender, const std::type_info &messageType)
 
template<class T >
void Send (JBroadcaster *recipient, const T &message)
 
template<class T >
void Broadcast (const T &message)
 
void SendWithFeedback (JBroadcaster *recipient, Message *message)
 
void BroadcastWithFeedback (Message *message)
 
virtual void ReceiveWithFeedback (JBroadcaster *sender, Message *message)
 
virtual void ReceiveGoingAway (JBroadcaster *sender)
 

Additional Inherited Members

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

Detailed Description

Class to display the progress of a long process.  The client must call
SetItems() with the appropriate widgets so we have something to draw to.

When a background process is event driven, it is convenient to ignore
the process until an event arrives.  In this case, the Cancel button
will not work nicely if events are rare.  The CancelRequested message
is broadcast when the process is backgrounded in order to avoid this
problem.

Constructor & Destructor Documentation

◆ JXProgressDisplay()

JXProgressDisplay::JXProgressDisplay ( )

◆ ~JXProgressDisplay()

JXProgressDisplay::~JXProgressDisplay ( )
override

Member Function Documentation

◆ AppendToMessageWindow()

void JXProgressDisplay::AppendToMessageWindow ( const JString message)
protectedvirtual

◆ CheckForCancel()

bool JXProgressDisplay::CheckForCancel ( )
overrideprotectedvirtual

Implements JProgressDisplay.

◆ DisplayBusyCursor()

void JXProgressDisplay::DisplayBusyCursor ( )
overridevirtual

Implements JProgressDisplay.

◆ IncrementProgress() [1/3]

bool JXProgressDisplay::IncrementProgress ( const JSize  delta)
overridevirtual

Update the display to show that progress is being made. Returns false if process was cancelled by user.

The iteration count is incremented by the specified value.

Implements JProgressDisplay.

◆ IncrementProgress() [2/3]

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

Update the display to show that progress is being made. Returns false if process was cancelled by user.

If the current process is of variable length and the message is not nullptr, then it is displayed in the message window.

Implements JProgressDisplay.

◆ IncrementProgress() [3/3]

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

Update the display to show that progress is being made. Returns false if process was cancelled by user.

If the current process is of variable length and the message is not nullptr, then it is displayed in the message window.

Implements JProgressDisplay.

◆ ProcessBeginning()

void JXProgressDisplay::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.

Reimplemented in JXStandAlonePG.

◆ ProcessContinuing()

bool JXProgressDisplay::ProcessContinuing ( )
overridevirtual

Save the current location of the message window. Returns false if process was cancelled by user.

Reimplemented from JProgressDisplay.

Reimplemented in JXStandAlonePG.

◆ ProcessFinished()

void JXProgressDisplay::ProcessFinished ( )
overridevirtual

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

Reimplemented from JProgressDisplay.

Reimplemented in JXStandAlonePG.

◆ Receive()

void JXProgressDisplay::Receive ( JBroadcaster sender,
const Message message 
)
overrideprotectedvirtual

Process the given message from the given sender. This function is not pure virtual because not all classes will want to implement it.

Reimplemented from JBroadcaster.

◆ SetItems()

void JXProgressDisplay::SetItems ( JXTextButton cancelButton,
JXStaticText counter,
JXProgressIndicator indicator,
JXTEBase label = nullptr 
)

Member Data Documentation

◆ kCancelRequested

const JUtf8Byte * JXProgressDisplay::kCancelRequested = "CancelRequested::JXProgressDisplay"
static

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