control Package

control Package

Package nabla.gl.gui.control provides an Overlay and several Control classes.

class Blind(parent, name=None, x=0, y=0, w=None, h=None, type=None, col=0, colspan=1, row=0, rowspan=1, padx=None, pady=None, ipadx=None, ipady=None, sticky=None, expand=None, border=False, reduce=None, group=None, order=None, background=False, events=True, **kwargs)

Bases: nabla.gl.gui.control.control.Definition, nabla.gl.gui.control.control.Grid, nabla.gl.gui.control.control.Box

Not interactive Control.

class Canvas(parent, name=None, x=0, y=0, w=None, h=None, type=None, col=0, colspan=1, row=0, rowspan=1, padx=None, pady=None, ipadx=None, ipady=None, sticky=None, expand=None, border=False, reduce=None, group=None, order=None, background=False, events=True, **kwargs)

Bases: nabla.gl.gui.control.Control

delete()
grid(x=0, y=0, w=0, h=0, level=0)
on_scroll(x, y, scroll_x, scroll_y)
scroll_update()
view_x
view_y
class Clip(parent, name=None, x=0, y=0, w=None, h=None, type=None, col=0, colspan=1, row=0, rowspan=1, padx=None, pady=None, ipadx=None, ipady=None, sticky=None, expand=None, border=False, reduce=None, group=None, order=None, background=False, events=True, **kwargs)

Bases: nabla.gl.gui.control.Control

Extended Control that does a scissor, nothing is visible out of its box.

on_move()
class Column(parent, name=None, x=0, y=0, w=None, h=None, type=None, col=0, colspan=1, row=0, rowspan=1, padx=None, pady=None, ipadx=None, ipady=None, sticky=None, expand=None, border=False, reduce=None, group=None, order=None, background=False, events=True, **kwargs)

Bases: nabla.gl.gui.control.Canvas

Extended Control to create columns.

delete()
list
on_click(x, y, button, modifiers)
on_list_update()
selected
class Container

Bases: object

A void Control that can be in an Overlay.

inside(x, y)
on_key_press(symbol, modifiers)
on_key_release(symbol, modifiers)
on_mouse_drag(x, y, dx, dy, button, modifiers)
on_mouse_press(x, y, button, modifiers)
on_mouse_release(x, y, button, modifiers)
on_mouse_scroll(x, y, scroll_x, scroll_y)
on_resize(w, h)
on_text(text)
on_text_motion(motion, select)
on_text_motion_select(motion)
press()
release()
class Control(parent, name=None, x=0, y=0, w=None, h=None, type=None, col=0, colspan=1, row=0, rowspan=1, padx=None, pady=None, ipadx=None, ipady=None, sticky=None, expand=None, border=False, reduce=None, group=None, order=None, background=False, events=True, **kwargs)

Bases: nabla.gl.gui.control.control.Definition, nabla.gl.gui.control.control.Interaction, nabla.gl.gui.control.control.Grid, nabla.gl.gui.control.control.Box

This is the common skeleton class for every widget.

class Display(parent, name=None, x=0, y=0, w=None, h=None, type=None, col=0, colspan=1, row=0, rowspan=1, padx=None, pady=None, ipadx=None, ipady=None, sticky=None, expand=None, border=False, reduce=None, group=None, order=None, background=False, events=True, **kwargs)

Bases: nabla.gl.gui.control.Texture

Special Control that contains a texture and maintains aspect.

grid(x=0, y=0, w=0, h=0, level=0)
class Document(parent, name=None, x=0, y=0, w=None, h=None, type=None, col=0, colspan=1, row=0, rowspan=1, padx=None, pady=None, ipadx=None, ipady=None, sticky=None, expand=None, border=False, reduce=None, group=None, order=None, background=False, events=True, **kwargs)

Bases: nabla.gl.gui.control.Control

Extended Control that contains a FormattedDocument text layout and allows the user to edit the document.

content_height
content_width
delete()
document
line(line)
on_focus()
on_focus_lost()
on_key_press(symbol, modifiers)
on_key_release(symbol, modifiers)
on_mouse_drag(x, y, dx, dy, button, modifiers)
on_mouse_scroll(x, y, scroll_x, scroll_y)
on_text(text)
on_text_update()
set_style(style={})
text
view_x
view_y
class Dynamic(parent, name=None, x=0, y=0, w=None, h=None, type=None, col=0, colspan=1, row=0, rowspan=1, padx=None, pady=None, ipadx=None, ipady=None, sticky=None, expand=None, border=False, reduce=None, group=None, order=None, background=False, events=True, **kwargs)

Bases: nabla.gl.gui.control.Control

Special Control that can change position, scale, color, anytime.

