ASpreadsheetCell
- Module
- Arc
- Header
#include "Arc/Widgets/ASpreadsheetCell.h"- Namespace
Arcf
Properties
| Type | Name | Description |
|---|---|---|
ArcDelegate<void(const std::string&)> | OnCommitted | |
ArcDelegate<void()> | OnEditRequested | |
ArcDelegate<void()> | OnEditCancelled | |
ArcDelegate<void(int32_t, int32_t)> | OnNavigate | After a commit by Enter (0, +1) or Tab (+1, 0): the host moves the active cell by (columns, rows). |
ArcDelegate<void(bool)> | OnClicked | A click on the cell; true when Shift extends the block. |
ArcDelegate<void()> | OnCopyRequested | |
ArcDelegate<void()> | OnPasteRequested | |
ArcDelegate<void(int32_t, int32_t)> | OnFillDragged | A finished fill drag: rows down and columns right (negative is up or left), never both. |
std::function<bool(const CKeyEvent&)> | OnKey | Host hooks run before the cell's own keys and menu; true claims. |
std::function<bool(CMenuBuilder&)> | OnBuildMenu | |
TSharedPtr<AWidget> | FocusTarget | Where a click parks keyboard focus (the grid's focusable body); the cell itself when unset. |
Public functions
| Returns | Name | Description |
|---|---|---|
ARC_WIDGET_ARGS | ||
void | Construct | |
void | SetText | |
std::string | GetText | |
void | SetTextSource | A live text source read at paint (the cell's model value). |
void | SetValueWidget | A typed editor shown in place of the painted text. |
void | SetSelected | |
bool | IsSelected | |
void | SetActive | The active cell of the grid: the 2 px frame and the fill handle, whether or not the grid itself holds keyboard focus. |
bool | IsActive | |
void | SetHasError | |
void | SetReadOnly | |
bool | IsEditing | |
bool | BeginEdit | Opens the inline field (text cells) or asks the host to focus its editor (OnEditRequested). |
void | CommitEdit | Commits the inline field's text through OnCommitted. |
void | CancelEdit | Closes the inline field and restores the text it opened with. |
std::string | GetEditText | The text the inline field holds while editing. |
void | SetEditText | |
ArcRect | FillHandleRect | The bottom-right drag-fill handle of a cell rect. |
void | FillRange | Whole cells a fill drag of delta covers: the dominant axis only, as a spreadsheet does, counted in this cell's size. |
ArcVec2 | ComputeDesiredSize | |
void | ArrangeChildren | |
int32_t | OnPaint | |
CReply | OnMouseButtonDown | |
CReply | OnMouseButtonDoubleClick | |
CReply | OnMouseMove | |
CReply | OnMouseButtonUp | |
CReply | OnKeyDown | |
bool | OnContextMenu | |
void | OnMouseEnter | |
void | OnMouseCaptureLost | |
EArcCursorType | OnCursorQuery | |
void | SetFocusable | A grid that keeps one keyboard stop for all its cells (the Data Table: the arrows move the active cell) takes the cells out of the Tab order; the inline field still takes focus while editing. |
bool | IsFocusable | |
void | SetAlignRight | Right-aligned text, the way a table column of figures reads. |
EFocusVisual | GetFocusVisual | |
bool | PaintsOwnFocus | The spec's focused state is the 2 px inset FocusRing frame the cell paints itself; a ring outside it would sit over the neighbours. |
bool | OnActivate | |
int32_t | GetFillRows | The fill drag in progress, in cells (for the preview outline). |
int32_t | GetFillColumns | |
const char* | GetTypeName |
Function details
ARC_WIDGET_ARGS
ARC_WIDGET_ARGS(ASpreadsheetCell) ARC_ARG(std::string, Text) ARC_ARG(bool, Numeric) ARC_ARG(bool, ReadOnly) ARC_WIDGET_ARGS_END() static constexpr float kFillHandleSize = 6.0fConstruct
void Construct(const CArguments& args)SetText
void SetText(const std::string& text)GetText
std::string GetText() constSetTextSource
void SetTextSource(std::function<std::string()> source)A live text source read at paint (the cell's model value).
SetValueWidget
void SetValueWidget(TSharedPtr<AWidget> widget)A typed editor shown in place of the painted text.
SetSelected
void SetSelected(bool selected)IsSelected
bool IsSelected() constSetActive
void SetActive(bool active)The active cell of the grid: the 2 px frame and the fill handle, whether or not the grid itself holds keyboard focus.
IsActive
bool IsActive() constSetHasError
void SetHasError(bool hasError)SetReadOnly
void SetReadOnly(bool readOnly)IsEditing
bool IsEditing() constBeginEdit
bool BeginEdit()Opens the inline field (text cells) or asks the host to focus its editor (OnEditRequested). False for a read-only or disabled cell.
CommitEdit
void CommitEdit()Commits the inline field's text through OnCommitted.
CancelEdit
void CancelEdit()Closes the inline field and restores the text it opened with.
GetEditText
std::string GetEditText() constThe text the inline field holds while editing.
SetEditText
void SetEditText(const std::string& text)FillHandleRect
static ArcRect FillHandleRect(const ArcRect& cell)The bottom-right drag-fill handle of a cell rect.
FillRange
static void FillRange(const ArcVec2& delta, const ArcVec2& cellSize, int32_t& outRows, int32_t& outColumns)Whole cells a fill drag of delta covers: the dominant axis only, as a spreadsheet does, counted in this cell's size.
ComputeDesiredSize
ArcVec2 ComputeDesiredSize(float scale) const overrideArrangeChildren
void ArrangeChildren(const CGeometry& geo) overrideOnPaint
int32_t OnPaint(const CArcPaintArgs& args, const CGeometry& geo, CArcUIRenderer& renderer, int32_t layerId) const overrideOnMouseButtonDown
CReply OnMouseButtonDown(const CGeometry& geo, const CPointerEvent& event) overrideOnMouseButtonDoubleClick
CReply OnMouseButtonDoubleClick(const CGeometry& geo, const CPointerEvent& event) overrideOnMouseMove
CReply OnMouseMove(const CGeometry& geo, const CPointerEvent& event) overrideOnMouseButtonUp
CReply OnMouseButtonUp(const CGeometry& geo, const CPointerEvent& event) overrideOnKeyDown
CReply OnKeyDown(const CGeometry& geo, const CKeyEvent& event) overrideOnContextMenu
bool OnContextMenu(const CGeometry& geo, const CPointerEvent& event, CMenuBuilder& builder) overrideOnMouseEnter
void OnMouseEnter(const CGeometry& geo, const CPointerEvent& event) overrideOnMouseCaptureLost
void OnMouseCaptureLost() overrideOnCursorQuery
EArcCursorType OnCursorQuery(const CGeometry& geo, const CPointerEvent& event) const overrideSetFocusable
void SetFocusable(bool focusable)A grid that keeps one keyboard stop for all its cells (the Data Table: the arrows move the active cell) takes the cells out of the Tab order; the inline field still takes focus while editing.
IsFocusable
bool IsFocusable() const overrideSetAlignRight
void SetAlignRight(bool alignRight)Right-aligned text, the way a table column of figures reads.
GetFocusVisual
EFocusVisual GetFocusVisual() const overridePaintsOwnFocus
bool PaintsOwnFocus() const overrideThe spec's focused state is the 2 px inset FocusRing frame the cell paints itself; a ring outside it would sit over the neighbours.
OnActivate
bool OnActivate() overrideGetFillRows
int32_t GetFillRows() constThe fill drag in progress, in cells (for the preview outline).
GetFillColumns
int32_t GetFillColumns() constGetTypeName
const char* GetTypeName() const override