JX Application Framework
|
#include <JTableSelectionIterator.h>
Public Types | |
enum | Direction { kIterateByRow , kIterateByCol } |
enum | Position { kStartAtBeginning , kStartAtEnd , kStartBefore , kStartAfter } |
Public Member Functions | |
JTableSelectionIterator (const JTableSelection *tableSelection, const Direction d=kIterateByCol, const Position start=kStartAtBeginning, const JIndex row=0, const JIndex col=0) | |
JTableSelectionIterator (const JTableSelectionIterator &source) | |
~JTableSelectionIterator () override | |
Direction | GetDirection () const |
void | SetDirection (const Direction d) |
bool | Prev (JPoint *cell) |
bool | Prev (JIndex *row, JIndex *col) |
bool | Next (JPoint *cell) |
bool | Next (JIndex *row, JIndex *col) |
void | MoveTo (const Position newPosition, const JPoint &cell) |
void | MoveTo (const Position newPosition, const JIndex row, const JIndex col) |
bool | AtBeginning () const |
bool | AtEnd () 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 | |
const JTableSelection * | GetTableSelection () const |
void | Receive (JBroadcaster *sender, const Message &message) override |
void | ReceiveGoingAway (JBroadcaster *sender) override |
![]() | |
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) |
This class provides a simple, error-resistant way to retrieve the coordinates of the cells that are selected and can iterate over the table either by row or by column. The cursor values run from one to row/col count.
JTableSelectionIterator::JTableSelectionIterator | ( | const JTableSelection * | tableSelection, |
const Direction | d = kIterateByCol , |
||
const Position | start = kStartAtBeginning , |
||
const JIndex | row = 0 , |
||
const JIndex | col = 0 |
||
) |
We can't overload the constructor to provide one that takes a JPoint because then the compiler can't tell which one to call because of all the default values.
JTableSelectionIterator::JTableSelectionIterator | ( | const JTableSelectionIterator & | source | ) |
|
override |
bool JTableSelectionIterator::AtBeginning | ( | ) | const |
Return true if iterator is positioned at the top left of the table or if the table has been deleted.
bool JTableSelectionIterator::AtEnd | ( | ) | const |
Return true if iterator is positioned at the bottom right of the table or if the table has been deleted.
|
inline |
|
inlineprotected |
|
inline |
Return true if there is a next selected cell, fetching the coordinates of the cell and incrementing the iterator position. Otherwise return false without fetching or incrementing.
Return true if there is a previous selected cell, fetching the coordinates of the cell and decrementing the iterator position. Otherwise return false without fetching or decrementing.
|
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.
|
overrideprotectedvirtual |
The given sender has been deleted.
Warning: Since this function may be called from within a -chain- of destructors, it is not usually safe to do anything inside this function other than directly changing instance variables (e.g. setting pointers to nullptr).
This function is not pure virtual because not all classes will want to implement it.
Reimplemented from JBroadcaster.
|
inline |