color
height
opacity
position
scale
set_position_relative(x, y)
visible
width
x
y
class Formatted(parent, name=None, x=0, y=0, w=None, h=None, type=None, col=0, colspan=1, row=0, rowspan=1, padx=None, pady=None, ipadx=None, ipady=None, sticky=None, expand=None, border=False, reduce=None, group=None, order=None, background=False, events=True, **kwargs)

Bases: nabla.gl.gui.control.Clip

Extended Control that contains a FormattedDocument text layout

delete()
class Frontal(parent, name='', x=0, y=0, w=None, h=None, col=0, colspan=1, row=0, rowspan=1, padx=None, pady=None, ipadx=None, ipady=None, sticky=None, expand=None, border=False, reduce=False, group=None, order=None, background=None, **kwargs)

Bases: nabla.gl.gui.control.Control

Extended Control that is floating on top of the others, used by Submenu and ComboBox.

delete()
class Independent(parent, name=None, x=0, y=0, w=None, h=None, type=None, col=0, colspan=1, row=0, rowspan=1, padx=None, pady=None, ipadx=None, ipady=None, sticky=None, expand=None, border=False, reduce=None, group=None, order=None, background=False, events=True, **kwargs)

Bases: nabla.gl.gui.control.Dynamic

Special Control that can migrate to another overlay.

batch
draw()
group
class Lines(parent, name=None, x=0, y=0, w=None, h=None, type=None, col=0, colspan=1, row=0, rowspan=1, padx=None, pady=None, ipadx=None, ipady=None, sticky=None, expand=None, border=False, reduce=None, group=None, order=None, background=False, events=True, **kwargs)

Bases: nabla.gl.gui.control.Formatted

Extended Control that contains a FormattedDocument that represents a List TODO: a xml editor

on_list_update()
class Origin(parent, name='', x=0, y=0, w=None, h=None, col=0, colspan=1, row=0, rowspan=1, padx=None, pady=None, ipadx=None, ipady=None, sticky=None, expand=None, border=False, reduce=False, group=None, order=None, background=None, **kwargs)

Bases: nabla.gl.gui.control.Control

Extended Control that defines a new origin for its controls. Used for windows.

get_origin(x, y)
get_position()
layout(tuple=None, smooth=False, finish=None)
layout_save()
layout_set_relative(tuple)
move(dx, dy)
on_mouse_drag(x, y, dx, dy, button, modifiers)
on_mouse_motion(x, y, dx, dy)
on_mouse_press(x, y, button, modifiers)
on_mouse_release(x, y, button, modifiers)
on_mouse_scroll(x, y, scroll_x, scroll_y)
x
y
class Special(parent, name=None, x=0, y=0, w=None, h=None, type=None, col=0, colspan=1, row=0, rowspan=1, padx=None, pady=None, ipadx=None, ipady=None, sticky=None, expand=None, border=False, reduce=None, group=None, order=None, background=False, events=True, **kwargs)

Bases: nabla.gl.gui.control.control.Definition, nabla.gl.gui.control.control.Interaction, nabla.gl.gui.control.control.Box

This is the common skeleton class for every widget.

grid(x=None, y=None, w=None, h=None, level=0)

Override to apply a special cell ocuppation.

grid_update()
class Table(parent, name=None, x=0, y=0, w=None, h=None, type=None, col=0, colspan=1, row=0, rowspan=1, padx=None, pady=None, ipadx=None, ipady=None, sticky=None, expand=None, border=False, reduce=None, group=None, order=None, background=False, events=True, **kwargs)

Bases: nabla.gl.gui.control.Canvas

class Texture(parent, name=None, x=0, y=0, w=None, h=None, type=None, col=0, colspan=1, row=0, rowspan=1, padx=None, pady=None, ipadx=None, ipady=None, sticky=None, expand=None, border=False, reduce=None, group=None, order=None, background=False, events=True, **kwargs)

Bases: nabla.gl.gui.control.Dynamic

Special Control that contains a texture.

delete()
image
texture

control Module

Master Control class.

class Box

Bases: object

background

A GUI_COLOR key or None.

border

A GUI_BORDER key or None.

height
hide()

Set this control invisible.

layout(tuple=None)
layout_save()
place(x=None, y=None, w=None, h=None)
redraw()

Force redraw

set_background_color(colors=None)
show()

Set this control visible.

width
x
y
class Definition(parent, name=None, x=0, y=0, w=None, h=None, type=None, col=0, colspan=1, row=0, rowspan=1, padx=None, pady=None, ipadx=None, ipady=None, sticky=None, expand=None, border=False, reduce=None, group=None, order=None, background=False, events=True, **kwargs)

Bases: object

This class contain the common methods used to create a Control. Widgets can override this methods to define itselfs.

