|
Manpages XCALCSection: User Commands (1)Updated: Release 6.5 Index Return to Main Contents NAMExcalc - scientific calculator for XSYNOPSISxcalc [-stipple] [-rpn] [-toolkitoption...]DESCRIPTIONxcalc is a scientific calculator desktop accessory that can emulate a TI-30 or an HP-10C.OPTIONSxcalc accepts all of the standard toolkit command line options along with two additional options:
OPERATIONPointer Usage: Operations may be performed with pointer button 1, or in some cases, with the keyboard. Many common calculator operations have keyboard accelerators. To quit, press pointer button 3 on the AC key of the TI calculator, or the ON key of the HP calculator. Calculator Key Usage (TI mode): The numbered keys, the +/- key, and the +, -, *, /, and = keys all do exactly what you would expect them to. It should be noted that the operators obey the standard rules of precedence. Thus, entering "3+4*5=" results in "23", not "35". The parentheses can be used to override this. For example, "(1+2+3)*(4+5+6)=" results in "6*15=90". The entire number in the calculator display can be selected, in order to paste the result of a calculation into text. The action procedures associated with each function are given below. These are useful if you are interested in defining a custom calculator. The action used for all digit keys is digit(n), where n is the corresponding digit, 0..9.
Calculator Key Usage (RPN mode): The number keys, CHS (change sign), +, -, *, /, and ENTR keys all do exactly what you would expect them to do. Many of the remaining keys are the same as in TI mode. The differences are detailed below. The action procedure for the ENTR key is enter().
Finally, there are two additional action procedures: bell(), which rings the bell; and selection(), which performs a cut on the entire number in the calculator's ``liquid crystal'' display. ACCELERATORSAccelerators are shortcuts for entering commands. xcalc provides some sample keyboard accelerators; also users can customize accelerators. The numeric keypad accelerators provided by xcalc should be intuitively correct. The accelerators defined by xcalc on the main keyboard are given below:
TI Key HP Key Keyboard Accelerator TI Function HP Function
SQRT SQRT r squareRoot() squareRoot()
AC ON space clear() clear()
AC <- Delete clear() back()
AC <- Backspace clear() back()
AC <- Control-H clear() back()
AC Clear clear()
AC ON q quit() quit()
AC ON Control-C quit() quit()
INV i i inverse() inverse()
sin s s sine() sine()
cos c c cosine() cosine()
tan t t tangent() tangent()
DRG DRG d degree() degree()
e e e()
ln ln l naturalLog() naturalLog()
y^x y^x ^ power() power()
PI PI p pi() pi()
x! x! ! factorial() factorial()
( ( leftParen()
) ) rightParen()
/ / / divide() divide()
* * * multiply() multiply()
- - - subtract() subtract()
+ + + add() add()
= = equal()
0..9 0..9 0..9 digit() digit()
. . . decimal() decimal()
+/- CHS n negate() negate()
x:y x XexchangeY()
ENTR Return enter()
ENTR Linefeed enter()
CUSTOMIZATIONThe application class name is XCalc.xcalc has an enormous application defaults file which specifies the position, label, and function of each key on the calculator. It also gives translations to serve as keyboard accelerators. Because these resources are not specified in the source code, you can create a customized calculator by writing a private application defaults file, using the Athena Command and Form widget resources to specify the size and position of buttons, the label for each button, and the function of each button. The foreground and background colors of each calculator key can be individually specified. For the TI calculator, a classical color resource specification might be:
For each of buttons 20, 25, 30, 35, and 40, specify:
For each of buttons 22, 23, 24, 27, 28, 29, 32, 33, 34, 37, 38, and 39:
WIDGET HIERARCHYIn order to specify resources, it is useful to know the hierarchy of the widgets which compose xcalc. In the notation below, indentation indicates hierarchical structure. The widget class name is given first, followed by the widget instance name.
XCalc xcalc
Form ti or hp (the name depends on the mode)
Form bevel
Form screen
Label M
Toggle LCD
Label INV
Label DEG
Label RAD
Label GRAD
Label P
Command button1
Command button2
Command button3
and so on, ...
Command button38
Command button39
Command button40
APPLICATION RESOURCES
COLORSIf you would like xcalc to use its ti colors, include the following in the #ifdef COLOR section of the file you read with xrdb:*customization: -color
SEE ALSOX(7), xrdb(1), the Athena Widget SetBUGSHP mode: A bug report claims that the sequence of keys 5, ENTER, <- should clear the display, but it doesn't. COPYRIGHTCopyright ([,]*) X ConsortiumSee X(7) for a full statement of rights and permissions. AUTHORSJohn Bradley, University of PennsylvaniaMark Rosenstein, MIT Project Athena Donna Converse, MIT X Consortium
Index
This document was created by man2html, using the manual pages. Time: 20:52:23 GMT, October 30, 2025 |