Gnm.SheetObject¶
- Subclasses:
Gnm.CellCombo
,Gnm.Comment
,Gnm.FilterCombo
,Gnm.SOFilled
,Gnm.SOLine
,Gnm.SOPath
,Gnm.SOPolygon
,Gnm.SheetObjectComponent
,Gnm.SheetObjectGraph
,Gnm.SheetObjectImage
,Gnm.SheetObjectWidget
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
anchor |
r |
||
flags |
r |
||
name |
r |
||
parent_object |
r |
||
realized_list |
[ |
r |
|
sheet |
r |
Class Details¶
- class Gnm.SheetObject(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
- Parameters:
view (
Gnm.SheetObjectView
) –Gnm.SheetObjectView
actions ([
Gnm.SheetObjectAction
]) – array of actions.i (
int
) – index of first action to add in the array.
- Returns:
the newly constructed
Gtk.Menu
.- Return type:
Builds the contextual menu for view.
- classmethod move_do(objects, anchors, objects_created)¶
- Parameters:
objects ([
Gnm.SheetObject
]) –anchors ([
Gnm.SheetObjectAnchor
]) –objects_created (
bool
) –
- Returns:
the newly allocated
GOffice.Undo
.- Return type:
- classmethod move_undo(objects, objects_created)¶
- Parameters:
objects ([
Gnm.SheetObject
]) –objects_created (
bool
) –
- Returns:
the newly allocated
GOffice.Undo
.- Return type:
- classmethod pts_to_anchor(anchor, sheet, res_pts)¶
- Parameters:
anchor (
Gnm.SheetObjectAnchor
) –sheet (
Gnm.Sheet
) –res_pts (
float
) –
- clear_sheet()¶
Removes self from its container, unrealizes all views, disconnects the associated data and unrefs the object
- component_get_component()¶
- Returns:
the embedded
GOffice.Component
orNone
on error.- Return type:
- component_set_component(component)¶
- Parameters:
component (
GOffice.Component
) –
- default_size()¶
- Returns:
- w:
a ptr into which to store the default_width.
- h:
a ptr into which to store the default_height.
- Return type:
Measurements are in pts.
- direction_set(coords)¶
- Parameters:
coords ([
float
]) – array of coordinates in L,T,R,B order
Sets the object direction from the given the new coordinates The original coordinates are assumed to be normalized (so that top is above bottom and right is at the right of left)
- draw_cairo(cr, rtl)¶
- Parameters:
cr (
cairo.Context
) –rtl (
bool
) –
Draw a sheet object using cairo.
We are assuming that the cairo context is set up so that the top left of the bounds is (0,0). Note that this is the real top left cell, not necessarily the cell with to which we are anchored.
- draw_cairo_sized(cr, width, height)¶
- Parameters:
cr (
cairo.Context
) –width (
float
) –height (
float
) –
- dup()¶
- Returns:
A copy of self that is not attached to a sheet.
- Return type:
- exportable_get_target_list()¶
- Return type:
- foreach_dep(func, user)¶
- Parameters:
func (
Gnm.SheetObjectForeachDepFunc
) – #SheetObjectForeachDepFunc
Loops over each dependent contained in a sheet object and call the handler.
- get_anchor()¶
- Returns:
the
Gnm.SheetObjectAnchor
for self.- Return type:
- get_editor(sc)¶
- Parameters:
sc (
Gnm.SheetControl
) –
- get_sheet()¶
-
A small utility to help keep the implementation of SheetObjects modular.
- get_target_list()¶
- Return type:
- get_view(container)¶
- Parameters:
container (
Gnm.SheetObjectViewContainer
) –Gnm.SheetObjectViewContainer
- Returns:
the found
Gnm.SheetObjectView
orNone
.- Return type:
- graph_ensure_size()¶
Updates the size of the graph item in the canvas for graph sheets objects.
- graph_get_gog()¶
- Returns:
the embedded
GOffice.GraphGraph
orNone
on error.- Return type:
- graph_set_gog(graph)¶
- Parameters:
graph (
GOffice.GraphGraph
orNone
) –GOffice.GraphGraph
If graph is non-
None
add a reference to it, otherwise create a new graph. Assign the graph to itsGnm.SheetObjectGraph
wrapper and initialize the handlers, disconnecting any existing connection for the preceding graph.
- new_view(container)¶
- Parameters:
container (
Gnm.SheetObjectViewContainer
) –- Returns:
the new
Gnm.SheetObjectView
.- Return type:
Asks self to create a view for container.
- Parameters:
actions ([
Gnm.SheetObjectAction
]) –GLib.PtrArray
- Returns:
- Return type:
actions: [
Gnm.SheetObjectAction
]
Get a list of the actions that can be performed on self
- position_pts_get()¶
- Returns:
coordinates
- Return type:
coords: [
float
]
Calculate the position of the object self in pts from the logical position in the object.
- rubber_band_directly()¶
- save_as_image(format, resolution, url)¶
- Parameters:
- Raises:
Saves a sheet object as an image to url. If an error occurs, err will be set.
- set_anchor(anchor)¶
- Parameters:
anchor (
Gnm.SheetObjectAnchor
) –
- set_anchor_mode(mode)¶
- Parameters:
mode (
Gnm.SOAnchorMode
) –
- update_bounds(p)¶
- Parameters:
p (
Gnm.CellPos
orNone
) – A position marking the top left of the region needing relocation (default == A1)
update the bounds of an object that intersects the region whose top left is p. This is used when an objects position is anchored to cols/rows and they change position.
- write_image(format, resolution, output)¶
- Parameters:
resolution (
float
) – export resolutionoutput (
Gsf.Output
) – destination
- Raises:
Saves a sheet object as an image to output. If an error occurs, err will be set.
- write_object(format, output, err, convs)¶
- Parameters:
format (
str
) –output (
Gsf.Output
) –err (
GLib.Error
) –convs (
Gnm.Conventions
) –
- do_bounds_changed() virtual¶
- do_copy(src) virtual¶
- Parameters:
src (
Gnm.SheetObject
) –
- do_default_size() virtual¶
- Returns:
- w:
a ptr into which to store the default_width.
- h:
a ptr into which to store the default_height.
- Return type:
Measurements are in pts.
- do_draw_cairo(cr, width, height) virtual¶
- Parameters:
cr (
cairo.Context
) –width (
float
) –height (
float
) –
- do_foreach_dep(func, user) virtual¶
- Parameters:
func (
Gnm.SheetObjectForeachDepFunc
) – #SheetObjectForeachDepFunc
Loops over each dependent contained in a sheet object and call the handler.
- do_new_view(container) virtual¶
- Parameters:
container (
Gnm.SheetObjectViewContainer
) –- Returns:
the new
Gnm.SheetObjectView
.- Return type:
Asks so to create a view for container.
- Parameters:
actions ([
Gnm.SheetObjectAction
]) –GLib.PtrArray
- Returns:
- Return type:
actions: [
Gnm.SheetObjectAction
]
Get a list of the actions that can be performed on so
- do_prep_sax_parser(xin, attrs, convs) virtual¶
- Parameters:
xin (
Gsf.XMLIn
) –attrs (
libxml2.Char
) –convs (
Gnm.Conventions
) –
- do_unrealized() virtual¶
- do_user_config(s_control) virtual¶
- Parameters:
s_control (
Gnm.SheetControl
) –
- do_write_xml_sax(output, convs) virtual¶
- Parameters:
output (
Gsf.XMLOut
) –convs (
Gnm.Conventions
) –
Signal Details¶
- Gnm.SheetObject.signals.bounds_changed(sheet_object)¶
- Signal Name:
bounds-changed
- Flags:
- Parameters:
sheet_object (
Gnm.SheetObject
) – The object which received the signal
- Gnm.SheetObject.signals.unrealized(sheet_object)¶
- Signal Name:
unrealized
- Flags:
- Parameters:
sheet_object (
Gnm.SheetObject
) – The object which received the signal