Public Member Functions | Protected Types | Protected Member Functions | Protected Attributes | List of all members
OOF_mixRepAbstractCellEditor Class Reference

Support typical actions of report editing dialogs. More...

#include <oofrepedit.h>

Inheritance diagram for OOF_mixRepAbstractCellEditor:
Inheritance graph
Collaboration diagram for OOF_mixRepAbstractCellEditor:
Collaboration graph

Public Member Functions

virtual void maybeChangeTargetLink (dbFieldLink *)
virtual bool receiveMsg (OOFmsgT msg, unsigned long senderDefined)
 The default receiveMsg behaviour is to delete yourself when the broadcaster closes. More...
void resumeListening ()
virtual void subscribeTo (oofBroadcaster *)
void suspendListening ()
virtual dbTabletable () const
virtual void unsubscribe (oofBroadcaster *from=0)

Protected Types

enum  movementT {
  eGoFirst, eGoLast, eGoLeft, eGoRight,
  eGoUp, eGoDown

Protected Member Functions

virtual bool AttemptSaveCellEditField ()
void EnterLink (oofRepEditLink *)
virtual void FinishCreationByLinkingDataModel (oofRepEditingEnv *, oofRepEditLink *)
virtual void GoToAnotherCell (movementT)
virtual void GoToAnotherItem (movementT)
 Separate out item movement from cell movement because you may wish to implement one but use default for the other. More...
void LoadAndUpdate ()
 separation of these three steps, which commonly occurs, is example of the Template Method pattern allowing for overriding of minor points More...
virtual void LoadCellEditField ()
 Typical reasons to override - want to display location or a different display of the editable state (eg: visible lock icon) More...
virtual void maybeDirty (dbFieldLink *)
 OOF_mixRepAbstractCellEditor ()
virtual void UnableToMoveWarning (movementT, bool movingByCell)
 default beep More...
virtual void UpdateMovementButtons ()
 override to control disabling More...
virtual ~OOF_mixRepAbstractCellEditor ()

Protected Attributes

bool mAnyContentDirtied
unsigned short mSuspendCount

Detailed Description

Support typical actions of report editing dialogs.

The idea of the mixin base is to define a common set of controls and their behaviour so an application can subclass with just a few overrides, supporting with whatever dialog class and layout they fancy. This is necessary because application code may have dialogs based on LGADialog or other base classes.

Any buttons not initialised will not be implemented so the entire movement approach can be ignored if desired.

Most of the behaviour is cross platform in OOF_mixRepAbstractCellEditor thanks to the cross-platform GUI interface.

Definition at line 129 of file oofrepedit.h.

Constructor & Destructor Documentation

OOF_mixRepAbstractCellEditor::OOF_mixRepAbstractCellEditor ( )

Definition at line 952 of file oofrepedit.cpp.

OOF_mixRepAbstractCellEditor::~OOF_mixRepAbstractCellEditor ( )

Definition at line 961 of file oofrepedit.cpp.

References mAdapter.

Member Function Documentation

bool OOF_mixRepAbstractCellEditor::AttemptSaveCellEditField ( )
void OOF_mixRepAbstractCellEditor::EnterLink ( oofRepEditLink inLink)
void OOF_mixRepAbstractCellEditor::FinishCreationByLinkingDataModel ( oofRepEditingEnv inEnv,
oofRepEditLink inLink 

Definition at line 968 of file oofrepedit.cpp.

References EnterLink(), and mEnv.

void OOF_mixRepAbstractCellEditor::GoToAnotherCell ( movementT  inMove)
void OOF_mixRepAbstractCellEditor::GoToAnotherItem ( movementT  inMove)

Separate out item movement from cell movement because you may wish to implement one but use default for the other.

eg: use default moves to items but custom cells because you have fancy report objects in your application.

Definition at line 1118 of file oofrepedit.cpp.

References eGoDown, eGoUp, EnterLink(), oofRepEditLink::leaveLink(), mCurrentLink, and UnableToMoveWarning().

void OOF_mixRepAbstractCellEditor::LoadAndUpdate ( )

separation of these three steps, which commonly occurs, is example of the Template Method pattern allowing for overriding of minor points

Definition at line 1103 of file oofrepedit.cpp.

References LoadCellEditField(), dbFieldLink::markClean(), mCurrentLink, and UpdateMovementButtons().

Referenced by EnterLink(), and GoToAnotherCell().

void OOF_mixRepAbstractCellEditor::LoadCellEditField ( )

Typical reasons to override - want to display location or a different display of the editable state (eg: visible lock icon)

Definition at line 1024 of file oofrepedit.cpp.

References oofRepEditLink::getCellText(), oofString::lineEndingsCurrentPlatform(), mAdapter, mCurrentLink, and dbGUIAdapter::setString().

Referenced by LoadAndUpdate().

void dbHelper::maybeChangeTargetLink ( dbFieldLink )

Reimplemented in dbAbstractEditHelper.

Definition at line 278 of file oofgui.cpp.

Referenced by dbFieldLink::maybeChangeTargetLink().

void OOF_mixRepAbstractCellEditor::maybeDirty ( dbFieldLink )

Reimplemented from dbHelper.

Definition at line 1147 of file oofrepedit.cpp.

References mAnyContentDirtied.

bool oofSingleListener::receiveMsg ( OOFmsgT  msg,
unsigned long  senderDefined 

The default receiveMsg behaviour is to delete yourself when the broadcaster closes.

In many user subclasses oofSingleListener is a mixin and you have a class owned elsewhere, not self-deleting.

\warning If a subclass is not self-deleting it MUST override receiveMsg 
handling of the msg OOFmsg_BroadcasterClosing to prevent runtime error.

However it is still important to set mListensTo=0 otherwise when you finally get around to deleting your oofSingleListener, it will try to update a deleted oofBroadcaster and cause a crash.

Implements oofReceiver.

Reimplemented in dbRelMaintainer, dbCloneCleanup, OOF_recordCacheCopier, dbFieldCopier, dbAbstractEditHelper, dbAbstractBrowseHelper, dbBrowseHelper, oofPromisedGraphSettings, oofPromisedRepTextStyle, oofRepData, oofE_Table, dbHierBrowseHelper, dbRelRefBase, and dbTableViewDisplay.

Definition at line 275 of file oofmsg.cpp.

References oofSingleListener::mListensTo, and OOFmsg_BroadcasterClosing.

Referenced by dbRelRefBase::receiveMsg(), oofPromisedGraphSettings::receiveMsg(), dbFieldCopier::receiveMsg(), and dbRelMaintainer::receiveMsg().

void oofSingleListener::resumeListening ( )
void oofSingleListener::subscribeTo ( oofBroadcaster broad)
void oofSingleListener::suspendListening ( )
dbTable * dbHelper::table ( ) const

Reimplemented in dbAbstractEditHelper, and dbAbstractBrowseHelper.

Definition at line 292 of file oofgui.cpp.

Referenced by dbFieldLink::readOnly().

void OOF_mixRepAbstractCellEditor::UnableToMoveWarning ( movementT  ,
bool  movingByCell 

default beep

Warning method called when try to trigger a movement and we can't move in that direction (eg: GoLeftCell when already at leftmost cell).

You may wish to override with an alert.

Definition at line 1010 of file oofrepedit.cpp.

References oofRuntimeEnv::beep().

Referenced by GoToAnotherCell(), and GoToAnotherItem().

void oofSingleListener::unsubscribe ( oofBroadcaster from = 0)
void OOF_mixRepAbstractCellEditor::UpdateMovementButtons ( )

override to control disabling

We are initialised with a cell position and maintain it ourselves so can query the link and enable buttons to suit.

If you don't want your buttons disabled, don't pass them into the InitMovementControls.

Reimplemented in OOF_mixRepCellEditor.

Definition at line 998 of file oofrepedit.cpp.

Referenced by LoadAndUpdate().

Member Data Documentation

dbGUIAdapter* OOF_mixRepAbstractCellEditor::mAdapter
bool OOF_mixRepAbstractCellEditor::mAnyContentDirtied

Definition at line 160 of file oofrepedit.h.

Referenced by maybeDirty().

oofRepEditLink* OOF_mixRepAbstractCellEditor::mCurrentLink
oofRepEditingEnv* OOF_mixRepAbstractCellEditor::mEnv

Definition at line 161 of file oofrepedit.h.

Referenced by FinishCreationByLinkingDataModel().

oofBroadcaster* oofSingleListener::mListensTo
unsigned short oofSingleListener::mSuspendCount
oofBroadcaster* oofSingleListener::mSuspendedListensTo

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