[2093355 ] Small bugs in OpenXpertya POS

REARRANGE SCREEN TO BE MORE INTUITIVE
PLS SEE SCREEHSHOT HERE > http://www.adempiere.com/wiki/index.php/Image:JavaPOS.png
This commit is contained in:
Redhuan D. Oon 2008-11-29 09:59:38 +00:00
parent fd1290c921
commit acf4d6e054
4 changed files with 45 additions and 50 deletions

View File

@ -120,7 +120,7 @@ public class PosPanel extends CPanel
} }
frame.getContentPane().add(this, BorderLayout.CENTER); frame.getContentPane().add(this, BorderLayout.CENTER);
frame.getContentPane().add(f_status, BorderLayout.SOUTH); frame.getContentPane().add(f_status, BorderLayout.SOUTH);
// this.setPreferredSize(new Dimension (800-20,600-20)); this.setPreferredSize(new Dimension (800-20,500-20));
} }
catch(Exception e) catch(Exception e)
{ {

View File

@ -85,74 +85,68 @@ public class SubCheckout extends PosSubPanel implements ActionListener
GridBagConstraints gbc = new GridBagConstraints(); GridBagConstraints gbc = new GridBagConstraints();
gbc.insets = INSETS2; gbc.insets = INSETS2;
// -- 0 // BOX 1 - CASH
gbc.gridx = 0; gbc.gridx = 0;
f_register = createButtonAction("Register", null);
gbc.gridy = 0;
add (f_register, gbc);
//
f_summary = createButtonAction("Summary", null);
gbc.gridy = 1;
gbc.gridheight = 1;
add (f_summary, gbc);
//
f_process = createButtonAction("Process", null);
gbc.gridy = 2;
gbc.gridheight = 1;
add (f_process, gbc);
//
f_print = createButtonAction("Print", null);
gbc.gridy = 3;
gbc.gridheight =1;
add (f_print, gbc);
// -- 1 -- Cash
gbc.gridx = 1;
gbc.gridheight = 2; gbc.gridheight = 2;
gbc.fill = GridBagConstraints.BOTH; gbc.fill = GridBagConstraints.BOTH;
gbc.weightx = .1; gbc.weightx = .1;
CPanel cash = new CPanel(new GridBagLayout()); CPanel cash = new CPanel(new GridBagLayout());
cash.setBorder(new TitledBorder(Msg.getMsg(Env.getCtx(), "Cash"))); cash.setBorder(new TitledBorder(Msg.getMsg(Env.getCtx(), "Cash")));
gbc.gridy = 1; gbc.gridy = 0;
add (cash, gbc); add (cash, gbc);
GridBagConstraints gbc0 = new GridBagConstraints(); GridBagConstraints gbc0 = new GridBagConstraints();
gbc0.insets = INSETS2; gbc0.insets = INSETS2;
gbc0.anchor = GridBagConstraints.WEST; // gbc0.anchor = GridBagConstraints.EAST;
// //
f_lcashGiven = new CLabel(Msg.getMsg(Env.getCtx(),"CashGiven")); f_lcashGiven = new CLabel(Msg.getMsg(Env.getCtx(),"CashGiven"));
cash.add (f_lcashGiven, gbc0); cash.add (f_lcashGiven, gbc0);
f_cashGiven = new VNumber("CashGiven", false, false, true, DisplayType.Amount, f_cashGiven = new VNumber("CashGiven", false, false, true, DisplayType.Amount, Msg.translate(Env.getCtx(), "CashGiven"));
Msg.translate(Env.getCtx(), "CashGiven")); f_cashGiven.setColumns(14, 25);
f_cashGiven.setColumns(10, 25);
cash.add (f_cashGiven, gbc0); cash.add (f_cashGiven, gbc0);
f_cashGiven.setValue(Env.ZERO); f_cashGiven.setValue(Env.ZERO);
f_cashGiven.addActionListener(this); //para que actualice el cambio con el dinero entregado f_cashGiven.addActionListener(this); //to update the change with the money
// //
f_lcashReturn = new CLabel(Msg.getMsg(Env.getCtx(),"CashReturn")); f_lcashReturn = new CLabel(Msg.getMsg(Env.getCtx(),"CashReturn"));
cash.add (f_lcashReturn, gbc0); cash.add (f_lcashReturn, gbc0);
f_cashReturn = new VNumber("CashReturn", false, true, false, DisplayType.Amount, f_cashReturn = new VNumber("CashReturn", false, true, false, DisplayType.Amount, "CashReturn");
"CashReturn");
f_cashReturn.setColumns(10, 25); f_cashReturn.setColumns(10, 25);
cash.add (f_cashReturn, gbc0); cash.add (f_cashReturn, gbc0);
f_cashReturn.setValue(Env.ZERO); f_cashReturn.setValue(Env.ZERO);
f_cashPayment = createButtonAction("Payment", null); f_cashPayment = createButtonAction("Payment", null);
f_cashPayment.setActionCommand("Cash"); f_cashPayment.setActionCommand("Cash");
gbc0.anchor = GridBagConstraints.EAST;
gbc0.weightx = 0.1; gbc0.weightx = 0.1;
cash.add (f_cashPayment, gbc0); cash.add (f_cashPayment, gbc0);
gbc.gridx=1; // BOX 2 - UTILS
gbc.gridy=3; CPanel utils = new CPanel(new GridBagLayout());
gbc.gridheight=1; utils.setBorder(new TitledBorder(Msg.getMsg(Env.getCtx(), "Utils")));
CPanel caja = new CPanel(); gbc.gridx = 0;
add(caja,gbc); gbc.gridy = 2;
caja.setPreferredSize(new Dimension(30,30)); gbc.weightx = .1;
add (utils, gbc);
GridBagConstraints gbcU = new GridBagConstraints();
gbcU.insets = INSETS2;
gbcU.anchor = GridBagConstraints.EAST;
//CASH FUNCTIONS
f_cashRegisterFunctions = createButtonAction("CashRegisterFunction", null); f_cashRegisterFunctions = createButtonAction("CashRegisterFunction", null);
f_cashRegisterFunctions.setText("Cash Drawer\n Movements"); f_cashRegisterFunctions.setText("Cash Functions");
f_cashRegisterFunctions.setPreferredSize(new Dimension(160,30)); f_cashRegisterFunctions.setPreferredSize(new Dimension(130,37));
f_cashRegisterFunctions.setMaximumSize(new Dimension(160,30)); f_cashRegisterFunctions.setMaximumSize(new Dimension(130,37));
f_cashRegisterFunctions.setMinimumSize(new Dimension(160,30)); f_cashRegisterFunctions.setMinimumSize(new Dimension(130,37));
caja.add(f_cashRegisterFunctions); utils.add(f_cashRegisterFunctions, gbcU);
//REGISTER
f_register = createButtonAction("Register", null);
utils.add (f_register, gbcU);
//SUMMARY
f_summary = createButtonAction("Summary", null);
utils.add (f_summary, gbcU);
//PROCESS
f_process = createButtonAction("Process", null);
utils.add (f_process, gbcU);
//PRINT
f_print = createButtonAction("Print", null);
utils.add (f_print, gbcU);

View File

@ -66,7 +66,7 @@ public class SubFunctionKeys extends PosSubPanel implements ActionListener
return; return;
int COLUMNS = 4; // Min Columns int COLUMNS = 4; // Min Columns
int ROWS = 5; // Min Rows int ROWS = 6; // Min Rows
m_keys = fKeys.getKeys(false); m_keys = fKeys.getKeys(false);
int noKeys = m_keys.length; int noKeys = m_keys.length;
int rows = Math.max (((noKeys-1) / COLUMNS) + 1, ROWS); int rows = Math.max (((noKeys-1) / COLUMNS) + 1, ROWS);
@ -106,7 +106,7 @@ public class SubFunctionKeys extends PosSubPanel implements ActionListener
button.setFocusable(false); button.setFocusable(false);
content.add (button); content.add (button);
} }
content.setPreferredSize(new Dimension(cols*150, rows*50)); content.setPreferredSize(new Dimension(cols*180, rows*50));
add (content); add (content);
} // init } // init
@ -118,7 +118,8 @@ public class SubFunctionKeys extends PosSubPanel implements ActionListener
GridBagConstraints gbc = super.getGridBagConstraints(); GridBagConstraints gbc = super.getGridBagConstraints();
gbc.gridx = 1; gbc.gridx = 1;
gbc.gridy = 2; gbc.gridy = 2;
gbc.gridheight = 2; //added by ConSerTi so that the panel takes up more space gbc.gridheight = 3; //added by ConSerTi so that the panel takes up more space
// gbc.fill = GridBagConstraints.HORIZONTAL;
return gbc; return gbc;
} // getGridBagConstraints } // getGridBagConstraints

