Commit Graph

390 Commits

Author SHA1 Message Date
0penBrain
4116a59813 [Sheet][Bugfix] Reject alignment change for merged cell except top-left one 2021-11-21 20:57:33 -06:00
0penBrain
28d10fc6e6 [Sheet] Assert non-null pointer before using it 2021-11-21 20:57:33 -06:00
0penBrain
0e13882a65 [Sheet] Prevent duplicate call to 'nonNullCellAt' 2021-11-21 20:57:33 -06:00
wmayer
049a34645b Mod: change error text of Python wrapper when trying to access deleted view 2021-11-21 19:57:21 +01:00
wmayer
25afe523c4 Spreadsheet: [skip ci] return Py::None() instead of Py::Object() 2021-11-20 14:40:12 +01:00
Chris Hennes
a9ee8d4ffb Spreadsheet: Remove unnecessary functions & files
Remove functions from they Python code for ViewProviderSpreadsheet that
are now in SheetView, and eliminate the unneded files for SheetView now
that it's being generated by hand to facilitate pseudo-inheritance.
2021-11-20 14:40:12 +01:00
Chris Hennes
0da3bc7332 Spreadsheet: Implement Python SheetView functions
Add the following functions to the Python interface of SheetView:
* selectedRanges()
* selectedCells()
* select(cell, flags)
* select(upperLeft, lowerRight, flags)
* currentIndex()
* setCurrentIndex(cell)
2021-11-20 14:40:12 +01:00
wmayer
67cc5c9047 Gui: add MDIViewPy.cast_to_base and implement in Python wrappers for sub-classes of MDIView 2021-11-19 15:44:23 +01:00
Yorik van Havre
c4d4575eb3 Merged crowdin translations 2021-11-16 17:30:39 +01:00
Zheng, Lei
fdae470c1b App: add hiddenref() expression built-in function
Any object reference inside this function is treated as hidden to
exclude it from dependency calculation. This function allows some form
of cyclic depdenency.

