-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathkcwctrl.js
151 lines (147 loc) · 4.3 KB
/
kcwctrl.js
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
//----------------------------------------------------------------------------------
//
// CRUNKCWCTRL Objet Window Control
//
//----------------------------------------------------------------------------------
/* Copyright (c) 1996-2012 Clickteam
*
* This source code is part of the HTML5 exporter for Clickteam Multimedia Fusion 2.
*
* Permission is hereby granted to any person obtaining a legal copy
* of Clickteam Multimedia Fusion 2 to use or modify this source code for
* debugging, optimizing, or customizing applications created with
* Clickteam Multimedia Fusion 2.
* Any other use of this source code is prohibited.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
CRunkcwctrl.CND_ISICONIC = 0;
CRunkcwctrl.CND_ISMAXIMIZED = 1;
CRunkcwctrl.CND_ISVISIBLE = 2;
CRunkcwctrl.CND_ISAPPACTIVE = 3;
CRunkcwctrl.CND_HASFOCUS = 4;
CRunkcwctrl.CND_ISATTACHEDTODESKTOP = 5;
CRunkcwctrl.CND_LAST = 6;
CRunkcwctrl.ACT_SETBACKCOLOR = 23;
CRunkcwctrl.EXP_GETXPOSITION = 0;
CRunkcwctrl.EXP_GETYPOSITION = 1;
CRunkcwctrl.EXP_GETXSIZE = 2;
CRunkcwctrl.EXP_GETYSIZE = 3;
CRunkcwctrl.EXP_GETSCREENXSIZE = 4;
CRunkcwctrl.EXP_GETSCREENYSIZE = 5;
CRunkcwctrl.EXP_GETSCREENDEPTH = 6;
CRunkcwctrl.EXP_GETCLIENTXSIZE = 7;
CRunkcwctrl.EXP_GETCLIENTYSIZE = 8;
CRunkcwctrl.EXP_GETTITLE = 9;
CRunkcwctrl.EXP_GETBACKCOLOR = 10;
CRunkcwctrl.EXP_GETXFRAME = 11;
CRunkcwctrl.EXP_GETYFRAME = 12;
CRunkcwctrl.EXP_GETWFRAME = 13;
CRunkcwctrl.EXP_GETHFRAME = 14;
function CRunkcwctrl()
{
}
CRunkcwctrl.prototype = CServices.extend(new CRunExtension(),
{
getNumberOfConditions: function ()
{
return CRunkcwctrl.CND_LAST;
},
// Conditions
// --------------------------------------------------
condition: function (num, cnd)
{
switch (num)
{
case CRunkcwctrl.CND_ISICONIC:
return false;
case CRunkcwctrl.CND_ISMAXIMIZED:
return false;
case CRunkcwctrl.CND_ISVISIBLE:
return true;
case CRunkcwctrl.CND_ISAPPACTIVE:
return true;
case CRunkcwctrl.CND_HASFOCUS:
return this.rh.rhApp.bActivated;
case CRunkcwctrl.CND_ISATTACHEDTODESKTOP:
return false;
}
return false;
},
// Expressions
// --------------------------------------------
getScreenWidth: function ()
{
return screen.width;
},
getScreenHeight: function ()
{
return screen.height;
},
getWindowWidth: function ()
{
var winW = 630;
if (document.body && document.body.offsetWidth)
{
winW = document.body.offsetWidth;
}
if (document.compatMode == 'CSS1Compat' &&
document.documentElement &&
document.documentElement.offsetWidth)
{
winW = document.documentElement.offsetWidth;
}
if (window.innerWidth && window.innerHeight)
{
winW = window.innerWidth;
}
return winW;
},
getWindowHeight: function ()
{
return winH;
},
expression: function (num)
{
switch (num)
{
case CRunkcwctrl.EXP_GETXPOSITION:
return (0);
case CRunkcwctrl.EXP_GETYPOSITION:
return (0);
case CRunkcwctrl.EXP_GETXSIZE:
return window.outerWidth;
case CRunkcwctrl.EXP_GETYSIZE:
return window.outerHeight;
case CRunkcwctrl.EXP_GETSCREENXSIZE:
return this.getScreenWidth();
case CRunkcwctrl.EXP_GETSCREENYSIZE:
return this.getScreenHeight();
case CRunkcwctrl.EXP_GETSCREENDEPTH:
return window.colorDepth;
case CRunkcwctrl.EXP_GETCLIENTXSIZE:
return window.innerWidth;
case CRunkcwctrl.EXP_GETCLIENTYSIZE:
return window.innerHeight;
case CRunkcwctrl.EXP_GETTITLE:
return document.title;
case CRunkcwctrl.EXP_GETBACKCOLOR:
return (this.rh.rhApp.gaBorderColour);
case CRunkcwctrl.EXP_GETXFRAME:
return (0);
case CRunkcwctrl.EXP_GETYFRAME:
return (0);
case CRunkcwctrl.EXP_GETWFRAME:
return this.rh.rhApp.gaCxWin;
case CRunkcwctrl.EXP_GETHFRAME:
return this.rh.rhApp.gaCyWin;
}
return 0;
}
});