JX Application Framework
|
#include <JXModalDialogDirector.h>
Public Member Functions | |
JXModalDialogDirector (const bool allowResizing=false) | |
~JXModalDialogDirector () override | |
JXButton * | GetOKButton () const |
JXButton * | GetCancelButton () const |
void | SetButtons (JXButton *okButton, JXButton *cancelButton) |
bool | DoDialog () |
void | EndDialog (const bool success) |
void | Activate () override |
bool | Deactivate () override |
bool | Close () override |
![]() | |
JXWindowDirector (JXDirector *supervisor) | |
~JXWindowDirector () override | |
void | Activate () override |
bool | Deactivate () override |
void | Suspend () override |
void | Resume () override |
JXWindow * | GetWindow () const |
JXDisplay * | GetDisplay () const |
virtual const JString & | GetName () const |
virtual bool | GetMenuIcon (const JXImage **icon) const |
virtual bool | NeedsSave () const |
![]() | |
JXDirector (JXDirector *supervisor) | |
~JXDirector () override | |
bool | IsClosing () const |
bool | IsActive () const |
bool | IsSuspended () const |
bool | HasSubdirectors () const |
bool | GetSubdirectors (const JPtrArray< JXDirector > **list) const |
![]() | |
JBroadcaster () | |
virtual | ~JBroadcaster () |
JBroadcaster & | operator= (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) |
Protected Member Functions | |
bool | OKToDeactivate () override |
bool | Cancelled () const |
void | Receive (JBroadcaster *sender, const Message &message) override |
![]() | |
JXDirector * | GetSupervisor () const |
bool | CloseAllSubdirectors () |
virtual void | DirectorClosed (JXDirector *theDirector) |
![]() | |
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) |
Maintains a modal dialog window. Call DoDialog() to show the window. We suspend all other windows while active. If DoDialog() returns true, the client can extract the information. We Close() automatically. Modeless dialog windows that are supposed to simply hide themselves instead of closing must be implemented as JXWindowDirectors intead of JXModalDialogDirectors. If the client wants actions other than OK and Cancel, it merely has to add extra buttons and ListenTo() each one. If part of the action should be to close the dialog, the client can call EndDialog(). Derived classes that implement modal windows are required to call SetButtons() with at least an okButton. Derived classes can also implement extra validation (e.g. one input field greater than another) by overriding OKToDeactivate(). One should only perform such checks if Cancelled() returns false, however, because nothing should be checked if the user cancels the dialog.
JXModalDialogDirector::JXModalDialogDirector | ( | const bool | allowResizing = false | ) |
|
override |
|
overridevirtual |
We do not propagate the Activate message to subdirectors because each derived class must decide whether or not this is appropriate.
Reimplemented from JXDirector.
Reimplemented in JXSaveFileDialog.
|
inlineprotected |
|
overridevirtual |
Close all sub-directors and delete ourselves.
Reimplemented from JXDirector.
|
overridevirtual |
Reimplemented from JXDirector.
bool JXModalDialogDirector::DoDialog | ( | ) |
Returns true if the dialog is ok'd.
void JXModalDialogDirector::EndDialog | ( | const bool | success | ) |
If success is true, we close ourselves with success. Otherwise, we close as if cancelled.
We don't bother to return the result of Deactivate() because, if it is successful, kJXDialogDeactivated will be broadcast.
|
inline |
|
inline |
|
overrideprotectedvirtual |
Check that the active object is willing to unfocus.
Reimplemented from JXWindowDirector.
Reimplemented in JXOpenDisplayDialog, JXPSPrintSetupDialog, JXPTPrintSetupDialog, and JXSaveFileDialog.
|
overrideprotectedvirtual |
Listen for pushed ok and cancel buttons.
Reimplemented from JBroadcaster.
Reimplemented in JXPSPrintSetupDialog, JXPTPageSetupDialog, JXPTPrintSetupDialog, and JXSaveFileDialog.
If the window is not modal, okButton and cancelButton can be nullptr. If the window is modal, okButton must not be nullptr.