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