add_control(control)

Convenience function to add a control.

create()

Personalize

delete()

Permanently destroy this Control.

dump(level=1)

Debug tools.

function(index)

Auxiliar function.

function_index(index)

Returs a function call to function(index).

get_origin(x, y)

Returns the position of Origin (0,0) in the Overlay

get_overlay()

Returns the Overlay containing this Control.

get_window()

Returns window Control

sync(*args, **kwargs)

Force sync.

visible
class Events

Bases: object

Methods that every control needs to have.

events
inside(x, y)
on_click(*args, **kwargs)
on_click_release(*args, **kwargs)
on_double_click(x=0, y=0, button=0, modifiers=0)
on_drag(x, y, dx, dy, button, modifiers)
on_focus()
on_focus_lost()
on_key_press(symbol, modifiers)
on_key_release(symbol, modifiers)
on_mouse_drag(x, y, dx, dy, button, modifiers)
on_mouse_motion(x, y, dx, dy)
on_mouse_out()
on_mouse_over()
on_mouse_press(x, y, button, modifiers)
on_mouse_release(x, y, button, modifiers)
on_mouse_scroll(x, y, scroll_x, scroll_y)
on_move()
on_press()
on_release(inside=False)
on_resize(w, h)
on_scroll(x, y, button, modifiers)
on_text(text)
on_text_motion(motion, select=False)
on_text_motion_select(motion)
return_false(*args, **kwargs)

Assign this function to a method that should return False.

return_true(*args, **kwargs)

Assign this function to a method that should return True.

class Grid

Bases: object

Layout Manager implemented during one Ballmer Peak. Nobody knows how it works.

grid(x=None, y=None, w=None, h=None)

Calculate position and size of this Control. Override this method to personalize behavior.

grid_update()

Force control scan, if children has changed.

on_grid()
stick(x, y, w, h)

Apply in-cell sticky value.

class Interaction

Bases: nabla.gl.gui.control.control.Events

focus
got_focus()
pressed

draw Module

Drawing functions.

class DrawGroup(name=None, order=32, parent=None)

Bases: pyglet.graphics.OrderedGroup

set_state()
unset_state()
class ScissorGroup(name='ScissorGroup', order=16, parent=None)

Bases: pyglet.graphics.OrderedGroup

set_state()
unset_state()
class TextureGroup(texture, order=21, parent=None)

Bases: pyglet.graphics.OrderedGroup

set_state()
set_texture(texture)
unset_state()
class TranslateGroup(name='TranslateGroup', order=32, parent=None)

Bases: pyglet.graphics.OrderedGroup

set_state()
unset_state()
vertex_perimeter(x, y, w, h, o=0)
vertex_quad(x, y, w, h, o=0)

functions Module

Miscelaneous functions.

class FileList

Bases: object

file
filter(tuple)
folder_back()
folder_up()
path
class FileSystem

Bases: object

file
path
ForceText(text)
class Log

Bases: object

write(text)
approximation(pos, size)
extension(path)
filetype(path)
interrogate(item)

Print useful information about item.

log(text)
log_enabled(value=None)
newfolder(path)

globals Module

Initialize nabla.gl.gui. Define global configuration constants and resources.

class ErrorHandler

Bases: object

info(title='Untitled', control=None)
colors_window_title()
is_filetype(EXT, path)
load_resources()
set_color(key, tuple)

overlay Module

Provides Overlay class

class Focus

Bases: object

focus
pressed
released
set_focus = False
class Interface

Bases: object

inside(x, y)
on_key_press(symbol, modifiers)
on_key_release(symbol, modifiers)
on_mouse_drag(x, y, dx, dy, button, modifiers)
on_mouse_motion(x, y, dx, dy)
on_mouse_press(x, y, button, modifiers)
on_mouse_release(x, y, button, modifiers)
on_mouse_scroll(x, y, scroll_x, scroll_y)
on_text(text)
on_text_motion(motion, select=False)
on_text_motion_select(motion)
resize(w, h)
class Overlay(x=0, y=0, w=960, h=590, name='Overlay')

Bases: nabla.gl.gui.control.overlay.Interface, nabla.gl.gui.control.overlay.Focus, pyglet.event.EventDispatcher

Control Manager.

add_control(control)
add_frontal(control)
dump()
get_origin(x, y)
get_overlay()
grid()
order()
set_mouse(viewport)
set_mouse_cursor(cursor=None)
tick(dt)
vsync_toggle()
window = None
class Pointer(overlay)

Bases: object

OpenGL mouse pointer.

move(dx, dy)
pos()
position(x, y)

Contenidos

Tema anterior

Paquete gl.gui

Próximo tema

Paquete gl.geo

Esta página