aboutsummaryrefslogtreecommitdiff
path: root/Src/resources/skins/Big Bento/scripts/standardframe.m
blob: acb87f8b90f25a3c29719e9ae653335d4b94896d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#include <lib/std.mi>

Global Group frameGroup, content;//, titlebar;
Global String x, y, w, h, rx, ry, rw, rh;
//Global Layer mouselayer;
Global Button Sysmenu;

Function setNewGroup(String groupid);

System.onScriptLoaded() {
	frameGroup = getScriptGroup();
	String param = getParam();
	x = getToken(param, ",", 0);
	y = getToken(param, ",", 1);
	w = getToken(param, ",", 2);
	h = getToken(param, ",", 3);
	rx = getToken(param, ",", 4);
	ry = getToken(param, ",", 5);
	rw = getToken(param, ",", 6);
	rh = getToken(param, ",", 7);
	sysmenu = frameGroup.findObject("sysmenu");
}

System.onSetXuiParam(String param, String value) {
	if (param == "content") {
		setNewGroup(value);
		//titlebar = frameGroup.findObject("wasabi.titlebar");
		//mouselayer = titlebar.findObject("mousetrap");
	}
	/*if (param == "padtitleright" || param == "padtitleleft") {
		if (titlebar != NULL) titlebar.setXmlParam(param, value); 
	}
	if (param == "shade") {
		if (mouselayer != NULL) mouselayer.setXmlParam("dblclickaction", "switch;"+value);
		else messagebox("Cannot set shade parameter for StandardFrame object, no mousetrap found", "Skin Error", 0, "");
	}*/
}

// backward compatibility for prerelease notify trick
frameGroup.onNotify(String cmd, String param, int a, int b) {
	String _command = getToken(cmd, ",", 0);
	String _param = getToken(cmd, ",", 1);
	if (_command == "content" || _command == "padtitleright" || _command == "padtitleleft" || _command == "shade") {
		onSetXuiParam(_command, _param);
	}
}

setNewGroup(String groupid) {
	content = newGroup(groupid);
	if (content == NULL) {
		messagebox("group \"" + groupid + "\" not found", "ButtonGroup", 0, "");
		return;
	}
	content.setXmlParam("x", x);
	content.setXmlParam("y", y);
	content.setXmlParam("w", w);
	content.setXmlParam("h", h);
	content.setXmlParam("relatx", rx);
	content.setXmlParam("relaty", ry);
	content.setXmlParam("relatw", rw);
	content.setXmlParam("relath", rh);
	content.init(frameGroup);
}

Sysmenu.onLeftClick() {
	LayoutStatus _status = frameGroup.findObject("sysmenu.status");
	_status.callme("{system}");
}