HOW TO

  • Center element vertically and/or horizontally
Use 'margin-top: 50%%; margin-bottom: 50%%;' for vertical alignment
Use 'margin-left: 50%%; margin-right: 50%%;' for horizontal alignment
Use 'margin: 50%%;' to center element in the container
  • What event handlers are available for the element
onMouse( e:Event ), onKey( e:Event ), onFocus( e:Event ), onScroll( e:Event ), onControlEvent( e:Event ), onTimer(), onSize()

All events are bubbling except onTimer and onSize
  • How to define an event handler for an element?
<script>
type MyElementHandlerClass : Behavior {
    function onMouse(evt) {
          // handler code
    }
}
</script>

<div style="prototype: MyElementHandlerClass;" >my div content</div>
  • How to send an event?
Use Element.postEvent( evtcode: int [, reason: int [, owner: Element ]] )
  • How to send a custom event?
Use postEvent method of element to post an event and onControlEvent handler to handle custom user events.
User defined event types are in range 0x1000-0x7fff.
sciter/howto.txt · Last modified: 2007/09/21 22:39 (external edit)
chimeric.de = chi`s home Creative Commons License Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0