Merger note: renamed from "HREF" to "HIDDENREF" to avoid confusion with
the standard "hypertext reference" use of HREF.
2021-11-14 20:45:09 -06:00
wmayer
90630795b8 Spreadsheet: several improvements
* do not simply return with Py_None from Python handler without incrementing the ref. counter as otherwise the interpreter steals a reference and the program will crash after a while
* avoid using the plain Python C API and instead use the PyCXX API
2021-11-13 21:56:15 +01:00
wmayer
7431bddea7 Spreadsheet: get access to the sheet view from the view provider via Python 2021-11-13 21:43:58 +01:00
wmayer
43b3bfcb04 Spreadsheet: in ViewProviderSheet do not add a second member to store the Python wrapper because the base class already has it
and it invalidates the wrapper in case the it is destroyed
2021-11-13 21:34:43 +01:00
wmayer
54688e7267 SpreadSheet: fix -Wunused-parameter 2021-11-13 20:45:06 +01:00
wmayer
aea7e60bf3 SpreadSheet: fix -Winconsistent-missing-override 2021-11-13 20:41:06 +01:00
wmayer
d398ee7f50 Spreadsheet: implement SheetViewPy that acts as sub-class of MDIViewPy 2021-11-13 20:40:32 +01:00
Chris Hennes
48f4277477 Spreadsheet: Expose currentIndex to Python 2021-11-12 22:54:24 -06:00
Chris Hennes
170e515f15 Spreadsheet: Add programmatic selection of cells
Implement modifying the current selection programmatically via the
ViewProvider object in both C++ and Python. This enables unit testing of
GUI tasks that require a selection, and improves scriptability of
Spreadsheet.
2021-11-12 17:33:39 -06:00
Chris Hennes
23370d3ba1 Spreadsheet: Minor code cleanup 2021-11-12 13:31:05 -06:00
Jose Luis Cercos-Pita
6c63bc3acf Expose the selected cells to Python 2021-11-12 13:19:03 -06:00
Chris Hennes
fc193e3614 Spreadsheet: Prevent marking a cell dirty when the content didn't change 2021-11-03 19:16:31 -05:00
Chris Hennes
da4ff7589f Spreadsheet: Fix copy of empty but used cell 2021-11-03 14:31:11 -05:00
Chris Hennes
bdd600ba6e 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
Chris Hennes
34fdcd1a61 Spreadsheet: Remove double-set of value on enter 2021-11-02 23:12:31 -05:00
Chris Hennes
1d8a9a86a4 Spreadsheet: Fix bug in content and alias lineedits
The two line edit widgets above the spreadsheet, one for exiting the
cell contents and one for editing the alias, were set to use the same
editing widget as the individual spreadsheet cells. Once that widget was
refactored to handle tab/enter behavior it was no longer the correct
widget for those elements. This commit changes them to
Gui::ExpressionLineEdit widgets instead, so that the Enter key works
correctly for them again.
2021-11-02 10:15:19 -05:00
Chris Hennes
7c7b30e79d [Spreadsheet] Fix missing header context menu 2021-10-31 23:38:11 -05:00
wmayer
f275893f5f Spreadsheet: [skip ci] update translation 2021-10-26 17:40:48 +02:00
wmayer
82d147b0a3 Spreadsheet: [skip ci] add sub-menu text for translation 2021-10-26 17:40:21 +02:00
luz paz
397729e33e Fix various typos
Found via `codespell -q 3 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,apoints,ba,beginn,behaviour,bloaded,bottome,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childs,colour,colours,commen,connexion,currenty,dof,doubleclick,dum,eiter,elemente,ende,feld,finde,findf,freez,hist,iff,indicies,initialisation,initialise,initialised,initialises,initialisiert,inout,ist,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oder,ontop,orgin,orginx,orginy,ot,pard,parms,pres,programm,que,recurrance,rougly,seperator,serie,sinc,strack,substraction,te,thist,thru,tread,uint,unter,vertexes,wallthickness,whitespaces -S ./.git,*.po,*.ts,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml,./build/doc/SourceDocu`
2021-10-20 18:18:33 -04:00
Zheng, Lei
64053912b1 Spreadsheet: support displaying of integer 2021-10-12 15:14:31 -05:00
Zheng, Lei
8e51d7a86d Spreadsheet: preserve component reference in cell 2021-10-12 14:58:36 -05:00
Zheng, Lei
49074f5af1 Spreadsheet: add a few context menu options 2021-10-12 14:34:58 -05:00
Chris Hennes
82e3bc5844 [Spreadsheet] Clean up compilation warnings 2021-10-12 11:53:48 -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
Chris Hennes
11c5e2b96f Merge pull request #5049 from chennes/spreadsheetPasteCleanup
[Spreadsheet] Refactor and simplify paste code
2021-10-03 13:15:57 -05:00
donovaly
56a9f4f144 [Spreadsheet] fix preferences UI
- add missing layouts (Qt's designer warns too)
- add spacers to assure a compact layout on all screens
2021-10-03 13:44:44 +02:00
Yorik van Havre
140e03301e Updated ts files 2021-09-29 14:32:12 +02:00
mwganson
2e021e5880 [Spreadsheet] add preference page and 3 import/export parameters 2021-09-27 22:05:36 -05:00
Chris Hennes
3d85ad70b5 Merge branch 'master' into spreadsheetPasteCleanup 2021-09-24 07:59:21 -05:00
Yorik van Havre
6ad3530981 Merged crowdin translations 2021-09-23 17:14:48 +02:00
Chris Hennes
4ebfb0c7f4 [Spreadsheet] Add support for copying empty cells 2021-09-21 14:32:42 -05:00
Chris Hennes
bbee3f05eb [Spreadsheet] Refactor and simplify paste code 2021-09-20 16:12:16 -05:00
mwganson
eb88ebafaf [Spreadsheet] Prevent infinite loop when copy/paste of non-rectangular selection 2021-09-14 15:15:59 -05:00
Yorik van Havre
34d28ac985 Merge pull request #5015 from Roy-043/Spreadsheet-importXLSX
Spreadsheet importXLSX: Added floor and ceil functions.
2021-09-07 12:45:03 +02:00
Yorik van Havre
a9717a1e17 Merged crowdin translations 2021-09-07 11:26:48 +02:00
Roy-043
5221175455 Spreadsheet importXLSX: Added floor and ceil functions. Fixed aliasRef is None issue.
See https://forum.freecadweb.org/viewtopic.php?f=3&t=61807&p=530473#p530413
2021-09-07 09:26:39 +02:00
Yorik van Havre
199e8a8d6e Merged crowdin translations 2021-08-26 14:51:36 +02:00
Yorik van Havre
834933866e Merged crowdin translations 2021-07-08 16:06:38 +02:00
Yorik van Havre
da508e30b0 Merged crowdin translations 2021-07-01 13:56:25 +02:00
Yorik van Havre
acedf491f3 Merged crowdin translations 2021-06-24 17:22:19 +02:00