Fieldpine Logo Documentation Home  
User Interface Home

The button directive places a button on the screen that executes PosCommands when pressed. There are a large range of options around creating and designing buttons. Buttons can be clicked by either mouse or touch screens.

Command Options

at(x1,y1,x2,y2)

Defines the bounding box position the button is drawn on the window.

label(string)

The text to be drawn on the button face. eg "Pay" or "Spaghetti". The value "\n" may be used to force a line break if the button is marked multiline.

font(string)

Sets the font characteristics to use on the button

keymgmt(N)

bitmap(N)

A name of a file to be drawn as a background image for the button. This allows you to create graphical buttons rather than simple text buttons.

noborder

multiline

Specifies that the label() value should be wrapped to multiple lines. The default is to only draw on one line.

program and program(N)

Indicate that this is a programmable button

type(N)

Use deprecated

tip(N)

keys(N)

Supplies a list of single keys that can be pressed on the keyboard to invoke the button as if the user had clicked the button. Commonly called shortcut keys. See Key Directive for details.

brgb(N)

Specifies the RGB triple colour to draw the button background in.

rgb(N)

Specifies the RGB triple colour for the label on the button.

draw(N)

group(A,B,C)

legend(N)

action(N)

required(N)

overlay(N,B)

An additional POS Command that will be executed if the user presses the button within the left N% of the button.

A typical use of this feature is to issue the command sale(mustprint=1) if the user presses the left side of a cash payment button. No matter where they press the sale completes, but if the left side is pressed a receipt is printed also - a key saving feature for busy environments

if(N)

position(N)

A list of keywords allowing full control over positioning of the button. Acceptable keywords are: center, left, right, bottom, tab, noclip, prefix, singleline, top, middle, wordwrap, disable, hidden. Each keyword can also be prefixed with "-" to remove it from the list of styles. eg "position(center -singleline wordwrap)" Center the text, use wordwrap and multiple lines if needed.

hook(N)

Manually hook this button to internal events.

name(N)

Sets the name of this button for receiving commands.

ticked(N)

Indicates for tickboxes and or push buttons if the initial state is pressed/ticked or not.

mouseover(N)

Provides additional actions to be executed when the mouse is over the button. This does not work in all environments and so is not formally supported.

holdaction(N,A)

Provides additional actions to perform if the user holds the button down for N mS or longer. This could be used as a variation of the example given in overlay to produce receipts.

radius(N)

Draws buttons with rounded corners and other effects.

security(N)

disablebrgb(N)

Sets a RGB background colour for when the button is disabled. The system will automatically fade the brgb() value but sometimes this fading may not be a suitable colour.

disablergb(N)

Sets the disabled colour for the label(). See previous point for more details.


Internal Operation


Examples of Use

Multiline Definitions:

;;### PastSales (with Teller Security) ###
button
define
at(195,410,380,450) label(Pastsales) keys(+Vv) legend(label(V) at(5,5) font(Calibri,16)) font(Calibri,22) brgb(98,99,92) rgb(255,255,255)
if(cond(data(activeteller.rights.have.pastsales) = 1) else(position(hidden) rgb(174,174,174))) hook(20200)
execute
pastsales(go) screen(1delete)
end

;;### End Day (with Teller Security) ###
button
define
at(10,365,190,405) label(%message.106.20%) keys(+Ff) legend(label(F) at(5,5) font(Calibri,16)) brgb(98,99,92) font(Calibri,22) rgb(255,255,255)
if(cond(data(activeteller.rights.have.983047) = 1) else(position(hidden) rgb(175,175,175))) hook(20200)
execute
settle(go) screen(1delete)
end

;;### Product Lookup (No Teller Security) ###
button
define
at(40,60,300,100) keys(+1) legend(label(1) at(5,5) font(calibri,16)) label(Product Lookup) font(calibri,20) brgb(255,255,0)
execute
lookup(products,u_lu_product,unique:pid,enable:edit:new)
end

