TavernerPOS - Source Code

Clone: 

git clone http://www.librarysmith.co.uk/tavernerPOS

 

Index » tavernerPOS : Commitdiff 30c058

Add option to allow blank buttons defined by a '-' as the menu item name. These are set as invisible when the MenuItemView is rendered and allow for creating column layouts using the Sort Order field

Matt Smith [16-01-11 19:26]
Add option to allow blank buttons defined by a '-' as the menu item name. These are set as invisible when the MenuItemView is rendered and allow for creating column layouts using the Sort Order field
diff --git a/src/com/floreantpos/ui/views/order/MenuItemView.java b/src/com/floreantpos/ui/views/order/MenuItemView.java
old mode 100644
new mode 100755
index 46d2e96..8c8a46f
--- a/src/com/floreantpos/ui/views/order/MenuItemView.java
+++ b/src/com/floreantpos/ui/views/order/MenuItemView.java
@@ -74,7 +74,7 @@ public class MenuItemView extends SelectionView {
 		MenuItem menuItem = (MenuItem) item;
 		ItemButton itemButton = new ItemButton(menuItem);
 		menuItemButtonMap.put(menuItem.getId(), itemButton);
-
+
 		return itemButton;
 	}

@@ -136,6 +136,7 @@ public class MenuItemView extends SelectionView {
 				setText("<html><body><center>" + menuItem.getName() + "</center></body></html>"); //$NON-NLS-1$ //$NON-NLS-2$
 			}

+
 			if(menuItem.getButtonColor() != null) {
 				setBackground(new Color(menuItem.getButtonColor()));
 			}
@@ -144,6 +145,9 @@ public class MenuItemView extends SelectionView {
 			}

 			setPreferredSize(new Dimension(BUTTON_SIZE, BUTTON_SIZE));
+
+			if (menuItem.getName().equals("-"))  this.setVisible(false);
+
 			addActionListener(this);
 		}

diff --git a/src/com/floreantpos/ui/views/order/SelectionView.java b/src/com/floreantpos/ui/views/order/SelectionView.java
old mode 100644
new mode 100755

Add comment
These comments are moderated so so won't be published until reviewed.