home *** CD-ROM | disk | FTP | other *** search
/ Chip 2002 December / Chip_2002-12_cd1.bin / zkuste / delphi / kompon / d234567 / MAGNET.ZIP / BCB1 / FormMagnet.hpp < prev    next >
Encoding:
C/C++ Source or Header  |  2002-09-23  |  5.7 KB  |  170 lines

  1. //----------------------------------------------------------------------------
  2. // FormMagnet.hpp - bcbdcc32 generated hdr (DO NOT EDIT) rev: 0
  3. // From: FormMagnet.pas
  4. //----------------------------------------------------------------------------
  5. #ifndef FormMagnetHPP
  6. #define FormMagnetHPP
  7. //----------------------------------------------------------------------------
  8. #include <Forms.hpp>
  9. #include <Classes.hpp>
  10. #include <Messages.hpp>
  11. #include <Windows.hpp>
  12. #include <System.hpp>
  13. namespace Formmagnet
  14. {
  15. //-- type declarations -------------------------------------------------------
  16. class __declspec(delphiclass) TMagnetFormHookComponent;
  17. class __declspec(pascalimplementation) TMagnetFormHookComponent : public Classes::TComponent
  18. {
  19.     typedef Classes::TComponent inherited;
  20.     
  21. private:
  22.     bool Hooked;
  23.     Forms::TForm* FParentForm;
  24.     int FParentHandle;
  25.     void *FOldWndProc;
  26.     void *FNewWndProc;
  27.     void __fastcall HookWndProc(Messages::TMessage &Message);
  28.     
  29. protected:
  30.     virtual void __fastcall MessageBefore(Messages::TMessage &Message, bool &Handled);
  31.     virtual void __fastcall MessageAfter(Messages::TMessage &Message);
  32.     virtual void __fastcall FormRecreate(void);
  33.     virtual int __fastcall GetParentHandle(void);
  34.     
  35. public:
  36.     __fastcall virtual TMagnetFormHookComponent(Classes::TComponent* aOwner);
  37.     __fastcall virtual ~TMagnetFormHookComponent(void);
  38.     __property Forms::TForm* ParentForm = {read=FParentForm, nodefault};
  39.     __property int ParentHandle = {read=FParentHandle, nodefault};
  40.     __property void * OldWndProc = {read=FOldWndProc, nodefault};
  41. };
  42.  
  43. enum TScreenArea { saFullScreen, saWorkArea };
  44.  
  45. class __declspec(delphiclass) TScreenMagnet;
  46. class __declspec(pascalimplementation) TScreenMagnet : public Classes::TPersistent
  47. {
  48.     typedef Classes::TPersistent inherited;
  49.     
  50. private:
  51.     TScreenArea FArea;
  52.     Byte FDesktopPower;
  53.     bool FTop;
  54.     bool FBottom;
  55.     bool FLeft;
  56.     bool FRight;
  57.     
  58. public:
  59.     __fastcall TScreenMagnet(void);
  60.     
  61. __published:
  62.     __property TScreenArea Area = {read=FArea, write=FArea, nodefault};
  63.     __property Byte DesktopPower = {read=FDesktopPower, write=FDesktopPower, nodefault};
  64.     __property bool Top = {read=FTop, write=FTop, nodefault};
  65.     __property bool Bottom = {read=FBottom, write=FBottom, nodefault};
  66.     __property bool Left = {read=FLeft, write=FLeft, nodefault};
  67.     __property bool Right = {read=FRight, write=FRight, nodefault};
  68. public:
  69.     /* TObject.Destroy */ __fastcall virtual ~TScreenMagnet(void) { }
  70.     
  71. };
  72.  
  73. class __declspec(delphiclass) TGluedObject;
  74. class __declspec(delphiclass) TFormMagnet;
  75. enum TMagnetType { mkOnMoving, mkAfterMoving };
  76.  
  77. typedef void __fastcall (__closure *TOnGlue)(System::TObject* Sender, Forms::TForm* AnotherForm, bool 
  78.     &AllowGlue);
  79.  
  80. typedef void __fastcall (__closure *TOnMagnet)(System::TObject* Sender, Forms::TForm* AnotherForm, bool 
  81.     &AllowMagnet);
  82.  
  83. class __declspec(delphiclass) TGlueList;
  84. class __declspec(pascalimplementation) TGlueList : public Classes::TList
  85. {
  86.     typedef Classes::TList inherited;
  87.     
  88. public:
  89.     bool __fastcall IsGluedTo(TFormMagnet* Magnet);
  90.     tagPOINT __fastcall GetFormPositionByMagnet(TFormMagnet* Magnet);
  91. public:
  92.     /* TList.Destroy */ __fastcall virtual ~TGlueList(void) { }
  93.     
  94. public:
  95.     /* TObject.Create */ __fastcall TGlueList(void) : Classes::TList() { }
  96.     
  97. };
  98.  
  99. class __declspec(pascalimplementation) TFormMagnet : public TMagnetFormHookComponent
  100. {
  101.     typedef TMagnetFormHookComponent inherited;
  102.     
  103. private:
  104.     bool FActive;
  105.     bool FGlue;
  106.     bool FFormDragable;
  107.     TMagnetType FMagnetType;
  108.     Byte FPower;
  109.     TScreenMagnet* FScreenMagnet;
  110.     TOnGlue FOnGlue;
  111.     TOnMagnet FOnMagnet;
  112.     Classes::TNotifyEvent FOnDragMove;
  113.     bool Suspended;
  114.     TGlueList* GluedTo;
  115.     bool Moving;
  116.     tagPOINT BeginMovingPos;
  117.     void __fastcall SetActive(bool Value);
  118.     bool __fastcall AllowGlueTo(TFormMagnet* AnotherMagnet);
  119.     bool __fastcall AllowMagnetTo(TFormMagnet* AnotherMagnet);
  120.     void __fastcall RecalculateGluing(void);
  121.     void __fastcall MagnetByDraggingRect(Windows::TRect &DraggingRect, bool CalculateRelativePlacement, 
  122.         bool GlueOnly);
  123.     
  124. protected:
  125.     virtual void __fastcall MessageBefore(Messages::TMessage &Message, bool &Handled);
  126.     virtual void __fastcall MessageAfter(Messages::TMessage &Message);
  127.     virtual void __fastcall Loaded(void);
  128.     
  129. public:
  130.     __fastcall virtual TFormMagnet(Classes::TComponent* aOwner);
  131.     __fastcall virtual ~TFormMagnet(void);
  132.     void __fastcall DoMagnet(void);
  133.     
  134. __published:
  135.     __property bool Active = {read=FActive, write=SetActive, nodefault};
  136.     __property bool Glue = {read=FGlue, write=FGlue, nodefault};
  137.     __property bool FormDragable = {read=FFormDragable, write=FFormDragable, nodefault};
  138.     __property TMagnetType MagnetType = {read=FMagnetType, write=FMagnetType, nodefault};
  139.     __property Byte Power = {read=FPower, write=FPower, nodefault};
  140.     __property TScreenMagnet* ScreenMagnet = {read=FScreenMagnet, write=FScreenMagnet, nodefault};
  141.     __property TOnGlue OnGlue = {read=FOnGlue, write=FOnGlue};
  142.     __property TOnMagnet OnMagnet = {read=FOnMagnet, write=FOnMagnet};
  143.     __property Classes::TNotifyEvent OnDragMove = {read=FOnDragMove, write=FOnDragMove};
  144. };
  145.  
  146. class __declspec(pascalimplementation) TGluedObject : public System::TObject
  147. {
  148.     typedef System::TObject inherited;
  149.     
  150. private:
  151.     TFormMagnet* Magnet;
  152.     tagPOINT Position;
  153.     
  154. public:
  155.     __fastcall TGluedObject(TFormMagnet* aMagnet, int aLeft, int aTop);
  156. public:
  157.     /* TObject.Destroy */ __fastcall virtual ~TGluedObject(void) { }
  158.     
  159. };
  160.  
  161. //-- var, const, procedure ---------------------------------------------------
  162. extern void __fastcall Register(void);
  163.  
  164. }    /* namespace Formmagnet */
  165. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  166. using namespace Formmagnet;
  167. #endif
  168. //-- end unit ----------------------------------------------------------------
  169. #endif    // FormMagnet
  170.