Skip to content
FranX1024 edited this page Jul 29, 2019 · 1 revision

DOM42 library

Introduction

DOM42 is a JavaScript library for Windows93 which makes creating GUI for Windows93 apps simpler. In the start you need to create a new window. It can be done using 2 methods.

Method 1.

var root = $window42({ <stuff> });
//To see what goes to <stuff> look up $window({})

Method 2.

var win = $window({ <stuff> });
var root = new DOM42(win);

Adding widgets

Before the following it is advised to do $widget.Export(). That would enable you to do var btn = Button(...) instead of var btn = $widget.Button(...).

List of all widgets & their methods:

Below you can see the list of all widgets. Optional arguments will be marked with <...>.

  • Label(text, )
    • setPosition(x, y)
    • setStyle(object)
  • Button(text)
    • onClick(function)
    • setPosition(x, y, , )
    • setStyle(object)
  • Input(, )
    • getText()
    • setText(text)
    • setPosition(x, y, , )
    • setStyle(object)
  • Entry()
    • getText()
    • setText(text)
    • setPosition(x, y, , )
    • setStyle(object)
  • Section()
    • setPosition(x, y, , )
    • setStyle(object)
  • IFrame(src)
    • setPosition(x, y, , )
    • setStyle(object)

NOTE:

Section is a div element and it can be turned to DOM42 object by doing the following:

var sct = $widget.Section();
var root2 = new DOM42(sct);

Console

Console script is a library which consists of one class $console. $console constructor accepts one argument which represents window title and by creating object new window will be created. It has 2 methods:

  1. obj.print(string) - prints the string to the console window
  2. obj.input(string, callback) - prints the string and calls callback