Author: jleroux
Date: Sun Jul 27 09:40:33 2008 New Revision: 680147 URL: http://svn.apache.org/viewvc?rev=680147&view=rev Log: Add a numbers line in keyboard and simplify/clean the code + some comments about XUI 800*600 hardcoded dialog size Modified: ofbiz/trunk/specialpurpose/pos/screens/default/dialog/keyboard.xml ofbiz/trunk/specialpurpose/pos/screens/default/menu/posmain.xml ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/Keyboard.java ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/NumericKeypad.java ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/SaveSale.java Modified: ofbiz/trunk/specialpurpose/pos/screens/default/dialog/keyboard.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/screens/default/dialog/keyboard.xml?rev=680147&r1=680146&r2=680147&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/pos/screens/default/dialog/keyboard.xml (original) +++ ofbiz/trunk/specialpurpose/pos/screens/default/dialog/keyboard.xml Sun Jul 27 09:40:33 2008 @@ -1,61 +1,104 @@ <?xml version="1.0" encoding="UTF-8"?> <!-- -Licensed to the Apache Software Foundation (ASF) under one -or more contributor license agreements. See the NOTICE file -distributed with this work for additional information -regarding copyright ownership. The ASF licenses this file -to you under the Apache License, Version 2.0 (the -"License"); you may not use this file except in compliance -with the License. You may obtain a copy of the License at - -http://www.apache.org/licenses/LICENSE-2.0 - -Unless required by applicable law or agreed to in writing, -software distributed under the License is distributed on an -"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY -KIND, either express or implied. See the License for the -specific language governing permissions and limitations -under the License. + Licensed to the Apache Software Foundation (ASF) under one + or more contributor license agreements. See the NOTICE file + distributed with this work for additional information + regarding copyright ownership. The ASF licenses this file + to you under the Apache License, Version 2.0 (the + "License"); you may not use this file except in compliance + with the License. You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, + software distributed under the License is distributed on an + "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + KIND, either express or implied. See the License for the + specific language governing permissions and limitations + under the License. --> <XPage class="net.xoetrope.swing.XDialog"> <Components> - <Panel x="0" y="0" w="760" h="50" style="numButton"> - <Edit name="keyboard_input" x="2" y="2" w="600" h="42" style="editAndList" border="1" alignment="Left"/> - <Button name="charDel" x="659" y="2" w="100" h="42" style="numButton" content="Backspace" alignment="Center"/> - </Panel> - <Panel x="0" y="50" w="760" h="282" style="numButton"> - <Button name="charQ" x="0" y="0" w="75" h="68" style="numButton" content="q" alignment="Center"/> - <Button name="charW" x="76" y="0" w="75" h="68" style="numButton" content="w" alignment="Center"/> - <Button name="charE" x="152" y="0" w="75" h="68" style="numButton" content="e" alignment="Center"/> - <Button name="charR" x="228" y="0" w="75" h="68" style="numButton" content="r" alignment="Center"/> - <Button name="charT" x="304" y="0" w="75" h="68" style="numButton" content="t" alignment="Center"/> - <Button name="charY" x="380" y="0" w="75" h="68" style="numButton" content="y" alignment="Center"/> - <Button name="charU" x="456" y="0" w="75" h="68" style="numButton" content="u" alignment="Center"/> - <Button name="charI" x="532" y="0" w="75" h="68" style="numButton" content="i" alignment="Center"/> - <Button name="charO" x="608" y="0" w="75" h="68" style="numButton" content="o" alignment="Center"/> - <Button name="charP" x="684" y="0" w="75" h="68" style="numButton" content="p" alignment="Center"/> - <Button name="charA" x="10" y="69" w="75" h="68" style="numButton" content="a" alignment="Center"/> - <Button name="charS" x="86" y="69" w="75" h="68" style="numButton" content="s" alignment="Center"/> - <Button name="charD" x="162" y="69" w="75" h="68" style="numButton" content="d" alignment="Center"/> - <Button name="charF" x="238" y="69" w="75" h="68" style="numButton" content="f" alignment="Center"/> - <Button name="charG" x="314" y="69" w="75" h="68" style="numButton" content="g" alignment="Center"/> - <Button name="charH" x="390" y="69" w="75" h="68" style="numButton" content="h" alignment="Center"/> - <Button name="charJ" x="466" y="69" w="75" h="68" style="numButton" content="j" alignment="Center"/> - <Button name="charK" x="542" y="69" w="75" h="68" style="numButton" content="k" alignment="Center"/> - <Button name="charL" x="618" y="69" w="75" h="68" style="numButton" content="l" alignment="Center"/> - <Button name="menuEnter" x="694" y="69" w="65" h="136" style="numButton" content="Enter" alignment="Center"/> - <Button name="charZ" x="40" y="138" w="75" h="68" style="numButton" content="z" alignment="Center"/> - <Button name="charX" x="116" y="138" w="75" h="68" style="numButton" content="x" alignment="Center"/> - <Button name="charC" x="192" y="138" w="75" h="68" style="numButton" content="c" alignment="Center"/> - <Button name="charV" x="268" y="138" w="75" h="68" style="numButton" content="v" alignment="Center"/> - <Button name="charB" x="344" y="138" w="75" h="68" style="numButton" content="b" alignment="Center"/> - <Button name="charN" x="420" y="138" w="75" h="68" style="numButton" content="n" alignment="Center"/> - <Button name="charM" x="496" y="138" w="75" h="68" style="numButton" content="m" alignment="Center"/> - <Button name="menuClear" x="0" y="207" w="75" h="68" style="numButton" content="Clear" alignment="Center"/> - <Button name="menuShift" x="76" y="207" w="75" h="68" style="numButton" content="Shift" alignment="Center"/> - <Button name="menuShiftLock" x="152" y="207" w="75" h="68" style="numButton" content="Lock" alignment="Center"/> - <Button name="charSpace" x="228" y="207" w="300" h="68" style="numButton" content="Space Bar" alignment="Center"/> - <Button name="menuCancel" x="684" y="207" w="75" h="68" style="numButton" content="Cancel" alignment="Center"/> + <Panel name="mainPanel" x="0" y="0" w="1024" h="768" style="menu" > + <!-- FIXME XUI dialog boxes are hardcoded to a 800*600 max ! https://issues.apache.org/jira/browse/OFBIZ-1606?focusedCommentId=12614469#action_12614469 + actually maxi seem to be 808*628 certainly due to margins(?) + --> + <Panel name="inputAndDel" x="0" y="0" w="760" h="50" style="numButton"> + <Edit name="keyboard_input" x="2" y="2" w="600" h="42" style="editAndList" border="1" alignment="Left"/> + <Button name="charDel" x="609" y="2" w="150" h="42" style="numButton" content="Backspace" alignment="Center"/> + </Panel> + <Panel name="alphaNum_keyboard" x="0" y="50" w="760" h="351" style="numButton"> + <Button name="char1" x="0" y="0" w="75" h="68" style="numButton" content="1" alignment="Center"/> + <Button name="char2" x="76" y="0" w="75" h="68" style="numButton" content="2" alignment="Center"/> + <Button name="char3" x="152" y="0" w="75" h="68" style="numButton" content="3" alignment="Center"/> + <Button name="char4" x="228" y="0" w="75" h="68" style="numButton" content="4" alignment="Center"/> + <Button name="char5" x="304" y="0" w="75" h="68" style="numButton" content="5" alignment="Center"/> + <Button name="char6" x="380" y="0" w="75" h="68" style="numButton" content="6" alignment="Center"/> + <Button name="char7" x="456" y="0" w="75" h="68" style="numButton" content="7" alignment="Center"/> + <Button name="char8" x="532" y="0" w="75" h="68" style="numButton" content="8" alignment="Center"/> + <Button name="char9" x="608" y="0" w="75" h="68" style="numButton" content="9" alignment="Center"/> + <Button name="char0" x="684" y="0" w="75" h="68" style="numButton" content="0" alignment="Center"/> + + <Button name="charQ" x="0" y="69" w="75" h="68" style="numButton" content="q" alignment="Center"/> + <Button name="charW" x="76" y="69" w="75" h="68" style="numButton" content="w" alignment="Center"/> + <Button name="charE" x="152" y="69" w="75" h="68" style="numButton" content="e" alignment="Center"/> + <Button name="charR" x="228" y="69" w="75" h="68" style="numButton" content="r" alignment="Center"/> + <Button name="charT" x="304" y="69" w="75" h="68" style="numButton" content="t" alignment="Center"/> + <Button name="charY" x="380" y="69" w="75" h="68" style="numButton" content="y" alignment="Center"/> + <Button name="charU" x="456" y="69" w="75" h="68" style="numButton" content="u" alignment="Center"/> + <Button name="charI" x="532" y="69" w="75" h="68" style="numButton" content="i" alignment="Center"/> + <Button name="charO" x="608" y="69" w="75" h="68" style="numButton" content="o" alignment="Center"/> + <Button name="charP" x="684" y="69" w="75" h="68" style="numButton" content="p" alignment="Center"/> + + <Button name="charA" x="00" y="138" w="75" h="68" style="numButton" content="a" alignment="Center"/> + <Button name="charS" x="76" y="138" w="75" h="68" style="numButton" content="s" alignment="Center"/> + <Button name="charD" x="152" y="138" w="75" h="68" style="numButton" content="d" alignment="Center"/> + <Button name="charF" x="228" y="138" w="75" h="68" style="numButton" content="f" alignment="Center"/> + <Button name="charG" x="304" y="138" w="75" h="68" style="numButton" content="g" alignment="Center"/> + <Button name="charH" x="380" y="138" w="75" h="68" style="numButton" content="h" alignment="Center"/> + <Button name="charJ" x="456" y="138" w="75" h="68" style="numButton" content="j" alignment="Center"/> + <Button name="charK" x="532" y="138" w="75" h="68" style="numButton" content="k" alignment="Center"/> + <Button name="charL" x="608" y="138" w="75" h="68" style="numButton" content="l" alignment="Center"/> + + <Button name="charZ" x="00" y="207" w="75" h="68" style="numButton" content="z" alignment="Center"/> + <Button name="charX" x="76" y="207" w="75" h="68" style="numButton" content="x" alignment="Center"/> + <Button name="charC" x="152" y="207" w="75" h="68" style="numButton" content="c" alignment="Center"/> + <Button name="charV" x="228" y="207" w="75" h="68" style="numButton" content="v" alignment="Center"/> + <Button name="charB" x="304" y="207" w="75" h="68" style="numButton" content="b" alignment="Center"/> + <Button name="charN" x="380" y="207" w="75" h="68" style="numButton" content="n" alignment="Center"/> + <Button name="charM" x="456" y="207" w="75" h="68" style="numButton" content="m" alignment="Center"/> + <Button name="charDot" x="532" y="207" w="75" h="68" style="numButton" content="." alignment="Center"/> + <Button name="charDash" x="608" y="207" w="75" h="68" style="numButton" content="-" alignment="Center"/> + + <Button name="charEnter" x="694" y="206" w="65" h="138" style="numButton" content="Enter" alignment="Center"/> + + <Button name="charClear" x="0" y="276" w="75" h="68" style="numButton" content="Clear" alignment="Center"/> + <Button name="charShift" x="76" y="276" w="75" h="68" style="numButton" content="Shift" alignment="Center"/> + <Button name="charShiftLock" x="152" y="276" w="75" h="68" style="numButton" content="Lock" alignment="Center"/> + + <Button name="charSpace" x="228" y="276" w="300" h="68" style="numButton" content="Space Bar" alignment="Center"/> + + <Button name="charCancel" x="585" y="276" w="100" h="68" style="numButton" content="Cancel" alignment="Center"/> + </Panel> + + <!-- FIXME XUI dialog boxes are hardcoded to a 800*600 max ! https://issues.apache.org/jira/browse/OFBIZ-1606?focusedCommentId=12614469#action_12614469 + actually maxi seem to be 808*628 certainly due to margins(?) + --> + <!--Panel name="num_keyboard" x="760" y="50" w="264" h="282" style="numButton"> + <Button name="numSeven" x="0" y="0" w="70" h="68" style="numButton" content="7" alignment="Center"/> + <Button name="numEight" x="76" y="0" w="75" h="68" style="numButton" content="8" alignment="Center"/> + <Button name="numNine" x="152" y="0" w="75" h="68" style="numButton" content="9" alignment="Center"/> + <Button name="numPercent" x="228" y="0" w="75" h="68" style="numButton" content="%" alignment="Center"/> + <Button name="numFour" x="0" y="69" w="75" h="68" style="numButton" content="4" alignment="Center"/> + <Button name="numFive" x="76" y="69" w="75" h="68" style="numButton" content="5" alignment="Center"/> + <Button name="numSix" x="152" y="69" w="75" h="68" style="numButton" content="6" alignment="Center"/> + <Button name="numOne" x="0" y="138" w="75" h="68" style="numButton" content="1" alignment="Center"/> + <Button name="numTwo" x="76" y="138" w="75" h="68" style="numButton" content="2" alignment="Center"/> + <Button name="numThree" x="152" y="138" w="75" h="68" style="numButton" content="3" alignment="Center"/> + <Button name="numMinus" x="0" y="207" w="75" h="68" style="posButton" content="-" alignment="Center"/> + <Button name="numZero" x="76" y="207" w="75" h="68" style="numButton" content="0" alignment="Center"/> + <Button name="numDZero" x="152" y="207" w="75" h="68" style="numButton" content="00" alignment="Center"/> + </Panel--> </Panel> </Components> </XPage> Modified: ofbiz/trunk/specialpurpose/pos/screens/default/menu/posmain.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/screens/default/menu/posmain.xml?rev=680147&r1=680146&r2=680147&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/pos/screens/default/menu/posmain.xml (original) +++ ofbiz/trunk/specialpurpose/pos/screens/default/menu/posmain.xml Sun Jul 27 09:40:33 2008 @@ -69,6 +69,7 @@ <Button name="" x="408" y="310" w="100" h="60" style="posButton" content="" alignment="Center"/> <Button name="" x="510" y="310" w="100" h="60" style="posButton" content="" alignment="Center"/> <!--Button name="testMsr" x="510" y="310" w="100" h="60" style="posButton" content="TEST MSR" alignment="Center"/--> + <!--Button name="testNumeric" x="510" y="310" w="100" h="60" style="posButton" content="Num Keypad" alignment="Center"/--> </Components> </XPage> Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/Keyboard.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/Keyboard.java?rev=680147&r1=680146&r2=680147&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/Keyboard.java (original) +++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/Keyboard.java Sun Jul 27 09:40:33 2008 @@ -19,12 +19,16 @@ package org.ofbiz.pos.screen; import java.awt.Color; + +import org.ofbiz.base.util.Debug; + import net.xoetrope.swing.XButton; import net.xoetrope.swing.XDialog; import net.xoetrope.swing.XEdit; import net.xoetrope.xui.PageSupport; import net.xoetrope.xui.XPage; import net.xoetrope.xui.events.XEventHelper; +import java.awt.Panel; public class Keyboard extends XPage { public static final String module = Keyboard.class.getName(); @@ -49,6 +53,12 @@ public String openDlg() { setupEvents(); originalText = getText(); +// XuiUtilities.getMaxCoordinates(m_dialog); +// Panel m_panel = m_dialog.PANEL; +// pageHelper.componentFactory.setParentComponent( this ); +// contentPanel = ( XPanel )pageHelper.componentFactory.addComponent( XPage.PANEL, 0, 0, 800, 600 ); +// FIXME XUI dialog boxes are hardcoded to a 800*600 max ! https://issues.apache.org/jira/browse/OFBIZ-1606?focusedCommentId=12614469#action_12614469 +// actually maxi seem to be 808*628 certainly due to margins(?) m_dialog.pack(); m_dialog.showDialog(this); return m_edit.getText(); @@ -74,72 +84,14 @@ } private void setupEvents() { - XButton button = (XButton) m_dialog.findComponent("charA"); - XEventHelper.addMouseHandler(this, button, "triggerA"); - button = (XButton) m_dialog.findComponent("charB"); - XEventHelper.addMouseHandler(this, button, "triggerB"); - button = (XButton) m_dialog.findComponent("charC"); - XEventHelper.addMouseHandler(this, button, "triggerC"); - button = (XButton) m_dialog.findComponent("charD"); - XEventHelper.addMouseHandler(this, button, "triggerD"); - button = (XButton) m_dialog.findComponent("charE"); - XEventHelper.addMouseHandler(this, button, "triggerE"); - button = (XButton) m_dialog.findComponent("charF"); - XEventHelper.addMouseHandler(this, button, "triggerF"); - button = (XButton) m_dialog.findComponent("charG"); - XEventHelper.addMouseHandler(this, button, "triggerG"); - button = (XButton) m_dialog.findComponent("charH"); - XEventHelper.addMouseHandler(this, button, "triggerH"); - button = (XButton) m_dialog.findComponent("charI"); - XEventHelper.addMouseHandler(this, button, "triggerI"); - button = (XButton) m_dialog.findComponent("charJ"); - XEventHelper.addMouseHandler(this, button, "triggerJ"); - button = (XButton) m_dialog.findComponent("charK"); - XEventHelper.addMouseHandler(this, button, "triggerK"); - button = (XButton) m_dialog.findComponent("charL"); - XEventHelper.addMouseHandler(this, button, "triggerL"); - button = (XButton) m_dialog.findComponent("charM"); - XEventHelper.addMouseHandler(this, button, "triggerM"); - button = (XButton) m_dialog.findComponent("charN"); - XEventHelper.addMouseHandler(this, button, "triggerN"); - button = (XButton) m_dialog.findComponent("charO"); - XEventHelper.addMouseHandler(this, button, "triggerO"); - button = (XButton) m_dialog.findComponent("charP"); - XEventHelper.addMouseHandler(this, button, "triggerP"); - button = (XButton) m_dialog.findComponent("charQ"); - XEventHelper.addMouseHandler(this, button, "triggerQ"); - button = (XButton) m_dialog.findComponent("charR"); - XEventHelper.addMouseHandler(this, button, "triggerR"); - button = (XButton) m_dialog.findComponent("charS"); - XEventHelper.addMouseHandler(this, button, "triggerS"); - button = (XButton) m_dialog.findComponent("charT"); - XEventHelper.addMouseHandler(this, button, "triggerT"); - button = (XButton) m_dialog.findComponent("charU"); - XEventHelper.addMouseHandler(this, button, "triggerU"); - button = (XButton) m_dialog.findComponent("charV"); - XEventHelper.addMouseHandler(this, button, "triggerV"); - button = (XButton) m_dialog.findComponent("charW"); - XEventHelper.addMouseHandler(this, button, "triggerW"); - button = (XButton) m_dialog.findComponent("charX"); - XEventHelper.addMouseHandler(this, button, "triggerX"); - button = (XButton) m_dialog.findComponent("charY"); - XEventHelper.addMouseHandler(this, button, "triggerY"); - button = (XButton) m_dialog.findComponent("charZ"); - XEventHelper.addMouseHandler(this, button, "triggerZ"); - button = (XButton) m_dialog.findComponent("charDel"); - XEventHelper.addMouseHandler(this, button, "triggerDel"); - button = (XButton) m_dialog.findComponent("charSpace"); - XEventHelper.addMouseHandler(this, button, "triggerSpace"); - button = (XButton) m_dialog.findComponent("menuClear"); - XEventHelper.addMouseHandler(this, button, "triggerClear"); - button = (XButton) m_dialog.findComponent("menuEnter"); - XEventHelper.addMouseHandler(this, button, "triggerEnter"); - button = (XButton) m_dialog.findComponent("menuCancel"); - XEventHelper.addMouseHandler(this, button, "triggerCancel"); - button = (XButton) m_dialog.findComponent("menuShift"); - XEventHelper.addMouseHandler(this, button, "triggerShift"); - button = (XButton) m_dialog.findComponent("menuShiftLock"); - XEventHelper.addMouseHandler(this, button, "triggerShiftLock"); + String[] keys = {"A" ,"B" ,"C" ,"D" ,"E" ,"F" ,"G" ,"H" ,"I" ,"J" ,"K" ,"L" ,"M" ,"N" ,"O" ,"P" ,"Q" ,"R" ,"S" ,"T" ,"U" ,"V" ,"W" ,"X" ,"Y" ,"Z", + "1" ,"2" ,"3" ,"4" ,"5" ,"6" ,"7" ,"8" ,"9" ,"0" , + "Dot", "Dash", "Del", "Space", "Clear", "Enter", "Cancel", "Shift", "ShiftLock"}; + XButton button = null; + for(String key : keys) { + button = (XButton) m_dialog.findComponent("char" + key); + XEventHelper.addMouseHandler(this, button, "trigger" + key); + } } private void setButtonText(String buttonName, String newText) { @@ -148,61 +100,18 @@ } private void setUppercase() { - setButtonText("charA", "A"); - setButtonText("charB", "B"); - setButtonText("charC", "C"); - setButtonText("charD", "D"); - setButtonText("charE", "E"); - setButtonText("charF", "F"); - setButtonText("charG", "G"); - setButtonText("charH", "H"); - setButtonText("charI", "I"); - setButtonText("charJ", "J"); - setButtonText("charK", "K"); - setButtonText("charL", "L"); - setButtonText("charM", "M"); - setButtonText("charN", "N"); - setButtonText("charO", "O"); - setButtonText("charP", "P"); - setButtonText("charQ", "Q"); - setButtonText("charR", "R"); - setButtonText("charS", "S"); - setButtonText("charT", "T"); - setButtonText("charU", "U"); - setButtonText("charV", "V"); - setButtonText("charW", "W"); - setButtonText("charX", "X"); - setButtonText("charY", "Y"); - setButtonText("charZ", "Z"); + String[] keys = {"A" ,"B" ,"C" ,"D" ,"E" ,"F" ,"G" ,"H" ,"I" ,"J" ,"K" ,"L" ,"M" ,"N" ,"O" ,"P" ,"Q" ,"R" ,"S" ,"T" ,"U" ,"V" ,"W" ,"X" ,"Y" ,"Z"}; + for(String key : keys) { + setButtonText("char" + key, key); + } } private void setLowercase() { - setButtonText("charA", "a"); - setButtonText("charB", "b"); - setButtonText("charC", "c"); - setButtonText("charD", "d"); - setButtonText("charE", "e"); - setButtonText("charF", "f"); - setButtonText("charG", "g"); - setButtonText("charH", "h"); - setButtonText("charI", "i"); - setButtonText("charJ", "j"); - setButtonText("charK", "k"); - setButtonText("charL", "l"); - setButtonText("charM", "m"); - setButtonText("charN", "n"); - setButtonText("charO", "o"); - setButtonText("charP", "p"); - setButtonText("charQ", "q"); - setButtonText("charR", "r"); - setButtonText("charS", "s"); - setButtonText("charT", "t"); - setButtonText("charU", "u"); - setButtonText("charV", "v"); - setButtonText("charW", "w"); - setButtonText("charX", "x"); - setButtonText("charY", "y"); - setButtonText("charZ", "z"); + + String[] keys = {"a" ,"b" ,"c" ,"d" ,"e" ,"f" ,"g" ,"h" ,"i" ,"j" ,"k" ,"l" ,"m" ,"n" ,"o" ,"p" ,"q" ,"r" ,"s" ,"t" ,"u" ,"v" ,"w" ,"x" ,"y" ,"z"}; + for(String key : keys) { + setButtonText("char" + key, key); + } } public void triggerA() { @@ -309,12 +218,60 @@ keypress('z', 'Z'); } - public void triggerClear() { - clear(); + public void trigger1() { + triggerAndAppend("1"); + } + + public void trigger2() { + triggerAndAppend("2"); + } + + public void trigger3() { + triggerAndAppend("3"); + } + + public void trigger4() { + triggerAndAppend("4"); + } + + public void trigger5() { + triggerAndAppend("5"); + } + + public void trigger6() { + triggerAndAppend("6"); + } + + public void trigger7() { + triggerAndAppend("7"); + } + + public void trigger8() { + triggerAndAppend("8"); + } + + public void trigger9() { + triggerAndAppend("9"); + } + + public void trigger0() { + triggerAndAppend("0"); + } + + public void triggerDot() { + triggerAndAppend("."); + } + + public void triggerDash() { + triggerAndAppend("-"); } public void triggerSpace() { - keypress(' ', ' '); + triggerAndAppend(" "); + } + + public void triggerClear() { + clear(); } public void triggerDel() { @@ -341,6 +298,12 @@ } } + public void triggerAndAppend(String s) { + if (wasMouseClicked()) { + append(s); + } + } + private synchronized void keypress(char lower, char upper) { if (wasMouseClicked()) { if (m_shiftLock) { Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/NumericKeypad.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/NumericKeypad.java?rev=680147&r1=680146&r2=680147&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/NumericKeypad.java (original) +++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/NumericKeypad.java Sun Jul 27 09:40:33 2008 @@ -15,7 +15,7 @@ XDialog m_dialog = null; PosScreen m_pos = null; PageSupport m_pageSupport = null; - + boolean m_minus = false; boolean m_percent = false; @@ -23,29 +23,28 @@ m_pos = pos; return; } - + public String openDlg() { - - m_pageSupport = pageMgr.loadPage( - m_pos.getScreenLocation() + "/dialog/numeric"); + + m_pageSupport = pageMgr.loadPage(m_pos.getScreenLocation() + "/dialog/numeric"); m_dialog = (XDialog)m_pageSupport; - + m_edit = (XEdit) m_pageSupport.findComponent("numeric_input"); m_edit.setText(""); setupEvents(); - + m_dialog.pack(); m_dialog.showDialog(this); - + return m_edit.getText(); } - + //call before openDlg public void setMinus(boolean minus){ m_minus = minus; } - + public boolean getMinus(){ return m_minus; } @@ -54,7 +53,7 @@ public void setPercent(boolean percent){ m_percent = percent; } - + public boolean getPercent(){ return m_percent; } @@ -96,7 +95,7 @@ XEventHelper.addMouseHandler(this, button, "triggerClear"); button = (XButton) m_dialog.findComponent("menuEnter"); XEventHelper.addMouseHandler(this, button, "triggerEnter"); - + if(getMinus()){ button = (XButton) m_dialog.findComponent("numMinus"); XEventHelper.addMouseHandler(this, button, "triggerMinus"); @@ -112,7 +111,7 @@ return; } - + public void triggerOne() { append('1'); @@ -187,7 +186,7 @@ { prependUnique('%'); } - + private synchronized void prependUnique(char c){ if(wasMouseClicked()){ String text = ""; @@ -229,14 +228,14 @@ } return buf.toString(); } - + private synchronized void close(){ if(wasMouseClicked()){ m_dialog.closeDlg(); return; } } - + private synchronized void clear(){ if(wasMouseClicked()){ String text = ""; Modified: ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/SaveSale.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/SaveSale.java?rev=680147&r1=680146&r2=680147&view=diff ============================================================================== --- ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/SaveSale.java (original) +++ ofbiz/trunk/specialpurpose/pos/src/org/ofbiz/pos/screen/SaveSale.java Sun Jul 27 09:40:33 2008 @@ -79,7 +79,7 @@ XEventHelper.addMouseHandler(this, m_save, "save"); XEventHelper.addMouseHandler(this, m_saveAndClear, "saveAndClear"); // Save and Print - XEventHelper.addMouseHandler(this, m_saveAndPrint, "saveAndPrint"); + //XEventHelper.addMouseHandler(this, m_saveAndPrint, "saveAndPrint"); //FIXME : button does not exist yet XEventHelper.addMouseHandler(this, m_saleName, "editSaleName"); m_dialog.pack(); |
Free forum by Nabble | Edit this page |