Module basic module

Module gui

gui module

Instructions:

1
var gui = require('gui');

Static function

setVersion

Set the highest simulation version of IE in WebView . When the system IE version is lower than this version, the system installation version will be simulated

1
static gui.setVersion(Integer ver);

Call parameters:

  • ver : Integer, specify ie simulation version

open

Open a window and visit the specified URL

1 2
static WebView gui.open(String url, Object opt = {});

Call parameters:

  • url : String, the specified URL, you can use fs : path access the local file system
  • opt : Object, open window parameters

Return result:

  • WebView , returns the opened window object

The following parameters are supported:

1 2 3 4 5 6 7 8 9 10 11 12
{ "left": 100, // 窗口左上角 x,缺省系统自动设定 "right": 100, // 窗口左上角 y,缺省系统自动设定 "width": 100, // 窗口宽度,缺省系统自动设定 "height": 100, // 窗口高度,缺省系统自动设定 "border": true, // 是否有边框,缺省有边框 "caption": true, // 是否有标题栏,缺省有标题栏 "resizable": true, // 是否可改变尺寸,缺省可以改变 "maximize": false, // 是否最大化显示,缺省不最大化 "visible": true, // 是否显示,缺省显示 "debug": true // 是否输出 WebView 内的错误和 console 信息,缺省显示 }

When width and height are set, but left or right is not set, the window will be automatically centered

constant

IE7

WebView ie simulation version, specify ie7

1
const gui.IE7 = 7000;

IE8

WebView ie simulation version, specify ie8

1
const gui.IE8 = 8000;

IE9

WebView ie simulation version, specify ie9

1
const gui.IE9 = 9000;

IE10

WebView ie simulation version, specify ie10

1
const gui.IE10 = 10000;

IE11

WebView ie simulation version, specify ie11

1
const gui.IE11 = 11000;

EDGE

WebView ie simulation version, specify edge

1
const gui.EDGE = 11001;