View source | Discuss this page | Page history | Printable version   
Toolbox
Main Page
Upload file
What links here
Recent changes
Help

PDF Books
Add page
Show collection (0 pages)
Collections help

Search

POS - Using shortkeys in menu items

Code snippet

Name: POS - Using shortkeys in menu items
Version: POS/2.20 & 2.30 Beta
Author: Mikel Irurita



This code snippet is intented to use shortkeys in the Openbravo POS left menu items. For example, Sales, Edit sales, Customers, Payments, Close cash, Cash closed, Customers, Stock...

This code has been copied from this forum thread.

Go to the constructor of 'MenuPanelAction (com.openbravo.pos.forms) class.

Check the content of the keytext parameter and add mnemonic.

In this example pressing Alt+E keys you will view the Edit sales panel.

 
 //View Edit sales panel
 if (keytext.equals("Menu.TicketEdit")) {
   putValue(Action.MNEMONIC_KEY, KeyEvent.VK_E);
 }

All the together looks like:

 
 public MenuPanelAction(AppView app, String icon, String keytext, String sMyView) {
   putValue(Action.SMALL_ICON, new ImageIcon(JPrincipalApp.class.getResource(icon)));
   putValue(Action.NAME, AppLocal.getIntString(keytext));
   //View Edit sales panel
   if (keytext.equals("Menu.TicketEdit")) {
     putValue(Action.MNEMONIC_KEY, KeyEvent.VK_E);
   }
   putValue(AppUserView.ACTION_TASKNAME, sMyView);
   m_App = app;
   m_sMyView = sMyView;
 }

Retrieved from "http://wiki.openbravo.com/wiki/POS_-_Using_shortkeys_in_menu_items"

This page has been accessed 10,798 times. This page was last modified on 28 April 2009, at 08:40. Content is available under Creative Commons Attribution-ShareAlike 2.5 Spain License.