;;### Stop all POS/REPORTING Services ###
button
define
at(40,454,320,494) label(Stop all POS/REPORTING Services) brgb(255,255,0) font(calibri,20)
execute
message(99,1,The POS and Reporting Services will take 2 minutes to shut down, please donot attempt any to do backups, upgrades or restarting of the services until the 2 minute shut down period is reasched.) system(net stop PosService) system(net stop Globaldata)
end

Single Line Definitions:

;;### PastSales (with Teller Security) ###
246|more|||button|at(195,410,380,450) label(PastSales) brgb(98,99,92) keys(+Vv) legend(label(V) at(5,5) font(Calibri,16)) font(Calibri,20) if(cond(data(activeteller.rights.have.pastsales) = 1) else(position(hidden) hook(20200))|pastsales(go) screen(1delete)|2003

;;### End Of Day (with Teller Security) ###
246|more|||button|at(10,365,190,405) label(%message.106.20%) brgb(98,99,92) keys(+Ff) legend(label(F) at(5,5) font(Calibri,16)) font(Calibri,20) if(cond(data(activeteller.rights.have.983047) = 1) else(position(hidden) hook(20200))|settle(go) screen(1delete)|2005

;;### Product Lookup (No Teller security) ###
249|stock|||button|at(40,60,300,100) keys(+1) legend(label(1) at(5,5) font(calibri,16)) label(Product Lookup) font(calibri,20) brgb(255,255,0)|lookup(products,u_lu_product,unique:pid,enable:edit:new)|1032

;;### Open a Web Page within the pos ###
6030|main|||browser|at(10,50,1160,570) url(http://127.0.0.1:8095/activesale.htm) register(hohb)|4450

;;### On Screen NumberPad ###
5025|main|||button|at(225,387,300,437) brgb(193,193,193) label(7) font(Arial,30,bold)|send(55,kp)|1080 5025|main|||button|at(302,387,377,437) brgb(193,193,193) label(8) font(Arial,30,bold)|send(56,kp)|1081 5025|main|||button|at(379,387,454,437) brgb(193,193,193) label(9) font(Arial,30,bold)|send(57,kp)|1082 5025|main|||button|at(225,439,300,489) brgb(193,193,193) label(4) font(Arial,30,bold)|send(52,kp)|1083 5025|main|||button|at(302,439,377,489) brgb(193,193,193) label(5) font(Arial,30,bold)|send(53,kp)|1084 5025|main|||button|at(379,439,454,489) brgb(193,193,193) label(6) font(Arial,30,bold)|send(54,kp)|1085 5025|main|||button|at(225,491,300,541) brgb(193,193,193) label(1) font(Arial,30,bold)|send(49,kp)|1086 5025|main|||button|at(302,491,377,541) brgb(193,193,193) label(2) font(Arial,30,bold)|send(50,kp)|1087 5025|main|||button|at(379,491,454,541) brgb(193,193,193) label(3) font(Arial,30,bold)|send(51,kp)|1088 5025|main|||button|at(225,543,377,593) brgb(193,193,193) label(0) font(Arial,30,bold)|send(48,kp)|1089 5025|main|||button|at(379,543,454,593) brgb(193,193,193) label(%country.decimalseparator%) font(Arial,30,bold)|send(46,kp)|1090 5025|main|||button|at(456,491,531,541) brgb(193,193,193) label(X) font(Arial,30,bold)|sale? if(cond(%screen..led.kp.value% != money(0.0)) then(sendstr(posc(sale(line,set,quantity,s%PARAM%)),kp) send(42,kp)) else(message(99,3,Cannot set quantity to zero. Please enter the quantity required first.))|1091 5025|main|||button|at(456,543,531,593) brgb(193,193,193) label(-) font(arial,36,bold)|send(45,kp)|1092

;;### Programmable Buttons ###
1st column of programmable buttons.
5025|main|||button|at(5,75,75,125) program label(A1) multiline brgb(227,107,36) font(arial,16)||1021

;;### Programmable Buttons ###
2nd column of programmable buttons.
5025|main|||button|at(77,75,147,125) program label(B1) multiline brgb(227,107,36) font(arial,16)||1031

;;### Programmable Buttons ###
3rd column of programmable buttons.
5025|main|||button|at(149,75,219,125) program label(C1) multiline brgb(227,107,36) font(arial,16)||1041