Initial community commit
This commit is contained in:
parent
537bcbc862
commit
fc06254474
16440 changed files with 4239995 additions and 2 deletions
74
Src/resources/data/freeform/xml/wasabi/Scripts/debug.sym
Normal file
74
Src/resources/data/freeform/xml/wasabi/Scripts/debug.sym
Normal file
|
@ -0,0 +1,74 @@
|
|||
-- Variables Table ---------------------------------------------------
|
||||
var# | Class | What
|
||||
----------------------------------------------------------------------
|
||||
0000 | System | System*
|
||||
0001 | Int | NULL
|
||||
0002 | Group | frameGroup
|
||||
0003 | Group | content
|
||||
0004 | Group | titlebar
|
||||
0005 | String | x
|
||||
0006 | String | y
|
||||
0007 | String | w
|
||||
0008 | String | h
|
||||
0009 | String | rx
|
||||
000A | String | ry
|
||||
000B | String | rw
|
||||
000C | String | rh
|
||||
000D | Layer | mouselayer
|
||||
000E | Button | Sysmenu
|
||||
000F | String | param
|
||||
0010 | String | ","
|
||||
0011 | Int | 0
|
||||
0012 | Int | 1
|
||||
0013 | Int | 2
|
||||
0014 | Int | 3
|
||||
0015 | Int | 4
|
||||
0016 | Int | 5
|
||||
0017 | Int | 6
|
||||
0018 | Int | 7
|
||||
0019 | String | "sysmenu"
|
||||
001A | String | param
|
||||
001B | String | value
|
||||
001C | String | "content"
|
||||
001D | String | "wasabi.titlebar"
|
||||
001E | String | "mousetrap"
|
||||
001F | String | "padtitleright"
|
||||
0020 | String | "padtitleleft"
|
||||
0021 | String | "shade"
|
||||
0022 | String | "dblclickaction"
|
||||
0023 | String | "switch;"
|
||||
0024 | String | "Cannot set shade parameter for StandardFrame object, no mousetrap found"
|
||||
0025 | String | "Skin Error"
|
||||
0026 | String | ""
|
||||
0027 | String | cmd
|
||||
0028 | String | param
|
||||
0029 | Int | a
|
||||
002A | Int | b
|
||||
002B | String | _command
|
||||
002C | String | _param
|
||||
002D | String | groupid
|
||||
002E | String | "group \""
|
||||
002F | String | "\" not found"
|
||||
0030 | String | "ButtonGroup"
|
||||
0031 | String | "x"
|
||||
0032 | String | "y"
|
||||
0033 | String | "w"
|
||||
0034 | String | "h"
|
||||
0035 | String | "relatx"
|
||||
0036 | String | "relaty"
|
||||
0037 | String | "relatw"
|
||||
0038 | String | "relath"
|
||||
0039 | String | "sysmenu.status"
|
||||
003A | LayoutStatus | _status
|
||||
003B | String | "{system}"
|
||||
-- Events Table ------------------------------------------------------
|
||||
var# | Code Pointer | What
|
||||
----------------------------------------------------------------------
|
||||
0000 | 0000 | System.onScriptLoaded
|
||||
0000 | 013E | System.onSetXuiParam
|
||||
0002 | 0235 | frameGroup.onNotify
|
||||
000E | 03F2 | Sysmenu.onLeftClick
|
||||
-- User Functions Table ----------------------------------------------
|
||||
Code Pointer | What
|
||||
----------------------------------------------------------------------
|
||||
02D8 | setNewGroup
|
|
@ -0,0 +1,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}");
|
||||
}
|
Binary file not shown.
96
Src/resources/data/freeform/xml/wasabi/Scripts/titlebar.m
Normal file
96
Src/resources/data/freeform/xml/wasabi/Scripts/titlebar.m
Normal file
|
@ -0,0 +1,96 @@
|
|||
#include <lib/std.mi>
|
||||
|
||||
#define MARGIN 0
|
||||
|
||||
Function resizeObjects();
|
||||
|
||||
Global GuiObject left, right, center;
|
||||
Global Text tcenter;
|
||||
Global Group sg;
|
||||
Global int padleft, padright;
|
||||
|
||||
System.onScriptLoaded() {
|
||||
|
||||
padleft = 0;
|
||||
padright = 0;
|
||||
|
||||
sg = getScriptGroup();
|
||||
|
||||
if (sg == NULL) {
|
||||
messageBox("titlebar.maki can only run within a group", "Error", 0, "");
|
||||
return;
|
||||
}
|
||||
|
||||
left = sg.findObject(getToken(getParam(), ";", 0));
|
||||
center = sg.findObject(getToken(getParam(), ";", 1));
|
||||
if (center != NULL) {
|
||||
tcenter = center.findObject("window.titlebar.title");
|
||||
}
|
||||
right = sg.findObject(getToken(getParam(), ";", 2));
|
||||
}
|
||||
|
||||
// backward compatibility with prerelease notify trick
|
||||
sg.onNotify(String cmd, String param, int a, int b) {
|
||||
String _command = getToken(cmd, ",", 0);
|
||||
String _param = getToken(cmd, ",", 1);
|
||||
if (_command == "padtitleright" || _command == "padtitleright")
|
||||
onSetXuiParam(_command, _param);
|
||||
}
|
||||
|
||||
System.onSetXuiParam(String param, String value) {
|
||||
if (param == "padtitleright") {
|
||||
padright = padright + StringToInteger(value);
|
||||
resizeObjects();
|
||||
}
|
||||
if (param == "padtitleleft") {
|
||||
padleft = padleft + StringToInteger(value);
|
||||
resizeObjects();
|
||||
}
|
||||
}
|
||||
|
||||
resizeObjects() {
|
||||
int text_width = 0;
|
||||
int layout_width = 0;
|
||||
int group_width = sg.getWidth();
|
||||
|
||||
Layout l = sg.getParentLayout();
|
||||
layout_width = l.getWidth();
|
||||
|
||||
if (center != NULL) {
|
||||
text_width = center.getAutoWidth();
|
||||
}
|
||||
|
||||
int lx = (layout_width - text_width) / 2;
|
||||
lx = l.clientToScreenX(lx);
|
||||
lx = sg.screenToClientX(lx);
|
||||
lx = lx - sg.getLeft();
|
||||
|
||||
if (center != NULL) {
|
||||
center.setXmlParam("x", IntegerToString(lx));
|
||||
center.setXmlParam("relatx", "0");
|
||||
center.setXmlParam("w", IntegerToString(text_width));
|
||||
center.setXmlParam("relatw", "0");
|
||||
}
|
||||
|
||||
if (left != NULL) {
|
||||
left.setXmlParam("x", IntegerToString(padleft));
|
||||
left.setXmlParam("relatx", "0");
|
||||
left.setXmlParam("w", IntegerToString(lx-padleft-MARGIN));
|
||||
left.setXmlParam("relatw", "0");
|
||||
}
|
||||
if (right != NULL) {
|
||||
right.setXmlParam("x", IntegerToString(lx+text_width+MARGIN+1));
|
||||
right.setXmlParam("relatx", "0");
|
||||
right.setXmlParam("w", "-" + IntegerToString(lx+text_width+1+padright+MARGIN+1)); //IntegerToString(group_width-(lx+text_width)));
|
||||
right.setXmlParam("relatw", "1");
|
||||
}
|
||||
}
|
||||
|
||||
tcenter.onTextChanged(string newtext) {
|
||||
resizeObjects();
|
||||
}
|
||||
|
||||
sg.onResize(int x, int y, int w, int h) {
|
||||
resizeObjects();
|
||||
}
|
||||
|
BIN
Src/resources/data/freeform/xml/wasabi/Scripts/titlebar.maki
Normal file
BIN
Src/resources/data/freeform/xml/wasabi/Scripts/titlebar.maki
Normal file
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue