Commit Graph

33 Commits

Author SHA1 Message Date
0penBrain
b33478f8d0 Sheet: update commands status when selection is changed
Notice it doesn't cover the case of the context menu actions
 Partially fixes #6744
2022-04-15 12:14:55 -05:00
wmayer
2a2b8835c0 Spreadsheet: modernize C++11
* use nullptr
2022-03-23 19:26:14 +01:00
wmayer
91e4e468dd Base: move ILogger sub-classes to their own source files in order to reduce including stream classes in client code 2022-03-06 10:13:47 +01:00
wmayer
5e0cfc64ee App: use forward declarations 2022-03-04 21:09:46 +01:00
Zheng, Lei
c7255f196b Spreadsheet: improve copy/cut/paste cells
Add color bound around user copy/cut ranges. Do not touch Spreadsheet
object when cutting, only do so when pasting.
2021-12-21 21:41:02 -07:00
Zheng, Lei
7ebb142b2c Spreadsheet: add menu action 'Configuration table...'
To make it easy for user to create dynamically switchable configuration
tables using spreadsheet.
2021-12-21 21:41:02 -07:00
Zheng, Lei
0c2c334f87 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
Zheng, Lei
55e2c918a9 Spreadsheet: support paste into cell range
For single range copy, the range selection when pasting determines the
start cell and the number of duplications.

For example, when copying a range A1:B2 (i.e. a 2x2 square) and pasting
into a selection of C1:C5 (i.e. a 5x1 vertical line), the square will be
duplicated once in horizontal, but twice in vertical, resulting new
cells range from C1:D4. This logic is borrowed from google sheet.

For multi-ranged copy, no multi duplication is intended. If more than
one selection range exists before pasting, only the top left cell of
the last selected range is used to determine the starting cell for
pasting. The cells will be copied with the exact cell layout keeping any
empty cells in between. This logic is different from google sheet, where
it disallows unalligned multi-ranged copy, and will condense and
eliminate any empty cells for aligned multi-range copy.
2021-12-21 21:41:02 -07:00
wmayer
45de32c4e1 Spreadsheet: fix format of table cells when used for printing, by default use landscape orientation 2021-12-05 12:16:54 +01:00
wmayer
1d3822822d Spreadsheet: issue 0002957: spreadsheet direct printing 2021-12-04 23:36:11 +01:00
Chris Hennes
7c7b30e79d [Spreadsheet] Fix missing header context menu 2021-10-31 23:38:11 -05:00
Zheng, Lei
49074f5af1 Spreadsheet: add a few context menu options 2021-10-12 14:34:58 -05:00
Chris Hennes
8aa22d1a68 [Spreadsheet] Refactor keyboard handling
LineEdit no longer actually handles motion, it simply indicates which
action was taken to cause it to lose focus (e.g. which key was pressed).
It's up to the client code to determine what this means. This allows
significant consolidation of keyboard-handling logic, and the
implementation of more extensive keyboard navigation features.

New keyboard shortcuts include a tab counter to implement auto-return,
plus Ctrl->Arrow, End, Home, Ctrl-End, and Ctrl-Home, matching the
behavior of OpenOffice, LibreOffice, etc.

Block selection via keyboard has also been added by holding down the
shift key during navigation with the arrow keys (this also works in
combination with the Ctrl modifier for region navigation).
2021-10-08 14:55:39 -05:00
wmayer
f4e0abc9d2 Spreadsheet: [skip ci] fix gcc warnings about unused variables 2021-04-03 12:21:42 +02:00
Benjamin Nauck
4e4a8df724 Spreadsheet: Fix UI issues when trying to insert rows/cols
* Add support for better translations (using pluralizations)
* Add support for inserting rows/columns after the selection
* Informs the user that it will insert rows/cols above/under/left/right of the selection
* Informs the user how many rows/cols that will be inserted
2021-04-02 19:33:06 +02:00
luz paz
786d84d288 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
wmayer
d6169d6478 boost: fix for boost < 1.60 2020-06-15 19:38:39 +02:00
wmayer
730154a684 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
asapelkin
ced8100ab9 use emplace_back instead of push_back where justified 2019-11-21 14:48:09 +01:00
wmayer
f50dc8e652 [skip ci] fix more -Wgnu-zero-variadic-macro-arguments 2019-11-17 15:14:18 +01:00
Zheng, Lei
43d4b9a497 Spreadsheet: column/row select on right click 2019-10-07 17:24:30 +02:00
Zheng, Lei
f1b569621a Split App::AutoTransaction into its own file 2019-09-10 14:17:07 +02:00
Zheng, Lei
11321bb996 Spreadsheet changes
Various changes to support in-place editing, and more.
2019-08-17 15:15:47 +02:00
wmayer
4accbb257c Fix scan coverity issues:
CID 184299:  Null pointer dereferences  (FORWARD_NULL)
CID 184297:  Error handling issues  (UNCAUGHT_EXCEPT)
CID 184296:  Uninitialized members  (UNINIT_CTOR)
CID 184292:  Uninitialized members  (UNINIT_CTOR)
2018-11-13 13:20:16 +01:00
wmayer
3ea9b6ca70 implement cut/copy/paste in spreadsheet view 2018-10-09 00:02:53 +02:00
wmayer
4d47ce619e fixes #0002833: [Spreadsheet] Keyboard events are sent to the wrong viewprovider 2018-09-12 17:40:57 +02:00
wmayer
2af6bb6e49 replace deprecated auto_ptr with unique_ptr 2016-09-22 13:01:20 +02:00
wmayer
9a38507c76 fix Coverity issues 2016-08-21 23:13:22 +02:00
Eivind Kvedalen
ae111d11b5 Spreadsheet: Removed own expression parser and instead use the one in App. 2016-04-02 12:01:04 +02:00
Eivind Kvedalen
899956cd51 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
a8e9a0a77f Spreadsheet: Added direct alias command. 2015-10-11 09:41:14 +02:00
wmayer
0a06b2b703 + fix various warnings 2015-08-29 23:01:19 +02:00
Eivind Kvedalen
935ec5b034 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