Gnm.Sheet¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
class |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w/co |
Columns number in the sheet |
||
r/w |
How to format displayed expressions, (A1 vs R1C1, function names, …) |
||
r/w |
Control whether column headers are shown. |
||
r/w |
Control whether formulæ are shown instead of values. |
||
r/w |
Control whether the grid is shown. |
||
r/w |
Control whether outlines are shown. |
||
r/w |
Control whether outline symbols are shown below. |
||
r/w |
Control whether outline symbols are shown to the right. |
||
r/w |
Control whether |
||
r/w |
Control whether zeros are shown are blanked out. |
||
r/w |
The name of the sheet. |
||
r/w |
|
||
r/w |
Allow cell format changes while a sheet is protected |
||
r/w |
Allow column formatting while a sheet is protected |
||
r/w |
Allow columns to be deleted while a sheet is protected |
||
r/w |
Allow rows to be deleted while a sheet is protected |
||
r/w |
Allow auto filters to be edited while a sheet is protected |
||
r/w |
Allow objects to be edited while a sheet is protected |
||
r/w |
Allow pivottable to be edited while a sheet is protected |
||
r/w |
Allow scenarios to be edited while a sheet is protected |
||
r/w |
Allow columns to be inserted while a sheet is protected |
||
r/w |
Allow hyperlinks to be inserted while a sheet is protected |
||
r/w |
Allow rows to be inserted while a sheet is protected |
||
r/w |
Allow |
||
r/w |
Allow the user to select locked cells while a sheet is protected |
||
r/w |
Allow the user to select unlocked cells while a sheet is protected |
||
r/w |
Allow ranges to be sorted while a sheet is protected |
||
r/w/co |
Rows number in the sheet |
||
r/w/co |
Which type of sheet this is. |
||
r/w |
The background color of the tab. |
||
r/w |
The foreground color of the tab. |
||
r/w |
Text goes from right to left. |
||
r/w |
How to format displayed expressions, (a convenience api) |
||
r/w |
How visible the sheet is. |
||
r/w/co |
The |
||
r/w/c |
The level of zoom used for this sheet. |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
base |
r |
||
being_constructed |
r |
||
being_destructed |
r |
||
being_invalidated |
r |
||
cell_hash |
r |
||
cols |
r |
||
conditions |
r |
||
convs |
r |
||
deps |
r |
||
display_formulas |
r |
||
display_outlines |
r |
||
filters |
[ |
r |
|
has_filtered_rows |
r |
||
hash_merged |
r |
||
hide_col_header |
r |
||
hide_grid |
r |
||
hide_row_header |
r |
||
hide_zero |
r |
||
index_in_wb |
r |
||
is_protected |
r |
||
last_zoom_factor_used |
r |
||
list_merged |
[ |
r |
|
max_object_extent |
r |
||
name_case_insensitive |
r |
||
name_quoted |
r |
||
name_unquoted |
r |
||
name_unquoted_collate_key |
r |
||
names |
r |
||
outline_symbols_below |
r |
||
outline_symbols_right |
r |
||
pending_redraw |
[ |
r |
|
pending_redraw_src |
r |
||
print_info |
r |
||
priv |
r |
||
rendered_values |
r |
||
revive |
r |
||
rows |
r |
||
scenarios |
[ |
r |
|
sheet_objects |
[ |
r |
|
sheet_type |
r |
||
sheet_views |
[ |
r |
|
simulation_round |
r |
||
size |
r |
||
slicers |
[ |
r |
|
solver_parameters |
r |
||
sort_setups |
r |
||
style_data |
r |
||
tab_color |
r |
||
tab_text_color |
r |
||
text_is_rtl |
r |
||
tile_top_level |
r |
||
visibility |
r |
||
workbook |
r |
Class Details¶
- class Gnm.Sheet(**kwargs)¶
- Bases:
- Abstract:
No
- classmethod apply_style_undo(sr, style)¶
- Parameters:
sr (
Gnm.SheetRange
) –Gnm.SheetRange
- Returns:
the new
GOffice.Undo
.- Return type:
- classmethod cell_set_expr(cell, texpr)¶
- Parameters:
texpr (
Gnm.ExprTop
) – New expression for cell.
Marks the sheet as dirty Clears old spans. Flags status updates Queues recalcs
- classmethod clear_region_undo(sr, clear_flags)¶
- Parameters:
sr (
Gnm.SheetRange
) –Gnm.SheetRange
clear_flags (
int
) – flags.
- Returns:
the new
GOffice.Undo
.- Return type:
- Parameters:
conds (
Gnm.StyleConditions
) –- Returns:
Conditions equivalent to conds, or
None
if conds had not been seen before.- Return type:
- Parameters:
conds (
Gnm.StyleConditions
) –
This notifies the sheet conditions manager that one use of the shared conditions has gone away.
- classmethod flag_status_update_cell(cell)¶
- Parameters:
cell (
Gnm.Cell
) – The cell that has changed.
flag the sheet as requiring an update to the status display if the supplied cell location is the edit
Gnm.cursor
, or part of the selected region.Will cause the format
Gnm.toolbar
, the edit area, and the auto expressions to be updated if appropriate.
- classmethod merge_relocate(ri)¶
- Parameters:
ri (
Gnm.ExprRelocateInfo
) – Descriptor of what is moving.- Returns:
Undo information.
- Return type:
pundo:
GOffice.Undo
Shifts merged regions that need to move.
- classmethod move_range(rinfo, cc)¶
- Parameters:
rinfo (
Gnm.ExprRelocateInfo
) –cc (
GOffice.CmdContext
) – The command context
- Returns:
undo object
- Return type:
pundo:
GOffice.Undo
Move a range as specified in rinfo report warnings to cc. if pundo is non-
None
, invalidate references to the target region that are being cleared, and store the undo information in pundo. If it isNone
do NOT INVALIDATE.
- classmethod new(wb, name, columns, rows)¶
- Parameters:
wb (
Gnm.Workbook
) –Gnm.Workbook
name (
str
) – The name for the sheet (unquoted).columns (
int
) – The requested columns number.rows (
int
) – The requested rows number.
- Returns:
the newly allocated sheet.
- Return type:
Create a new
Gnm.Sheet
of type SHEET_DATA, and associate it with wb. The type cannot be changed later
- classmethod new_with_type(wb, name, type, columns, rows)¶
- Parameters:
wb (
Gnm.Workbook
) –Gnm.Workbook
name (
str
) – An unquoted nametype (
Gnm.SheetType
) – GnmSheetTypecolumns (
int
) – The number of columns for the sheetrows (
int
) – The number of rows for the sheet
- Returns:
the newly allocated sheet.
- Return type:
Create a new
Gnm.Sheet
of type type, and associate it with wb. The type cannot be changed later.
- classmethod objects_relocate(rinfo, update)¶
- Parameters:
rinfo (
Gnm.ExprRelocateInfo
) – details on what should be moved.update (
bool
) – Should we do the bound_update now, or leave it for later. ifFalse
honour the move_with_cells flag.
- Returns:
add dropped objects to
::objects
- Return type:
pundo:
GOffice.Undo
Uses the relocation info and the anchors to decide whether or not, and how to relocate objects when the grid moves (eg ins/del
Gnm.col
/Gnm.row
).
- classmethod style_insdel_colrow(rinfo)¶
- Parameters:
rinfo (
Gnm.ExprRelocateInfo
) –
Insert of delete style columns/rows.
For the insert case, we stretch the preceding column/
Gnm.row
into there space we open.
- classmethod style_relocate(rinfo)¶
- Parameters:
rinfo (
Gnm.ExprRelocateInfo
) –
Slide the styles from the origin region to the new position.
- classmethod suggest_size(cols, rows)¶
- Parameters:
- Returns:
- cols:
number of columns
- rows:
number of rows
- Return type:
This function produces a valid sheet size that is reasonable for data of cols columns by rows rows. If possible, this will be a size bigger in both dimensions. However, that is not always possible and when it is not, the suggested will be smaller in one or both directions.
- apply_border(range, borders)¶
- Parameters:
borders ([
Gnm.Border
]) – Border styles to set.
- apply_style(range, style)¶
- Parameters:
A mid level routine that applies the supplied partial style style to the target range and performs the necessary respanning and redrawing.
- cell_create(col, row)¶
-
Creates a new cell and adds it to the sheet hash.
- cell_fetch(col, row)¶
- cell_foreach(callback, *data)¶
- Parameters:
callback (
GLib.HFunc
) –
Call callback with an argument of data for each cell in the sheet
- cell_get(col, row)¶
- cell_get_value(col, row)¶
- cell_positions(comments)¶
- Parameters:
comments (
bool
) – If true, include cells with only comments also.- Returns:
the newly created array
- Return type:
Collects a
GLib.PtrArray
ofGnm.EvalPos
pointers for all cells in a sheet. No particular order should be assumed.
- cell_remove(cell, redraw, queue_recalc)¶
-
Remove the cell from the web of dependencies of a sheet. Do NOT free the cell, optionally redraw it, optionally queue it for recalc.
- cell_set_text(col, row, str)¶
-
Sets the contents of a cell.
- cell_set_value(col, row, v)¶
-
Set the
GOffice.value
of the cell at (col,`row`) to v.The
GOffice.value
is rendered and spans are calculated. It queues a redraw and checks to see if the edit region or selection content changed.
- cells(r)¶
-
Retrieves an array of all cells inside r.
- cells_count()¶
- Return type:
Returns the number of cells with content in the current
GOffice.workbook
.
- clear_region(start_col, start_row, end_col, end_row, clear_flags, cc)¶
- Parameters:
start_col (
int
) – Starting columnstart_row (
int
) – StartingGnm.row
end_col (
int
) – Ending columnend_row (
int
) – EndingGnm.row
clear_flags (
Gnm.SheetClearFlags
) – flags indicating what to clearcc (
GOffice.CmdContext
orNone
) – command context for error reporting
Clears a region of cells, formats, object, etc. as indicated by clear_flags.
- col_fetch(col)¶
- Parameters:
col (
int
) – Column number- Returns:
The
Gnm.ColRowInfo
for column col. This result will not be the defaultGnm.ColRowInfo
and may be changed.- Return type:
- col_get(col)¶
- Parameters:
col (
int
) – Column number- Returns:
A
Gnm.ColRowInfo
for the column, orNone
if none has been allocated yet.- Return type:
- col_get_default_size_pts()¶
- Returns:
the default number of pts in a column, including margins. This function returns the raw sum, no rounding etc.
- Return type:
- col_get_distance_pixels(from_, to)¶
- col_get_distance_pts(from_, to)¶
- col_get_info(col)¶
- Parameters:
col (
int
) – Column number- Returns:
The
Gnm.ColRowInfo
for column col. This may be the defaultGnm.ColRowInfo
for columns and should not be changed.- Return type:
- col_set_size_pixels(col, width_pixels, set_by_user)¶
- col_set_size_pts(col, width_pts, set_by_user)¶
- Parameters:
Sets width of a
Gnm.col
in pts, INCLUDING left and right margins, and the far grid line. This is a low level internal routine. It does NOT redraw, or reposition objects.
- col_size_fit_pixels(col, srow, erow, ignore_strings)¶
- Parameters:
col (
int
) – the column that we want to querysrow (
int
) – startingGnm.row
.erow (
int
) – endingGnm.row
.ignore_strings (
bool
) – skip cells containing string values. Currently this flags doubles as an indicator that numeric cells should only cause a widening when they would otherwise cause “####” to be displayed.
- Returns:
Maximum size in pixels INCLUDING margins and grid lines or 0 if there are no cells.
- Return type:
This routine computes the ideal size for the column to make the contents all cells in the column visible.
- colrow_can_group(r, is_cols)¶
- colrow_copy_info(colrow, is_cols, cri)¶
- Parameters:
colrow (
int
) –is_cols (
bool
) –cri (
Gnm.ColRowInfo
) –
- colrow_fetch(colrow, is_cols)¶
- Parameters:
- Return type:
- colrow_foreach(is_cols, first, last, callback, *user_data)¶
- Parameters:
first (
int
) – start position (inclusive)last (
int
) – stop position (inclusive), -1 meaning end-of-sheetcallback (
Gnm.ColRowHandler
) – A callback function which should returnTrue
to stop the iteration.
- Return type:
Iterates through the existing rows or columns within the range supplied. If a callback returns
True
, iteration stops.
- colrow_get(colrow, is_cols)¶
- Parameters:
- Return type:
- colrow_get_default(is_cols)¶
- Parameters:
- Returns:
the default
Gnm.ColRowInfo
.- Return type:
- colrow_get_distance_pixels(is_cols, from_, to)¶
- colrow_get_info(colrow, is_cols)¶
- Parameters:
- Return type:
- colrow_group_ungroup(r, is_cols, inc)¶
- colrow_gutter(is_cols, max_outline)¶
-
Set the maximum outline levels for cols or rows.
- colrow_optimize()¶
- conditions_dump()¶
- conditions_init()¶
- conditions_simplify()¶
- conditions_uninit()¶
- date_conv()¶
- Returns:
the date conventions in effect for the sheet. This is purely a convenience function to access the conventions used for the
GOffice.workbook
. All sheets in aGOffice.workbook
share the same date conventions.- Return type:
- delete_cols(col, count, cc)¶
- Parameters:
col (
int
) – At which position we want to start deleting columnscount (
int
) – The number of columns to be deletedcc (
GOffice.CmdContext
) – The command context
- Returns:
- pundo:
(transfer full): (allow-none): undo closure
- Return type:
(
bool
, pundo:GOffice.Undo
)
- delete_rows(row, count, cc)¶
- Parameters:
row (
int
) – At which position we want to start deleting rowscount (
int
) – The number of rows to be deletedcc (
GOffice.CmdContext
) – The command context
- Returns:
- pundo:
(transfer full): (allow-none): undo closure
- Return type:
(
bool
, pundo:GOffice.Undo
)
- destroy_contents()¶
- filter_at_pos(pos)¶
- Parameters:
pos (
Gnm.CellPos
) – location to query- Returns:
Gnm.Filter
covering pos.- Return type:
Gnm.Filter
orNone
- filter_can_be_extended(f, r)¶
- Parameters:
f (
Gnm.Filter
) –r (
Gnm.Range
) –
- Returns:
- Return type:
- filter_insdel_colrow(is_cols, is_insert, start, count)¶
- Parameters:
- Returns:
location to store undo closures.
- Return type:
pundo:
GOffice.Undo
Adjust filters as necessary to handle
Gnm.col
/Gnm.row
insertions and deletions
- filter_intersect_rows(from_, to)¶
- Parameters:
- Returns:
the
Gnm.Filter
, if any, that intersects the rows from to to.- Return type:
Gnm.Filter
orNone
- find_boundary_horizontal(col, move_row, base_row, count, jump_to_boundaries)¶
- Parameters:
- Returns:
the column index.
- Return type:
Calculate the column index for the column which is count units from start_col doing bounds checking. If jump_to_boundaries is
True
then count must be 1 and the jump is to the edge of the logical range.This routine implements the logic necessary for ctrl-arrow style movement. That is more complicated than simply finding the last in a list of cells with content. If you are at the end of a range it will find the start of the next. Make sure that is the sort of behavior you want before calling this.
- find_boundary_vertical(move_col, row, base_col, count, jump_to_boundaries)¶
- Parameters:
- Returns:
the
Gnm.row
index.- Return type:
Calculate the
Gnm.row
index for theGnm.row
which is count units from start_row doing bounds checking. If jump_to_boundaries isTrue
then count must be 1 and the jump is to the edge of the logical range.This routine implements the logic necessary for ctrl-arrow style movement. That is more complicated than simply finding the last in a list of cells with content. If you are at the end of a range it will find the start of the next. Make sure that is the sort of behavior you want before calling this.
- find_sort_setup(key)¶
- flag_recompute_spans()¶
Flag the sheet as requiring a full span recomputation the next time
Gnm.Sheet.update
is called.
- flag_status_update_range(range)¶
-
flag the sheet as requiring an update to the status display if the supplied cell location contains the edit
Gnm.cursor
, or intersects of the selected region.Will cause the format
Gnm.toolbar
, the edit area, and the auto expressions to be updated if appropriate.
- flag_style_update_range(range)¶
- Parameters:
range (
Gnm.Range
) – the range that is changing.
Flag format changes that will require updating the format indicators.
- foreach_cell_in_range(flags, r, callback, closure)¶
- Parameters:
flags (
Gnm.CellIterFlags
) –callback (
Gnm.CellIterFunc
) – #CellFilterFunc
- Returns:
the
GOffice.value
returned by the callback, which can be: non-None
on error, or VALUE_TERMINATE if some invoked routine requested to stop (by returning non-None
).NOTE: between 0.56 and 0.57, the traversal order changed. The order is now
1 2 3 4 5 6 7 8 9
(This appears to be the order in which XL looks at the values of ranges.) If your code depends on any particular ordering, please add a very visible
Gnm.comment
near the call.- Return type:
For each existing cell in the range specified, invoke the callback routine. If the only_existing flag is passed, then callbacks are only invoked for existing cells.
Note: this function does not honour the
Gnm.CellIterFlags.IGNORE_SUBTOTAL
flag.
- foreach_cell_in_region(flags, start_col, start_row, end_col, end_row, callback, closure)¶
- Parameters:
flags (
Gnm.CellIterFlags
) –start_col (
int
) – Starting columnstart_row (
int
) – StartingGnm.row
end_col (
int
) – Ending column, -1 meaning lastend_row (
int
) – EndingGnm.row
, -1 meaning lastcallback (
Gnm.CellIterFunc
) – #CellFilterFunc
- Returns:
the
GOffice.value
returned by the callback, which can be: non-None
on error, or VALUE_TERMINATE if some invoked routine requested to stop (by returning non-None
).NOTE: between 0.56 and 0.57, the traversal order changed. The order is now
1 2 3 4 5 6 7 8 9
(This appears to be the order in which XL looks at the values of ranges.) If your code depends on any particular ordering, please add a very visible
Gnm.comment
near the call.- Return type:
For each existing cell in the range specified, invoke the callback routine. If the only_existing flag is passed, then callbacks are only invoked for existing cells.
Note: this function does not honour the
Gnm.CellIterFlags.IGNORE_SUBTOTAL
flag.
- foreach_name(func, *data)¶
- Parameters:
func (
GLib.HFunc
) –GLib.HFunc
Executes func for each name in self.
- get_cells_extent()¶
- Returns:
the range.
- Return type:
Calculates the area occupied by cells, including empty cells.
- get_comment(pos)¶
- Parameters:
pos (
Gnm.CellPos
) –Gnm.CellPos
const *- Returns:
the
Gnm.comment
orNone
.- Return type:
If there is a cell
Gnm.comment
at pos in self return it.Caller does get a reference to the object if it exists.
- get_conventions()¶
- Return type:
- get_extent(spans_and_merges_extend, include_hidden)¶
- Parameters:
- Returns:
the range.
- Return type:
calculates the area occupied by cell data.
NOTE: When spans_and_merges_extend is
True
, this function will calculate all spans. That might be expensive.NOTE: This refers to *visible* contents. Cells with empty values, including formulas with such values, are *ignored.
- get_printarea(include_styles, ignore_printarea)¶
- get_size()¶
- Returns:
the sheet size.
- Return type:
- get_size2(wb)¶
- Parameters:
wb (
Gnm.Workbook
orNone
) –GOffice.workbook
.- Returns:
the sheet size.
- Return type:
Determines the sheet size, either of self if that is non-
None
or of wb's default sheet. One of self and wb must be non-None
.
- get_view(wbv)¶
- Parameters:
wbv (
Gnm.WorkbookView
) –- Returns:
the view.
- Return type:
Find the
Gnm.SheetView
corresponding to the supplied wbv.
- guess_data_range(region)¶
-
Makes a guess at the logical range containing region and returns the possibly expanded result in region. The range is also expanded upwards.
- guess_region(region)¶
-
Makes a guess at the logical containing region and returns the possibly expanded result in region.
- hlink_find(pos)¶
- Parameters:
pos (
Gnm.CellPos
) – #GcmCellPos- Returns:
the found
Gnm.HLink
.- Return type:
- insert_cols(col, count, cc)¶
- Parameters:
col (
int
) – At which position we want to insertcount (
int
) – The number of columns to be insertedcc (
GOffice.CmdContext
) – The command context
- Returns:
- pundo:
(transfer full): (allow-none): undo closure
- Return type:
(
bool
, pundo:GOffice.Undo
)
- insert_rows(row, count, cc)¶
- Parameters:
row (
int
) – At which position we want to insertcount (
int
) – The number of rows to be insertedcc (
GOffice.CmdContext
) – The command context
- Returns:
- pundo:
(transfer full): (allow-none): undo closure
- Return type:
(
bool
, pundo:GOffice.Undo
)
- is_region_empty(r)¶
- mark_dirty()¶
- merge_add(r, clear, cc)¶
- Parameters:
r (
Gnm.Range
) – The region to mergeclear (
bool
) – should the non-corner content of the region be cleared and the style from the corner applied.cc (
GOffice.CmdContext
orNone
) – the calling context
- Return type:
Add a range to the list of merge targets. Checks for array splitting returns
True
if there was an error. Queues a respan. Only queues a redraw if clear isTrue
.
- merge_contains_pos(pos)¶
- Parameters:
pos (
Gnm.CellPos
) – Position to look for a merged range.- Returns:
the merged range covering pos, or
None
if pos is not within a merged region.- Return type:
- merge_find_bounding_box(r)¶
- Parameters:
r (
Gnm.Range
) – the range to extend
Extends r such that no merged range is split by its boundary.
- merge_get_adjacent(pos)¶
- Parameters:
pos (
Gnm.CellPos
) – the cell to test for adjacent regions.- Returns:
- left:
the return for a region on the left
- right:
the return for a region on the right
- Return type:
Returns the nearest regions to either side of pos.
- merge_get_overlap(r)¶
- merge_is_corner(pos)¶
- Parameters:
pos (
Gnm.CellPos
) – cellpos if top left corner- Returns:
a merged
Gnm.Range
covering pos if it is the top-left corner of a merged region.- Return type:
- merge_remove(r)¶
-
Remove a merged range. Queues a redraw.
- names_check(r)¶
- Parameters:
- Returns:
The name of a
Gnm.NamedExpr
if self!`r` is the target of a named range.Preference is given to
GOffice.workbook
scope over sheet.- Return type:
- objects_clear(r, t)¶
- Parameters:
r (
Gnm.Range
orNone
) –Gnm.Range
to look in tGObject.GType
t (
GObject.GType
) –
- Return type:
pundo:
GOffice.Undo
orNone
Removes the objects in the region.
- objects_dup(dst, range)¶
- Parameters:
Clones the objects of the src sheet and attaches them into the dst sheet
- objects_get(r, t)¶
- Parameters:
t (
GObject.GType
) – The type of object to lookup,GObject.TYPE_NONE
for any.
- Returns:
a list containing all objects of exactly the specified type (inheritance does not
GOffice.count
) that are completely contained in r.- Return type:
- queue_redraw_range(range)¶
- Parameters:
range (
Gnm.Range
) – range to redraw
This queues a redraw for the indicated range. The redraw will happen when Gnumeric returns to the gui main loop.
- queue_respan(start_row, end_row)¶
-
queues a span generation for the selected rows. the caller is responsible for queuing a redraw
- range_calc_spans(r, flags)¶
- Parameters:
r (
Gnm.Range
) – the region to update.flags (
Gnm.SpanCalcFlags
) –
This is used to re-calculate cell dimensions and re-render a cell’s text. eg. if a format has changed we need to re-render the cached version of the rendered text in the cell.
- range_contains_merges_or_arrays(r, cc, cmd, merges, arrays)¶
- Parameters:
- Returns:
True
if the target region self!`r` contains any merged regions or arrays.- Return type:
Check to see if the target region self!`r` contains any merged regions or arrays. Report an error to the cc if it is supplied.
- range_has_heading(src, top, ignore_styles)¶
- Parameters:
- Returns:
True
if src seems to have a heading- Return type:
Checks for a header
Gnm.row
in self!`src`. If top is true it looks for a headerGnm.row
from the top and if false it looks for a headerGnm.col
from the left
- range_splits_array(r, ignore, cc, cmd)¶
- Parameters:
- Returns:
True
if an array would be split.- Return type:
Check the outer edges of range self!`r` to ensure that if an array is within it then the entire array is within the range. ignore is useful when src and dest ranges may overlap.
- range_splits_region(r, ignore, cc, cmd)¶
- Parameters:
r (
Gnm.Range
) – The range whose boundaries are checkedignore (
Gnm.Range
) – An optional range in which it is ok to have arrays and mergescc (
GOffice.CmdContext
) – The context that issued the commandcmd (
str
) – The translated command name.
- Returns:
whether any arrays or merged regions will be split.
- Return type:
A utility to see whether moving the range r will split any arrays or merged regions.
- range_trim(r, cols, rows)¶
- Parameters:
- Returns:
True
if the range was totally empty.- Return type:
This removes empty rows/cols from the right hand or bottom edges of the range depending on the
GOffice.value
of cols or rows.
- range_unrender(r)¶
-
Unrenders all cells in the given range. If r is
None
, the all cells in the sheet are unrendered.
- ranges_split_region(ranges, cc, cmd)¶
- Parameters:
ranges ([
Gnm.Range
]) – A list of ranges to check.cc (
GOffice.CmdContext
) – The context that issued the commandcmd (
str
) – The translated command name.
- Returns:
whether any arrays or merged regions will be split.
- Return type:
A utility to see whether moving any of the ranges ranges will split any arrays or merged regions.
- recompute_spans_for_col(col)¶
- Parameters:
col (
int
) – The column that changed
This routine recomputes the column span for the cells that touches the column.
- redraw_range(range)¶
- Parameters:
range (
Gnm.Range
) – range to redraw
Redraw the indicated range, or at least the visible parts of it.
- redraw_region(start_col, start_row, end_col, end_row)¶
- region_queue_recalc(range)¶
-
Queues things that depend on self!`range` for recalc.
If range is
None
the entire sheet is used.
- resize(cols, rows, cc)¶
- Parameters:
cols (
int
) – the new columns number.rows (
int
) – the new rows number.cc (
GOffice.CmdContext
) –GOffice.CmdContext
.
- Returns:
the newly allocated
GOffice.Undo
.- perr:
will be
True
on error.
- Return type:
(
GOffice.Undo
, perr:bool
)
- row_fetch(row)¶
- Parameters:
row (
int
) – Row number- Returns:
The
Gnm.ColRowInfo
forGnm.row
row. This result will not be the defaultGnm.ColRowInfo
and may be changed.- Return type:
- row_get(row)¶
- Parameters:
row (
int
) – Row number- Returns:
A
Gnm.ColRowInfo
for theGnm.row
, orNone
if none has been allocated yet.- Return type:
- row_get_default_size_pts()¶
- Returns:
the default number of units in a
Gnm.row
, including margins. This function returns the raw sum, no rounding etc.- Return type:
- row_get_distance_pixels(from_, to)¶
- row_get_distance_pts(from_, to)¶
- row_get_info(row)¶
- Parameters:
row (
int
) – column number- Returns:
The
Gnm.ColRowInfo
forGnm.row
row. This may be the defaultGnm.ColRowInfo
for rows and should not be changed.- Return type:
- row_set_size_pixels(row, height_pixels, set_by_user)¶
- Parameters:
Sets height of a
Gnm.row
in pixels, INCLUDING top and bottom margins, and the lower grid line.
- row_set_size_pts(row, height_pts, set_by_user)¶
- Parameters:
Sets height of a
Gnm.row
in pts, INCLUDING top and bottom margins, and the lower grid line. This is a low level internal routine. It does NOT redraw, or reposition objects.
- row_size_fit_pixels(row, scol, ecol, ignore_strings)¶
- Parameters:
- Returns:
Maximum size in pixels INCLUDING margins and grid lines or 0 if there are no cells.
- Return type:
This routine computes the ideal size for the
Gnm.row
to make all data fit properly.
- scenario_add(sc)¶
- Parameters:
sc (
Gnm.Scenario
) –Gnm.Scenario
- scenario_find(name)¶
- Parameters:
name (
str
) – the scenario name.- Returns:
the found scenario, or
None
.- Return type:
Gnm.Scenario
orNone
- scenario_remove(sc)¶
- Parameters:
sc (
Gnm.Scenario
) –
- scrollbar_config()¶
- selection_is_allowed(pos)¶
- Parameters:
pos (
Gnm.CellPos
) –- Return type:
- set_outline_direction(is_cols)¶
-
When changing the placement of outline collapse markers the flags need to be recomputed.
- set_solver_params(param)¶
- Parameters:
param (
Gnm.SolverParameters
) –
- slicers_at_pos(pos)¶
- Parameters:
pos (
Gnm.CellPos
) –Gnm.CellPos
- Returns:
None
or theGnm.SheetSlicer
in self that overlaps with pos.- Return type:
- style_apply_border(range, borders)¶
- Parameters:
borders ([
Gnm.Border
]) – Border styles to set.
When a user applies a border to a region we attempt to remove the border from the opposing side to avoid overlapping border specifications. eg if we apply a top border to a range, we would clear the bottom border of the range offset upwards.
- style_apply_col(col, style)¶
-
NOTE: This is a simple wrapper for now. When we support
Gnm.col
/Gnm.row
styles it will make life easier.Apply a partial style to a full
Gnm.col
.
- style_apply_pos(col, row, style)¶
-
Apply a partial style to a single cell
- style_apply_row(row, style)¶
-
NOTE: This is a simple wrapper for now. When we support
Gnm.col
/Gnm.row
styles it will make life easier.Apply a partial style to a full
Gnm.col
.
- style_collect_conditions(r)¶
- style_collect_hlinks(r)¶
- style_collect_validations(r)¶
- style_find(st)¶
-
Looks up a style from the sheets collection. Linking if necessary.
- style_find_conflicts(r, style)¶
- style_foreach(func, *user_data)¶
-
Executes func for each style in the sheet.
- style_get(col, row)¶
- style_get_auto_pattern_color()¶
- Returns:
the color for rendering auto colored patterns in this sheet.
- Return type:
- style_get_extent(r)¶
- Parameters:
r (
Gnm.Range
) – starting range and resulting range- Returns:
starting range and resulting range
- Return type:
r:
Gnm.Range
A simple implementation that finds the smallest range containing all visible styles and containing r.
- style_get_nondefault_extent(extent, src, col_defaults)¶
- Parameters:
- Returns:
extent
- Return type:
extent:
Gnm.Range
Extends extent so that it covers any non-default style used.
- style_get_nondefault_rows(col_defaults)¶
- Parameters:
col_defaults ([
Gnm.Style
]) – defaults styles- Returns:
GLib.ByteArray
with one element perGnm.row
. An element isTrue
if theGnm.row
uses a non-default style.- Return type:
- style_get_range(r)¶
-
Get a list of rectangles and their associated styles. Note that when a range is given, the resulting ranges are relative to the input range.
- style_get_row(sr)¶
- Parameters:
sr (
Gnm.StyleRow
) –Gnm.StyleRow
A utility routine which efficiently retrieves a range of styles within a
Gnm.row
. It also merges adjacent borders as necessary.
- style_init()¶
- style_is_default(r, col_defaults)¶
- style_most_common(is_col)¶
- style_optimize()¶
- style_range_foreach(r, func, *user_data)¶
- Parameters:
func (
GLib.HFunc
) – callback.
- style_region_contains_link(r)¶
- Parameters:
- Returns:
the found #GmHLink if any.
- Return type:
Utility routine that checks to see if a region contains at least ones hyperlink and returns the first one it finds.
- style_set_auto_pattern_color(grid_color)¶
- Parameters:
grid_color (
Gnm.Color
) – The color
Set the color for rendering auto colored patterns in this sheet.
- style_set_list(corner, l, range_modify, *data)¶
- Parameters:
corner (
Gnm.CellPos
) – The top-left corner (in LTR mode)l ([
object
]) – #GnmStyleListrange_modify (
Gnm.sheet_style_set_list_cb_t
) –
- Return type:
Overwrites the styles of the ranges given by corner with the content of list. Optionally transposing the ranges
- style_set_pos(col, row, style)¶
-
Change the complete style for a single cell.
- style_set_range(range, style)¶
-
Change the complete style for a region.
- style_shutdown()¶
- style_update_grid_color(context)¶
- Parameters:
context (
Gtk.StyleContext
) –
This function updates the color of
Gnm.Style.border_none
when the sheet to be rendered is known.Gnm.Style.border_none
tells how to render the grid. Because the grid color may be different for different sheets, the functions which render the grid call this function first. The rule for selecting the grid color, which is the same as in Excel, is: - if the auto pattern color is default (which is black), the grid color is gray, as returned byGnm.Style.color_grid
(). - otherwise, the auto pattern color is used for the grid.
- update()¶
Should be called after a logical command has finished processing to request redraws for any pending events, and to update the various status regions
- update_only_grid()¶
Should be called after a logical command has finished processing to request redraws for any pending events
Signal Details¶
- Gnm.Sheet.signals.detached_from_workbook(sheet, object)¶
- Signal Name:
detached-from-workbook
- Flags:
- Parameters:
sheet (
Gnm.Sheet
) – The object which received the signalobject (
Gnm.Workbook
) –
Property Details¶
- Gnm.Sheet.props.columns¶
- Name:
columns
- Type:
- Default Value:
256
- Flags:
Columns number in the sheet
- Gnm.Sheet.props.conventions¶
- Name:
conventions
- Type:
- Default Value:
- Flags:
How to format displayed expressions, (A1 vs R1C1, function names, …)
- Gnm.Sheet.props.display_column_header¶
-
Control whether column headers are shown.
- Gnm.Sheet.props.display_formulas¶
-
Control whether formulæ are shown instead of values.
- Gnm.Sheet.props.display_grid¶
-
Control whether the grid is shown.
- Gnm.Sheet.props.display_outlines¶
-
Control whether outlines are shown.
- Gnm.Sheet.props.display_outlines_below¶
-
Control whether outline symbols are shown below.
- Gnm.Sheet.props.display_outlines_right¶
-
Control whether outline symbols are shown to the right.
- Gnm.Sheet.props.display_row_header¶
-
Control whether
Gnm.row
headers are shown.
- Gnm.Sheet.props.display_zeros¶
-
Control whether zeros are shown are blanked out.
- Gnm.Sheet.props.name¶
-
The name of the sheet.
- Gnm.Sheet.props.protected_allow_cell_formatting¶
-
Allow cell format changes while a sheet is protected
- Gnm.Sheet.props.protected_allow_column_formatting¶
-
Allow column formatting while a sheet is protected
- Gnm.Sheet.props.protected_allow_delete_columns¶
-
Allow columns to be deleted while a sheet is protected
- Gnm.Sheet.props.protected_allow_delete_rows¶
-
Allow rows to be deleted while a sheet is protected
- Gnm.Sheet.props.protected_allow_edit_auto_filters¶
-
Allow auto filters to be edited while a sheet is protected
- Gnm.Sheet.props.protected_allow_edit_objects¶
-
Allow objects to be edited while a sheet is protected
- Gnm.Sheet.props.protected_allow_edit_pivottable¶
-
Allow pivottable to be edited while a sheet is protected
- Gnm.Sheet.props.protected_allow_edit_scenarios¶
-
Allow scenarios to be edited while a sheet is protected
- Gnm.Sheet.props.protected_allow_insert_columns¶
-
Allow columns to be inserted while a sheet is protected
- Gnm.Sheet.props.protected_allow_insert_hyperlinks¶
-
Allow hyperlinks to be inserted while a sheet is protected
- Gnm.Sheet.props.protected_allow_insert_rows¶
-
Allow rows to be inserted while a sheet is protected
- Gnm.Sheet.props.protected_allow_row_formatting¶
-
Allow
Gnm.row
formatting while a sheet is protected
- Gnm.Sheet.props.protected_allow_select_locked_cells¶
-
Allow the user to select locked cells while a sheet is protected
- Gnm.Sheet.props.protected_allow_select_unlocked_cells¶
- Name:
protected-allow-select-unlocked-cells
- Type:
- Default Value:
- Flags:
Allow the user to select unlocked cells while a sheet is protected
- Gnm.Sheet.props.protected_allow_sort_ranges¶
-
Allow ranges to be sorted while a sheet is protected
- Gnm.Sheet.props.rows¶
- Name:
rows
- Type:
- Default Value:
65536
- Flags:
Rows number in the sheet
- Gnm.Sheet.props.sheet_type¶
- Name:
sheet-type
- Type:
- Default Value:
- Flags:
Which type of sheet this is.
- Gnm.Sheet.props.tab_background¶
-
The background color of the tab.
- Gnm.Sheet.props.tab_foreground¶
-
The foreground color of the tab.
- Gnm.Sheet.props.text_is_rtl¶
-
Text goes from right to left.
- Gnm.Sheet.props.use_r1c1¶
-
How to format displayed expressions, (a convenience api)
- Gnm.Sheet.props.visibility¶
- Name:
visibility
- Type:
- Default Value:
- Flags:
How visible the sheet is.
- Gnm.Sheet.props.workbook¶
- Name:
workbook
- Type:
- Default Value:
- Flags:
The
GOffice.workbook
in which this sheet lives