Gnm.Cell

Fields

Name

Type

Access

Description

base

Gnm.Dependent

r/w

pos

Gnm.CellPos

r/w

value

Gnm.Value

r/w

Methods

class

set_array (sheet, r, texpr)

class

set_array_formula_undo (sr, texpr)

class

set_comment (sheet, pos, author, text, markup)

array_bound ()

calc_layout (rv, y_direction, width, height, h_center, res_color, res_x, res_y)

calc_span (col1, col2)

convert_expr_to_value ()

draw (cr, x, y, height, width, h_center, show_extension_markers, style)

eval ()

finish_layout (rv, col_width, inhibit_overflow)

foreach_dep (func, user)

get_effective_style ()

get_entered_text ()

get_format ()

get_render_color ()

get_rendered_text ()

get_style ()

get_text_for_editing ()

get_value ()

has_expr ()

is_array ()

is_blank ()

is_empty ()

is_error ()

is_nonsingleton_array ()

is_number ()

is_zero ()

name ()

queue_recalc ()

register_span (left, right)

rendered_height ()

rendered_offset ()

rendered_width ()

unregister_span ()

unrender ()

Details

class Gnm.Cell
classmethod set_array(sheet, r, texpr)
Parameters:
  • sheet (Gnm.Sheet) – The sheet to set the array expression in.

  • r (Gnm.Range) – The range to set.

  • texpr (Gnm.ExprTop) – an expression (the inner expression, not a corner or element)

Returns:

True if the operation succeeded.

NOTE : This adds a reference to the expression.

Does not regenerate spans, dimensions or autosize cols/rows.

DOES CHECK for array partitioning.

Return type:

bool

Set an array expression for a range. Uses cell_set_expr_internal to store the expr as an ‘array-formula’. The supplied expression is wrapped in an array operator for each cell in the range and scheduled for recalc.

classmethod set_array_formula_undo(sr, texpr)
Parameters:
Returns:

the newly allocated GOffice.Undo.

Return type:

GOffice.Undo

classmethod set_comment(sheet, pos, author, text, markup)
Parameters:
Returns:

the newly allocated Gnm.Comment.

Return type:

Gnm.Comment

array_bound()
Returns:

True, if the cell is an array cell

res:

The range containing an array cell

Return type:

(bool, res: Gnm.Range)

calc_layout(rv, y_direction, width, height, h_center, res_color, res_x, res_y)
Parameters:
Return type:

bool

calc_span(col1, col2)
Parameters:
  • col1 (int) –

  • col2 (int) –

convert_expr_to_value()

NOTE : the cell’s expression cannot be linked into the expression * list.

The cell is rendered but spans are not calculated, the cell is NOT marked for recalc.

WARNING : This is an internal routine that does not queue redraws, does not auto-resize, and does not calculate spans.

draw(cr, x, y, height, width, h_center, show_extension_markers, style)
Parameters:
eval()
finish_layout(rv, col_width, inhibit_overflow)
Parameters:
foreach_dep(func, user)
Parameters:
get_effective_style()
Returns:

the fully qualified style for self, taking any conditional formats into account.

Return type:

Gnm.Style

get_entered_text()
Returns:

a text expression if the cell contains a formula, or a string representation of the GOffice.value.

Return type:

str

get_format()
Returns:

the effective format for the cell, i.e., the cell style’s format unless that is General and the cell GOffice.value has a format.

Return type:

GOffice.Format

get_render_color()
Returns:

A #GOColor used for foreground in self.

Return type:

int

get_rendered_text()
Return type:

str

get_style()
Returns:

the fully qualified style for self.

Return type:

Gnm.Style

get_text_for_editing()
Returns:

A string suitable for editing

Primary user of this function is the formula entry. This function should return the GOffice.value most appropriate for editing

quoted:

Whether a single quote was used to force string interpretation

cursor_pos:

Desired initial Gnm.cursor position

Return type:

(str, quoted: bool, cursor_pos: int)

get_value()
Returns:

self's GOffice.value

Return type:

Gnm.Value

has_expr()
Returns:

True if self has an expression or False if it is empty or contains a GOffice.value.

Return type:

bool

is_array()
Return type:

bool

Returns True is self is part of an array

is_blank()
Returns:

True, if the cell has not been created, has Gnm.ValueType.EMPTY, or has an empty Gnm.ValueType.STRING.

Return type:

bool

is_empty()
Returns:

True, If the cell has not been created, or has Gnm.ValueType.EMPTY.

Return type:

bool

is_error()
Returns:

self's GOffice.value if it is an error, or None.

Return type:

Gnm.Value or None

is_nonsingleton_array()
Returns:

True is self is part of an array larger than 1x1

Return type:

bool

is_number()
Returns:

True, if the cell contains a number.

Return type:

bool

is_zero()
Returns:

True, if the cell contains zero.

Return type:

bool

name()
Returns:

the name of self, like “B11”

Return type:

str

queue_recalc()

Queue the cell and everything that depends on it for recalculation. If a dependency is already queued ignore it.

register_span(left, right)
Parameters:
  • left (int) –

  • right (int) –

rendered_height()
Return type:

int

rendered_offset()
Return type:

int

rendered_width()
Return type:

int

unregister_span()
unrender()