widgets Package¶
widgets
Package¶
accounttree
Module¶
-
class
stoqlib.gui.widgets.accounttree.
StockTextColumn
(*args, **kwargs)[source]¶ Bases:
kiwi.ui.objectlist.Column
A column which you can add a stock item and a text
-
class
stoqlib.gui.widgets.accounttree.
AccountTree
(with_code=True, create_mode=False)[source]¶ Bases:
kiwi.ui.objectlist.ObjectTree
calculator
Module¶
-
class
stoqlib.gui.widgets.calculator.
CalculatorPopup
(entry, mode)[source]¶ Bases:
kiwi.ui.popup.PopupWindow
A popup calculator for entries
Right now it supports both
kiwi.ui.widgets.spinbutton.ProxySpinButton
andkiwi.ui.widgets.entry.ProxyEntry
, as long as their data types are numeric (e.g. int, currency, Decimal, etc)-
MODE_ADD
= 0¶ The add mode. Any value typed on the entry will be added to the original value. e.g. 10% means +10%
-
MODE_SUB
= 1¶ The sub mode. Any value typed on the entry will be subtracted from the original value. e.g. 10% means -10%
-
fieldgrid
Module¶
Widget containing a Grid of fields
-
class
stoqlib.gui.widgets.fieldgrid.
FieldInfo
(grid, name, widget, x, y, width=-1, height=1, model=None)[source]¶ Bases:
object
-
class
stoqlib.gui.widgets.fieldgrid.
FieldGrid
(font, width, height)[source]¶ Bases:
gtk.Layout
FieldGrid is a Grid like widget which you can add fields to
- field-added (object): Emitted when a field is added to the grid
- field-removed (object): Emitted when a field is removed from the grid
- ** selection-changed** (object): Emitted when a field is selected or deselected by the user.
-
add_field
(text, description, x, y, width=-1, height=1, model=None)[source]¶ Adds a new field to the grid
Parameters: - text – text of the field
- description – description of the field
- x – x position of the field
- y – y position of the field
-
select_field
(field)[source]¶ Selects a field :param field: the field to select, must be FieldInfo or None
-
get_selected_field
()[source]¶ Returns the currently selected field :returns: the currently selected field :rtype: FieldInfo
hintedentry
Module¶
kanbanview
Module¶
-
class
stoqlib.gui.widgets.kanbanview.
KanbanObjectListColumn
(attribute='', title=None, data_type=None, **kwargs)[source]¶ Bases:
kiwi.ui.objectlist.Column
-
class
stoqlib.gui.widgets.kanbanview.
CellRendererTextBox
[source]¶ Bases:
gtk.CellRendererText
-
PADDING
= 3¶
-
SIZE
= 6¶
-
margin_color
¶ the magin color of the renderer, this the part to the left of it, indicating a category color
-
do_get_property
(pspec)¶
-
do_set_property
(pspec, value)¶
-
-
class
stoqlib.gui.widgets.kanbanview.
KanbanViewColumn
(title, value)[source]¶ Bases:
object
A column in a KanbanView
It just has a title and can be cleared via
clear
and you can append an item viaappend_item
-
class
stoqlib.gui.widgets.kanbanview.
KanbanView
[source]¶ Bases:
gtk.Frame
This is a kanban view which can be used to display a set of columns with boxes that can be rearranged.
-
TREEVIEW_DND_TARGETS
= [('text/plain', 0, 1)]¶
-
get_column_by_title
(column_title)[source]¶ Get a column given a title
Returns: a column or None
if none are found
-
add_column
(column)[source]¶ Adds a new column to the view
Parameters: column (KanbanViewColumn) – column to add
-
enable_editing
()[source]¶ Makes it possible to edit items within this treeview.
You also need to return
True
in the ::item-dragged callback for an item to be draggable.
-
select
(item)[source]¶ Select an item in the view
Parameters: item – the item to select or None
to unselect all
-
get_selected_item
()[source]¶ Get the currently selected item from the view
Returns: the selected item or None
if no items are selected
-
render_item
(column, renderer, item)[source]¶ Renders an item, this is an optional hook that can be implemented by a subclass.
Parameters: - column – the treeview column
- renderer – the cell renderer
Parma item: the item
-
lazyobjectlist
Module¶
-
class
stoqlib.gui.widgets.lazyobjectlist.
LazyObjectModelRow
(item, path, iter)[source]¶ Bases:
object
-
class
stoqlib.gui.widgets.lazyobjectlist.
LazyObjectModel
(objectlist, result, executer, initial_count)[source]¶ Bases:
gtk.GenericTreeModel
,gtk.TreeSortable
-
class
stoqlib.gui.widgets.lazyobjectlist.
LazyObjectListUpdater
(search, objectlist)[source]¶ Bases:
object
This is a helper that updates the list automatically when you scroll down in it. Similar to what twisted / facebook does (as of 2012)
-
EXTRA_ROWS
= 30¶
-
SCROLL_TIMEOUT
= 10¶
-
INITIAL_ROWS
= 50¶
-
THRESHOLD
= 250¶
-
notebookbutton
Module¶
Bases:
gtk.Button
A simple button that doesn’t have much border or padding, to be used specially with notebooks.
processview
Module¶
Process View a simple view of a process’ stdout or stderr
queryentry
Module¶
-
class
stoqlib.gui.widgets.queryentry.
QueryEntryGadget
(entry, store, initial_value=None, parent=None, run_editor=None, edit_button=None, info_button=None, search_clause=None)[source]¶ Bases:
object
This gadget modifies a ProxyEntry to behave like a ProxyComboEntry.
When instanciated, the gadget will remove the entry from the editor, add a gtk.HBox on its place, and re-attach the entry to the newly created hbox. This hbox will also have a button to add/edit a new object.
There are a few advantages in using this instead of a combo:
- There is no need to prefill the combo with all the options, which can be very slow depending on the number of objects.
- This allows the user to use a better search mechanism, allowing him to filter using multiple keywords and even candidade keys (like a client document)
-
MIN_KEY_LENGTH
= 1¶
-
LOADING_ITEMS_TEXT
= 'Loading items...'¶
-
NEW_ITEM_TEXT
= 'Create a new item with that name'¶
-
NEW_ITEM_TOOLTIP
= 'Create a new item'¶
-
EDIT_ITEM_TOOLTIP
= 'Edit the selected item'¶
-
INFO_ITEM_TOOLTIP
= 'See info about the selected item'¶
-
NO_ITEMS_FOUND_TEXT
= 'No items found'¶
-
advanced_search
= True¶
-
selection_only
= False¶
-
item_editor
= None¶
-
item_info_dialog
¶ alias of
ClientEditor
-
search_class
= None¶
-
search_spec
= None¶
-
search_columns
= None¶
-
class
stoqlib.gui.widgets.queryentry.
PersonEntryGadget
(entry, store, initial_value=None, parent=None, run_editor=None, edit_button=None, info_button=None)[source]¶ Bases:
stoqlib.gui.widgets.queryentry.QueryEntryGadget
-
person_type
= None¶
-
-
class
stoqlib.gui.widgets.queryentry.
ClientEntryGadget
(entry, store, initial_value=None, parent=None, run_editor=None, edit_button=None, info_button=None)[source]¶ Bases:
stoqlib.gui.widgets.queryentry.PersonEntryGadget
-
LOADING_ITEMS_TEXT
= 'Loading clients...'¶
-
NEW_ITEM_TEXT
= 'Create a new client with this name...'¶
-
NEW_ITEM_TOOLTIP
= 'Create a new client'¶
-
EDIT_ITEM_TOOLTIP
= 'Edit the selected client'¶
-
INFO_ITEM_TOOLTIP
= 'See info about the selected client'¶
-
item_editor
¶ alias of
ClientEditor
-
item_info_dialog
¶ alias of
ClientDetailsDialog
-
person_type
¶ alias of
Client
-
search_class
¶ alias of
ClientSearch
-
search_spec
¶ alias of
ClientView
-
search_columns
= [<storm.properties.PropertyColumn object at 0x7f2cb4e9d3d0>, <storm.properties.PropertyColumn object at 0x7f2cb4e9dd70>, <storm.properties.PropertyColumn object at 0x7f2cb4e9d4b0>, <storm.properties.PropertyColumn object at 0x7f2cb4e9d360>, <storm.properties.PropertyColumn object at 0x7f2cb4e9d670>, <storm.properties.PropertyColumn object at 0x7f2cb4e9db40>]¶
-
-
class
stoqlib.gui.widgets.queryentry.
SupplierEntryGadget
(entry, store, initial_value=None, parent=None, run_editor=None, edit_button=None, info_button=None)[source]¶ Bases:
stoqlib.gui.widgets.queryentry.PersonEntryGadget
-
LOADING_ITEMS_TEXT
= 'Loading suppliers...'¶
-
NEW_ITEM_TEXT
= 'Create a new supplier with this name...'¶
-
NEW_ITEM_TOOLTIP
= 'Create a new supplier'¶
-
EDIT_ITEM_TOOLTIP
= 'Edit the selected supplier'¶
-
INFO_ITEM_TOOLTIP
= 'See info about the selected supplier'¶
-
item_editor
¶ alias of
SupplierEditor
-
item_info_dialog
¶ alias of
SupplierDetailsDialog
-
person_type
¶ alias of
Supplier
-
search_class
¶ alias of
SupplierSearch
-
search_spec
¶ alias of
SupplierView
-
search_columns
= [<storm.properties.PropertyColumn object at 0x7f2cb4e9d3d0>, <storm.properties.PropertyColumn object at 0x7f2cb4e9dd70>, <storm.properties.PropertyColumn object at 0x7f2cb4e9d4b0>, <storm.properties.PropertyColumn object at 0x7f2cb4e9d360>, <storm.properties.PropertyColumn object at 0x7f2cb4e9d670>, <storm.properties.PropertyColumn object at 0x7f2cb4e9db40>]¶
-
-
class
stoqlib.gui.widgets.queryentry.
SaleTokenEntryGadget
(entry, store, initial_value=None, parent=None, run_editor=None, edit_button=None, info_button=None, search_clause=None)[source]¶ Bases:
stoqlib.gui.widgets.queryentry.QueryEntryGadget
-
LOADING_ITEMS_TEXT
= 'Loading tokens...'¶
-
NO_ITEMS_FOUND_TEXT
= 'No tokens found... Register some in the admin app'¶
-
advanced_search
= False¶
-
selection_only
= True¶
-
search_spec
¶ alias of
SaleTokenView
-
search_columns
= [<storm.properties.PropertyColumn object at 0x7f2cb411b1a0>, <storm.properties.PropertyColumn object at 0x7f2cb411b280>, <storm.expr.Coalesce object at 0x7f2cb41cf590>]¶
-
searchfilterbutton
Module¶
Bases:
gtk.Button
searchentry
Module¶
A gadget that will transform a regular entry in an advanced entry, that allows the user to select the object using a regular search.
-
class
stoqlib.gui.widgets.searchentry.
SearchEntryGadget
(entry, store, model, model_property, search_columns, search_class, parent, run_editor=None)[source]¶ Bases:
object
-
find_tooltip
= 'Search'¶
-
edit_tooltip
= 'Edit'¶
-
new_tooltip
= 'Create'¶
-
-
class
stoqlib.gui.widgets.searchentry.
ClientSearchEntryGadget
(entry, store, model, parent, model_property='client', search_class=<class 'stoqlib.gui.search.personsearch.ClientSearch'>, run_editor=None)[source]¶ Bases:
stoqlib.gui.widgets.searchentry.SearchEntryGadget
-
find_tooltip
= 'Search for clients'¶
-
edit_tooltip
= 'Edit the selected client'¶
-
new_tooltip
= 'Create a new client'¶
-
splash
Module¶
Splash screen helper