-
Notifications
You must be signed in to change notification settings - Fork 47
/
Copy pathHelpDialog.patch
107 lines (107 loc) · 3.61 KB
/
HelpDialog.patch
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
--- /dev/null
+++ src/main/java/com/lushprojects/circuitjs1/client/HelpDialog.java
@@ -0,0 +1,104 @@
+/*
+ Copyright (C) Paul Falstad, Iain Sharp and Usevalad Khatkevich
+
+ This file is part of CircuitJS1.
+
+ CircuitJS1 is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 2 of the License, or
+ (at your option) any later version.
+
+ CircuitJS1 is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with CircuitJS1. If not, see <http://www.gnu.org/licenses/>.
+*/
+
+package com.lushprojects.circuitjs1.client;
+
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.event.dom.client.ClickHandler;
+import com.google.gwt.user.client.ui.DialogBox;
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.HTML;
+import com.google.gwt.user.client.ui.HasHorizontalAlignment;
+import com.google.gwt.user.client.ui.Button;
+import com.google.gwt.user.client.ui.TabPanel;
+import com.lushprojects.circuitjs1.client.util.Locale;
+
+public class HelpDialog extends DialogBox {
+
+ HorizontalPanel hp;
+ VerticalPanel vp;
+ Button okButton;
+ VerticalPanel vpEN;
+ VerticalPanel vpRU;
+ VerticalPanel vpPL;
+ VerticalPanel vpDE;
+ VerticalPanel vpDA;
+
+ HelpDialog() {
+ super();
+ vp = new VerticalPanel();
+ setWidget(vp);
+ setText(Locale.LS("Help"));
+
+ TabPanel tp = new TabPanel();
+ vp.add(tp);
+ String tab1Title = "EN";
+ String tab2Title = "RU";
+ //String tab3Title = "PL";
+ //String tab4Title = "DE";
+ //String tab5Title = "DA";
+
+ //create tabs
+ tp.add(vpEN = new VerticalPanel(), tab1Title);
+ vpEN.setWidth("500px");
+ vpEN.add(new HTML("<iframe style=\"border:0;\" src=\"help/EN.html\" width=\"500\" height=\"400\" scrolling=\"auto\" frameborder=\"1\"></iframe>"));
+
+ tp.add(vpRU = new VerticalPanel(), tab2Title);
+ vpRU.setWidth("500px");
+ vpRU.add(new HTML("<iframe style=\"border:0;\" src=\"help/RU.html\" width=\"500\" height=\"400\" scrolling=\"auto\" frameborder=\"1\"></iframe>"));
+/*
+ tp.add(vpPL = new VerticalPanel(), tab3Title);
+ vpPL.setWidth("500px");
+ vpPL.add(new HTML("<iframe style=\"border:0;\" src=\"help/PL.html\" width=\"500\" height=\"400\" scrolling=\"auto\" frameborder=\"1\"></iframe>"));
+
+ tp.add(vpDE = new VerticalPanel(), tab4Title);
+ vpDE.setWidth("500px");
+ vpDE.add(new HTML("<iframe style=\"border:0;\" src=\"help/DE.html\" width=\"500\" height=\"400\" scrolling=\"auto\" frameborder=\"1\"></iframe>"));
+
+ tp.add(vpDA = new VerticalPanel(), tab5Title);
+ vpDA.setWidth("500px");
+ vpDA.add(new HTML("<iframe style=\"border:0;\" src=\"help/DA.html\" width=\"500\" height=\"400\" scrolling=\"auto\" frameborder=\"1\"></iframe>"));
+*/
+ HorizontalPanel hp = new HorizontalPanel();
+ hp.setWidth("100%");
+ hp.setHorizontalAlignment(HasHorizontalAlignment.ALIGN_LEFT);
+ hp.setStyleName("topSpace");
+
+ //select first tab
+ tp.selectTab(0);
+
+ //set width if tabpanel
+ tp.setWidth("500");
+
+ vp.add(hp);
+ hp.add(okButton = new Button("OK"));
+ okButton.addClickHandler(new ClickHandler() {
+ public void onClick(ClickEvent event) {
+ closeDialog();
+ }
+ });
+ center();
+ show();
+ }
+
+ protected void closeDialog() {
+ hide();
+ }
+}