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

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