View File

@ -122,7 +122,7 @@ public class SubLines extends PosSubPanel implements ActionListener
m_table.setMultiSelection(false); m_table.setMultiSelection(false);
// m_table.addMouseListener(this); // m_table.addMouseListener(this);
// m_table.getSelectionModel().addListSelectionListener(this); // m_table.getSelectionModel().addListSelectionListener(this);
scroll.setPreferredSize(new Dimension(100,100)); scroll.setPreferredSize(new Dimension(100,120));
add (scroll, BorderLayout.CENTER); add (scroll, BorderLayout.CENTER);
// Right side // Right side
@ -149,7 +149,7 @@ public class SubLines extends PosSubPanel implements ActionListener
CLabel lNet = new CLabel (Msg.translate(Env.getCtx(), "TotalLines")); CLabel lNet = new CLabel (Msg.translate(Env.getCtx(), "TotalLines"));
summary.add(lNet); summary.add(lNet);
f_net = new VNumber("TotalLines", false, true, false, DisplayType.Amount, "TotalLines"); f_net = new VNumber("TotalLines", false, true, false, DisplayType.Amount, "TotalLines");
f_net.setColumns(6, 22); f_net.setColumns(11, 22);
lNet.setLabelFor(f_net); lNet.setLabelFor(f_net);
summary.add(f_net); summary.add(f_net);
f_net.setValue (Env.ZERO); f_net.setValue (Env.ZERO);
@ -165,7 +165,7 @@ public class SubLines extends PosSubPanel implements ActionListener
CLabel lTotal = new CLabel (Msg.translate(Env.getCtx(), "GrandTotal")); CLabel lTotal = new CLabel (Msg.translate(Env.getCtx(), "GrandTotal"));
summary.add(lTotal); summary.add(lTotal);
f_total = new VNumber("GrandTotal", false, true, false, DisplayType.Amount, "GrandTotal"); f_total = new VNumber("GrandTotal", false, true, false, DisplayType.Amount, "GrandTotal");
f_total.setColumns(6, 22); f_total.setColumns(11, 22);
lTotal.setLabelFor(f_total); lTotal.setLabelFor(f_total);
summary.add(f_total); summary.add(f_total);
f_total.setValue (Env.ZERO); f_total.setValue (Env.ZERO);