Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4842 from 0penBrain/getSheetPy
[Spreadsheet] Expose SpreadsheetView::getSheet to Python
- Loading branch information
Showing
4 changed files
with
69 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<GenerateModel xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="generateMetaModel_Module.xsd"> | ||
<PythonExport | ||
Father="PyObjectBase" | ||
Name="SpreadsheetViewPy" | ||
Twin="SheetView" | ||
TwinPointer="SheetView" | ||
Include="Mod/Spreadsheet/Gui/SpreadsheetView.h" | ||
Namespace="SpreadsheetGui" | ||
FatherInclude="Base/PyObjectBase.h" | ||
FatherNamespace="Base"> | ||
<Documentation> | ||
<Author Licence="LGPL" Name="openBrain" EMail="" /> | ||
<UserDocu>SpreadsheetView object</UserDocu> | ||
</Documentation> | ||
<Methode Name="getSheet"> | ||
<Documentation> | ||
<UserDocu>returns the sheet being displayed</UserDocu> | ||
</Documentation> | ||
</Methode> | ||
<CustomAttributes /> | ||
</PythonExport> | ||
</GenerateModel> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#include "PreCompiled.h" | ||
|
||
#include "SpreadsheetViewPy.h" | ||
#include "SpreadsheetViewPy.cpp" | ||
|
||
#include <Mod/Spreadsheet/App/SheetPy.h> | ||
|
||
using namespace SpreadsheetGui; | ||
|
||
PyObject* SpreadsheetViewPy::getSheet(PyObject *args) | ||
{ | ||
if (!PyArg_ParseTuple(args, "")) | ||
return nullptr; | ||
return new Spreadsheet::SheetPy(getSheetViewPtr()->getSheet()); | ||
} | ||
|
||
// returns a string which represents the object e.g. when printed in python | ||
std::string SpreadsheetViewPy::representation(void) const | ||
{ | ||
return std::string("<SheetView object>"); | ||
} | ||
|
||
PyObject *SpreadsheetViewPy::getCustomAttributes(const char* /*attr*/) const | ||
{ | ||
return 0; | ||
} | ||
|
||
int SpreadsheetViewPy::setCustomAttributes(const char* /*attr*/, PyObject* /*obj*/) | ||
{ | ||
return 0; | ||
} |