Gnm.ExprEntry

g Atk.ImplementorIface Atk.ImplementorIface Gtk.Widget Gtk.Widget Atk.ImplementorIface->Gtk.Widget GObject.GInterface GObject.GInterface GObject.GInterface->Atk.ImplementorIface GOffice.GraphDataEditor GOffice.GraphDataEditor GObject.GInterface->GOffice.GraphDataEditor Gtk.Buildable Gtk.Buildable GObject.GInterface->Gtk.Buildable Gtk.CellEditable Gtk.CellEditable GObject.GInterface->Gtk.CellEditable Gtk.Orientable Gtk.Orientable GObject.GInterface->Gtk.Orientable GObject.InitiallyUnowned GObject.InitiallyUnowned GObject.InitiallyUnowned->Gtk.Widget GObject.Object GObject.Object GObject.Object->GObject.InitiallyUnowned Gnm.ExprEntry Gnm.ExprEntry GOffice.GraphDataEditor->Gnm.ExprEntry Gtk.Box Gtk.Box Gtk.Box->Gnm.ExprEntry Gtk.Buildable->Gtk.Widget Gtk.CellEditable->Gnm.ExprEntry Gtk.Container Gtk.Container Gtk.Container->Gtk.Box Gtk.Orientable->Gtk.Box Gtk.Widget->Gtk.Container

Subclasses:

None

Methods

Inherited:

Gtk.Box (14), Gtk.Container (35), Gtk.Widget (278), GObject.Object (37), Gtk.Buildable (10), Gtk.Orientable (2), GOffice.GraphDataEditor (2), Gtk.CellEditable (3)

Structs:

Gtk.ContainerClass (5), Gtk.WidgetClass (12), GObject.ObjectClass (5)

class

new (wbcg, with_icon)

can_rangesel ()

close_tips ()

disable_tips ()

editing_canceled ()

enable_tips ()

find_range ()

freeze ()

get_entry ()

get_rangesel ()

get_scg ()

get_text ()

global_range_name (sheet)

grab_focus (select_all)

is_blank ()

is_cell_ref (sheet, allow_multiple_cell)

load_from_dep (dep)

load_from_expr (texpr, pp)

load_from_range (sheet, r)

load_from_text (txt)

parse (pp, perr, start_sel, flags)

parse_as_list (sheet)

parse_as_value (sheet)

rangesel_stop (clear_string)

set_flags (flags, mask)

set_scg (scg)

set_update_policy (policy)

signal_update (user_requested)

thaw ()

Virtual Methods

Inherited:

Gtk.Container (10), Gtk.Widget (82), GObject.Object (7), Gtk.Buildable (10), Gtk.CellEditable (3)

Properties

Inherited:

Gtk.Box (3), Gtk.Container (3), Gtk.Widget (39), Gtk.Orientable (1), Gtk.CellEditable (1)

Name

Type

Flags

Short Description

constant-format

GOffice.Format

r/w

Format for constants

flags

int

r/w

scg

Gnm.SheetControlGUI

r/w

The GUI container associated with the entry.

text

str

r/w

The contents of the entry

update-policy

Gnm.UpdateType

r/w

How frequently changes to the entry should be applied

wbcg

Gnm.WBCGtk

r/w

The toplevel GUI container associated with the entry.

with-icon

bool

r/w

Should there be an icon to the right of the entry?

Child Properties

Inherited:

Gtk.Box (5)

Style Properties

Inherited:

Gtk.Widget (17)

Signals

Inherited:

Gtk.Container (4), Gtk.Widget (69), GObject.Object (1), Gtk.CellEditable (2)

Name

Short Description

activate

changed

update

Fields

Inherited:

Gtk.Container (4), Gtk.Widget (69), GObject.Object (1), Gtk.CellEditable (2)

Class Details

class Gnm.ExprEntry(*args, **kwargs)
Bases:

Gtk.Box, GOffice.GraphDataEditor, Gtk.CellEditable

Abstract:

No

classmethod new(wbcg, with_icon)
Parameters:
Returns:

a new Gnm.ExprEntry.

Return type:

Gnm.ExprEntry

Creates a new Gnm.ExprEntry, which is an entry widget with support for range selections. The entry is created with default flag settings which are suitable for use in many dialogs, but see Gnm.ExprEntry.set_flags.

can_rangesel()
Returns:

True if a range selection is meaningful at current position.

Return type:

bool

close_tips()
disable_tips()
editing_canceled()
Return type:

bool

enable_tips()
find_range()
Return type:

bool

Look at the current selection to see how much of it needs to be changed when selecting a range.

freeze()
get_entry()
Returns:

the associated Gtk.Entry.

Return type:

Gtk.Entry

get_rangesel()
Returns:

True if the returned range is indeed valid. The resulting range is normalized.

r:

address to receive Gnm.Range

sheet:

address to receive #sheet

Return type:

(bool, r: Gnm.Range, sheet: Gnm.Sheet)

Get the range selection. Gnm.Range is copied, Gnm.Sheet is not. If sheet argument is None, the corresponding GOffice.value is not returned.

get_scg()
Returns:

the associated Gnm.SheetControlGUI.

Return type:

Gnm.SheetControlGUI

get_text()
Returns:

The content of the entry. Caller should not modify the result.

Return type:

str

A small convenience routine. Think long and hard before using this. There are lots of parse routines that serve the common case.

