|
| JTable (const JCoordinate defRowHeight, const JCoordinate defColWidth, const JColorID borderColor, const JColorID selectionColor) |
|
| ~JTable () override |
|
void | SetTableData (const JTableData *data) |
|
JSize | GetRowCount () const |
|
JCoordinate | GetRowHeight (const JIndex index) const |
|
void | SetRowHeight (const JIndex index, const JCoordinate rowHeight) |
|
void | SetAllRowHeights (const JCoordinate rowHeight) |
|
JCoordinate | GetDefaultRowHeight () const |
|
void | SetDefaultRowHeight (const JCoordinate defRowHeight) |
|
JSize | GetColCount () const |
|
JCoordinate | GetColWidth (const JIndex index) const |
|
void | SetColWidth (const JIndex index, const JCoordinate colWidth) |
|
void | SetAllColWidths (const JCoordinate colWidth) |
|
JCoordinate | GetDefaultColWidth () const |
|
void | SetDefaultColWidth (const JCoordinate defColWidth) |
|
bool | GetCell (const JPoint &pt, JPoint *cell) const |
|
JRect | GetCellRect (const JPoint &cell) const |
|
JCoordinate | GetRowTop (const JIndex index) const |
|
JCoordinate | GetColLeft (const JIndex index) const |
|
JTableSelection & | GetTableSelection () |
|
const JTableSelection & | GetTableSelection () const |
|
virtual bool | IsSelectable (const JPoint &cell, const bool forExtend) const |
|
void | SelectSingleCell (const JPoint &cell, const bool scroll=true) |
|
bool | GetNextSelectableCell (JPoint *cell, const JPoint &delta, const bool forExtend) const |
|
virtual bool | IsEditable (const JPoint &cell) const |
|
bool | BeginEditing (const JPoint &cell, const bool scrollToCell=true) |
|
bool | ShiftEditing (const JCoordinate dx, const JCoordinate dy, const bool scrollToCell=true) |
|
bool | EndEditing () |
|
void | CancelEditing () |
|
bool | IsEditing () const |
|
bool | GetEditedCell (JPoint *editCell) const |
|
void | Print (JPagePrinter &p, const bool printRowHeader=true, const bool printColHeader=true) |
|
void | Print (JEPSPrinter &p, const bool printRowHeader=true, const bool printColHeader=true) |
|
void | DrawForPrint (JPainter &p, const JPoint &topLeft, const bool userPrintRowHeader, const bool userPrintColHeader) |
|
void | GetRowBorderInfo (JCoordinate *lineWidth, JColorID *color) const |
|
void | SetRowBorderInfo (const JCoordinate lineWidth, const JColorID color) |
|
void | GetColBorderInfo (JCoordinate *lineWidth, JColorID *color) const |
|
void | SetColBorderInfo (const JCoordinate lineWidth, const JColorID color) |
|
JColorID | GetSelectionColor () const |
|
void | SetSelectionColor (const JColorID color) |
|
bool | GetRowHeader (const JTable **table) const |
|
void | SetRowHeader (JTable *table) |
|
bool | GetColHeader (const JTable **table) const |
|
void | SetColHeader (JTable *table) |
|
bool | RowIndexValid (const JIndex index) const |
|
bool | ColIndexValid (const JIndex index) const |
|
bool | CellValid (const JPoint &cell) const |
|
bool | TableScrollToCell (const JPoint &cell, const bool centerInDisplay=false) |
|
void | RegisterAuxData (JTableData *auxData) |
|
void | RemoveAuxData (JTableData *auxData) |
|
| 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) |
|
|
virtual void | TableRefresh ()=0 |
|
virtual void | TableRefreshRect (const JRect &rect)=0 |
|
void | TableRefreshCell (const JPoint &cell) |
|
void | TableRefreshCell (const JIndex row, const JIndex col) |
|
void | TableRefreshCellRect (const JRect &cellRect) |
|
void | TableRefreshRow (const JIndex index) |
|
void | TableRefreshCol (const JIndex index) |
|
bool | WillActLike1DList () const |
|
void | ShouldActLike1DList (const bool act1D=true) |
|
void | SetDrawOrder (const DrawOrder order) |
|
void | TableDraw (JPainter &p, const JRect &r, const bool drawLowerRightBorder=false) |
|
virtual void | TableDrawCell (JPainter &p, const JPoint &cell, const JRect &rect)=0 |
|
virtual void | TablePrepareToDrawRow (const JIndex rowIndex, const JIndex firstCol, const JIndex lastCol) |
|
virtual void | TablePrepareToDrawCol (const JIndex colIndex, const JIndex firstRow, const JIndex lastRow) |
|
bool | Paginate (const JCoordinate pageWidth, const JCoordinate pageHeight, const bool userPrintRowHeader, JArray< JCoordinate > *rowBreakpts, bool *printRowHeader, const bool userPrintColHeader, JArray< JCoordinate > *colBreakpts, bool *printColHeader) const |
|
void | HilightIfSelected (JPainter &p, const JPoint &cell, const JRect &rect) const |
|
void | InsertRows (const JIndex index, const JSize count, const JCoordinate rowHeight=0) |
|
void | PrependRows (const JSize count, const JCoordinate rowHeight=0) |
|
void | AppendRows (const JSize count, const JCoordinate rowHeight=0) |
|
void | RemoveRow (const JIndex index) |
|
void | RemoveNextRows (const JIndex firstIndex, const JSize count) |
|
void | RemovePrevRows (const JIndex lastIndex, const JSize count) |
|
void | RemoveAllRows () |
|
void | MoveRow (const JIndex origIndex, const JIndex newIndex) |
|
void | InsertCols (const JIndex index, const JSize count, const JCoordinate colWidth=0) |
|
void | PrependCols (const JSize count, const JCoordinate colWidth=0) |
|
void | AppendCols (const JSize count, const JCoordinate colWidth=0) |
|
void | RemoveCol (const JIndex index) |
|
void | RemoveNextCols (const JIndex firstIndex, const JSize count) |
|
void | RemovePrevCols (const JIndex lastIndex, const JSize count) |
|
void | RemoveAllCols () |
|
void | MoveCol (const JIndex origIndex, const JIndex newIndex) |
|
virtual void | TableSetGUIBounds (const JCoordinate w, const JCoordinate h)=0 |
|
virtual void | TableSetScrollSteps (const JCoordinate hStep, const JCoordinate vStep)=0 |
|
virtual void | TableHeightChanged (const JCoordinate y, const JCoordinate delta)=0 |
|
virtual void | TableHeightScaled (const JFloat scaleFactor)=0 |
|
virtual void | TableRowMoved (const JCoordinate origY, const JSize height, const JCoordinate newY)=0 |
|
virtual void | TableWidthChanged (const JCoordinate x, const JCoordinate delta)=0 |
|
virtual void | TableWidthScaled (const JFloat scaleFactor)=0 |
|
virtual void | TableColMoved (const JCoordinate origX, const JSize width, const JCoordinate newX)=0 |
|
virtual bool | TableScrollToCellRect (const JRect &cellRect, const bool centerInDisplay=false)=0 |
|
virtual JCoordinate | TableGetApertureWidth () const =0 |
|
virtual JCoordinate | GetMin1DVisibleWidth (const JPoint &cell) const |
|
virtual bool | CreateInputField (const JPoint &cell, const JRect &cellRect) |
|
virtual bool | ExtractInputData (const JPoint &cell) |
|
virtual void | DeleteInputField () |
|
virtual void | PlaceInputField (const JCoordinate x, const JCoordinate y) |
|
virtual void | MoveInputField (const JCoordinate dx, const JCoordinate dy) |
|
virtual void | SetInputFieldSize (const JCoordinate w, const JCoordinate h) |
|
virtual void | ResizeInputField (const JCoordinate dw, const JCoordinate dh) |
|
virtual JCoordinate | GetPrintHeaderHeight (JPagePrinter &p) const |
|
virtual JCoordinate | GetPrintFooterHeight (JPagePrinter &p) const |
|
virtual void | DrawPrintHeader (JPagePrinter &p, const JCoordinate headerHeight) |
|
virtual void | DrawPrintFooter (JPagePrinter &p, const JCoordinate footerHeight) |
|
bool | IsDraggingSelection () const |
|
void | SetSelectionBehavior (const bool allowMultiple, const bool allowDiscont) |
|
void | BeginSelectionDrag (const JPoint &cell, const bool extendSelection, const bool selectDiscont) |
|
void | ContinueSelectionDrag (const JPoint &cell) |
|
void | FinishSelectionDrag () |
|
bool | HandleSelectionKeyPress (const JUtf8Character &key, const bool extendSelection) |
|
void | AdjustToTableData () |
|
void | Receive (JBroadcaster *sender, const Message &message) 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) |
|
virtual void | ReceiveGoingAway (JBroadcaster *sender) |
|
Abstract class to define a display organized into rows and columns.
JPoint(col,row) indicates a particular cell.
The borders between rows are not counted in the width of the rows,
and likewise for columns.
Derived classes must implement the following functions:
TableDrawCell
Draw the contents of the given cell. All drawing is automatically
clipped to the boundaries of the cell. This can usually only be
overridden by leaf classes since it requires understanding of the
actual data. The origin of the painter is irrelevant because
the cellRect provides all the necessary information.
TableSetGUIBounds
The total size of the table has changed to the given width and height.
TableSetScrollSteps
Set the step sizes and page contexts used when scrolling the table.
TableHeightChanged
TableHeightScaled
TableRowMoved
TableWidthChanged
TableWidthScaled
TableColMoved
Adjust the scrolltabs.
TableScrollToCell
Scroll the table to display the specified cell rectangle.
Return false if no scrolling was necessary.
TableGetApertureWidth
Return the width of the visible portion of the table.
TableRefresh
Refresh the entire table.
TableRefreshRect
Refresh the specified rectangle (in pixels).
Derived classes can override the following routines:
TablePrepareToDrawRow
DrawCell is about to be called for each cell in a row. If some
common initialization needs to be done, do it here.
TablePrepareToDrawCol
DrawCell is about to be called for each cell in a column. If some
common initialization needs to be done, do it here.
To use our cell selection functions, a derived class should consider
overriding:
IsSelectable
Returns true if the specified cell is selectable.
To use our editing mechanism, a derived class must override the
following routines:
IsEditable
Return true if the specified cell can be edited.
CreateInputField
Create or activate an input field to edit the specified cell.
Returns true if successful.
ExtractInputData
Check the data in the active input field, and save it if
it is valid. Return true if it is valid.
DeleteInputField
Delete or deactivate the active input field. Called when
editing is cancelled or when ExtractInputData returns true.
PlaceInputField
MoveInputField
SetInputFieldSize
ResizeInputField
Adjust the position or size of the input field.
We could have written this so that the input field moved itself based
on JTable messages, but this would require every input field object
to implement the same Receive() code, which is a waste. It seems much
better to do it once in JTable code.
To draw page headers and footers while printing, override the
following routines:
GetPrintHeaderHeight
Return the height required for the page header.
DrawPrintHeader
Draw the page header. JTable will lock the header afterwards.
GetPrintFooterHeight
Return the height required for the page footer.
DrawPrintFooter
Draw the page footer. JTable will lock the footer afterwards.