Commit ff256cffc4a168e23e459bd627508d931ca6ff55
1 parent
942fb9cd
Exists in
master
and in
5 other branches
Iniciando implmentação do menu android
Showing
9 changed files
with
413 additions
and
25 deletions
Show diff stats
android/Makefile
... | ... | @@ -40,39 +40,65 @@ bin/classes/$(CLASSPATH)/%.class: src/$(CLASSPATH)/%.java |
40 | 40 | @echo "Compile thumb : `basename $@` <= `basename $<`" |
41 | 41 | @$(JAVAC) -classpath $(ANDROIDSDK)/platforms/android-15/android.jar -d bin/classes $< |
42 | 42 | |
43 | +res/drawable-xhdpi/%.png: %.svg | |
44 | + @echo "Gen XHDPI : `basename $@` <= `basename $<`" | |
45 | + @$(MKDIR) `dirname $@` | |
46 | + @$(CONVERT) --format=png --width=96 --height=96 --output=$@ $< | |
47 | + | |
48 | +res/drawable-mdpi/%.png: %.svg | |
49 | + @echo "Gen MDPI : `basename $@` <= `basename $<`" | |
50 | + @$(MKDIR) `dirname $@` | |
51 | + @$(CONVERT) --format=png --width=48 --height=48 --output=$@ $< | |
52 | + | |
53 | +res/drawable-ldpi/%.png: %.svg | |
54 | + @echo "Gen LDPI : `basename $@` <= `basename $<`" | |
55 | + @$(MKDIR) `dirname $@` | |
56 | + @$(CONVERT) --format=png --width=36 --height=36 --output=$@ $< | |
57 | + | |
58 | +res/drawable-hdpi/%.png: %.svg | |
59 | + @echo "Gen HDPI : `basename $@` <= `basename $<`" | |
60 | + @$(MKDIR) `dirname $@` | |
61 | + @$(CONVERT) --format=png --width=72 --height=72 --output=$@ $< | |
62 | + | |
43 | 63 | #---[ Targets ]---------------------------------------------------------------- |
44 | 64 | |
65 | +all: jni/lib3270jni.h icons | |
66 | + @$(NDKBUILD) | |
67 | + | |
45 | 68 | Debug: jni/lib3270jni.h icons |
46 | 69 | @$(NDKBUILD) |
47 | 70 | |
48 | -icons: $(foreach DIR, $(RESOLUTION), res/drawable-$(DIR)/ic_launcher.png) | |
71 | +icons: $(foreach DIR, $(RESOLUTION), res/drawable-$(DIR)/ic_launcher.png) \ | |
72 | + $(foreach DIR, $(RESOLUTION), res/drawable-$(DIR)/ic_connect.png) \ | |
73 | + $(foreach DIR, $(RESOLUTION), res/drawable-$(DIR)/ic_disconnect.png) \ | |
74 | + $(foreach DIR, $(RESOLUTION), res/drawable-$(DIR)/ic_settings.png) | |
49 | 75 | |
50 | 76 | clean: |
51 | 77 | @rm -fr obj |
52 | 78 | @rm -f jni/lib3270jni.h |
53 | 79 | @rm -f sigs.txt |
54 | 80 | @rm -f bin/classes/$(CLASSPATH)/lib3270.class |
55 | - @rm -f $(foreach DIR, $(RESOLUTION), res/drawable-$(DIR)/ic_launcher.png) | |
81 | + @rm -f $(foreach DIR, $(RESOLUTION), res/drawable-$(DIR)/*.png) | |
56 | 82 | |
57 | 83 | cleanDebug: clean |
58 | 84 | |
59 | 85 | res/drawable-xhdpi/ic_launcher.png: ../src/pw3270/pixmaps/pw3270.svg |
60 | - @echo " ICON xhdpi" | |
86 | + @echo "Laucher xhdpi : `basename $@` <= `basename $<`" | |
61 | 87 | @$(MKDIR) `dirname $@` |
62 | 88 | @$(CONVERT) --format=png --width=96 --height=96 --output=$@ $< |
63 | 89 | |
64 | 90 | res/drawable-mdpi/ic_launcher.png: ../src/pw3270/pixmaps/pw3270.svg |
65 | - @echo " ICON mdpi" | |
91 | + @echo "Laucher mdpi : `basename $@` <= `basename $<`" | |
66 | 92 | @$(MKDIR) `dirname $@` |
67 | 93 | @$(CONVERT) --format=png --width=48 --height=48 --output=$@ $< |
68 | 94 | |
69 | 95 | res/drawable-ldpi/ic_launcher.png: ../src/pw3270/pixmaps/pw3270.svg |
70 | - @echo " ICON ldpi" | |
96 | + @echo "Laucher ldpi : `basename $@` <= `basename $<`" | |
71 | 97 | @$(MKDIR) `dirname $@` |
72 | 98 | @$(CONVERT) --format=png --width=36 --height=36 --output=$@ $< |
73 | 99 | |
74 | 100 | res/drawable-hdpi/ic_launcher.png: ../src/pw3270/pixmaps/pw3270.svg |
75 | - @echo " ICON hdpi" | |
101 | + @echo "Laucher hdpi : `basename $@` <= `basename $<`" | |
76 | 102 | @$(MKDIR) `dirname $@` |
77 | 103 | @$(CONVERT) --format=png --width=72 --height=72 --output=$@ $< |
78 | 104 | ... | ... |
... | ... | @@ -0,0 +1,93 @@ |
1 | +<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
2 | +<!-- Created with Inkscape (http://www.inkscape.org/) --> | |
3 | + | |
4 | +<svg | |
5 | + xmlns:dc="http://purl.org/dc/elements/1.1/" | |
6 | + xmlns:cc="http://creativecommons.org/ns#" | |
7 | + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | |
8 | + xmlns:svg="http://www.w3.org/2000/svg" | |
9 | + xmlns="http://www.w3.org/2000/svg" | |
10 | + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" | |
11 | + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" | |
12 | + width="45.000008" | |
13 | + height="44.796928" | |
14 | + id="svg4447" | |
15 | + version="1.1" | |
16 | + inkscape:version="0.48.2 r9819" | |
17 | + sodipodi:docname="connect.svg"> | |
18 | + <defs | |
19 | + id="defs4449" /> | |
20 | + <sodipodi:namedview | |
21 | + id="base" | |
22 | + pagecolor="#ffffff" | |
23 | + bordercolor="#666666" | |
24 | + borderopacity="1.0" | |
25 | + inkscape:pageopacity="0.0" | |
26 | + inkscape:pageshadow="2" | |
27 | + inkscape:zoom="5.6" | |
28 | + inkscape:cx="-8.8755188" | |
29 | + inkscape:cy="16.217373" | |
30 | + inkscape:document-units="px" | |
31 | + inkscape:current-layer="layer1" | |
32 | + showgrid="false" | |
33 | + fit-margin-top="0" | |
34 | + fit-margin-left="0" | |
35 | + fit-margin-right="0" | |
36 | + fit-margin-bottom="0" | |
37 | + inkscape:window-width="1280" | |
38 | + inkscape:window-height="966" | |
39 | + inkscape:window-x="0" | |
40 | + inkscape:window-y="26" | |
41 | + inkscape:window-maximized="1" /> | |
42 | + <metadata | |
43 | + id="metadata4452"> | |
44 | + <rdf:RDF> | |
45 | + <cc:Work | |
46 | + rdf:about=""> | |
47 | + <dc:format>image/svg+xml</dc:format> | |
48 | + <dc:type | |
49 | + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> | |
50 | + <dc:title /> | |
51 | + </cc:Work> | |
52 | + </rdf:RDF> | |
53 | + </metadata> | |
54 | + <g | |
55 | + inkscape:label="Camada 1" | |
56 | + inkscape:groupmode="layer" | |
57 | + id="layer1" | |
58 | + transform="translate(-349.54724,-503.78263)"> | |
59 | + <g | |
60 | + id="g2987" | |
61 | + transform="translate(-7.0314067,0)"> | |
62 | + <g | |
63 | + id="Battery_-_charging" | |
64 | + transform="translate(281.87974,386.63159)"> | |
65 | + <path | |
66 | + sodipodi:nodetypes="ccssccccccccccscc" | |
67 | + id="path1353" | |
68 | + d="m 112.668,142.443 -9.347,0 0,10e-4 c 0,3.977 -3.256,7.232 -7.234,7.232 l -6.6,0 0,-2.894 -7.232,0 0,-4.339 7.232,0 0,-5.742 -7.232,0 0,-4.34 7.232,0 0,-2.938 6.6,0 c 3.979,0 7.234,3.254 7.234,7.232 l 9.348,0" | |
69 | + inkscape:connector-curvature="0" | |
70 | + style="fill:#333333" /> | |
71 | + </g> | |
72 | + <g | |
73 | + transform="matrix(1.2859907,0,0,1,-89.445423,-0.17091598)" | |
74 | + style="fill:#333333;fill-opacity:1;stroke:#333333;stroke-opacity:1" | |
75 | + id="g4566"> | |
76 | + <rect | |
77 | + style="fill:#333333;fill-opacity:1;stroke:#333333;stroke-width:0.65551269;stroke-linecap:butt;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" | |
78 | + id="rect4546" | |
79 | + width="3.2658451" | |
80 | + height="19.597486" | |
81 | + x="354.63577" | |
82 | + y="516.50861" /> | |
83 | + <rect | |
84 | + style="fill:#333333;fill-opacity:1;stroke:#333333;stroke-width:0.69507933;stroke-linecap:butt;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" | |
85 | + id="rect4546-4" | |
86 | + width="3.2262783" | |
87 | + height="22.30492" | |
88 | + x="352.60605" | |
89 | + y="515.15491" /> | |
90 | + </g> | |
91 | + </g> | |
92 | + </g> | |
93 | +</svg> | ... | ... |
... | ... | @@ -0,0 +1,89 @@ |
1 | +<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
2 | +<!-- Created with Inkscape (http://www.inkscape.org/) --> | |
3 | + | |
4 | +<svg | |
5 | + xmlns:dc="http://purl.org/dc/elements/1.1/" | |
6 | + xmlns:cc="http://creativecommons.org/ns#" | |
7 | + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | |
8 | + xmlns:svg="http://www.w3.org/2000/svg" | |
9 | + xmlns="http://www.w3.org/2000/svg" | |
10 | + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" | |
11 | + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" | |
12 | + width="45.000008" | |
13 | + height="44.796928" | |
14 | + id="svg4447" | |
15 | + version="1.1" | |
16 | + inkscape:version="0.48.2 r9819" | |
17 | + sodipodi:docname="disconnect.svg"> | |
18 | + <defs | |
19 | + id="defs4449" /> | |
20 | + <sodipodi:namedview | |
21 | + id="base" | |
22 | + pagecolor="#ffffff" | |
23 | + bordercolor="#666666" | |
24 | + borderopacity="1.0" | |
25 | + inkscape:pageopacity="0.0" | |
26 | + inkscape:pageshadow="2" | |
27 | + inkscape:zoom="7.9195959" | |
28 | + inkscape:cx="16.481624" | |
29 | + inkscape:cy="16.217373" | |
30 | + inkscape:document-units="px" | |
31 | + inkscape:current-layer="layer1" | |
32 | + showgrid="false" | |
33 | + fit-margin-top="0" | |
34 | + fit-margin-left="0" | |
35 | + fit-margin-right="0" | |
36 | + fit-margin-bottom="0" | |
37 | + inkscape:window-width="1280" | |
38 | + inkscape:window-height="966" | |
39 | + inkscape:window-x="0" | |
40 | + inkscape:window-y="26" | |
41 | + inkscape:window-maximized="1" /> | |
42 | + <metadata | |
43 | + id="metadata4452"> | |
44 | + <rdf:RDF> | |
45 | + <cc:Work | |
46 | + rdf:about=""> | |
47 | + <dc:format>image/svg+xml</dc:format> | |
48 | + <dc:type | |
49 | + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> | |
50 | + <dc:title></dc:title> | |
51 | + </cc:Work> | |
52 | + </rdf:RDF> | |
53 | + </metadata> | |
54 | + <g | |
55 | + inkscape:label="Camada 1" | |
56 | + inkscape:groupmode="layer" | |
57 | + id="layer1" | |
58 | + transform="translate(-349.54724,-503.78263)"> | |
59 | + <g | |
60 | + transform="translate(281.87974,386.63159)" | |
61 | + id="Battery_-_charging"> | |
62 | + <path | |
63 | + style="fill:#333333" | |
64 | + inkscape:connector-curvature="0" | |
65 | + d="m 112.668,142.443 -9.347,0 0,10e-4 c 0,3.977 -3.256,7.232 -7.234,7.232 l -6.6,0 0,-2.894 -7.232,0 0,-4.339 7.232,0 0,-5.742 -7.232,0 0,-4.34 7.232,0 0,-2.938 6.6,0 c 3.979,0 7.234,3.254 7.234,7.232 l 9.348,0" | |
66 | + id="path1353" | |
67 | + sodipodi:nodetypes="ccssccccccccccscc" /> | |
68 | + </g> | |
69 | + <g | |
70 | + id="g4566" | |
71 | + style="fill:#333333;fill-opacity:1;stroke:#333333;stroke-opacity:1" | |
72 | + transform="translate(1.2626907,-0.12627312)"> | |
73 | + <rect | |
74 | + y="516.50861" | |
75 | + x="354.63577" | |
76 | + height="19.597486" | |
77 | + width="3.2658451" | |
78 | + id="rect4546" | |
79 | + style="fill:#333333;fill-opacity:1;stroke:#333333;stroke-width:0.65551269;stroke-linecap:butt;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> | |
80 | + <rect | |
81 | + y="515.15491" | |
82 | + x="352.60605" | |
83 | + height="22.30492" | |
84 | + width="3.2262783" | |
85 | + id="rect4546-4" | |
86 | + style="fill:#333333;fill-opacity:1;stroke:#333333;stroke-width:0.69507933;stroke-linecap:butt;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" /> | |
87 | + </g> | |
88 | + </g> | |
89 | +</svg> | ... | ... |
... | ... | @@ -0,0 +1,77 @@ |
1 | +<?xml version="1.0" encoding="UTF-8" standalone="no"?> | |
2 | +<!-- Created with Inkscape (http://www.inkscape.org/) --> | |
3 | + | |
4 | +<svg | |
5 | + xmlns:dc="http://purl.org/dc/elements/1.1/" | |
6 | + xmlns:cc="http://creativecommons.org/ns#" | |
7 | + xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" | |
8 | + xmlns:svg="http://www.w3.org/2000/svg" | |
9 | + xmlns="http://www.w3.org/2000/svg" | |
10 | + xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd" | |
11 | + xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape" | |
12 | + width="45.000008" | |
13 | + height="44.796928" | |
14 | + id="svg4447" | |
15 | + version="1.1" | |
16 | + inkscape:version="0.48.2 r9819" | |
17 | + sodipodi:docname="Novo documento 2"> | |
18 | + <defs | |
19 | + id="defs4449" /> | |
20 | + <sodipodi:namedview | |
21 | + id="base" | |
22 | + pagecolor="#ffffff" | |
23 | + bordercolor="#666666" | |
24 | + borderopacity="1.0" | |
25 | + inkscape:pageopacity="0.0" | |
26 | + inkscape:pageshadow="2" | |
27 | + inkscape:zoom="5.6" | |
28 | + inkscape:cx="10.30575" | |
29 | + inkscape:cy="16.217373" | |
30 | + inkscape:document-units="px" | |
31 | + inkscape:current-layer="layer1" | |
32 | + showgrid="false" | |
33 | + fit-margin-top="0" | |
34 | + fit-margin-left="0" | |
35 | + fit-margin-right="0" | |
36 | + fit-margin-bottom="0" | |
37 | + inkscape:window-width="1280" | |
38 | + inkscape:window-height="966" | |
39 | + inkscape:window-x="0" | |
40 | + inkscape:window-y="26" | |
41 | + inkscape:window-maximized="1" /> | |
42 | + <metadata | |
43 | + id="metadata4452"> | |
44 | + <rdf:RDF> | |
45 | + <cc:Work | |
46 | + rdf:about=""> | |
47 | + <dc:format>image/svg+xml</dc:format> | |
48 | + <dc:type | |
49 | + rdf:resource="http://purl.org/dc/dcmitype/StillImage" /> | |
50 | + <dc:title></dc:title> | |
51 | + </cc:Work> | |
52 | + </rdf:RDF> | |
53 | + </metadata> | |
54 | + <g | |
55 | + inkscape:label="Camada 1" | |
56 | + inkscape:groupmode="layer" | |
57 | + id="layer1" | |
58 | + transform="translate(-349.54724,-503.78263)"> | |
59 | + <g | |
60 | + transform="translate(222.09224,-33.108444)" | |
61 | + id="Settings"> | |
62 | + <g | |
63 | + id="g1208"> | |
64 | + <path | |
65 | + style="fill:#333333" | |
66 | + inkscape:connector-curvature="0" | |
67 | + d="m 169.92,548.999 c -0.181,-0.441 -0.497,-0.633 -0.703,-0.426 -0.206,0.205 -0.575,0.451 -0.819,0.543 -0.244,0.094 -1.056,-0.443 -1.392,-0.779 h -0.001 c -0.336,-0.338 -0.688,-0.813 -0.78,-1.057 -0.092,-0.244 0.444,-1.055 0.78,-1.393 l 0.011,-0.01 c 0.337,-0.338 0.348,-0.898 0.023,-1.248 l -3.978,-3.666 c -0.374,-0.295 -0.851,-0.248 -1.059,0.104 -0.209,0.35 -0.555,0.76 -0.769,0.91 -0.214,0.148 -1.133,-0.17 -1.541,-0.414 -0.409,-0.242 -0.866,-0.617 -1.017,-0.83 -0.149,-0.215 0.132,-1.066 0.326,-1.393 0.194,-0.328 -0.013,-0.729 -0.461,-0.889 l -5.998,-1.547 c -0.47,-0.078 -0.854,0.205 -0.854,0.631 0,0.426 -0.088,0.969 -0.194,1.207 -0.107,0.238 -1.061,0.434 -1.536,0.434 -0.475,0 -1.06,-0.088 -1.298,-0.195 -0.238,-0.107 -0.433,-1.02 -0.433,-1.445 0,-0.425 -0.384,-0.709 -0.854,-0.631 l -5.998,1.547 c -0.448,0.16 -0.655,0.561 -0.461,0.889 0.195,0.326 0.379,0.807 0.408,1.066 0.03,0.258 -0.689,0.914 -1.099,1.156 -0.408,0.244 -0.955,0.467 -1.215,0.496 -0.26,0.029 -0.885,-0.643 -1.095,-0.992 -0.208,-0.352 -0.686,-0.398 -1.06,-0.104 l -3.978,3.666 c -0.324,0.35 -0.313,0.91 0.024,1.248 l 0.011,0.01 c 0.336,0.338 0.688,0.813 0.78,1.057 0.092,0.244 -0.444,1.055 -0.781,1.393 -0.336,0.336 -0.812,0.688 -1.056,0.779 -0.244,0.091 -0.949,-0.338 -1.155,-0.543 -0.206,-0.207 -0.522,-0.016 -0.703,0.426 0,0 -2.54,6.197 -2.54,10.189 0,12.428 10.073,22.5 22.5,22.5 12.427,0 22.5,-10.072 22.5,-22.5 0.005,-3.992 -2.535,-10.189 -2.535,-10.189 z m -19.96,21.541 c -6.213,0 -11.25,-5.037 -11.25,-11.25 0,-5.076 3.363,-9.363 7.981,-10.764 l 2.882,-5.764 c 0.213,-0.426 0.561,-0.426 0.773,0 l 2.882,5.764 c 4.619,1.4 7.981,5.688 7.981,10.764 0.001,6.213 -5.036,11.25 -11.249,11.25 z" | |
68 | + id="path1210" /> | |
69 | + <path | |
70 | + style="fill:#333333" | |
71 | + inkscape:connector-curvature="0" | |
72 | + d="m 149.96,551.501 c -4.295,0 -7.788,3.494 -7.788,7.789 0,4.295 3.493,7.787 7.788,7.787 4.295,0 7.788,-3.492 7.788,-7.787 0,-4.295 -3.493,-7.789 -7.788,-7.789 z" | |
73 | + id="path1212" /> | |
74 | + </g> | |
75 | + </g> | |
76 | + </g> | |
77 | +</svg> | ... | ... |
... | ... | @@ -0,0 +1,53 @@ |
1 | +/* | |
2 | + * "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270 | |
3 | + * (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a | |
4 | + * aplicativos mainframe. Registro no INPI sob o nome G3270. Registro no INPI sob o nome G3270. | |
5 | + * | |
6 | + * Copyright (C) <2008> <Banco do Brasil S.A.> | |
7 | + * | |
8 | + * Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob | |
9 | + * os termos da GPL v.2 - Licença Pública Geral GNU, conforme publicado pela | |
10 | + * Free Software Foundation. | |
11 | + * | |
12 | + * Este programa é distribuído na expectativa de ser útil, mas SEM QUALQUER | |
13 | + * GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou de ADEQUAÇÃO | |
14 | + * A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para | |
15 | + * obter mais detalhes. | |
16 | + * | |
17 | + * Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este | |
18 | + * programa; se não, escreva para a Free Software Foundation, Inc., 59 Temple | |
19 | + * Place, Suite 330, Boston, MA, 02111-1307, USA | |
20 | + * | |
21 | + * Este programa está nomeado como actions.cpp e possui - linhas de código. | |
22 | + * | |
23 | + * Contatos: | |
24 | + * | |
25 | + * perry.werneck@gmail.com (Alexandre Perry de Souza Werneck) | |
26 | + * | |
27 | + */ | |
28 | + | |
29 | + #include "globals.h" | |
30 | + #include <lib3270/actions.h> | |
31 | + #include <string.h> | |
32 | + | |
33 | +/*--[ Implement ]------------------------------------------------------------------------------------*/ | |
34 | + | |
35 | +JNIEXPORT void JNICALL Java_br_com_bb_pw3270_lib3270_sendEnter(JNIEnv *env, jobject obj) | |
36 | +{ | |
37 | + PW3270_JNI_BEGIN | |
38 | + | |
39 | + lib3270_enter(PW3270_SESSION); | |
40 | + | |
41 | + PW3270_JNI_END | |
42 | +} | |
43 | + | |
44 | +JNIEXPORT void JNICALL Java_br_com_bb_pw3270_lib3270_sendPFkey(JNIEnv *env, jobject obj, jint key) | |
45 | +{ | |
46 | + PW3270_JNI_BEGIN | |
47 | + | |
48 | + lib3270_pfkey(PW3270_SESSION,key); | |
49 | + | |
50 | + PW3270_JNI_END | |
51 | +} | |
52 | + | |
53 | + | ... | ... |
... | ... | @@ -0,0 +1,15 @@ |
1 | +<?xml version="1.0" encoding="utf-8"?> | |
2 | +<menu xmlns:android="http://schemas.android.com/apk/res/android" | |
3 | + android:layout_width="match_parent" | |
4 | + android:layout_height="match_parent" > | |
5 | + | |
6 | + <item android:id="@+id/connect" | |
7 | + android:icon="@drawable/ic_connect" | |
8 | + android:title="Conectar" /> | |
9 | + <item android:id="@+id/disconnect" | |
10 | + android:icon="@drawable/ic_disconnect" | |
11 | + android:title="Desconectar" /> | |
12 | + <item android:id="@+id/settings" | |
13 | + android:icon="@drawable/ic_settings" | |
14 | + android:title="Configurar" /> | |
15 | +</menu> | ... | ... |
android/src/br/com/bb/pw3270/PW3270Activity.java
... | ... | @@ -15,6 +15,10 @@ import android.webkit.WebViewClient; |
15 | 15 | import android.webkit.WebResourceResponse; |
16 | 16 | import android.webkit.WebChromeClient; |
17 | 17 | import android.app.ProgressDialog; |
18 | +import android.view.Menu; | |
19 | +import android.view.MenuInflater; | |
20 | +import android.view.MenuItem; | |
21 | + | |
18 | 22 | // import java.io.InputStream; |
19 | 23 | |
20 | 24 | // import android.app.Dialog; |
... | ... | @@ -63,17 +67,21 @@ public class PW3270Activity extends Activity |
63 | 67 | view.reload(); |
64 | 68 | } |
65 | 69 | |
66 | - protected void showProgramMessage(int id) | |
70 | + protected boolean showProgramMessage(int id) | |
67 | 71 | { |
68 | - String message[] = res.getStringArray(R.array.program_msg); | |
69 | - try | |
70 | - { | |
71 | - showProgressDialog(message[id]); | |
72 | - } catch(Exception e) | |
72 | + if(!super.showProgramMessage(id)) | |
73 | 73 | { |
74 | - Log.e(TAG,e.getLocalizedMessage()); | |
75 | - showProgressDialog("?"); | |
74 | + String message[] = res.getStringArray(R.array.program_msg); | |
75 | + try | |
76 | + { | |
77 | + showProgressDialog(message[id]); | |
78 | + } catch(Exception e) | |
79 | + { | |
80 | + Log.e(TAG,e.getLocalizedMessage()); | |
81 | + showProgressDialog("?"); | |
82 | + } | |
76 | 83 | } |
84 | + return true; | |
77 | 85 | } |
78 | 86 | |
79 | 87 | protected void popupMessage(int type, String title, String text, String info) |
... | ... | @@ -88,6 +96,7 @@ public class PW3270Activity extends Activity |
88 | 96 | d.show(); |
89 | 97 | } |
90 | 98 | |
99 | + @SuppressWarnings("unused") | |
91 | 100 | public String getscreencontents() |
92 | 101 | { |
93 | 102 | String text; |
... | ... | @@ -170,4 +179,33 @@ public class PW3270Activity extends Activity |
170 | 179 | |
171 | 180 | } |
172 | 181 | |
182 | + @Override | |
183 | + public boolean onCreateOptionsMenu(Menu menu) | |
184 | + { | |
185 | + MenuInflater inflater = getMenuInflater(); | |
186 | + Log.d(TAG,"Popup menu"); | |
187 | + inflater.inflate(R.layout.menu, menu); | |
188 | + return true; | |
189 | + } | |
190 | + | |
191 | + @Override | |
192 | + public boolean onOptionsItemSelected(MenuItem item) | |
193 | + { | |
194 | + // Handle item selection | |
195 | + Log.d(TAG,"Menu item selected"); | |
196 | + /* | |
197 | + switch (item.getItemId()) { | |
198 | + case R.id.new_game: | |
199 | + newGame(); | |
200 | + return true; | |
201 | + case R.id.help: | |
202 | + showHelp(); | |
203 | + return true; | |
204 | + default: | |
205 | + return super.onOptionsItemSelected(item); | |
206 | + } | |
207 | + */ | |
208 | + return super.onOptionsItemSelected(item); | |
209 | + } | |
210 | + | |
173 | 211 | } | ... | ... |
android/src/br/com/bb/pw3270/lib3270.java
... | ... | @@ -259,7 +259,7 @@ public class lib3270 { |
259 | 259 | break; |
260 | 260 | |
261 | 261 | case 1: // OIA message has changed |
262 | - updateProgramMessage(msg.arg1); | |
262 | + showProgramMessage(msg.arg1); | |
263 | 263 | break; |
264 | 264 | |
265 | 265 | case 2: // Screen changed |
... | ... | @@ -302,22 +302,16 @@ public class lib3270 { |
302 | 302 | |
303 | 303 | /*---[ Signal methods ]--------------------------------------------------*/ |
304 | 304 | |
305 | - protected void showProgramMessage(int id) | |
306 | - { | |
307 | - | |
308 | - } | |
309 | - | |
310 | - private void updateProgramMessage(int id) | |
305 | + protected boolean showProgramMessage(int id) | |
311 | 306 | { |
312 | 307 | if(id == 0 && screenState != 0) |
313 | 308 | { |
314 | 309 | screenState = 0; |
315 | 310 | updateScreen(); |
311 | + return true; | |
316 | 312 | } |
317 | - else | |
318 | - { | |
319 | - showProgramMessage(id); | |
320 | - } | |
313 | + | |
314 | + return false; | |
321 | 315 | } |
322 | 316 | |
323 | 317 | protected void popupMessage(int type, String title, String text, String info) { | ... | ... |