Minsky
|
#include <godleyTableWindow.h>
Public Member Functions | |
GodleyTableWindow (GodleyIcon &g) | |
void | requestRedraw () |
void | requestRedrawCanvas () override |
void | mouseDown (float x, float y) override |
void | mouseUp (float x, float y) override |
void | mouseMove (float x, float y) override |
void | zoom (double, double, double z) override |
double | zoomFactor () const override |
bool | keyPress (const EventInterface::KeyPressArgs &args) override |
handle key press over current itemFocus, More... | |
bool | hasScrollBars () const override |
return whether this window has scrollbars (needed for MacOSX). More... | |
void | draw (cairo_t *cairo) |
![]() | |
const RenderFrameArgs & | frameArgs () const |
~RenderNativeWindow () override | |
virtual void | init () |
perform any initialisation of any subclasses of this More... | |
void | renderFrame (const RenderFrameArgs &args) |
void | destroyFrame () |
void | draw () |
void | requestRedraw () |
void | macOSXRedraw () |
RenderNativeWindow & | operator= (const RenderNativeWindow &x) |
RenderNativeWindow ()=default | |
RenderNativeWindow (const RenderNativeWindow &)=default | |
![]() | |
virtual void | controlMouseDown (float x, float y) |
virtual void | moveTo (float x, float y) |
move this so that (x,y) is centred More... | |
virtual std::vector< float > | position () const |
current centre coordinates More... | |
virtual bool | getItemAt (float x, float y) |
item or wire obtained by get*At() calls More... | |
virtual bool | getWireAt (float x, float y) |
item or wire obtained by get*At() calls More... | |
![]() | |
GodleyIcon & | godleyIcon () |
const GodleyIcon & | godleyIcon () const |
void | disableButtons () |
void | enableButtons () |
bool | selectedCellInTable () const |
GodleyTableEditor (GodleyIcon &g) | |
void | draw (cairo_t *cairo) |
double | width () const |
double | height () const |
void | mouseDown (double x, double y) |
event handling More... | |
void | mouseUp (double x, double y) |
void | mouseMoveB1 (double x, double y) |
mouse motion with button 1 pressed More... | |
void | mouseMove (double x, double y) |
void | keyPress (int keySym, const std::string &utf8) |
ClickType | clickTypeZoomed (double x, double y) const |
returns the clickType in zoomed coordinates More... | |
void | addStockVar (double x) |
add/delete rows/columns at x,y More... | |
void | addStockVarByCol (int c) |
void | importStockVar (const std::string &name, double x) |
void | importStockVarByCol (const std::string &name, int c) |
void | deleteStockVar (double x) |
void | deleteStockVarByCol (int c) |
void | addFlow (double y) |
void | addFlowByRow (int r) |
void | deleteFlow (double y) |
void | deleteFlowByRow (int r) |
int | colXZoomed (double x) const |
int | rowYZoomed (double y) const |
std::string | moveAssetClass (double x, double y) |
std::string | swapAssetClass (double x, double y) |
void | highlightColumn (cairo_t *cairo, unsigned col) |
void | highlightRow (cairo_t *cairo, unsigned row) |
void | highlightCell (cairo_t *cairo, unsigned row, unsigned col) |
void | delSelection () |
void | cut () |
void | copy () |
void | paste () |
int | textIdx (double x) const |
void | pushHistory () |
void | undo (int changes) |
restore to state changes ago More... | |
void | adjustWidgets () |
ensure button widgets are synced with current table data More... | |
void | update () |
update canvas godleyIcon, and any related godley icons. Can throw More... | |
ClickType | clickType (double x, double y) const |
std::set< string > | matchingTableColumns (double x) |
return list of matching table columns for column at x More... | |
std::set< string > | matchingTableColumnsByCol (int c) |
void | navigateRight () |
move selected cell right, left, up or down, moving to next line and wrapping if at end of row or col More... | |
void | navigateLeft () |
move selected cell right, left, up or down, moving to next line and wrapping if at end of row or col More... | |
void | navigateUp () |
move selected cell right, left, up or down, moving to next line and wrapping if at end of row or col More... | |
void | navigateDown () |
move selected cell right, left, up or down, moving to next line and wrapping if at end of row or col More... | |
Protected Member Functions | |
bool | redraw (int, int, int width, int height) override |
![]() | |
int | colX (double x) const |
column at x in unzoomed coordinates More... | |
int | rowY (double y) const |
row at y in unzoomed coordinates More... | |
void | checkCell00 () |
check if cell (0,0) is selected, and deselect if so handle delete or backspace. Cell assumed selected More... | |
void | handleBackspace () |
void | handleDelete () |
Private Member Functions | |
CLASSDESC_ACCESS (GodleyTableWindow) | |
Additional Inherited Members | |
![]() | |
enum | ClickType { background, row0, col0, internal, importStock, rowWidget, colWidget } |
![]() | |
enum | RowCol { row, col } |
enum | Pos { first, second, middle, last, firstAndLast } |
![]() | |
enum | AssetClass { noAssetClass, asset, liability, equity } |
enum | DisplayStyle { DRCR, sign } |
![]() | |
static double | scaleFactor () |
![]() | |
ItemPtr | item |
item or wire obtained by get*At() calls More... | |
WirePtr | wire |
item or wire obtained by get*At() calls More... | |
![]() | |
double | leftTableOffset =4*ButtonWidget<col>::buttonSpacing |
offset of the table within the window More... | |
double | topTableOffset =30 |
bool | drawButtons =true |
whether to draw row/column buttons More... | |
unsigned | scrollRowStart =1 |
starting row/col number of the scrolling region More... | |
unsigned | scrollColStart =1 |
int | selectedRow =-1 |
which cell is active, none initially More... | |
int | selectedCol =-1 |
int | srcRow =-1 |
src cell in the event of a move More... | |
int | srcCol =-1 |
int | hoverRow =-1 |
int | hoverCol =-1 |
std::vector< double > | colLeftMargin |
computed positions of the table columns More... | |
double | rowHeight =0 |
computed height of each row More... | |
unsigned | insertIdx =0 |
location of insertion pointer in selected cell, as well as other end of selection (if mouse-swiped) More... | |
unsigned | selectIdx =0 |
double | zoomFactor =1 |
zoom the display More... | |
std::size_t | maxHistory {100} |
maximum no. of history states to save More... | |
std::size_t | historyPtr =0 |
![]() | |
static ecolab::cairo::Colour | backgroundColour {0.8,0.8,0.8,1} |
![]() | |
static constexpr double | columnButtonsOffset =12 |
static constexpr double | pulldownHot =12 |
space for ▼ in stackVar cells minimum column width (for eg empty columns) More... | |
static constexpr double | minColumnWidth =4*ButtonWidget<col>::buttonSpacing |
![]() | |
std::vector< ButtonWidget< row > > | rowWidgets |
std::vector< ButtonWidget< col > > | colWidgets |
int | motionRow =-1 |
int | motionCol =-1 |
current cell under mouse motion More... | |
std::deque< GodleyTable > | history |
Definition at line 216 of file godleyTableWindow.h.
|
inline |
Definition at line 229 of file godleyTableWindow.h.
|
private |
void minsky::GodleyTableEditor::draw |
Definition at line 156 of file godleyTableWindow.cc.
|
inlineoverridevirtual |
return whether this window has scrollbars (needed for MacOSX).
Reimplemented from minsky::RenderNativeWindow.
Definition at line 240 of file godleyTableWindow.h.
|
inlineoverridevirtual |
handle key press over current itemFocus,
keySym | the X key sym code |
utf8 | utf8 encoded character |
state | modifer state 1=shift, 2=caps lock, 4=ctrl, 8=alt |
x | & y contain mouse coordinates |
Reimplemented from minsky::EventInterface.
Definition at line 238 of file godleyTableWindow.h.
References minsky::GodleyTableEditor::keyPress(), minsky::EventInterface::KeyPressArgs::keySym, and minsky::EventInterface::KeyPressArgs::utf8.
|
inlineoverridevirtual |
Reimplemented from minsky::EventInterface.
Definition at line 233 of file godleyTableWindow.h.
References minsky::GodleyTableEditor::mouseDown().
|
inlineoverridevirtual |
Reimplemented from minsky::EventInterface.
Definition at line 235 of file godleyTableWindow.h.
References minsky::GodleyTableEditor::mouseMove().
|
inlineoverridevirtual |
Reimplemented from minsky::EventInterface.
Definition at line 234 of file godleyTableWindow.h.
References minsky::GodleyTableEditor::mouseUp().
|
inlineoverrideprotected |
Definition at line 220 of file godleyTableWindow.h.
References minsky::RenderNativeWindow::draw().
|
inline |
Definition at line 230 of file godleyTableWindow.h.
Referenced by requestRedrawCanvas(), and zoom().
|
inlineoverridevirtual |
Reimplemented from minsky::GodleyTableEditor.
Definition at line 231 of file godleyTableWindow.h.
References requestRedraw().
|
inlineoverridevirtual |
Reimplemented from minsky::EventInterface.
Definition at line 236 of file godleyTableWindow.h.
References requestRedraw(), and minsky::GodleyTableEditor::zoomFactor.
|
inlineoverridevirtual |
Reimplemented from minsky::EventInterface.
Definition at line 237 of file godleyTableWindow.h.
References minsky::GodleyTableEditor::zoomFactor.