35 #include <cairo_base.h> 39 class GodleyTableEditor;
99 void setCell(
int row,
int col,
const string& val);
135 void draw(cairo_t* cairo)
const override;
138 std::string
rowSum(
int row)
const;
158 bool onKeyPress(
int,
const std::string&,
int)
override;
159 bool inItem(
float,
float)
const override;
172 const vector<string>& varNames,
187 #pragma omit pack minsky::GodleyIcon 188 #pragma omit unpack minsky::GodleyIcon 193 public classdesc::NullDescriptor<classdesc::pack_t> {};
195 public classdesc::NullDescriptor<classdesc::unpack_t> {};
198 #include "godleyIcon.cd" 199 #include "godleyIcon.xcd" bool editorMode() const override
indicate whether icon is in editor mode or icon mode
void updateVars(Variables &vars, const vector< string > &varNames, VariableBase::Type varType)
void toggleEditorMode() override
std::vector< Summary > summarise() const
summary of variables in this godley table
represents items that have been selected
GodleyIcon * godleyIconCast() override
void toggleVariableDisplay()
bool wiresAttached() const
return true if any wires are attached to the variables
void adjustWidgets()
ensure button widgets are synced with current table data
bool buttonDisplay() const
enable/disable drawing buttons in table on canvas display
GodleyIcon * clone() const override
void scaleIcon(float w, float h)
scale icon until it's height or width matches h or w depending on which is minimum ...
void moveCell(const GodleyIcon::MoveCellArgs &)
const GodleyIcon * godleyIconCast() const override
float toEditorY(float) const
convert mouse coordinates into editor coords
represents rectangular region of a lasso operation
void positionVariables() const
move contained variables to correct locations within icon
void resize(const LassoBox &) override
resize this item on the canvas
void setCell(int row, int col, const string &val)
set cell(row,col) with contents val
std::shared_ptr< Item > ItemPtr
float flowMargin
for placement of bank icon within complex
std::string rowSum(int row) const
return the A-L-E row sum for row
const Variables & flowVars() const
string valueId(const string &name)
construct a valueId from fully qualified name @ name should not be canonicalised
bool onMouseOver(float, float) override
respond to mouse motion events (hover) without button pressed
BoundingBox bb
canvas bounding box.
CLASSDESC_ACCESS(GodleyIcon)
bool inItem(float, float) const override
virtual float zoomFactor() const
move the contents of cell at (srcRow, srcCol) to (destRow, destCol).
GodleyTable table
table data. Must be declared before editor
void update(const Item &x)
float leftMargin() const
left margin of bank icon with Godley icon
bool variableDisplay() const
static SVGRenderer svgRenderer
SVG icon to display when not in editor mode.
void insertControlled(Selection &selection) override
std::string valueId(const std::string &x) const
returns valueid for variable reference in table
ClickType::Type clickType(float x, float y) const override
returns the clicktype given a mouse click at x, y.
bool onMouseMotion(float, float) override
respond to mouse motion events with button pressed
GodleyTableWindow popup
for rendering the popup window
Creation and access to the minskyTCL_obj object, which has code to record whenever Minsky's state cha...
Units stockVarUnits(const std::string &stockName, bool check) const
performs dimensional analysis on stock var column stockName
void update()
updates the variable lists with the Godley table
represents the units (in sense of dimensional analysis) of a variable.
std::map< string, double > flowSignature(unsigned col) const
flows, along with multipliers, appearing in col
bool selected
true if selected for cut, copy or group operation
virtual float scaleFactor() const
factor by which item has been resized
ItemPtr select(float x, float y) const override
returns the variable if point (x,y) is within a variable icon, null otherwise, indicating that the Go...
float toEditorX(float) const
convert mouse coordinates into editor coords
std::vector< VariablePtr > Variables
void draw(cairo_t *cairo) const override
draw icon to context
const Variables & stockVars() const
void onMouseLeave() override
respond to mouse leave events (when mouse leaves item)
void removeControlledItems(GroupItems &) override
void setCurrency(const std::string ¤cy)
void onMouseUp(float, float) override
respond to mouse up events
void adjustPopupWidgets()
bool onKeyPress(int, const std::string &, int) override
respond to key press events
void onMouseDown(float, float) override
respond to mouse down events
GodleyTableEditor editor
rendering as a godley table
float bottomMargin() const
bottom margin of bank icon with Godley icon
void destroyFrame() override
clean up popup window structures on window close
void deleteRow(unsigned row)
delete row before row