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

  1. // Borland C++ Builder
  2. // Copyright (c) 1995, 1999 by Borland International
  3. // All rights reserved
  4.  
  5. // (DO NOT EDIT: machine generated header) 'FormMagnet.pas' rev: 5.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 
  95.     &AllowGlue);
  96.  
  97. typedef void __fastcall (__closure *TOnMagnet)(System::TObject* Sender, Forms::TForm* AnotherForm, bool 
  98.     &AllowMagnet);
  99.  
  100. class DELPHICLASS TGlueList;
  101. class PASCALIMPLEMENTATION TGlueList : public Classes::TList 
  102. {
  103.     typedef Classes::TList inherited;
  104.     
  105. public:
  106.     bool __fastcall IsGluedTo(TFormMagnet* Magnet);
  107.     Windows::TPoint __fastcall GetFormPositionByMagnet(TFormMagnet* Magnet);
  108. public:
  109.     #pragma option push -w-inl
  110.     /* TList.Destroy */ inline __fastcall virtual ~TGlueList(void) { }
  111.     #pragma option pop
  112.     
  113. public:
  114.     #pragma option push -w-inl
  115.     /* TObject.Create */ inline __fastcall TGlueList(void) : Classes::TList() { }
  116.     #pragma option pop
  117.     
  118. };
  119.  
  120.  
  121. class PASCALIMPLEMENTATION TFormMagnet : public TMagnetFormHookComponent 
  122. {
  123.     typedef TMagnetFormHookComponent inherited;
  124.     
  125. private:
  126.     bool FActive;
  127.     bool FGlue;
  128.     bool FFormDragable;
  129.     TMagnetType FMagnetType;
  130.     Byte FPower;
  131.     TScreenMagnet* FScreenMagnet;
  132.     TOnGlue FOnGlue;
  133.     TOnMagnet FOnMagnet;
  134.     Classes::TNotifyEvent FOnDragMove;
  135.     bool Suspended;
  136.     TGlueList* GluedTo;
  137.     bool Moving;
  138.     Windows::TPoint BeginMovingPos;
  139.     void __fastcall SetActive(bool Value);
  140.     bool __fastcall AllowGlueTo(TFormMagnet* AnotherMagnet);
  141.     bool __fastcall AllowMagnetTo(TFormMagnet* AnotherMagnet);
  142.     void __fastcall RecalculateGluing(void);
  143.     void __fastcall MagnetByDraggingRect(Windows::TRect &DraggingRect, bool CalculateRelativePlacement, 
  144.         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.     Windows::TPoint Position;
  176.     
  177. public:
  178.     __fastcall TGluedObject(TFormMagnet* aMagnet, int aLeft, int aTop);
  179. public:
  180.     #pragma option push -w-inl
  181.     /* TObject.Destroy */ inline __fastcall virtual ~TGluedObject(void) { }
  182.     #pragma option pop
  183.     
  184. };
  185.  
  186.  
  187. //-- var, const, procedure ---------------------------------------------------
  188. extern PACKAGE void __fastcall Register(void);
  189.  
  190. }    /* namespace Formmagnet */
  191. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  192. using namespace Formmagnet;
  193. #endif
  194. #pragma option pop    // -w-
  195. #pragma option pop    // -Vx
  196.  
  197. #pragma delphiheader end.
  198. //-- end unit ----------------------------------------------------------------
  199. #endif    // FormMagnet
  200.