19#include <unordered_map>
141 void setCellsFont(
const std::string& cell1,
const std::string& cell2,
int fontNo);
173 void setCellLine(
const std::string& cell,
int lineNo,
bool clicked =
true);
174 void setCellsLine(std::deque<Cell*> cells,
int lineNo,
bool clicked =
true);
176 void setCellsLine(
const std::string& cell1,
const std::string& cell2,
int lineNo,
bool clicked =
true);
183 void setCellsContent(
const std::string& cell1,
const std::string& cell2, std::vector<std::string> contents);
208 void selectCell(
const std::string& cell1,
const std::string& cell2);
248 static const int mousetolerance = 5;
249 const std::string errormessage =
"Error";
251 std::string fixTextFunction(
const std::string& text,
int index);
252 std::string fixNumeric(
const std::string& text);
253 std::string fixOverflowText(
Cell& thisCell,
Cell& otherCell);
255 std::string getTextColumn(
const std::string& text);
256 int getCellNo(
int rowNo,
int columnNo);
257 int getNearestFilledCell(
int index);
259 void fillCell(
int cellNo,
const std::string& tempstr);
260 float makeSum(
int c1,
int r1,
int c2,
int r2);
261 float makeFourOperation(
const std::string& cell1,
const std::string& cell2,
char operation,
const std::string& value1symbol =
"",
const std::string& value2symbol =
"");
262 float calculateCurrentX(
int columnNo);
263 float calculateCurrentY(
int rowNo);
264 bool isNumeric(
const std::string& text);
266 void addUndoStack(
int process);
268 void addOrChangeColumnWidth(
int columnNo,
float w);
269 void addOrChangeRowHeight(
int rowNo,
float h);
270 void addOrChangeFunction(
int functionSenderNo);
272 void makeDefaultCell();
273 void removeFunction(
int cellNo);
274 void operateFunction(
int functionNo);
276 void updateAllAffectedCellWidths(
int columnNo,
float diff);
277 void updateAllAffectedCellHeights(
int rowNo,
float diff);
278 void changeSelectedCell(
int amount);
279 void changeCell(
int cellNo);
280 void setSelectedCells(
bool takeAll =
false);
281 void resetSelectedIndexes();
288 int createCell(
int rowNo,
int columnNo);
293 int createCell(
int index,
int rowNo,
int columnNo);
294 void createTextBox();
296 void checkCellType(
int cellIndex);
298 void showCell(
int rowNo,
int columnNo);
306 void editCell(
Cell& cell,
bool clear =
false);
308 void disableTextbox();
310 void updateTotalSize();
311 void adjustScrollToFocusSelected();
313 uint64_t hashCell(
int row,
int column) {
314 return (uint64_t)row << 32L | column;
317 std::unordered_map<uint64_t, int> cellmap;
318 std::deque<Cell> allcells;
319 std::deque<int> selectedcells;
320 std::deque<std::array<float, 2>> gridboxesw;
321 std::deque<std::array<float, 2>> gridboxesh;
322 std::deque<std::string> functionindexes;
323 std::deque<std::deque<std::string>> functions;
324 std::vector<std::string> copiedcellvalues;
325 std::stack<int> undoprocessstack;
326 std::stack<std::string> undovaluestack;
327 std::stack<std::stack<std::string>> undostack;
328 std::stack<std::deque<int>> undocellstack;
329 std::stack<int> redoprocessstack;
330 std::stack<std::string> redovaluestack;
331 std::stack<std::stack<std::string>> redostack;
332 std::stack<std::deque<int>> redocellstack;
335 gColor selectedframecolor, selectedareacolor, selectedareadarkcolor;
336 bool isselected, isrowselected, iscolumnselected;
337 bool istextboxactive;
338 bool isdoubleclicked;
339 bool shiftpressed, ctrlpressed;
340 bool ctrlcpressed, ctrlvpressed, ctrlzpressed, ctrlypressed;
343 int rownum, columnnum;
347 int currentrow, currentcolumn;
348 int firstcursorposx, firstcursorposy;
349 int firstselectedcell, lastselectedcell;
351 float gridboxw, gridboxh, gridboxwhalf;
352 float gridx, gridy, gridw, gridh;
353 long clicktime, previousclicktime, firstclicktime, clicktimediff;
gBaseApp * root
Definition gBaseGUIObject.h:151
@ TEXTALIGNMENT_LEFT
Definition gBaseGUIObject.h:24
int width
Definition gBaseGUIObject.h:124
int height
Definition gBaseGUIObject.h:124
static gColor * fontcolor
Definition gBaseGUIObject.h:138
void setCellLine(Cell *cell, int lineNo, bool clicked=true)
void setCellFontSize(Cell *cell, int fontSize)
void setCellsContent(const std::string &cell1, const std::string &cell2, std::vector< std::string > contents)
void setCellsAlignment(std::deque< Cell * > cells, int cellAlignment)
void setCellsContent(Cell *cell1, Cell *cell2, std::vector< std::string > contents)
@ ENTERDIRECTION_RIGHT
Definition gGUIGrid.h:120
@ ENTERDIRECTION_DOWN
Definition gGUIGrid.h:119
void setSelectedFrameColor(gColor *selectedFrameColor)
void setCellsFontItalic(Cell *cell1, Cell *cell2)
void setCellsFontBold(const std::string &cell1, const std::string &cell2)
void setCellReadOnly(Cell *cell, bool readonly)
void set(gBaseApp *root, gBaseGUIObject *topParentGUIObject, gBaseGUIObject *parentGUIObject, int parentSlotLineNo, int parentSlotColumnNo, int x, int y, int w, int h)
void setEnterDirection(int enterDirection)
void setCellsFontBold(std::deque< Cell * > cells)
void selectCell(Cell *cell1, Cell *cell2)
void setCellsFontSize(Cell *cell1, Cell *cell2, int fontSize)
void setCellAlignment(int cellAlignment, bool clicked=true)
void setCellsFontItalic(std::deque< Cell * > cells)
void setCellFontColor(const std::string &cell, gColor *fontColor=fontcolor)
void setCellFont(const std::string &cell, int fontNo)
void setCellFontColor(gColor *fontColor=fontcolor)
void setCellsFontColor(const std::string &cell1, const std::string &cell2, gColor *fontColor=fontcolor)
@ FUNCTION_TYPE
Definition gGUIGrid.h:102
@ FUNCTION_SENDER
Definition gGUIGrid.h:103
@ FUNCTION_FIRSTINDEX
Definition gGUIGrid.h:104
gColor * getSelectedAreaColor()
@ TEXTLINE_NONE
Definition gGUIGrid.h:85
@ TEXTLINE_STRIKE
Definition gGUIGrid.h:88
@ TEXTLINE_UNDER
Definition gGUIGrid.h:86
@ TEXTLINE_DOUBLEUNDER
Definition gGUIGrid.h:87
void selectCell(int rowNo, int columnNo)
void setCellAlignment(Cell *cell, int cellAlignment)
void setCellContent(const std::string &cell, const std::string &cellContent)
void setCellsLine(std::deque< Cell * > cells, int lineNo, bool clicked=true)
void setCellReadOnly(const std::string &cell, bool readonly)
void setCellsFontSize(std::deque< Cell * > cells, int fontSize)
void setCellAlignment(const std::string &cell, int cellAlignment)
float getRowHeight(int rowNo)
void drawCellBackground()
std::deque< Cell * > getSelectedCells()
void setCellsFontColor(std::deque< Cell * > cells, gColor *fontColor=fontcolor)
void setCellFontItalic(Cell *cell)
void setCellsContent(std::deque< Cell * > cells, std::vector< std::string > contents)
void setCellFontSize(int fontSize)
void setCellsFontColor(Cell *cell1, Cell *cell2, gColor *fontColor=fontcolor)
gColor * getSelectedFrameColor()
void setRowHeight(int rowNo, float height)
void setColumnWidth(int columnNo, float width)
void mouseDragged(int x, int y, int button)
void setCellLine(const std::string &cell, int lineNo, bool clicked=true)
void setCellsLine(const std::string &cell1, const std::string &cell2, int lineNo, bool clicked=true)
void setColumnNum(int columnNum)
void setCellsFontItalic(const std::string &cell1, const std::string &cell2)
int getCursor(int x, int y)
void mouseScrolled(int x, int y)
void setCellFontItalic(const std::string &cell)
void selectCell(const std::string &cell1, const std::string &cell2)
void setGrid(int rowNum, int columnNum)
void setCellsFont(std::deque< Cell * > cells, int fontNo)
void setColumnReadOnly(int columnNo, bool readonly)
void setCellsFont(Cell *cell1, Cell *cell2, int fontNo)
void setCellFontColor(Cell *cell, gColor *fontColor=fontcolor)
void setSelectedAreaColor(gColor *selectedAreaColor)
@ PROCESS_TEXT
Definition gGUIGrid.h:108
@ PROCESS_FONTSTATE
Definition gGUIGrid.h:110
@ PROCESS_COLOR
Definition gGUIGrid.h:113
@ PROCESS_FONTSIZE
Definition gGUIGrid.h:111
@ PROCESS_ALL
Definition gGUIGrid.h:115
@ PROCESS_FONT
Definition gGUIGrid.h:109
@ PROCESS_LINE
Definition gGUIGrid.h:114
@ PROCESS_ALIGNMENT
Definition gGUIGrid.h:112
void setCellFontBold(const std::string &cell)
void setCellLine(int lineNo, bool clicked=true)
void selectCell(const std::string &cell)
const int maxrownum
Definition gGUIGrid.h:124
void setRowReadOnly(int rowNo, bool readonly)
const int maxcolumnnum
Definition gGUIGrid.h:123
std::string getColumnName(int columnNo)
void mousePressed(int x, int y, int button)
@ FUNCTIONTYPE_NONE
Definition gGUIGrid.h:92
@ FUNCTIONTYPE_SUB
Definition gGUIGrid.h:96
@ FUNCTIONTYPE_ADD
Definition gGUIGrid.h:95
@ FUNCTIONTYPE_DIVIDE
Definition gGUIGrid.h:97
@ FUNCTIONTYPE_SUM
Definition gGUIGrid.h:94
@ FUNCTIONTYPE_MULTIPLY
Definition gGUIGrid.h:98
@ FUNCTIONTYPE_COPY
Definition gGUIGrid.h:93
void setCellsFont(const std::string &cell1, const std::string &cell2, int fontNo)
void setRowNum(int rowNum)
void mouseReleased(int x, int y, int button)
void setCellFont(Cell *cell, int fontNo)
void setCellsFontBold(Cell *cell1, Cell *cell2)
void setCellFontSize(const std::string &cell, int fontSize)
void setCellReadOnly(int rowNo, int columnNo, bool readonly)
Cell * getCell(int rowNo, int columnNo)
void charPressed(unsigned int codepoint)
void setCellsLine(Cell *cell1, Cell *cell2, int lineNo, bool clicked=true)
void setCellsAlignment(Cell *cell1, Cell *cell2, int cellAlignment)
void keyReleased(int key)
float getColumnWidth(int columnNo)
void setCellContent(Cell *cell, const std::string &cellContent)
void selectCell(Cell *cell)
void setCellFont(int fontNo)
void setCellFontBold(Cell *cell)
void setCellContent(int rowNo, int columnNo, const std::string &cellContent)
int getColumnNo(const std::string &columnName)
void setCellsFontSize(const std::string &cell1, const std::string &cell2, int fontSize)
void setCellsAlignment(const std::string &cell1, const std::string &cell2, int cellAlignment)
Cell * getCell(const std::string &cellID)
Definition gGUIManager.h:37
@ FONT_FREESANS
Definition gGUIManager.h:51
@ FONTTYPE_REGULAR
Definition gGUIManager.h:44
Definition gGUITextbox.h:51
int fontstate
Definition gGUIGrid.h:41
float cellw
Definition gGUIGrid.h:47
bool readonly
Definition gGUIGrid.h:54
int fontsize
Definition gGUIGrid.h:42
@ TYPE_STRING
Definition gGUIGrid.h:27
@ TYPE_DIGIT
Definition gGUIGrid.h:28
int cellrowno
Definition gGUIGrid.h:38
bool removed
Definition gGUIGrid.h:53
std::string cellcontent
Definition gGUIGrid.h:49
int cellcolumnno
Definition gGUIGrid.h:39
bool iscolorchanged
Definition gGUIGrid.h:35
bool iscellselected
Definition gGUIGrid.h:31
int lineno
Definition gGUIGrid.h:44
std::string overflowcontent
Definition gGUIGrid.h:51
int cellalignment
Definition gGUIGrid.h:43
float textmoveamount
Definition gGUIGrid.h:48
int celltype
Definition gGUIGrid.h:45
int celly
Definition gGUIGrid.h:37
Cell()
Definition gGUIGrid.h:57
bool isitalic
Definition gGUIGrid.h:34
bool iscellaligned
Definition gGUIGrid.h:32
std::string showncontent
Definition gGUIGrid.h:50
bool isbold
Definition gGUIGrid.h:33
bool overflowdirty
Definition gGUIGrid.h:55
int cellx
Definition gGUIGrid.h:36
gColor cellfontcolor
Definition gGUIGrid.h:52
float cellh
Definition gGUIGrid.h:46
int fontnum
Definition gGUIGrid.h:40