home *** CD-ROM | disk | FTP | other *** search
/ Delphi 5 for Professionals / DELPHI5.iso / AddOns / Components / Essentials / SETUP.EXE / %MAINDIR% / EsCalc.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  1998-11-28  |  9.5 KB  |  264 lines

  1. // Borland C++ Builder
  2. // Copyright (c) 1995, 1998 by Borland International
  3. // All rights reserved
  4.  
  5. // (DO NOT EDIT: machine generated header) 'EsCalc.pas' rev: 3.00
  6.  
  7. #ifndef EsCalcHPP
  8. #define EsCalcHPP
  9. #include <EsUtil.hpp>
  10. #include <EsData.hpp>
  11. #include <EsConst.hpp>
  12. #include <EsBase.hpp>
  13. #include <SysUtils.hpp>
  14. #include <StdCtrls.hpp>
  15. #include <Messages.hpp>
  16. #include <Menus.hpp>
  17. #include <Graphics.hpp>
  18. #include <Forms.hpp>
  19. #include <ExtCtrls.hpp>
  20. #include <Controls.hpp>
  21. #include <Clipbrd.hpp>
  22. #include <Classes.hpp>
  23. #include <Buttons.hpp>
  24. #include <Windows.hpp>
  25. #include <SysInit.hpp>
  26. #include <System.hpp>
  27.  
  28. //-- user supplied -----------------------------------------------------------
  29.  
  30. namespace Escalc
  31. {
  32. //-- type declarations -------------------------------------------------------
  33. enum TEsCalculatorButton { ccNone, ccBack, ccClearEntry, ccClear, ccAdd, ccSub, ccMul, ccDiv, cc0, cc1, 
  34.     cc2, cc3, cc4, cc5, cc6, cc7, cc8, cc9, ccDecimal, ccEqual, ccInvert, ccChangeSign, ccPercent, ccSqrt, 
  35.     ccMemClear, ccMemRecall, ccMemStore, ccMemAdd, ccMemSub };
  36.  
  37. #pragma pack(push, 1)
  38. struct TEsButtonInfo
  39. {
  40.     Windows::TRect Position;
  41.     System::SmallString<10>  Caption;
  42.     bool Visible;
  43. } ;
  44. #pragma pack(pop)
  45.  
  46. typedef TEsButtonInfo TEsButtonArray[28];
  47.  
  48. enum TEsCalcState { csValid, csLocked, csClear };
  49.  
  50. typedef Graphics::TColor TEsCalcColorArray[8];
  51.  
  52. enum TEsCalcColorScheme { csCustom, csWindows, csDark, csOcean, csPlain };
  53.  
  54. typedef Graphics::TColor TEsCalcSchemeArray[5][8];
  55.  
  56. class DELPHICLASS TEsCalcColors;
  57. class PASCALIMPLEMENTATION TEsCalcColors : public Classes::TPersistent 
  58. {
  59.     typedef Classes::TPersistent inherited;
  60.     
  61. private:
  62.     bool FUpdating;
  63.     Classes::TNotifyEvent FOnChange;
  64.     bool SettingScheme;
  65.     void __fastcall DoOnChange(void);
  66.     Graphics::TColor __fastcall GetColor(int Index);
  67.     void __fastcall SetColor(int Index, Graphics::TColor Value);
  68.     void __fastcall SetColorScheme(TEsCalcColorScheme Value);
  69.     void __fastcall SetDisplayText(Graphics::TColor Value);
  70.     
  71. public:
  72.     Graphics::TColor FCalcColors[8];
  73.     TEsCalcColorScheme FColorScheme;
  74.     virtual void __fastcall Assign(Classes::TPersistent* Source);
  75.     void __fastcall BeginUpdate(void);
  76.     void __fastcall EndUpdate(void);
  77.     __property Classes::TNotifyEvent OnChange = {read=FOnChange, write=FOnChange};
  78.     
  79. __published:
  80.     __property TEsCalcColorScheme ColorScheme = {read=FColorScheme, write=SetColorScheme, nodefault};
  81.     __property Graphics::TColor DisabledMemoryButtons = {read=GetColor, write=SetColor, index=0, nodefault
  82.         };
  83.     __property Graphics::TColor Display = {read=GetColor, write=SetColor, index=1, nodefault};
  84.     __property Graphics::TColor DisplayText = {read=FCalcColors[7], write=SetDisplayText, nodefault};
  85.     __property Graphics::TColor EditButtons = {read=GetColor, write=SetColor, index=3, nodefault};
  86.     __property Graphics::TColor FunctionButtons = {read=GetColor, write=SetColor, index=4, nodefault};
  87.     __property Graphics::TColor MemoryButtons = {read=GetColor, write=SetColor, index=5, nodefault};
  88.     __property Graphics::TColor NumberButtons = {read=GetColor, write=SetColor, index=6, nodefault};
  89.     __property Graphics::TColor OperatorButtons = {read=GetColor, write=SetColor, index=7, nodefault};
  90. public:
  91.         
  92.     /* TPersistent.Destroy */ __fastcall virtual ~TEsCalcColors(void) { }
  93.     
  94. public:
  95.     /* TObject.Create */ __fastcall TEsCalcColors(void) : Classes::TPersistent() { }
  96.     
  97. };
  98.  
  99. class DELPHICLASS TEsCalcPanel;
  100. class PASCALIMPLEMENTATION TEsCalcPanel : public Extctrls::TPanel 
  101. {
  102.     typedef Extctrls::TPanel inherited;
  103.     
  104. protected:
  105.     DYNAMIC void __fastcall Click(void);
  106. public:
  107.     /* TCustomPanel.Create */ __fastcall virtual TEsCalcPanel(Classes::TComponent* AOwner) : Extctrls::
  108.         TPanel(AOwner) { }
  109.     
  110. public:
  111.     /* TCustomControl.Destroy */ __fastcall virtual ~TEsCalcPanel(void) { }
  112.     
  113. public:
  114.     /* TWinControl.CreateParented */ __fastcall TEsCalcPanel(HWND ParentWindow) : Extctrls::TPanel(ParentWindow
  115.         ) { }
  116.     
  117. };
  118.  
  119. typedef void __fastcall (__closure *TButtonPressedEvent)(System::TObject* Sender, TEsCalculatorButton 
  120.     Button);
  121.  
  122. class DELPHICLASS TEsCustomCalculator;
  123. class PASCALIMPLEMENTATION TEsCustomCalculator : public Esbase::TEsBase 
  124. {
  125.     typedef Esbase::TEsBase inherited;
  126.     
  127. protected:
  128.     TFormBorderStyle FBorderStyle;
  129.     TEsCalcColors* FColors;
  130.     bool FShowMemoryButtons;
  131.     TButtonPressedEvent FOnButtonPressed;
  132.     TEsButtonInfo cButtons[28];
  133.     Extended cDisplay;
  134.     System::AnsiString cDisplayStr;
  135.     TEsCalculatorButton cDownButton;
  136.     TEsCalculatorButton cLastButton;
  137.     int cMargin;
  138.     Extended cMemory;
  139.     Extended cOperand;
  140.     TEsCalculatorButton cOperation;
  141.     TEsCalcPanel* cPanel;
  142.     System::Set<TEsCalcState, csValid, csClear>  cState;
  143.     bool cPopup;
  144.     void __fastcall cAdjustHeight(void);
  145.     void __fastcall cCalculateLook(void);
  146.     void __fastcall cClearAll(void);
  147.     void __fastcall cColorChange(System::TObject* Sender);
  148.     void __fastcall cDisplayError(void);
  149.     void __fastcall cDisplayValue(const Extended Value);
  150.     void __fastcall cDrawCalcButton(const TEsButtonInfo &Button, bool Pressed);
  151.     void __fastcall cDrawFocusState(void);
  152.     void __fastcall cEvaluate(void);
  153.     void __fastcall cInvalidateIndicator(void);
  154.     void __fastcall SetBorderStyle(Forms::TBorderStyle Value);
  155.     void __fastcall SetShowMemoryButtons(bool Value);
  156.     HIDESBASE MESSAGE void __fastcall CMCtl3DChanged(Messages::TMessage &Msg);
  157.     HIDESBASE MESSAGE void __fastcall CMEnter(Messages::TMessage &Msg);
  158.     HIDESBASE MESSAGE void __fastcall CMExit(Messages::TMessage &Msg);
  159.     HIDESBASE MESSAGE void __fastcall CMFontChanged(Messages::TMessage &Msg);
  160.     HIDESBASE MESSAGE void __fastcall WMEraseBkgnd(Messages::TWMEraseBkgnd &Msg);
  161.     MESSAGE void __fastcall WMGetText(Messages::TWMGetText &Msg);
  162.     MESSAGE void __fastcall WMGetTextLength(Messages::TWMNoParams &Msg);
  163.     HIDESBASE MESSAGE void __fastcall WMKeyDown(Messages::TWMKey &Msg);
  164.     MESSAGE void __fastcall WMSetText(Messages::TWMSetText &Msg);
  165.     virtual void __fastcall CreateParams(Controls::TCreateParams &Params);
  166.     virtual void __fastcall CreateWnd(void);
  167.     DYNAMIC void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
  168.     DYNAMIC void __fastcall KeyPress(char &Key);
  169.     DYNAMIC void __fastcall MouseDown(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, 
  170.         int Y);
  171.     DYNAMIC void __fastcall MouseUp(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int 
  172.         Y);
  173.     virtual void __fastcall Paint(void);
  174.     __property Forms::TBorderStyle BorderStyle = {read=FBorderStyle, write=SetBorderStyle, default=0};
  175.     __property bool ShowMemoryButtons = {read=FShowMemoryButtons, write=SetShowMemoryButtons, default=1
  176.         };
  177.     __property TButtonPressedEvent OnButtonPressed = {read=FOnButtonPressed, write=FOnButtonPressed};
  178.     
  179. public:
  180.     __fastcall virtual TEsCustomCalculator(Classes::TComponent* AOwner);
  181.     __fastcall virtual TEsCustomCalculator(Classes::TComponent* AOwner, bool AsPopup);
  182.     __fastcall virtual ~TEsCustomCalculator(void);
  183.     virtual void __fastcall SetBounds(int ALeft, int ATop, int AWidth, int AHeight);
  184.     void __fastcall CopyToClipboard(void);
  185.     void __fastcall PasteFromClipboard(void);
  186.     void __fastcall PressButton(TEsCalculatorButton Button);
  187.     __property TEsCalcColors* Colors = {read=FColors, write=FColors};
  188.     __property Extended Memory = {read=cMemory, write=cMemory};
  189.     __property Text ;
  190.     __property Extended Value = {read=cDisplay};
  191. public:
  192.     /* TWinControl.CreateParented */ __fastcall TEsCustomCalculator(HWND ParentWindow) : Esbase::TEsBase(
  193.         ParentWindow) { }
  194.     
  195. };
  196.  
  197. class DELPHICLASS TEsCalculator;
  198. class PASCALIMPLEMENTATION TEsCalculator : public Escalc::TEsCustomCalculator 
  199. {
  200.     typedef Escalc::TEsCustomCalculator inherited;
  201.     
  202. __published:
  203.     __property Font ;
  204.     __property Align ;
  205.     __property BorderStyle ;
  206.     __property Ctl3D ;
  207.     __property Colors ;
  208.     __property Cursor ;
  209.     __property DragCursor ;
  210.     __property DragMode ;
  211.     __property Enabled ;
  212.     __property EsLabelInfo ;
  213.     __property ParentCtl3D ;
  214.     __property ParentFont ;
  215.     __property ParentShowHint ;
  216.     __property PopupMenu ;
  217.     __property ShowHint ;
  218.     __property ShowMemoryButtons ;
  219.     __property TabOrder ;
  220.     __property TabStop ;
  221.     __property Version ;
  222.     __property Visible ;
  223.     __property OnButtonPressed ;
  224.     __property OnDragDrop ;
  225.     __property OnDragOver ;
  226.     __property OnEndDrag ;
  227.     __property OnEnter ;
  228.     __property OnExit ;
  229.     __property OnKeyDown ;
  230.     __property OnKeyPress ;
  231.     __property OnKeyUp ;
  232.     __property OnMouseDown ;
  233.     __property OnMouseMove ;
  234.     __property OnMouseUp ;
  235.     __property OnStartDrag ;
  236. public:
  237.     /* TEsCustomCalculator.Create */ __fastcall virtual TEsCalculator(Classes::TComponent* AOwner) : Escalc::
  238.         TEsCustomCalculator(AOwner) { }
  239.     /* TEsCustomCalculator.CreateEx */ __fastcall virtual TEsCalculator(Classes::TComponent* AOwner, bool 
  240.         AsPopup) : Escalc::TEsCustomCalculator(AOwner, AsPopup) { }
  241.     /* TEsCustomCalculator.Destroy */ __fastcall virtual ~TEsCalculator(void) { }
  242.     
  243. public:
  244.     /* TWinControl.CreateParented */ __fastcall TEsCalculator(HWND ParentWindow) : Escalc::TEsCustomCalculator(
  245.         ParentWindow) { }
  246.     
  247. };
  248.  
  249. //-- var, const, procedure ---------------------------------------------------
  250. #define calcDefBorderStyle (Forms::TFormBorderStyle)(0)
  251. #define calcDefColor (int)(-2147483633)
  252. #define calcDefHeight (Byte)(140)
  253. #define calcDefShowMemoryButtons (bool)(1)
  254. #define calcDefTabStop (bool)(1)
  255. #define calcDefWidth (Byte)(200)
  256. extern PACKAGE Graphics::TColor CalcScheme[5][8];
  257.  
  258. }    /* namespace Escalc */
  259. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  260. using namespace Escalc;
  261. #endif
  262. //-- end unit ----------------------------------------------------------------
  263. #endif    // EsCalc
  264.