Module 基礎模組

模組gui

gui 模組

使用方法:

1
var gui = require('gui');

靜態函數

setVersion

設定WebView內ie 最高模擬版本,當系統ie 版本低於此版本時,將模擬系統安裝版本

1
static gui.setVersion(Integer ver);

呼叫參數:

  • ver: Integer, 指定ie 模擬版本

open

開啟一個視窗並存取指定網址

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

呼叫參數:

  • url: String, 指定的網址,可以使用fs:path存取本機檔案系統
  • opt: Object, 開啟視窗參數

回傳結果:

  • WebView, 傳回開啟的視窗對象

支援以下參數:

1 2 3 4 5 6 7 8 9 10 11 12
{ "left": 100, // specify the left position of the window, default is system auto set "right": 100, // spcify the top position of the window, default is system auto set "width": 100, // specify the width of the window, default is system auto set "height": 100, // specify the height of the window, default is system auto set "border": true, // specify whether the window has border, default is true "caption": true, // specify whether the window has caption, default is true "resizable": true, // specify whether the window is resizable, default is true "maximize": false, // specify whether the window is maximized, default is false "fullscreen": false, // specify whether the window is fullscreen, default is false "debug": true, // specify whether the WebView output error and console info, default is true }

當設定width 和height,而未設定left 或right 時,視窗將自動居中


打開一個空的瀏覽器視窗

1
static WebView gui.open(Object opt = {});

呼叫參數:

  • opt: Object, 開啟視窗參數

回傳結果:

  • WebView, 傳回開啟的視窗對象

支援以下參數:

1 2 3 4 5 6 7 8 9 10 11 12
{ "left": 100, // specify the left position of the window, default is system auto set "right": 100, // spcify the top position of the window, default is system auto set "width": 100, // specify the width of the window, default is system auto set "height": 100, // specify the height of the window, default is system auto set "border": true, // specify whether the window has border, default is true "caption": true, // specify whether the window has caption, default is true "resizable": true, // specify whether the window is resizable, default is true "maximize": false, // specify whether the window is maximized, default is false "fullscreen": false, // specify whether the window is fullscreen, default is false "debug": true, // specify whether the WebView output error and console info, default is true }

當設定width 和height,而未設定left 或right 時,視窗將自動居中

常量

IE7

WebViewie 模擬版本,指定ie7

1
const gui.IE7 = 7000;

IE8

WebViewie 模擬版本,指定ie8

1
const gui.IE8 = 8000;

IE9

WebViewie 模擬版本,指定ie9

1
const gui.IE9 = 9000;

IE10

WebViewie 模擬版本,指定ie10

1
const gui.IE10 = 10000;

IE11

WebViewie 模擬版本,指定ie11

1
const gui.IE11 = 11000;

EDGE

WebViewie 模擬版本,指定edge

1
const gui.EDGE = 11001;