Commit Graph

29 Commits

Author SHA1 Message Date
Zheng, Lei
68fca40983 Spreadsheet: support cell binding
Cell binding allows one to bind a range of cells of one sheet to another
range of cells of an arbitary sheet, including any empty cells in the
range.

The binding is implemented with PropertyExpressionEngine and
PropertySheet::setPathValue(), which binds a special path of
PropertySheet, such as

    .cells.Bind.A1.D1

to an expression, such as

     tuple(.cells, <<A2>>, <<A5>>)

The A1 and D1 in the example above specifies the binding start and end
cell address. And <<A2>> and <<A5>> are the range of cells to bind to.
Note that you can use any expression that evalutes to string for the
binding destination, e.g. <<A%d>> % B1, which uses the value inside B1
to construct the binding destination. The '.cells' in the tuple shown
above is an example to bind cells of the same PropertySheet. It can be
change to to reference to any other spreadsheet, even those outside the
current document, e.g. Document#Spreadsheet001.cells
2021-12-21 21:41:02 -07:00
Chris Hennes
bcab6b5a31 Spreadsheet: Prevent marking a cell dirty when the content didn't change 2021-11-03 19:16:31 -05:00
Chris Hennes
56d900c669 Spreadsheet: Display new value, or pending, when dirty
If recomputes are turned off, the old behavior was that a cell would
display its old property value in the SheetView. The new behavior is
that we check to see if the value is actually something that gets
computed: if so, show "#PENDING". If not, display the new value, but
format it specially to indicate that it's been changed and that
a recompute is (eventually) needed.
2021-11-03 09:23:43 -05:00
Zheng, Lei
ec27c67dc0 Spreadsheet: support displaying of integer 2021-10-12 15:14:31 -05:00
Chris Hennes
b1f8184858 Remove unneeded Qt version checks 2021-03-28 17:41:27 +02:00
Chris Hennes
b15f134038 Remove deprecated Qt constants
Qt has deprecated the following constants, this commit replaces them
with their new equivalent/replacement:

Qt::TextColorRole -> Qt::ForegroundRole
Qt::BackgroundColorRole -> Qt::BackgroundRole
QPainter::HighQualityAntialiasing -> QPainter::Antialiasing
QPalette::Foreground -> QPalette::WindowText
2021-03-28 17:03:09 +02:00
luz paz
7b6af35e6c Spreadsheet: Issue #0004473: Expose openCommand() to translation
Continuing the work to expose the undo/redo functionality to translation. This commit does so for the Spreadsheet Wb.  
Ticket: https://tracker.freecadweb.org/view.php?id=4473
2020-12-01 14:53:35 +01:00
luz paz
5bd5f3a963 Spreadsheet: Fix header uniformity + trailing whitespace
[skip ci]
2020-11-27 19:39:06 +01:00
wmayer
06152bf12a Spreadsheet: [skip ci] disable unused function 2020-09-09 21:18:31 +02:00
wmayer
556630ffdf Spreadsheet: [skip ci] use global scheme to display quantities in a spreadsheet table 2020-09-09 16:28:55 +02:00
wmayer
f3b460e42e boost: fix for boost < 1.60 2020-06-15 19:38:39 +02:00
wmayer
4ec45b545e boost 1.73.0: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated 2020-06-12 17:51:33 +02:00
wmayer
ec8b1bc072 [skip ci] use QLocale class consistently to make it possible to change it application-wide 2020-03-26 16:37:45 +01:00
Zheng, Lei
e911b69769 Spreadsheet changes
Various changes to support in-place editing, and more.
2019-08-17 15:15:47 +02:00
wmayer
58aa9b183e fixes 0003876: Spreadsheet WB does not respect number of decimal settings
fixes 0003875: Spreadsheet workbench does not respect locale for decimal separator
2019-03-02 23:07:49 +01:00
wmayer
7480544967 fix typo 2018-03-11 18:34:18 +01:00
Eivind Kvedalen
614a914926 Spreadsheet: Fixed dead code issue reported by Coverity (128977). 2016-12-15 17:27:18 +01:00
wmayer
6cf82fbe62 fix -Wextra & -Wdeprecated in Spreadsheet 2016-09-22 16:35:05 +02:00
wmayer
8e71e4038b fix Coverity issues 2016-08-21 23:13:22 +02:00
Eivind Kvedalen
a21571a652 Spreadsheet: Removed own expression parser and instead use the one in App. 2016-04-02 12:01:04 +02:00
Eivind Kvedalen
e523638c75 Spreadsheet: Enable tooltip for error messages. 2016-01-08 23:09:00 +01:00
Eivind Kvedalen
b7480210fd Spreadsheet: Issue #2301: Handle enter/return and tab keys the same as e.g OpenOffice and Excel. 2015-11-28 12:56:27 +01:00
Eivind Kvedalen
9fe3b0146a Spreadsheet: Added alias as tooltip. Made background of cell light yellow if an alias is defined for it. Can be overridden by setting a background color. 2015-10-11 09:41:14 +02:00
Eivind Kvedalen
4f589f6d60 Spreadsheet: Use Base::fromStdString/toStdString. 2015-09-21 14:51:01 +02:00
Eivind Kvedalen
61cbad8a12 Spreadsheet: Removed 'using namespace App'; preparation for moving Expression
classes to App.
2015-09-21 14:51:00 +02:00
wmayer
cac09437c8 + fix various warnings 2015-08-29 23:01:19 +02:00
Eivind Kvedalen
3743008cda - Self-reference bug
- Refactoring/clean-up of code
- Dependency tracking of aliased cells
- Various resolution errors
- Rewriting of ranges when columns/rows are inserted/removed
- References to aliases keep their units.
2015-03-04 22:18:20 +01:00
Eivind Kvedalen
d153fb2dbd + Fixed merge of cells to retain value in upper left cell+ Replaced std::map::at() with iterators and find. Removed some superfluous calls to std::map::find()
+ Visual Studio fixes
+ Fixed return values
+ Removed unused variables
2015-02-13 21:53:59 +01:00
Eivind Kvedalen
383ffa6e15 Initial implementation of Spreadsheet module (C++ version) by Eivind Kvedalen.
Various fixes for Windows by
Peter Lama <peterldev94@gmail.com>
Werner Mayer <wmayer@users.sourceforge.net>
2015-02-13 21:53:58 +01:00