initial checkin
[org.ibex.nanogoat.git] / src / org / ibex / builtin / proxy_authorization.ibex
1 <ibex>
2
3     <import name="org.ibex.builtin.*"/>
4     <template thisbox="frame" minwidth="397" maxwidth="397" minheight="243" maxheight="243"
5               vpad="20" hpad="10" titlebar="Enter Network Password">
6
7         _KeyPressed = function(k) {
8             if (k == "tab") {
9                 if ($password.focused) $user.focused = true;
10                 else $password.focused = true;
11             } else if (k == "enter") {
12                 $ok.click = true;
13             }
14         }
15
16         $cancel._click = function() { thisbox = null; }
17
18         $user._focused = function(f) {
19             ibex.println("user.focused = " + f);
20             if (f) $password.focused = false;
21         }
22
23         $password._focused = function(f) {
24             ibex.println("password.focused = " + f);
25             if (f) $user.focused = false;
26         }
27
28         _proxyIP = function(p) { $firewall.text = p; }
29         _realm = function(r) { $realm.text = r; }
30         $user._SizeChange = function() { $password.height = $user.height; }
31
32         $ok._click = function() {
33             ibex.proxyAuthorization = $user.text + ":" + $password.text;
34             thisbox = null;
35         }
36
37         <box hshrink="true">
38             <box width="10"/>
39             <box>
40                 <box sizetoimage="true" image="key" align="topleft"/>
41             </box>
42             <box width="10"/>
43         </box>
44
45         <box orient="vertical">
46             <box font="dialog8" text="Please type your user name and password." vshrink="true"/>
47             <box height="13"/>
48             <box>
49                 <box width="75" font="dialog8" text="Firewall:" vshrink="true"/>
50                 <box vshrink="true" font="dialog8" text="unknown" id="firewall"/>
51             </box>
52             <box height="13"/>
53             <box>
54                 <box width="75" font="dialog8" text="Realm" vshrink="true"/>
55                 <box vshrink="true" font="dialog8" text="unknown" id="realm"/>
56             </box>
57             <box height="22"/>
58             <box>
59                 <box width="75" font="dialog8" text="User Name" vshrink="true"/>
60                 <box border="bevel_2_down" hpad="2" vpad="2">
61                     <edit color="white" id="user" focused="true"/>
62                 </box>
63             </box>
64             <box height="10"/>
65             <box>
66                 <box width="75" font="dialog8" text="Password" vshrink="true"/>
67                 <box border="bevel_2_down" hpad="2" vpad="2">
68                     <edit color="white" id="password" font="org.ibex.builtin.password12" focused="false"/>
69                 </box>
70             </box>
71             <box height="30"/>
72             <box>
73                 <box/>
74                 <button width="75" height="24" id="ok">
75                     <box font="dialog8" text="OK" shrink="true"/>
76                 </button>
77                 <box width="20"/>
78                 <button width="75" height="24" id="cancel">
79                     <box font="dialog8" text="Cancel" shrink="true"/>
80                 </button>
81             </box>
82             <box/>
83         </box>
84
85     </template>
86
87 </ibex>