stage

package
v0.0.0-...-a8ee3e7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 11, 2022 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Compatible

type Compatible interface {
	Get() js.Value
}

type Stage

type Stage struct {
	// contains filtered or unexported fields
}

func (*Stage) Add

func (e *Stage) Add(value interface{}) (ref *Stage)

Add

English:

Adds an element to the document.

 Input:
   value: js.Value element containing an html document.

Português:

Adiciona um elemento ao documento.

 Entrada:
   value: elemento js.Value contendo um documento html.

func (*Stage) AddListener

func (e *Stage) AddListener(eventType interface{}, manager mouse.SimpleManager) (ref *Stage)

AddListener

English:

Associates a function with a mouse event.

 Example:
   stage.AddListener(browserMouse.KEventMouseOver, onMouseEvent)
   timer := time.NewTimer(10 * time.Second)
   go func() {
     select {
       case <-timer.C:
       stage.RemoveListener(mouse.KEventMouseOver)
     }
   }()

Português:

Associa uma função a um evento do mouse.

 Exemplo:
   stage.AddListener(browserMouse.KEventMouseOver, onMouseEvent)
   timer := time.NewTimer(10 * time.Second)
   go func() {
     select {
       case <-timer.C:
       stage.RemoveListener(mouse.KEventMouseOver)
     }
   }()

   func onMouseEvent(event browserMouse.MouseEvent) {
     isNull, target := event.GetRelatedTarget()
     if isNull == false {
       log.Print("id: ", target.Get("id"))
       log.Print("tagName: ", target.Get("tagName"))
     }
     log.Print(event.GetScreenX())
     log.Print(event.GetScreenY())
   }

func (*Stage) Append

func (e *Stage) Append(value interface{}) (ref *Stage)

func (*Stage) Get

func (e *Stage) Get() js.Value

Get

English:

Returns the document.

Português:

Retorna o documento.

func (Stage) GetById

func (e Stage) GetById(id string) (element interface{})

GetById

Português:

Retorna a referência do elemento através do seu ID.

 Entrada:
   id: string que diferência maiúsculas e minúsculas representando o ID único do elemento sendo
       procurado.
 Nota:
   * Elemento é uma referência a um objeto Element, ou null se um elemento com o ID especificado
     não estiver contido neste documento.
   * Se não existe um elemento com o id fornecido, esta função retorna null. Note, o parâmetro ID
     diferência maiúsculas e minúsculas. Assim document.getElementById("Main") retornará null ao
     invés do elemento <div id="main">, devido a "M" e "m" diferirem para o objetivo deste método;
   * Elementos que não estão no documento não são procurados por getElementById. Quando criar um
     elemento e atribuir um ID ao mesmo, você deve inserir o elemento na árvore do documento com
     insertBefore ou método similar antes que você possa acessá-lo com getElementById:

       var elemento = document.createElement("div");
       elemento.id = 'testqq';
       var el = document.getElementById('testqq'); // el será null!

   * Documentos não-HTML, a implementação do DOM deve ter informações que diz quais atributos são
     do tipo ID.  Atributos com o nome "id" não são do tipo ID a menos que assim sejam definidos
     nos documentos DTD. O atributo id é definido para ser um tipo ID em casos comuns de  XHTML,
     XUL, e outros. Implementações que não reconhecem se os atributos são do tipo ID, ou não são
     esperados retornam null.

func (Stage) GetHeight

func (e Stage) GetHeight() (height int)

GetHeight

English:

Returns the length of the document in pixels.

 Output:
   width: document size in pixels.

Português:

Retorna a altura do documento em pixels.

 Saída:
   width: tamanho do documento em pixels.

func (Stage) GetWidth

func (e Stage) GetWidth() (width int)

GetWidth

English:

Returns the width of the document in pixels.

 Output:
   width: document size in pixels.

Português:

Retorna o comprimento do documento em pixels.

 Saída:
   width: tamanho do documento em pixels.

func (*Stage) Init

func (e *Stage) Init()

Init

English:

Initializes the document with the browser's main document.

Português:

Inicializa o documento com o documento principal do navegador.

func (*Stage) MouseAuto

func (e *Stage) MouseAuto() (ref *Stage)

MouseAuto

English:

Sets the mouse pointer to auto.

Português:

Define o ponteiro do mouse como automático.

func (*Stage) MouseHide

func (e *Stage) MouseHide() (ref *Stage)

MouseHide

English:

Sets the mouse pointer to hide.

Português:

Define o ponteiro do mouse como oculto.

func (*Stage) Remove

func (e *Stage) Remove(value interface{}) (ref *Stage)

Remove

English:

Removes an html element from the document.

 Input:
   value: js.Value element containing an html document.

Português:

Remove um elemento html do documento.

 Entrada:
   value: elemento js.Value contendo um documento html.

func (*Stage) RemoveListener

func (e *Stage) RemoveListener(eventType interface{}) (ref *Stage)

func (*Stage) ResizeToScreen

func (e *Stage) ResizeToScreen() (ref *Stage)

ResizeToScreen

English:

Resizes the document to the size of the main document.

Português:

Redimensiona o documento para o tamanho do documento principal.

func (*Stage) SetMouse

func (e *Stage) SetMouse(value mouse.CursorType) (ref *Stage)

SetMouse

English:

Defines the shape of the mouse pointer.

 Input:
   value: mouse pointer shape.
     Example: SetMouse(mouse.KCursorCell) // Use mouse.K... and let autocomplete do the
              rest

Português:

Define o formato do ponteiro do mouse.

 Entrada:
   value: formato do ponteiro do mouse.
     Exemplo: SetMouse(mouse.KCursorCell) // Use mouse.K... e deixe o autocompletar fazer
              o resto

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL