Commit Graph

386 Commits

Author SHA1 Message Date
wmayer
2c701c0985 Spreadsheet: [skip ci] return Py::None() instead of Py::Object() 2021-11-20 14:40:12 +01:00
Chris Hennes
d60a0fb760 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
79a0c6b54c 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
8eb099d4e1 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
a26fb4db1a Merged crowdin translations 2021-11-16 17:30:39 +01:00
Zheng, Lei
14dfae0597 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
5eb97d0028 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
63e1f95a97 Spreadsheet: get access to the sheet view from the view provider via Python 2021-11-13 21:43:58 +01:00
wmayer
1e3b97f619 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
00846945d5 SpreadSheet: fix -Wunused-parameter 2021-11-13 20:45:06 +01:00
wmayer
b308645654 SpreadSheet: fix -Winconsistent-missing-override 2021-11-13 20:41:06 +01:00
wmayer
5f7b8214e5 Spreadsheet: implement SheetViewPy that acts as sub-class of MDIViewPy 2021-11-13 20:40:32 +01:00
Chris Hennes
093f15dce5 Spreadsheet: Expose currentIndex to Python 2021-11-12 22:54:24 -06:00
Chris Hennes
37dbcf7f66 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
179c6b540e Spreadsheet: Minor code cleanup 2021-11-12 13:31:05 -06:00
Jose Luis Cercos-Pita
16bbe12336 Expose the selected cells to Python 2021-11-12 13:19:03 -06: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
b8ad042986 Spreadsheet: Fix copy of empty but used cell 2021-11-03 14:31:11 -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
Chris Hennes
123b5b5da1 Spreadsheet: Remove double-set of value on enter 2021-11-02 23:12:31 -05:00
Chris Hennes
0d511a6dd2 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
ba2459cddc [Spreadsheet] Fix missing header context menu 2021-10-31 23:38:11 -05:00
wmayer
b60ed6140f Spreadsheet: [skip ci] update translation 2021-10-26 17:40:48 +02:00
wmayer
c2fdeae7aa Spreadsheet: [skip ci] add sub-menu text for translation 2021-10-26 17:40:21 +02:00
luz paz
42e8287699 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
ec27c67dc0 Spreadsheet: support displaying of integer 2021-10-12 15:14:31 -05:00
Zheng, Lei
93beb9fabd Spreadsheet: preserve component reference in cell 2021-10-12 14:58:36 -05:00
Zheng, Lei
127e8098e8 Spreadsheet: add a few context menu options 2021-10-12 14:34:58 -05:00
Chris Hennes
8fceac1762 [Spreadsheet] Clean up compilation warnings 2021-10-12 11:53:48 -05:00
Chris Hennes
403a569315 [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
c9d28ac9f5 Merge pull request #5049 from chennes/spreadsheetPasteCleanup
[Spreadsheet] Refactor and simplify paste code
2021-10-03 13:15:57 -05:00
donovaly
3833fe21ed [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
77925c428e Updated ts files 2021-09-29 14:32:12 +02:00
mwganson
0be3565dbe [Spreadsheet] add preference page and 3 import/export parameters 2021-09-27 22:05:36 -05:00
Chris Hennes
f2dc749170 Merge branch 'master' into spreadsheetPasteCleanup 2021-09-24 07:59:21 -05:00
Yorik van Havre
b042405933 Merged crowdin translations 2021-09-23 17:14:48 +02:00
Chris Hennes
a27d270fa9 [Spreadsheet] Add support for copying empty cells 2021-09-21 14:32:42 -05:00
Chris Hennes
f4c50e3701 [Spreadsheet] Refactor and simplify paste code 2021-09-20 16:12:16 -05:00
mwganson
d02e708e75 [Spreadsheet] Prevent infinite loop when copy/paste of non-rectangular selection 2021-09-14 15:15:59 -05:00
Yorik van Havre
e19c086116 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
89e1a97d80 Merged crowdin translations 2021-09-07 11:26:48 +02:00
Roy-043
4339e47582 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
49abe81271 Merged crowdin translations 2021-08-26 14:51:36 +02:00
Yorik van Havre
1cee70cd62 Merged crowdin translations 2021-07-08 16:06:38 +02:00
Yorik van Havre
ed9dca288c Merged crowdin translations 2021-07-01 13:56:25 +02:00
Yorik van Havre
c8b5d8d762 Merged crowdin translations 2021-06-24 17:22:19 +02:00
Yorik van Havre
69b084f492 Merged crowdin translations 2021-06-17 16:04:02 +02:00
Yorik van Havre
4a9963a03f Merged crowdin translations 2021-06-10 12:24:24 +02:00
0penBrain
6e7136284f [Spreadsheet] Expose SpreadsheetView::getSheet to Python 2021-06-07 21:18:26 +02:00
Yorik van Havre
d0d637b2c6 merged crowdin translations 2021-06-03 15:43:34 +02:00