global_range_name(sheet)
Parameters:

sheet (Gnm.Sheet) –

Return type:

str

grab_focus(select_all)
Parameters:

select_all (bool) –

is_blank()
Return type:

bool

is_cell_ref(sheet, allow_multiple_cell)
Parameters:
Return type:

bool

load_from_dep(dep)
Parameters:

dep (Gnm.Dependent) – A dependent

Sets the text of the entry, and removes saved information about earlier range selections.

load_from_expr(texpr, pp)
Parameters:

Sets the text of the entry, and removes saved information about earlier range selections.

load_from_range(sheet, r)
Parameters:
Returns:

true if displayed range is different from input range. false otherwise.

Sets the range selection and displays it in the entry text. If the widget already contains a range selection, the new text replaces the old. Otherwise, it is inserted at pos.

Return type:

bool

load_from_text(txt)
Parameters:

txt (str) –

parse(pp, perr, start_sel, flags)
Parameters:
Return type:

Gnm.ExprTop

Attempts to parse the content of the entry line honouring the flags.

parse_as_list(sheet)
Parameters:

sheet (Gnm.Sheet) – the sheet where the cell range is evaluated. This really only needed if the range given does not include a sheet specification.

Returns:

a (GLib.SList *) or None on failure.

Return type:

[Gnm.Value]

parse_as_value(sheet)
Parameters:

sheet (Gnm.Sheet) – the sheet where the cell range is evaluated.

Return type:

Gnm.Value

Returns a (Gnm.Value *) of type Gnm.ValueType.CELLRANGE if the range was successfully parsed or None on failure.

rangesel_stop(clear_string)
Parameters:

clear_string (bool) – clear string flag

Perform the appropriate action when a range selection has been completed.

set_flags(flags, mask)
Parameters:

Changes the flags specified in mask to values given in flags.

Flags (False by default): Gnm.ExprEntryFlags.SINGLE_RANGE Entry will only hold a single range. %GNM_EE_ABS_COL Column reference must be absolute. %GNM_EE_ABS_ROW Row reference must be absolute. Gnm.ExprEntryFlags.FULL_COL Gnm.Range consists of full columns. Gnm.ExprEntryFlags.FULL_ROW Gnm.Range consists of full rows. Gnm.ExprEntryFlags.SHEET_OPTIONAL Current sheet name not auto-added.

set_scg(scg)
Parameters:

scg (Gnm.SheetControlGUI) – a Gnm.SheetControlGUI

Associates the entry with a Gnm.SheetControlGUI. The entry widget automatically removes the association when the Gnm.SheetControlGUI is destroyed.

set_update_policy(policy)
Parameters:

policy (Gnm.UpdateType) – update policy

Sets the update policy for the expr-entry. Gnm.UpdateType.CONTINUOUS means that anytime the entry’s content changes, the update signal will be emitted. Gnm.UpdateType.DELAYED means that the signal will be emitted after a brief timeout when no changes occur, so updates are spaced by a short time rather than continuous. Gnm.UpdateType.DISCONTINUOUS means that the signal will only be emitted when the user releases the button and ends the rangeselection.

signal_update(user_requested)
Parameters:

user_requested (bool) – is the update requested by the user (eg activation)

Higher level operations know when they are logically complete and can notify Gnm.ExprEntry clients. For example, button-up after a Gnm.drag selection indicates a logical end to the change and offers a good time to update.

thaw()

Signal Details

Gnm.ExprEntry.signals.activate(expr_entry)
Signal Name:

activate

Flags:

RUN_LAST, ACTION

Parameters:

expr_entry (Gnm.ExprEntry) – The object which received the signal

Gnm.ExprEntry.signals.changed(expr_entry)
Signal Name:

changed

Flags:

RUN_LAST

Parameters:

expr_entry (Gnm.ExprEntry) – The object which received the signal

Gnm.ExprEntry.signals.update(expr_entry, object)
Signal Name:

update

Flags:

RUN_LAST

Parameters:
  • expr_entry (Gnm.ExprEntry) – The object which received the signal

  • object (bool) –

Property Details

Gnm.ExprEntry.props.constant_format
Name:

constant-format

Type:

GOffice.Format

Default Value:

None

Flags:

READABLE, WRITABLE

Format for constants

Gnm.ExprEntry.props.flags
Name:

flags

Type:

int

Default Value:

0

Flags:

READABLE, WRITABLE

Gnm.ExprEntry.props.scg
Name:

scg

Type:

Gnm.SheetControlGUI

Default Value:

None

Flags:

READABLE, WRITABLE

The GUI container associated with the entry.

Gnm.ExprEntry.props.text
Name:

text

Type:

str

Default Value:

''

Flags:

READABLE, WRITABLE

The contents of the entry

Gnm.ExprEntry.props.update_policy
Name:

update-policy

Type:

Gnm.UpdateType

Default Value:

Gnm.UpdateType.CONTINUOUS

Flags:

READABLE, WRITABLE

How frequently changes to the entry should be applied

Gnm.ExprEntry.props.wbcg
Name:

wbcg

Type:

Gnm.WBCGtk

Default Value:

None

Flags:

READABLE, WRITABLE

The toplevel GUI container associated with the entry.

Gnm.ExprEntry.props.with_icon
Name:

with-icon

Type:

bool

Default Value:

True

Flags:

READABLE, WRITABLE

Should there be an icon to the right of the entry?