User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Pascal and Delphi section within the Software Development category of DaniWeb, a massive community of 375,273 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,218 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Pascal and Delphi advertiser:
Apr 8th, 2005
Views: 4,509
It is a small two-in-one calculator that can work as a regular or RPN calculator, selected by a RPN checkbox. It has a four level stack similar to the HP 48 calculator made from four Tmemos. This code shows you how to make visual effects(RPN stack) from existing delphi components. I have also included 'calc.dfm' form code at the end to make it easy putting it together.
delphi Syntax | 3 stars
  1. {------------------------ calc.pas -------------------------}
  2.  
  3. unit calc;
  4.  
  5. {$X-}
  6.  
  7. interface
  8.  
  9. uses
  10. SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  11. Forms, Dialogs, Menus, StdCtrls, ExtCtrls, Buttons;
  12.  
  13. type
  14. Tcalcform = class(TForm)
  15. One: TButton;
  16. Two: TButton;
  17. Three: TButton;
  18. Four: TButton;
  19. Five: TButton;
  20. Six: TButton;
  21. Seven: TButton;
  22. Eight: TButton;
  23. Nine: TButton;
  24. Zero: TButton;
  25. Equal: TButton;
  26. Clear: TButton;
  27. AllClear: TButton;
  28. Multiply: TButton;
  29. Divide: TButton;
  30. Plus: TButton;
  31. Minus: TButton;
  32. Drop: TButton;
  33. Stack: TMemo;
  34. ExitButton: TBitBtn;
  35. Decimal: TButton;
  36. Enter: TButton;
  37. Entry: TMemo;
  38. RPN: TCheckBox;
  39. Stack2: TMemo;
  40. Stack3: TMemo;
  41. Stack4: TMemo;
  42. Edit1: TEdit;
  43. Edit2: TEdit;
  44. Edit3: TEdit;
  45. StaticText1: TStaticText;
  46. StaticText2: TStaticText;
  47. StaticText3: TStaticText;
  48. StaticText4: TStaticText;
  49. plusminus: TButton;
  50. procedure OneClick(Sender: TObject);
  51. procedure TwoClick(Sender: TObject);
  52. procedure ThreeClick(Sender: TObject);
  53. procedure FourClick(Sender: TObject);
  54. procedure FiveClick(Sender: TObject);
  55. procedure SixClick(Sender: TObject);
  56. procedure SevenClick(Sender: TObject);
  57. procedure EightClick(Sender: TObject);
  58. procedure NineClick(Sender: TObject);
  59. procedure PlusClick(Sender: TObject);
  60. procedure MinusClick(Sender: TObject);
  61. procedure MultiplyClick(Sender: TObject);
  62. procedure DivideClick(Sender: TObject);
  63. procedure ClearClick(Sender: TObject);
  64. procedure AllClearClick(Sender: TObject);
  65. procedure EntryChange(Sender: TObject);
  66. procedure EqualClick(Sender: TObject);
  67. procedure DecimalClick(Sender: TObject);
  68. procedure Display;
  69. procedure ExitButtonClick(Sender: TObject);
  70. procedure ZeroClick(Sender: TObject);
  71. procedure EntryKeyDown(Sender: TObject; var Key: Word;
  72. Shift: TShiftState);
  73. procedure FormShow(Sender: TObject);
  74. procedure EnterClick(Sender: TObject);
  75. procedure FormCreate(Sender: TObject);
  76. procedure DropClick(Sender: TObject);
  77. procedure RPNClick(Sender: TObject);
  78. procedure plusminusClick(Sender: TObject);
  79. private
  80. { Private declarations }
  81. procedure CreateParams(var Params: TCreateParams); override;
  82. procedure WMNCHitTest(var Msg: TMessage); message WM_NCHITTEST;
  83. public
  84. { Public declarations }
  85. end;
  86.  
  87.  
  88. var
  89. calcform: Tcalcform;
  90. DecimalSeparator: string;
  91. DigitGrouping: string;
  92. Total : Double;
  93. Complete: Boolean;
  94. Operator: Char;
  95. Sign : Boolean;
  96.  
  97. implementation
  98.  
  99. {$R *.dfm}
  100.  
  101. procedure Tcalcform.FormCreate(Sender: TObject);
  102. begin
  103. {$ExtendedSyntax On}
  104. end;
  105.  
  106. // the missing delay() procedure, delay in milliseconds
  107. procedure Delay(msecs: integer);
  108. var
  109. FirstTickCount: longint;
  110. begin
  111. FirstTickCount := GetTickCount;
  112. repeat
  113. Application.ProcessMessages; { allowing access to other controls }
  114. until ((GetTickCount-FirstTickCount) >= Longint(msecs));
  115. end;
  116.  
  117. function DeletePoint(Str: string): string;
  118. var
  119. i,position: Integer;
  120. begin
  121. i := 0;
  122. position := AnsiPos(DigitGrouping, Str);
  123. if position = 0 then
  124. Result:=Str
  125. else
  126. begin
  127. while i<=Length(Str) do
  128. if Str[i] = DigitGrouping then Delete(Str, i, 1)
  129. else
  130. Inc(i);
  131. Result:=Str
  132. end
  133. end;
  134.  
  135. // override form's style to create a window without titlebar
  136. procedure Tcalcform.CreateParams(var Params: TCreateParams);
  137. begin
  138. inherited CreateParams (Params);
  139. Params.Style := ws_Popup or ws_ClipChildren or ws_ClipSiblings or ws_Border;
  140. end;
  141.  
  142. // left mouse button will drag form
  143. procedure Tcalcform.WMNCHitTest(var Msg: TMessage);
  144. begin
  145. if GetAsyncKeyState(VK_LBUTTON) < 0 then
  146. Msg.Result := HTCAPTION
  147. else
  148. Msg.Result := HTCLIENT;
  149. end;
  150.  
  151. procedure Calculate(Number: Real; NextOp: Char);
  152. begin
  153. if not Complete or (Total = 0.0) then
  154. case Operator of
  155. '+': Total := Total + Number;
  156. '-': Total := Total - Number;
  157. 'x': Total := Total * Number;
  158. '/':
  159. begin
  160. if Number <> 0 then
  161. Total := Total / Number
  162. else
  163. begin
  164. calcform.Entry.Text := 'Division by Zero!';
  165. Delay(3000);
  166. end;
  167. end;
  168. end;
  169. Operator := NextOp;
  170. Complete := True;
  171. end;
  172.  
  173. procedure CalculateRPN(Number: Real; NextOp: Char);
  174. var
  175. No,No2: string;
  176. begin
  177. No := DeletePoint(calcform.Stack.Text);
  178. No2 := DeletePoint(calcform.Stack2.Text);
  179. if Number = 0.0 then
  180. begin
  181. Number := StrToFloat(No2);
  182. case NextOP of
  183. '+': Total := Number + StrToFloat(No);
  184. '-': Total := Number - StrToFloat(No);
  185. 'x': Total := Number * StrToFloat(No);
  186. '/':
  187. begin
  188. if Number <> 0 then
  189. Total := Number / StrToFloat(No)
  190. else
  191. begin
  192. calcform.Entry.Text := 'Division by Zero!';
  193. Delay(3000);
  194. end;
  195. end;
  196. end
  197. end
  198. else
  199. begin
  200. case NextOP of
  201. '+': Total := StrToFloat(No) + Number;
  202. '-': Total := StrToFloat(No) - Number;
  203. 'x': Total := StrToFloat(No) * Number;
  204. '/':
  205. begin
  206. if Number <> 0 then
  207. Total := StrToFloat(No) / Number
  208. else
  209. begin
  210. calcform.Entry.Text := 'Division by Zero!';
  211. Delay(3000);
  212. end;
  213. end;
  214. end;
  215.  
  216. end;
  217. Complete := True;
  218. Sign := False;
  219. end;
  220.  
  221. procedure Tcalcform.ZeroClick(Sender: TObject);
  222. begin
  223. if Complete then Entry.Text := '';
  224.  
  225. Entry.Text := Entry.Text + '0';
  226. Sign := False;
  227. Entry.SetFocus;
  228. end;
  229.  
  230. procedure Tcalcform.OneClick(Sender: TObject);
  231. begin
  232. if Complete then Entry.Text := '';
  233. Entry.Text := Entry.Text + '1';
  234. Sign := False;
  235. Entry.SetFocus;
  236. end;
  237.  
  238. procedure Tcalcform.TwoClick(Sender: TObject);
  239. begin
  240. if Complete then Entry.Text := '';
  241. Entry.Text := Entry.Text + '2';
  242. Sign := False;
  243. Entry.SetFocus;
  244. end;
  245.  
  246. procedure Tcalcform.ThreeClick(Sender: TObject);
  247. begin
  248. if Complete then Entry.Text := '';
  249. Entry.Text := Entry.Text + '3';
  250. Sign := False;
  251. Entry.SetFocus;
  252. end;
  253.  
  254. procedure Tcalcform.FourClick(Sender: TObject);
  255. begin
  256. if Complete then Entry.Text := '';
  257. Entry.Text := Entry.Text + '4';
  258. Sign := False;
  259. Entry.SetFocus;
  260. end;
  261.  
  262. procedure Tcalcform.FiveClick(Sender: TObject);
  263. begin
  264. if Complete then Entry.Text := '';
  265. Entry.Text := Entry.Text + '5';
  266. Sign := False;
  267. Entry.SetFocus;
  268. end;
  269.  
  270. procedure Tcalcform.SixClick(Sender: TObject);
  271. begin
  272. if Complete then Entry.Text := '';
  273. Entry.Text := Entry.Text + '6';
  274. Sign := False;
  275. Entry.SetFocus;
  276. end;
  277.  
  278. procedure Tcalcform.SevenClick(Sender: TObject);
  279. begin
  280. if Complete then Entry.Text := '';
  281. Entry.Text := Entry.Text + '7';
  282. Sign := False;
  283. Entry.SetFocus;
  284. end;
  285.  
  286. procedure Tcalcform.EightClick(Sender: TObject);
  287. begin
  288. if Complete then Entry.Text := '';
  289. Entry.Text := Entry.Text + '8';
  290. Sign := False;
  291. Entry.SetFocus;
  292. end;
  293.  
  294. procedure Tcalcform.NineClick(Sender: TObject);
  295. begin
  296. if Complete then Entry.Text := '';
  297. Entry.Text := Entry.Text + '9';
  298. Sign := False;
  299. Entry.SetFocus;
  300. end;
  301.  
  302. procedure Tcalcform.PlusClick(Sender: TObject);
  303. var
  304. No: string;
  305. begin
  306. if RPN.Checked then
  307. CalculateRPN(StrToFloat(Entry.Text), '+')
  308. else
  309. begin
  310. Sign := True;
  311. No := DeletePoint(Entry.Text);
  312. Calculate(StrToFloat(No), '+');
  313. end;
  314. Display;
  315. end;
  316.  
  317. procedure Tcalcform.MinusClick(Sender: TObject);
  318. var
  319. No: string;
  320. begin
  321. if RPN.Checked = TRUE then
  322. CalculateRPN(StrToFloat(Entry.Text), '-')
  323. else
  324. begin
  325. Sign := True;
  326. No := DeletePoint(Entry.Text);
  327. Calculate(StrToFloat(No), '-');
  328. end;
  329. Display;
  330. end;
  331.  
  332. procedure Tcalcform.MultiplyClick(Sender: TObject);
  333. var
  334. No: string;
  335. begin
  336. if RPN.Checked = TRUE then
  337. CalculateRPN(StrToFloat(Entry.Text), 'x')
  338. else
  339. begin
  340. Sign := True;
  341. No := DeletePoint(Entry.Text);
  342. Calculate(StrToFloat(No), 'x');
  343. end;
  344. Display;
  345. end;
  346.  
  347. procedure Tcalcform.DivideClick(Sender: TObject);
  348. var
  349. No: string;
  350. begin
  351. if RPN.Checked = TRUE then
  352. CalculateRPN(StrToFloat(Entry.Text), '/')
  353. else
  354. begin
  355. Sign := True;
  356. No := DeletePoint(Entry.Text);
  357. Calculate(StrToFloat(No), '/');
  358. end;
  359. Display;
  360. end;
  361.  
  362. procedure Tcalcform.ClearClick(Sender: TObject);
  363. var
  364. Sf: string;
  365. begin
  366. if Length(Entry.Text) = 1 then
  367. begin
  368. Complete := True;
  369. Entry.Text := '0'
  370. end
  371. else
  372. begin
  373. Sf := Entry.Text;
  374. if ((not Sign) and (not Complete)) then Delete(Sf, Length(Sf), Length(Sf)-1);
  375. Entry.Text := Sf;
  376. end;
  377. Entry.SetFocus;
  378. end;
  379.  
  380. procedure Tcalcform.AllClearClick(Sender: TObject);
  381. begin
  382. Entry.Text := '0';
  383. Stack.Lines.Clear;
  384. Stack2.Lines.Clear;
  385. Stack3.Lines.Clear;
  386. Stack4.Lines.Clear;
  387. Complete := True;
  388. Total := 0.0;
  389. Operator := '+';
  390. Sign := False;
  391. Entry.SetFocus;
  392. end;
  393.  
  394. procedure Tcalcform.EntryChange(Sender: TObject);
  395. begin
  396. if Entry.Text = '' then Complete := False;
  397. end;
  398.  
  399. procedure Tcalcform.EqualClick(Sender: TObject);
  400. var
  401. No: string;
  402. begin
  403. if RPN.Checked = FALSE then
  404. begin
  405. No := DeletePoint(Entry.Text);
  406. Calculate(StrToFloat(No), '+');
  407. Display;
  408. Complete := True;
  409. Total := 0.0;
  410. Sign := False;
  411. end;
  412. Entry.SetFocus;
  413. end;
  414.  
  415. procedure Tcalcform.DecimalClick(Sender: TObject);
  416. begin
  417. if Complete then
  418. begin
  419. Entry.Text := '0';
  420. Complete := False;
  421. end;
  422. if Pos(DecimalSeparator, Entry.Text) = 0 then
  423. Entry.Text := Entry.Text + DecimalSeparator;
  424. Entry.SetFocus;
  425. end;
  426.  
  427. // format the result display
  428. procedure Tcalcform.Display;
  429. begin
  430. if RPN.Checked = TRUE then
  431. begin
  432. if (StrToFloat(Entry.Text)) = 0.0 then
  433. begin
  434. Stack2.Text := Stack3.Text;
  435. Stack3.Text := Stack4.Text;
  436. Stack4.Lines.Clear;
  437. Stack.Text := Format('%.2n',[Total]);
  438. Entry.Text := '0';
  439. end
  440. else
  441. begin
  442. Stack.Text := Format('%.2n',[Total]);
  443. Entry.Text := '0';
  444. end
  445. end
  446. else
  447. Entry.Text := Format('%.2n',[Total]);
  448. Entry.SetFocus;
  449. end;
  450.  
  451. procedure Tcalcform.ExitButtonClick(Sender: TObject);
  452. begin
  453. Close;
  454. end;
  455.  
  456. procedure Tcalcform.EntryKeyDown(Sender: TObject; var Key: Word;
  457. Shift: TShiftState);
  458. begin
  459. if Key = 39 then ClearClick(Sender);
  460. if Key = 40 then DropClick(Sender);
  461. if Key = VK_NUMPAD0 then ZeroClick(Sender);
  462. if Key = VK_NUMPAD1 then OneClick(Sender);
  463. if Key = VK_NUMPAD2 then TwoClick(Sender);
  464. if Key = VK_NUMPAD3 then ThreeClick(Sender);
  465. if Key = VK_NUMPAD4 then FourClick(Sender);
  466. if Key = VK_NUMPAD5 then FiveClick(Sender);
  467. if Key = VK_NUMPAD6 then SixClick(Sender);
  468. if Key = VK_NUMPAD7 then SevenClick(Sender);
  469. if Key = VK_NUMPAD8 then EightClick(Sender);
  470. if Key = VK_NUMPAD9 then NineClick(Sender);
  471. if Key = VK_DECIMAL then DecimalClick(Sender);
  472. if Key = VK_ADD then PlusClick(Sender);
  473. if Key = VK_SUBTRACT then MinusClick(Sender);
  474. if Key = VK_DIVIDE then DivideClick(Sender);
  475. if Key = VK_MULTIPLY then MultiplyClick(Sender);
  476. if Key = VK_BACK then ClearClick(Sender);
  477. if Key = VK_RETURN then
  478. if RPN.Checked = TRUE then
  479. EnterClick(Sender)
  480. else
  481. EqualClick(Sender);
  482. Entry.SetFocus;
  483. end;
  484.  
  485. procedure Tcalcform.FormShow(Sender: TObject);
  486. begin
  487. Entry.SetFocus;
  488. end;
  489.  
  490. procedure Tcalcform.EnterClick(Sender: TObject);
  491. var
  492. No: string;
  493. begin
  494. No := DeletePoint(Entry.Text);
  495. Stack4.Text := Stack3.Text;
  496. Stack3.Text := Stack2.Text;
  497. Stack2.Text := Stack.Text;
  498. Stack.Text := Format('%.2n',[StrToFloat(No)]);
  499. Entry.Text := '0';
  500. Complete := True;
  501. Total := 0.0;
  502. Operator := '+';
  503. Entry.SetFocus;
  504. end;
  505.  
  506. procedure Tcalcform.DropClick(Sender: TObject);
  507. begin
  508. Stack.Text := Stack2.Text;
  509. Stack2.Text := Stack3.Text;
  510. Stack3.Text := Stack4.Text;
  511. Stack4.Lines.Clear;
  512. Entry.SetFocus;
  513.  
  514. end;
  515.  
  516. procedure Tcalcform.RPNClick(Sender: TObject);
  517. begin
  518. Total := 0.0;
  519. Entry.SetFocus;
  520. end;
  521.  
  522. procedure Tcalcform.plusminusClick(Sender: TObject);
  523. var
  524. str,str2,str3: string;
  525. it: integer;
  526. begin
  527. str2 := DeletePoint(calcform.Stack.Text);
  528. str3 := DeletePoint(Entry.Text);
  529. it := ansipos('-', Entry.Text);
  530. if it > 0 then
  531. begin
  532. str := Entry.Text;
  533. if not Sign then Delete(str, it, 1);
  534. Entry.Text := str;
  535. end
  536. else
  537. if ((StrToFloat(str3) > 0.0) and (not Sign)) then
  538. Entry.Text := '-' + Entry.Text
  539. else
  540. if ((RPN.Checked) and (StrToFloat(str2) > 0.0)) then
  541. Stack.Text := '-' + Stack.Text
  542. else
  543. if ((RPN.Checked) and (ansipos('-', Stack.Text) > 0)) then
  544. begin
  545. str := Stack.Text;
  546. Delete(str, 1, 1);
  547. Stack.Text := str;
  548. end;
  549.  
  550. Entry.SetFocus;
  551. end;
  552.  
  553. Initialization
  554.  
  555. DecimalSeparator := ',';
  556. DigitGrouping := '.';
  557. Complete := True;
  558. Total := 0.0;
  559. Operator := '+';
  560. Sign := False;
  561.  
  562. end.
  563.  
  564.  
  565. {------------------------ calc.dfm -------------------------}
  566. object calcform: Tcalcform
  567. Left = 388
  568. Top = 203
  569. Width = 315
  570. Height = 328
  571. Caption = 'Calculator'
  572. Color = 12615808
  573. TransparentColorValue = clMaroon
  574. Font.Charset = DEFAULT_CHARSET
  575. Font.Color = clWindowText
  576. Font.Height = -11
  577. Font.Name = 'MS Sans Serif'
  578. Font.Style = []
  579. OldCreateOrder = False
  580. OnCreate = FormCreate
  581. OnShow = FormShow
  582. PixelsPerInch = 96
  583. TextHeight = 13
  584. object Stack4: TMemo
  585. Left = 16
  586. Top = 16
  587. Width = 281
  588. Height = 24
  589. Alignment = taRightJustify
  590. Color = 102
  591. Font.Charset = DEFAULT_CHARSET
  592. Font.Color = clRed
  593. Font.Height = -16
  594. Font.Name = 'MS Sans Serif'
  595. Font.Style = [fsBold]
  596. MaxLength = 20
  597. ParentFont = False
  598. ReadOnly = True
  599. TabOrder = 26
  600. end
  601. object Stack3: TMemo
  602. Left = 16
  603. Top = 35
  604. Width = 281
  605. Height = 24
  606. Alignment = taRightJustify
  607. Color = 102
  608. Font.Charset = DEFAULT_CHARSET
  609. Font.Color = clRed
  610. Font.Height = -16
  611. Font.Name = 'MS Sans Serif'
  612. Font.Style = [fsBold]
  613. MaxLength = 20
  614. ParentFont = False
  615. ReadOnly = True
  616. TabOrder = 25
  617. end
  618. object Stack2: TMemo
  619. Left = 16
  620. Top = 54
  621. Width = 281
  622. Height = 24
  623. Alignment = taRightJustify
  624. Color = 102
  625. Font.Charset = DEFAULT_CHARSET
  626. Font.Color = clRed
  627. Font.Height = -16
  628. Font.Name = 'MS Sans Serif'
  629. Font.Style = [fsBold]
  630. MaxLength = 20
  631. ParentFont = False
  632. ReadOnly = True
  633. TabOrder = 24
  634. end
  635. object Stack: TMemo
  636. Left = 16
  637. Top = 73
  638. Width = 281
  639. Height = 24
  640. Alignment = taRightJustify
  641. Color = 102
  642. Font.Charset = DEFAULT_CHARSET
  643. Font.Color = clRed
  644. Font.Height = -16
  645. Font.Name = 'MS Sans Serif'
  646. Font.Style = [fsBold]
  647. Lines.Strings = (
  648. '')
  649. MaxLength = 20
  650. ParentFont = False
  651. ReadOnly = True
  652. TabOrder = 0
  653. WordWrap = False
  654. end
  655. object One: TButton
  656. Left = 16
  657. Top = 148
  658. Width = 33
  659. Height = 33
  660. Caption = '1'
  661. Font.Charset = DEFAULT_CHARSET
  662. Font.Color = clWindowText
  663. Font.Height = -11
  664. Font.Name = 'MS Sans Serif'
  665. Font.Style = [fsBold]
  666. ParentFont = False
  667. TabOrder = 1
  668. OnClick = OneClick
  669. end
  670. object Two: TButton
  671. Left = 56
  672. Top = 148
  673. Width = 33
  674. Height = 33
  675. Caption = '2'
  676. Font.Charset = DEFAULT_CHARSET
  677. Font.Color = clWindowText
  678. Font.Height = -11
  679. Font.Name = 'MS Sans Serif'
  680. Font.Style = [fsBold]
  681. ParentFont = False
  682. TabOrder = 2
  683. OnClick = TwoClick
  684. end
  685. object Three: TButton
  686. Left = 96
  687. Top = 148
  688. Width = 33
  689. Height = 33
  690. Caption = '3'
  691. Font.Charset = DEFAULT_CHARSET
  692. Font.Color = clWindowText
  693. Font.Height = -11
  694. Font.Name = 'MS Sans Serif'
  695. Font.Style = [fsBold]
  696. ParentFont = False
  697. TabOrder = 3
  698. OnClick = ThreeClick
  699. end
  700. object Four: TButton
  701. Left = 16
  702. Top = 188
  703. Width = 33
  704. Height = 33
  705. Caption = '4'
  706. Font.Charset = DEFAULT_CHARSET
  707. Font.Color = clWindowText
  708. Font.Height = -11
  709. Font.Name = 'MS Sans Serif'
  710. Font.Style = [fsBold]
  711. ParentFont = False
  712. TabOrder = 4
  713. OnClick = FourClick
  714. end
  715. object Five: TButton
  716. Left = 56
  717. Top = 188
  718. Width = 33
  719. Height = 33
  720. Caption = '5'
  721. Font.Charset = DEFAULT_CHARSET
  722. Font.Color = clWindowText
  723. Font.Height = -11
  724. Font.Name = 'MS Sans Serif'
  725. Font.Style = [fsBold]
  726. ParentFont = False
  727. TabOrder = 5
  728. OnClick = FiveClick
  729. end
  730. object Six: TButton
  731. Left = 96
  732. Top = 188
  733. Width = 33
  734. Height = 33
  735. Caption = '6'
  736. Font.Charset = DEFAULT_CHARSET
  737. Font.Color = clWindowText
  738. Font.Height = -11
  739. Font.Name = 'MS Sans Serif'
  740. Font.Style = [fsBold]
  741. ParentFont = False
  742. TabOrder = 6
  743. OnClick = SixClick
  744. end
  745. object Seven: TButton
  746. Left = 16
  747. Top = 228
  748. Width = 33
  749. Height = 33
  750. Caption = '7'
  751. Font.Charset = DEFAULT_CHARSET
  752. Font.Color = clWindowText
  753. Font.Height = -11
  754. Font.Name = 'MS Sans Serif'
  755. Font.Style = [fsBold]
  756. ParentFont = False
  757. TabOrder = 7
  758. OnClick = SevenClick
  759. end
  760. object Eight: TButton
  761. Left = 56
  762. Top = 228
  763. Width = 33
  764. Height = 33
  765. Caption = '8'
  766. Font.Charset = DEFAULT_CHARSET
  767. Font.Color = clWindowText
  768. Font.Height = -11
  769. Font.Name = 'MS Sans Serif'
  770. Font.Style = [fsBold]
  771. ParentFont = False
  772. TabOrder = 8
  773. OnClick = EightClick
  774. end
  775. object Nine: TButton
  776. Left = 96
  777. Top = 228
  778. Width = 33
  779. Height = 33
  780. Caption = '9'
  781. Font.Charset = DEFAULT_CHARSET
  782. Font.Color = clWindowText
  783. Font.Height = -11
  784. Font.Name = 'MS Sans Serif'
  785. Font.Style = [fsBold]
  786. ParentFont = False
  787. TabOrder = 9
  788. OnClick = NineClick
  789. end
  790. object Zero: TButton
  791. Left = 16
  792. Top = 268
  793. Width = 33
  794. Height = 33
  795. Caption = '0'
  796. Font.Charset = DEFAULT_CHARSET
  797. Font.Color = clWindowText
  798. Font.Height = -11
  799. Font.Name = 'MS Sans Serif'
  800. Font.Style = [fsBold]
  801. ParentFont = False
  802. TabOrder = 10
  803. OnClick = ZeroClick
  804. end
  805. object Equal: TButton
  806. Left = 56
  807. Top = 268
  808. Width = 73
  809. Height = 33
  810. Caption = '='
  811. Font.Charset = DEFAULT_CHARSET
  812. Font.Color = clWindowText
  813. Font.Height = -17
  814. Font.Name = 'MS Sans Serif'
  815. Font.Style = [fsBold]
  816. ParentFont = False
  817. TabOrder = 11
  818. OnClick = EqualClick
  819. end
  820. object Clear: TButton
  821. Left = 144
  822. Top = 148
  823. Width = 33
  824. Height = 33
  825. Caption = '<--'
  826. Font.Charset = DEFAULT_CHARSET
  827. Font.Color = clWindowText
  828. Font.Height = -13
  829. Font.Name = 'MS Sans Serif'
  830. Font.Style = [fsBold]
  831. ParentFont = False
  832. TabOrder = 12
  833. OnClick = ClearClick
  834. end
  835. object AllClear: TButton
  836. Left = 184
  837. Top = 148
  838. Width = 33
  839. Height = 33
  840. Caption = 'C'
  841. Font.Charset = DEFAULT_CHARSET
  842. Font.Color = clWindowText
  843. Font.Height = -11
  844. Font.Name = 'MS Sans Serif'
  845. Font.Style = [fsBold]
  846. ParentFont = False
  847. TabOrder = 13
  848. OnClick = AllClearClick
  849. end
  850. object Multiply: TButton
  851. Left = 144
  852. Top = 228
  853. Width = 33
  854. Height = 33
  855. Caption = 'X'
  856. Font.Charset = DEFAULT_CHARSET
  857. Font.Color = clWindowText
  858. Font.Height = -11
  859. Font.Name = 'MS Sans Serif'
  860. Font.Style = [fsBold]
  861. ParentFont = False
  862. TabOrder = 14
  863. OnClick = MultiplyClick
  864. end
  865. object Divide: TButton
  866. Left = 184
  867. Top = 228
  868. Width = 33
  869. Height = 33
  870. Caption = '/'
  871. Font.Charset = DEFAULT_CHARSET
  872. Font.Color = clWindowText
  873. Font.Height = -12
  874. Font.Name = 'MS Sans Serif'
  875. Font.Style = [fsBold]
  876. ParentFont = False
  877. TabOrder = 15
  878. OnClick = DivideClick
  879. end
  880. object Plus: TButton
  881. Left = 144
  882. Top = 188
  883. Width = 33
  884. Height = 33
  885. Caption = '+'
  886. Font.Charset = DEFAULT_CHARSET
  887. Font.Color = clWindowText
  888. Font.Height = -19
  889. Font.Name = 'MS Sans Serif'
  890. Font.Style = []
  891. ParentFont = False
  892. TabOrder = 16
  893. OnClick = PlusClick
  894. end
  895. object Minus: TButton
  896. Left = 184
  897. Top = 188
  898. Width = 33
  899. Height = 33
  900. Caption = '--'
  901. Font.Charset = DEFAULT_CHARSET
  902. Font.Color = clWindowText
  903. Font.Height = -16
  904. Font.Name = 'MS Sans Serif'
  905. Font.Style = [fsBold]
  906. ParentFont = False
  907. TabOrder = 17
  908. OnClick = MinusClick
  909. end
  910. object Drop: TButton
  911. Left = 224
  912. Top = 148
  913. Width = 73
  914. Height = 33
  915. Caption = 'DROP'
  916. Font.Charset = DEFAULT_CHARSET
  917. Font.Color = clWindowText
  918. Font.Height = -11
  919. Font.Name = 'MS Sans Serif'
  920. Font.Style = [fsBold]
  921. ParentFont = False
  922. TabOrder = 18
  923. OnClick = DropClick
  924. end
  925. object ExitButton: TBitBtn
  926. Left = 224
  927. Top = 271
  928. Width = 73
  929. Height = 30
  930. Caption = 'Exit'
  931. Font.Charset = DEFAULT_CHARSET
  932. Font.Color = clWindowText
  933. Font.Height = -11
  934. Font.Name = 'MS Sans Serif'
  935. Font.Style = [fsBold]
  936. ParentFont = False
  937. TabOrder = 19
  938. OnClick = ExitButtonClick
  939. end
  940. object Decimal: TButton
  941. Left = 184
  942. Top = 268
  943. Width = 33
  944. Height = 33
  945. Caption = ','
  946. Font.Charset = DEFAULT_CHARSET
  947. Font.Color = clWindowText
  948. Font.Height = -19
  949. Font.Name = 'MS Sans Serif'
  950. Font.Style = [fsBold]
  951. ParentFont = False
  952. TabOrder = 20
  953. OnClick = DecimalClick
  954. end
  955. object Enter: TButton
  956. Left = 224
  957. Top = 188
  958. Width = 73
  959. Height = 33
  960. Caption = 'Enter'
  961. Font.Charset = DEFAULT_CHARSET
  962. Font.Color = clWindowText
  963. Font.Height = -13
  964. Font.Name = 'MS Sans Serif'
  965. Font.Style = [fsBold]
  966. ParentFont = False
  967. TabOrder = 21
  968. OnClick = EnterClick
  969. end
  970. object Entry: TMemo
  971. Left = 17
  972. Top = 108
  973. Width = 280
  974. Height = 25
  975. Alignment = taRightJustify
  976. Color = 8323329
  977. Font.Charset = DEFAULT_CHARSET
  978. Font.Color = 12368963
  979. Font.Height = -16
  980. Font.Name = 'MS Sans Serif'
  981. Font.Style = [fsBold]
  982. Lines.Strings = (
  983. '0')
  984. MaxLength = 20
  985. ParentFont = False
  986. ReadOnly = True
  987. TabOrder = 22
  988. OnChange = EntryChange
  989. OnKeyDown = EntryKeyDown
  990. end
  991. object RPN: TCheckBox
  992. Left = 240
  993. Top = 236
  994. Width = 49
  995. Height = 17
  996. Caption = 'RPN'
  997. Font.Charset = DEFAULT_CHARSET
  998. Font.Color = clWindowText
  999. Font.Height = -11
  1000. Font.Name = 'MS Sans Serif'
  1001. Font.Style = [fsBold]
  1002. ParentFont = False
  1003. TabOrder = 23
  1004. OnClick = RPNClick
  1005. end
  1006. object Edit1: TEdit
  1007. Left = 18
  1008. Top = 73
  1009. Width = 277
  1010. Height = 2
  1011. BorderStyle = bsNone
  1012. Color = 102
  1013. TabOrder = 27
  1014. end
  1015. object Edit2: TEdit
  1016. Left = 18
  1017. Top = 54
  1018. Width = 277
  1019. Height = 2
  1020. BorderStyle = bsNone
  1021. Color = 102
  1022. TabOrder = 28
  1023. end
  1024. object Edit3: TEdit
  1025. Left = 18
  1026. Top = 35
  1027. Width = 277
  1028. Height = 2
  1029. BorderStyle = bsNone
  1030. Color = 102
  1031. TabOrder = 29
  1032. end
  1033. object StaticText1: TStaticText
  1034. Left = 22
  1035. Top = 18
  1036. Width = 19
  1037. Height = 21
  1038. AutoSize = False
  1039. Caption = '4:'
  1040. Color = 102
  1041. Font.Charset = DEFAULT_CHARSET
  1042. Font.Color = clRed
  1043. Font.Height = -16
  1044. Font.Name = 'MS Sans Serif'
  1045. Font.Style = [fsBold]
  1046. ParentColor = False
  1047. ParentFont = False
  1048. TabOrder = 30
  1049. end
  1050. object StaticText2: TStaticText
  1051. Left = 22
  1052. Top = 37
  1053. Width = 19
  1054. Height = 21
  1055. AutoSize = False
  1056. Caption = '3:'
  1057. Color = 102
  1058. Font.Charset = DEFAULT_CHARSET
  1059. Font.Color = clRed
  1060. Font.Height = -16
  1061. Font.Name = 'MS Sans Serif'
  1062. Font.Style = [fsBold]
  1063. ParentColor = False
  1064. ParentFont = False
  1065. TabOrder = 31
  1066. end
  1067. object StaticText3: TStaticText
  1068. Left = 22
  1069. Top = 56
  1070. Width = 19
  1071. Height = 21
  1072. AutoSize = False
  1073. Caption = '2:'
  1074. Color = 102
  1075. Font.Charset = DEFAULT_CHARSET
  1076. Font.Color = clRed
  1077. Font.Height = -16
  1078. Font.Name = 'MS Sans Serif'
  1079. Font.Style = [fsBold]
  1080. ParentColor = False
  1081. ParentFont = False
  1082. TabOrder = 32
  1083. end
  1084. object StaticText4: TStaticText
  1085. Left = 22
  1086. Top = 75
  1087. Width = 19
  1088. Height = 20
  1089. AutoSize = False
  1090. Caption = '1:'
  1091. Color =