home *** CD-ROM | disk | FTP | other *** search
/ Chip 2001 October / Chip_2001-10_cd1.bin / zkuste / delphi / kompon / d123456 / CHEMPLOT.ZIP / Misc / Switch.hpp < prev    next >
C/C++ Source or Header  |  2000-10-11  |  5KB  |  126 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) 'Switch.pas' rev: 3.00
  6.  
  7. #ifndef SwitchHPP
  8. #define SwitchHPP
  9. #include <Graphics.hpp>
  10. #include <Controls.hpp>
  11. #include <Classes.hpp>
  12. #include <Messages.hpp>
  13. #include <Windows.hpp>
  14. #include <SysInit.hpp>
  15. #include <System.hpp>
  16.  
  17. //-- user supplied -----------------------------------------------------------
  18.  
  19. namespace Switch
  20. {
  21. //-- type declarations -------------------------------------------------------
  22. typedef tagPOINT RectArray[4];
  23.  
  24. typedef tagPOINT TriArray[3];
  25.  
  26. enum TSwitchType { stHor_Rocker, stVert_Rocker, stButton };
  27.  
  28. class DELPHICLASS TSwitch;
  29. class PASCALIMPLEMENTATION TSwitch : public Controls::TCustomControl 
  30. {
  31.     typedef Controls::TCustomControl inherited;
  32.     
  33. private:
  34.     tagPOINT TopShape[3];
  35.     tagPOINT OnShape[4];
  36.     tagPOINT OffShape[4];
  37.     tagPOINT SideShape[4];
  38.     Classes::TNotifyEvent FOnChanged;
  39.     Classes::TNotifyEvent FOnChecked;
  40.     Classes::TNotifyEvent FOnUnChecked;
  41.     System::AnsiString FCaptionOn;
  42.     System::AnsiString FCaptionOff;
  43.     bool FChecked;
  44.     bool FCheckedLeft;
  45.     Byte FSlope;
  46.     Byte FSideLength;
  47.     Graphics::TColor FOnColor;
  48.     Graphics::TColor FOffColor;
  49.     Graphics::TColor FTopColor;
  50.     Graphics::TColor FSideColor;
  51.     TSwitchType FSwitchType;
  52.     int ALeft;
  53.     int ATop;
  54.     int AHeight;
  55.     int AWidth;
  56.     int LabelLen;
  57.     int LabelOfs;
  58.     int Side;
  59.     HIDESBASE MESSAGE void __fastcall WMSetFocus(Messages::TWMSetFocus &Message);
  60.     HIDESBASE MESSAGE void __fastcall WMKillFocus(Messages::TWMKillFocus &Message);
  61.     void __fastcall CallNotifyEvent(void);
  62.     void __fastcall Setup(void);
  63.     void __fastcall SetupVert(void);
  64.     void __fastcall Draw_Hor_Rocker(void);
  65.     void __fastcall Draw_Vert_Rocker(void);
  66.     void __fastcall Draw_Button(void);
  67.     void __fastcall SetCaptionOn(System::AnsiString Value);
  68.     void __fastcall SetCaptionOff(System::AnsiString Value);
  69.     void __fastcall SetChecked(bool Value);
  70.     void __fastcall SetCheckedLeft(bool Value);
  71.     void __fastcall SetSlope(Byte Value);
  72.     void __fastcall SetSideLength(Byte Value);
  73.     void __fastcall SetOnColor(Graphics::TColor Value);
  74.     void __fastcall SetOffColor(Graphics::TColor Value);
  75.     void __fastcall SetTopColor(Graphics::TColor Value);
  76.     void __fastcall SetSideColor(Graphics::TColor Value);
  77.     void __fastcall SetSwitchType(TSwitchType Value);
  78.     
  79. public:
  80.     __fastcall virtual TSwitch(Classes::TComponent* AOwner);
  81.     virtual void __fastcall Paint(void);
  82.     DYNAMIC void __fastcall MouseDown(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, 
  83.         int Y);
  84.     DYNAMIC void __fastcall KeyDown(Word &Key, Classes::TShiftState Shift);
  85.     
  86. __published:
  87.     __property System::AnsiString CaptionOn = {read=FCaptionOn, write=SetCaptionOn};
  88.     __property System::AnsiString CaptionOff = {read=FCaptionOff, write=SetCaptionOff};
  89.     __property bool Checked = {read=FChecked, write=SetChecked, default=0};
  90.     __property bool CheckedLeft = {read=FCheckedLeft, write=SetCheckedLeft, default=1};
  91.     __property Byte Slope = {read=FSlope, write=SetSlope, default=6};
  92.     __property Byte SideLength = {read=FSideLength, write=SetSideLength, default=6};
  93.     __property Graphics::TColor OnColor = {read=FOnColor, write=SetOnColor, default=255};
  94.     __property Graphics::TColor OffColor = {read=FOffColor, write=SetOffColor, default=128};
  95.     __property Graphics::TColor TopColor = {read=FTopColor, write=SetTopColor, default=12632256};
  96.     __property Graphics::TColor SideColor = {read=FSideColor, write=SetSideColor, default=12632256};
  97.     __property TSwitchType SwitchType = {read=FSwitchType, write=SetSwitchType, nodefault};
  98.     __property Font ;
  99.     __property TabStop ;
  100.     __property TabOrder ;
  101.     __property ShowHint ;
  102.     __property Visible ;
  103.     __property OnClick ;
  104.     __property OnMouseDown ;
  105.     __property Classes::TNotifyEvent OnChanged = {read=FOnChanged, write=FOnChanged};
  106.     __property Classes::TNotifyEvent OnChecked = {read=FOnChecked, write=FOnChecked};
  107.     __property Classes::TNotifyEvent OnUnChecked = {read=FOnUnChecked, write=FOnUnChecked};
  108. public:
  109.     /* TCustomControl.Destroy */ __fastcall virtual ~TSwitch(void) { }
  110.     
  111. public:
  112.     /* TWinControl.CreateParented */ __fastcall TSwitch(HWND ParentWindow) : Controls::TCustomControl(ParentWindow
  113.         ) { }
  114.     
  115. };
  116.  
  117. //-- var, const, procedure ---------------------------------------------------
  118. extern PACKAGE void __fastcall Register(void);
  119.  
  120. }    /* namespace Switch */
  121. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  122. using namespace Switch;
  123. #endif
  124. //-- end unit ----------------------------------------------------------------
  125. #endif    // Switch
  126.