home *** CD-ROM | disk | FTP | other *** search
/ CD/PC Actual 9 / CDACTUAL9.iso / progs / CB / DATA.Z / SPIN.HPP < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-06  |  8.1 KB  |  249 lines

  1. //----------------------------------------------------------------------------
  2. // Spin.hpp - dcc32 generated hdr (DO NOT EDIT) rev: -2
  3. // From: Spin.pas
  4. //----------------------------------------------------------------------------
  5. #ifndef SpinHPP
  6. #define SpinHPP
  7. //----------------------------------------------------------------------------
  8. #ifndef ButtonsHPP
  9. #include <Buttons.hpp>
  10. #endif
  11.  
  12. #ifndef MenusHPP
  13. #include <Menus.hpp>
  14. #endif
  15.  
  16. #ifndef GraphicsHPP
  17. #include <Graphics.hpp>
  18. #endif
  19.  
  20. #ifndef FormsHPP
  21. #include <Forms.hpp>
  22. #endif
  23.  
  24. #ifndef SysUtilsHPP
  25. #include <SysUtils.hpp>
  26. #endif
  27.  
  28. #ifndef MessagesHPP
  29. #include <Messages.hpp>
  30. #endif
  31.  
  32. #ifndef ControlsHPP
  33. #include <Controls.hpp>
  34. #endif
  35.  
  36. #ifndef ExtCtrlsHPP
  37. #include <ExtCtrls.hpp>
  38. #endif
  39.  
  40. #ifndef StdCtrlsHPP
  41. #include <StdCtrls.hpp>
  42. #endif
  43.  
  44. #ifndef ClassesHPP
  45. #include <Classes.hpp>
  46. #endif
  47.  
  48. #ifndef WindowsHPP
  49. #include <Windows.hpp>
  50. #endif
  51.  
  52. #ifndef SystemHPP
  53. #include <System.hpp>
  54. #endif
  55.  
  56. namespace Spin
  57. {
  58. //-- type declarations -------------------------------------------------------
  59. class __declspec(delphiclass) TSpinButton;
  60. class __declspec(delphiclass) TTimerSpeedButton;
  61. enum Spin_3 { tbFocusRect, tbAllowTimer };
  62.  
  63. typedef Set<Spin_3, tbFocusRect, tbAllowTimer>  TTimeBtnState;
  64.  
  65. class __declspec(pascalimplementation) TTimerSpeedButton : public Buttons::TSpeedButton
  66. {
  67.     typedef TTimerSpeedButton ThisClass;
  68.     typedef Buttons::TSpeedButton inherited;
  69.     
  70. private:
  71.     Extctrls::TTimer *FRepeatTimer;
  72.     TTimeBtnState FTimeBtnState;
  73.     void __fastcall TimerExpired(System::TObject *Sender);
  74.     
  75. protected:
  76.     virtual void __fastcall Paint(void);
  77.     virtual void __fastcall MouseDown(Controls::TMouseButton Button,  Classes::TShiftState Shift, System::Integer 
  78.         X, System::Integer Y);
  79.     virtual void __fastcall MouseUp(Controls::TMouseButton Button,  Classes::TShiftState Shift, System::Integer 
  80.         X, System::Integer Y);
  81.     
  82. public:
  83.     __fastcall virtual ~TTimerSpeedButton(void);
  84.     __property TTimeBtnState TimeBtnState = {read=FTimeBtnState, write=FTimeBtnState, nodefault};
  85. public:
  86.         
  87.     /* !! TSpeedButton.Create */ __fastcall virtual TTimerSpeedButton(Classes::TComponent *AOwner) : Buttons::TSpeedButton(
  88.         AOwner) { }
  89.     
  90. };
  91.  
  92. class __declspec(pascalimplementation) TSpinButton : public Controls::TWinControl
  93. {
  94.     typedef TSpinButton ThisClass;
  95.     typedef Controls::TWinControl inherited;
  96.     
  97. private:
  98.     TTimerSpeedButton *FUpButton;
  99.     TTimerSpeedButton *FDownButton;
  100.     TTimerSpeedButton *FFocusedButton;
  101.     Controls::TWinControl *FFocusControl;
  102.     Classes::TNotifyEvent FOnUpClick;
  103.     Classes::TNotifyEvent FOnDownClick;
  104.     TTimerSpeedButton *__fastcall CreateButton(void);
  105.     Graphics::TBitmap *__fastcall GetUpGlyph(void);
  106.     Graphics::TBitmap *__fastcall GetDownGlyph(void);
  107.     void __fastcall SetUpGlyph(Graphics::TBitmap *Value);
  108.     void __fastcall SetDownGlyph(Graphics::TBitmap *Value);
  109.     void __fastcall BtnClick(System::TObject *Sender);
  110.     void __fastcall BtnMouseDown(System::TObject *Sender, Controls::TMouseButton Button,  Classes::TShiftState 
  111.         Shift, System::Integer X, System::Integer Y);
  112.     void __fastcall SetFocusBtn(TTimerSpeedButton *Btn);
  113.     void __fastcall AdjustSize(System::Integer &W, System::Integer &H);
  114.     MESSAGE void __fastcall WMSize(Messages::TWMSize &Message);
  115.     MESSAGE void __fastcall WMSetFocus(Messages::TWMSetFocus &Message);
  116.     MESSAGE void __fastcall WMKillFocus(Messages::TWMKillFocus &Message);
  117.     MESSAGE void __fastcall WMGetDlgCode(Messages::TWMNoParams &Message);
  118.     
  119. protected:
  120.     virtual void __fastcall Loaded(void);
  121.     virtual void __fastcall KeyDown(System::Word &Key,  Classes::TShiftState Shift);
  122.     
  123. public:
  124.     __fastcall virtual TSpinButton(Classes::TComponent *AOwner);
  125.     virtual void __fastcall SetBounds(System::Integer ALeft, System::Integer ATop, System::Integer AWidth
  126.         , System::Integer AHeight);
  127.     
  128. __published:
  129.     __property Align ;
  130.     __property Ctl3D ;
  131.     __property Graphics::TBitmap * DownGlyph = {read=GetDownGlyph, write=SetDownGlyph, nodefault};
  132.     __property DragCursor ;
  133.     __property DragMode ;
  134.     __property Enabled ;
  135.     __property Controls::TWinControl * FocusControl = {read=FFocusControl, write=FFocusControl, nodefault
  136.         };
  137.     __property ParentCtl3D ;
  138.     __property ParentShowHint ;
  139.     __property PopupMenu ;
  140.     __property ShowHint ;
  141.     __property TabOrder ;
  142.     __property TabStop ;
  143.     __property Graphics::TBitmap * UpGlyph = {read=GetUpGlyph, write=SetUpGlyph, nodefault};
  144.     __property Visible ;
  145.     __property Classes::TNotifyEvent OnDownClick = {read=FOnDownClick, write=FOnDownClick};
  146.     __property OnDragDrop ;
  147.     __property OnDragOver ;
  148.     __property OnEndDrag ;
  149.     __property OnEnter ;
  150.     __property OnExit ;
  151.     __property Classes::TNotifyEvent OnUpClick = {read=FOnUpClick, write=FOnUpClick};
  152. public:
  153.     /* !! TWinControl.Destroy */ __fastcall virtual ~TSpinButton(void) { }
  154.     
  155. };
  156.  
  157. class __declspec(delphiclass) TSpinEdit;
  158. class __declspec(pascalimplementation) TSpinEdit : public Stdctrls::TCustomEdit
  159. {
  160.     typedef TSpinEdit ThisClass;
  161.     typedef Stdctrls::TCustomEdit inherited;
  162.     
  163. private:
  164.     System::Longint FMinValue;
  165.     System::Longint FMaxValue;
  166.     Graphics::TCanvas *FCanvas;
  167.     System::Longint FIncrement;
  168.     TSpinButton *FButton;
  169.     System::Boolean FEditorEnabled;
  170.     System::Integer __fastcall GetMinHeight(void);
  171.     System::Longint __fastcall GetValue(void);
  172.     System::Longint __fastcall CheckValue(System::Longint NewValue);
  173.     void __fastcall SetValue(System::Longint NewValue);
  174.     void __fastcall SetEditRect(void);
  175.     MESSAGE void __fastcall WMSize(Messages::TWMSize &Message);
  176.     MESSAGE void __fastcall CMEnter(Messages::TWMNoParams &Message);
  177.     MESSAGE void __fastcall CMExit(Messages::TWMNoParams &Message);
  178.     MESSAGE void __fastcall WMPaste(Messages::TWMNoParams &Message);
  179.     MESSAGE void __fastcall WMCut(Messages::TWMNoParams &Message);
  180.     
  181. protected:
  182.     virtual void __fastcall GetChildren(Classes::TGetChildProc Proc);
  183.     virtual System::Boolean __fastcall IsValidChar(System::Char Key);
  184.     virtual void __fastcall UpClick(System::TObject *Sender);
  185.     virtual void __fastcall DownClick(System::TObject *Sender);
  186.     virtual void __fastcall KeyDown(System::Word &Key,  Classes::TShiftState Shift);
  187.     virtual void __fastcall KeyPress(System::Char &Key);
  188.     virtual void __fastcall CreateParams(Controls::TCreateParams &Params);
  189.     virtual void __fastcall CreateWnd(void);
  190.     
  191. public:
  192.     __fastcall virtual TSpinEdit(Classes::TComponent *AOwner);
  193.     __fastcall virtual ~TSpinEdit(void);
  194.     __property TSpinButton * Button = {read=FButton, nodefault};
  195.     
  196. __published:
  197.     __property AutoSelect ;
  198.     __property AutoSize ;
  199.     __property Color ;
  200.     __property Ctl3D ;
  201.     __property DragCursor ;
  202.     __property DragMode ;
  203.     __property System::Boolean EditorEnabled = {read=FEditorEnabled, write=FEditorEnabled, default=1};
  204.     __property Enabled ;
  205.     __property Font ;
  206.     __property System::Longint Increment = {read=FIncrement, write=FIncrement, default=1};
  207.     __property MaxLength ;
  208.     __property System::Longint MaxValue = {read=FMaxValue, write=FMaxValue, nodefault};
  209.     __property System::Longint MinValue = {read=FMinValue, write=FMinValue, nodefault};
  210.     __property ParentColor ;
  211.     __property ParentCtl3D ;
  212.     __property ParentFont ;
  213.     __property ParentShowHint ;
  214.     __property PopupMenu ;
  215.     __property ReadOnly ;
  216.     __property ShowHint ;
  217.     __property TabOrder ;
  218.     __property TabStop ;
  219.     __property System::Longint Value = {read=GetValue, write=SetValue, nodefault};
  220.     __property Visible ;
  221.     __property OnChange ;
  222.     __property OnClick ;
  223.     __property OnDblClick ;
  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. };
  236.  
  237. //-- var, const, procedure ---------------------------------------------------
  238. #define InitRepeatPause System::Smallint(400)
  239. #define RepeatPause System::Byte(100)
  240. //-- template instantiations -------------------------------------------------
  241. template class TTimeBtnState ;
  242.  
  243. }    /* namespace Spin */
  244. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  245. using namespace Spin;
  246. #endif
  247. //-- end unit ----------------------------------------------------------------
  248. #endif    // Spin
  249.