19#include <unordered_map>
134 void setCellsFont(
const std::string& cell1,
const std::string& cell2,
int fontNo);
166 void setCellLine(
const std::string& cell,
int lineNo,
bool clicked =
true);
167 void setCellsLine(std::deque<Cell*> cells,
int lineNo,
bool clicked =
true);
169 void setCellsLine(
const std::string& cell1,
const std::string& cell2,
int lineNo,
bool clicked =
true);
176 void setCellsContent(
const std::string& cell1,
const std::string& cell2, std::vector<std::string> contents);
199 void selectCell(
const std::string& cell1,
const std::string& cell2);
236 static const int mousetolerance = 5;
237 const std::string errormessage =
"Error";
239 std::string fixTextFunction(
const std::string& text,
int index);
240 std::string fixNumeric(
const std::string& text);
241 std::string fixOverflowText(
Cell& thisCell,
Cell& otherCell);
243 std::string getTextColumn(
const std::string& text);
244 int getCellNo(
int rowNo,
int columnNo);
245 int getNearestFilledCell(
int index);
247 void fillCell(
int cellNo,
const std::string& tempstr);
248 float makeSum(
int c1,
int r1,
int c2,
int r2);
249 float makeFourOperation(
const std::string& cell1,
const std::string& cell2,
char operation,
const std::string& value1symbol =
"",
const std::string& value2symbol =
"");
250 float calculateCurrentX(
int columnNo);
251 float calculateCurrentY(
int rowNo);
252 bool isNumeric(
const std::string& text);
254 void addUndoStack(
int process);
256 void addOrChangeColumnWidth(
int columnNo,
float w);
257 void addOrChangeRowHeight(
int rowNo,
float h);
258 void addOrChangeFunction(
int functionSenderNo);
260 void makeDefaultCell();
261 void removeFunction(
int cellNo);
262 void operateFunction(
int functionNo);
264 void updateAllAffectedCellWidths(
int columnNo,
float diff);
265 void updateAllAffectedCellHeights(
int rowNo,
float diff);
266 void changeSelectedCell(
int amount);
267 void changeCell(
int cellNo);
268 void setSelectedCells(
bool takeAll =
false);
269 void resetSelectedIndexes();
276 int createCell(
int rowNo,
int columnNo);
281 int createCell(
int index,
int rowNo,
int columnNo);
282 void createTextBox();
284 void checkCellType(
int cellIndex);
286 void showCell(
int rowNo,
int columnNo);
294 void editCell(
Cell& cell,
bool clear =
false);
296 void disableTextbox();
298 void updateTotalSize();
299 void adjustScrollToFocusSelected();
301 uint64_t hashCell(
int row,
int column) {
302 return (uint64_t)row << 32L | column;
305 std::unordered_map<uint64_t, int> cellmap;
306 std::deque<Cell> allcells;
307 std::deque<int> selectedcells;
308 std::deque<std::array<float, 2>> gridboxesw;
309 std::deque<std::array<float, 2>> gridboxesh;
310 std::deque<std::string> functionindexes;
311 std::deque<std::deque<std::string>> functions;
312 std::vector<std::string> copiedcellvalues;
313 std::stack<int> undoprocessstack;
314 std::stack<std::string> undovaluestack;
315 std::stack<std::stack<std::string>> undostack;
316 std::stack<std::deque<int>> undocellstack;
317 std::stack<int> redoprocessstack;
318 std::stack<std::string> redovaluestack;
319 std::stack<std::stack<std::string>> redostack;
320 std::stack<std::deque<int>> redocellstack;
323 gColor selectedframecolor, selectedareacolor, selectedareadarkcolor;
324 bool isselected, isrowselected, iscolumnselected;
325 bool istextboxactive;
326 bool isdoubleclicked;
327 bool shiftpressed, ctrlpressed;
328 bool ctrlcpressed, ctrlvpressed, ctrlzpressed, ctrlypressed;
331 int rownum, columnnum;
335 int currentrow, currentcolumn;
336 int firstcursorposx, firstcursorposy;
337 int firstselectedcell, lastselectedcell;
339 float gridboxw, gridboxh, gridboxwhalf;
340 float gridx, gridy, gridw, gridh;
341 long clicktime, previousclicktime, firstclicktime, clicktimediff;
Definition gBaseGUIObject.h:18
gBaseApp * root
Definition gBaseGUIObject.h:147
@ TEXTALIGNMENT_LEFT
Definition gBaseGUIObject.h:24
int width
Definition gBaseGUIObject.h:120
int height
Definition gBaseGUIObject.h:120
static gColor * fontcolor
Definition gBaseGUIObject.h:134
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)
@ PROCESS_TEXT
Definition gGUIGrid.h:106
@ PROCESS_FONTSTATE
Definition gGUIGrid.h:108
@ PROCESS_COLOR
Definition gGUIGrid.h:111
@ PROCESS_FONTSIZE
Definition gGUIGrid.h:109
@ PROCESS_ALL
Definition gGUIGrid.h:113
@ PROCESS_FONT
Definition gGUIGrid.h:107
@ PROCESS_LINE
Definition gGUIGrid.h:112
@ PROCESS_ALIGNMENT
Definition gGUIGrid.h:110
void setCellsContent(Cell *cell1, Cell *cell2, std::vector< std::string > contents)
@ TEXTLINE_NONE
Definition gGUIGrid.h:83
@ TEXTLINE_STRIKE
Definition gGUIGrid.h:86
@ TEXTLINE_UNDER
Definition gGUIGrid.h:84
@ TEXTLINE_DOUBLEUNDER
Definition gGUIGrid.h:85
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 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)
gColor * getSelectedAreaColor()
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)
@ FUNCTION_TYPE
Definition gGUIGrid.h:100
@ FUNCTION_SENDER
Definition gGUIGrid.h:101
@ FUNCTION_FIRSTINDEX
Definition gGUIGrid.h:102
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)
@ FUNCTIONTYPE_NONE
Definition gGUIGrid.h:90
@ FUNCTIONTYPE_SUB
Definition gGUIGrid.h:94
@ FUNCTIONTYPE_ADD
Definition gGUIGrid.h:93
@ FUNCTIONTYPE_DIVIDE
Definition gGUIGrid.h:95
@ FUNCTIONTYPE_SUM
Definition gGUIGrid.h:92
@ FUNCTIONTYPE_MULTIPLY
Definition gGUIGrid.h:96
@ FUNCTIONTYPE_COPY
Definition gGUIGrid.h:91
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 setCellsFont(Cell *cell1, Cell *cell2, int fontNo)
void setCellFontColor(Cell *cell, gColor *fontColor=fontcolor)
void setSelectedAreaColor(gColor *selectedAreaColor)
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:117
const int maxcolumnnum
Definition gGUIGrid.h:116
std::string getColumnName(int columnNo)
void mousePressed(int x, int y, int button)
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
@ FONTTYPE_REGULAR
Definition gGUIManager.h:44
@ FONT_FREESANS
Definition gGUIManager.h:51
Definition gGUITextbox.h:46
int fontstate
Definition gGUIGrid.h:41
float cellw
Definition gGUIGrid.h:47
bool readonly
Definition gGUIGrid.h:54
int fontsize
Definition gGUIGrid.h:42
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:56
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
int cellx
Definition gGUIGrid.h:36
gColor cellfontcolor
Definition gGUIGrid.h:52
@ TYPE_STRING
Definition gGUIGrid.h:27
@ TYPE_DIGIT
Definition gGUIGrid.h:28
float cellh
Definition gGUIGrid.h:46
int fontnum
Definition gGUIGrid.h:40