forked from cztomczak/cefpython
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathwindow.html
More file actions
44 lines (40 loc) · 1.5 KB
/
window.html
File metadata and controls
44 lines (40 loc) · 1.5 KB
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
<html>
<head>
<title>Window Test</title>
<script>
function send_message(test, params) {
// This will result in a call to OnProcessMessageReceived in window_test.cpp.
app.sendMessage('WindowTest.' + test, params);
}
function minimize() {
send_message('Minimize');
}
function maximize() {
send_message('Maximize');
}
function restore() {
minimize();
setTimeout(function() { send_message('Restore'); }, 1000);
}
function position() {
var x = parseInt(document.getElementById('x').value);
var y = parseInt(document.getElementById('y').value);
var width = parseInt(document.getElementById('width').value);
var height = parseInt(document.getElementById('height').value);
if (isNaN(x) || isNaN(y) || isNaN(width) || isNaN(height))
alert('Please specify a valid numeric value.');
else
send_message('Position', [x, y, width, height]);
}
</script>
</head>
<body bgcolor="white">
<form>
Click a button to perform the associated window action.
<br/><input type="button" onclick="minimize();" value="Minimize">
<br/><input type="button" onclick="maximize();" value="Maximize">
<br/><input type="button" onclick="restore();" value="Restore"> (minimizes and then restores the window as topmost)
<br/><input type="button" onclick="position();" value="Set Position"> X: <input type="text" size="4" id="x" value="200"> Y: <input type="text" size="4" id="y" value="100"> Width: <input type="text" size="4" id="width" value="800"> Height: <input type="text" size="4" id="height" value="600">
</form>
</body>
</html>