fctreeheader.hpp
上传用户:hylc_2004
上传日期:2014-01-23
资源大小:46800k
文件大小:13k
源码类别:

Delphi控件源码

开发平台:

Delphi

  1. // Borland C++ Builder
  2. // Copyright (c) 1995, 2002 by Borland Software Corporation
  3. // All rights reserved
  4. // (DO NOT EDIT: machine generated header) 'fcTreeHeader.pas' rev: 6.00
  5. #ifndef fcTreeHeaderHPP
  6. #define fcTreeHeaderHPP
  7. #pragma delphiheader begin
  8. #pragma option push -w-
  9. #pragma option push -Vx
  10. #include <Menus.hpp> // Pascal unit
  11. #include <ExtCtrls.hpp> // Pascal unit
  12. #include <DB.hpp> // Pascal unit
  13. #include <ComCtrls.hpp> // Pascal unit
  14. #include <Dialogs.hpp> // Pascal unit
  15. #include <Forms.hpp> // Pascal unit
  16. #include <Controls.hpp> // Pascal unit
  17. #include <Graphics.hpp> // Pascal unit
  18. #include <Classes.hpp> // Pascal unit
  19. #include <SysUtils.hpp> // Pascal unit
  20. #include <Messages.hpp> // Pascal unit
  21. #include <Windows.hpp> // Pascal unit
  22. #include <SysInit.hpp> // Pascal unit
  23. #include <System.hpp> // Pascal unit
  24. //-- user supplied -----------------------------------------------------------
  25. namespace Fctreeheader
  26. {
  27. //-- type declarations -------------------------------------------------------
  28. #pragma option push -b-
  29. enum TfcTreeHeaderOption { thcoAllowColumnMove, thcoSortTreeOnClick, thcoRightBorder };
  30. #pragma option pop
  31. typedef Set<TfcTreeHeaderOption, thcoAllowColumnMove, thcoRightBorder>  TfcTreeHeaderOptions;
  32. class DELPHICLASS TfcTreeHeaderSection;
  33. class PASCALIMPLEMENTATION TfcTreeHeaderSection : public Classes::TCollectionItem 
  34. {
  35. typedef Classes::TCollectionItem inherited;
  36. private:
  37. AnsiString FFieldName;
  38. int FImageIndex;
  39. Classes::TAlignment FImageAlignment;
  40. AnsiString FText;
  41. int FWidth;
  42. int FMinWidth;
  43. int FMaxWidth;
  44. Classes::TAlignment FAlignment;
  45. Comctrls::THeaderSectionStyle FStyle;
  46. bool FAllowClick;
  47. int __fastcall GetLeft(void);
  48. int __fastcall GetRight(void);
  49. void __fastcall SetAlignment(Classes::TAlignment Value);
  50. void __fastcall SetMaxWidth(int Value);
  51. void __fastcall SetMinWidth(int Value);
  52. void __fastcall SetStyle(Comctrls::THeaderSectionStyle Value);
  53. void __fastcall SetText(const AnsiString Value);
  54. void __fastcall SetWidth(int Value);
  55. void __fastcall SetImageIndex(int Value);
  56. void __fastcall SetImageAlignment(Classes::TAlignment Value);
  57. protected:
  58. virtual AnsiString __fastcall GetDisplayName();
  59. public:
  60. __fastcall virtual TfcTreeHeaderSection(Classes::TCollection* Collection);
  61. virtual void __fastcall Assign(Classes::TPersistent* Source);
  62. __property int Left = {read=GetLeft, nodefault};
  63. __property int Right = {read=GetRight, nodefault};
  64. bool __fastcall PtInSection(const Types::TPoint &pt);
  65. __published:
  66. __property Classes::TAlignment Alignment = {read=FAlignment, write=SetAlignment, default=0};
  67. __property bool AllowClick = {read=FAllowClick, write=FAllowClick, default=1};
  68. __property int MaxWidth = {read=FMaxWidth, write=SetMaxWidth, default=10000};
  69. __property int MinWidth = {read=FMinWidth, write=SetMinWidth, default=0};
  70. __property Comctrls::THeaderSectionStyle Style = {read=FStyle, write=SetStyle, default=0};
  71. __property AnsiString Text = {read=FText, write=SetText};
  72. __property int Width = {read=FWidth, write=SetWidth, nodefault};
  73. __property AnsiString FieldName = {read=FFieldName, write=FFieldName};
  74. __property int ImageIndex = {read=FImageIndex, write=SetImageIndex, nodefault};
  75. __property Classes::TAlignment ImageAlignment = {read=FImageAlignment, write=SetImageAlignment, default=0};
  76. public:
  77. #pragma option push -w-inl
  78. /* TCollectionItem.Destroy */ inline __fastcall virtual ~TfcTreeHeaderSection(void) { }
  79. #pragma option pop
  80. };
  81. class DELPHICLASS TfcTreeHeaderSections;
  82. class DELPHICLASS TfcTreeHeaderControl;
  83. class DELPHICLASS TfcTreeHeader;
  84. typedef void __fastcall (__closure *TfcHeaderDrawSectionEvent)(TfcTreeHeader* HeaderControl, TfcTreeHeaderSection* Section, const Types::TRect &Rect, bool Pressed);
  85. typedef void __fastcall (__closure *TfcHeaderSectionMoveEvent)(TfcTreeHeader* HeaderControl, TfcTreeHeaderSection* Section, int DragFrom, int DragTo, bool &AllowMove);
  86. typedef void __fastcall (__closure *TfcHeaderSectionNotifyEvent)(TfcTreeHeader* HeaderControl, TfcTreeHeaderSection* Section);
  87. typedef void __fastcall (__closure *TfcHeaderSectionTrackEvent)(TfcTreeHeader* HeaderControl, TfcTreeHeaderSection* Section, int Width, Comctrls::TSectionTrackState State);
  88. typedef void __fastcall (__closure *TfcSectionDragEvent)(System::TObject* Sender, TfcTreeHeaderSection* FromSection, TfcTreeHeaderSection* ToSection);
  89. class PASCALIMPLEMENTATION TfcTreeHeader : public Extctrls::TCustomPanel 
  90. {
  91. typedef Extctrls::TCustomPanel inherited;
  92. private:
  93. TfcHeaderDrawSectionEvent FOnDrawSection;
  94. Classes::TNotifyEvent FOnResize;
  95. TfcHeaderSectionMoveEvent FOnSectionMove;
  96. TfcHeaderSectionNotifyEvent FOnSectionClick;
  97. TfcHeaderSectionNotifyEvent FOnSectionResize;
  98. TfcHeaderSectionTrackEvent FOnSectionTrack;
  99. TfcSectionDragEvent FOnSectionDrag;
  100. bool FDisableThemes;
  101. HIDESBASE MESSAGE void __fastcall WMSize(Messages::TWMSize &Message);
  102. HIDESBASE MESSAGE void __fastcall WMEraseBkgnd(Messages::TWMEraseBkgnd &Message);
  103. void __fastcall SetSections(TfcTreeHeaderSections* Value);
  104. TfcTreeHeaderSections* __fastcall GetSections(void);
  105. bool __fastcall GetHotTrack(void);
  106. void __fastcall SetHotTrack(bool Value);
  107. Controls::TImageList* __fastcall GetImageList(void);
  108. void __fastcall SetImageList(Controls::TImageList* Value);
  109. void __fastcall SetOptions(TfcTreeHeaderOptions val);
  110. TfcTreeHeaderOptions __fastcall GetOptions(void);
  111. Graphics::TCanvas* __fastcall GetCanvas(void);
  112. Controls::TWinControl* __fastcall GetTree(void);
  113. Controls::TMouseEvent __fastcall GetMouseDown();
  114. void __fastcall SetMouseDown(Controls::TMouseEvent Value);
  115. Controls::TMouseEvent __fastcall GetMouseUp();
  116. void __fastcall SetMouseUp(Controls::TMouseEvent Value);
  117. Controls::TMouseMoveEvent __fastcall GetMouseMove();
  118. void __fastcall SetMouseMove(Controls::TMouseMoveEvent Value);
  119. protected:
  120. DYNAMIC void __fastcall DrawSection(TfcTreeHeaderSection* Section, const Types::TRect &Rect, bool Pressed);
  121. DYNAMIC void __fastcall SectionMove(TfcTreeHeaderSection* Section, int DragFrom, int DragTo, bool &AllowMove);
  122. DYNAMIC void __fastcall SectionClick(TfcTreeHeaderSection* Section);
  123. DYNAMIC void __fastcall SectionResize(TfcTreeHeaderSection* Section);
  124. DYNAMIC void __fastcall SectionTrack(TfcTreeHeaderSection* Section, int Width, Comctrls::TSectionTrackState State);
  125. DYNAMIC void __fastcall SectionDrag(TfcTreeHeaderSection* FromSection, TfcTreeHeaderSection* ToSection);
  126. public:
  127. TfcTreeHeaderControl* HeaderControl;
  128. __fastcall virtual TfcTreeHeader(Classes::TComponent* AOwner);
  129. __fastcall virtual ~TfcTreeHeader(void);
  130. virtual void __fastcall CreateWnd(void);
  131. __property Graphics::TCanvas* Canvas = {read=GetCanvas};
  132. __property Controls::TWinControl* Tree = {read=GetTree};
  133. __published:
  134. __property DragCursor  = {default=-12};
  135. __property DragMode  = {default=0};
  136. __property Enabled  = {default=1};
  137. __property Font ;
  138. __property bool HotTrack = {read=GetHotTrack, write=SetHotTrack, default=0};
  139. __property TfcTreeHeaderSections* Sections = {read=GetSections, write=SetSections};
  140. __property ShowHint ;
  141. __property ParentFont  = {default=1};
  142. __property ParentShowHint  = {default=1};
  143. __property PopupMenu ;
  144. __property Visible  = {default=1};
  145. __property Controls::TImageList* Images = {read=GetImageList, write=SetImageList};
  146. __property TfcSectionDragEvent OnSectionDrag = {read=FOnSectionDrag, write=FOnSectionDrag};
  147. __property OnDragDrop ;
  148. __property OnDragOver ;
  149. __property OnEndDrag ;
  150. __property Controls::TMouseEvent OnMouseDown = {read=GetMouseDown, write=SetMouseDown};
  151. __property Controls::TMouseMoveEvent OnMouseMove = {read=GetMouseMove, write=SetMouseMove};
  152. __property Controls::TMouseEvent OnMouseUp = {read=GetMouseUp, write=SetMouseUp};
  153. __property TfcHeaderDrawSectionEvent OnDrawSection = {read=FOnDrawSection, write=FOnDrawSection};
  154. __property Classes::TNotifyEvent OnResize = {read=FOnResize, write=FOnResize};
  155. __property TfcHeaderSectionMoveEvent OnSectionMove = {read=FOnSectionMove, write=FOnSectionMove};
  156. __property TfcHeaderSectionNotifyEvent OnSectionClick = {read=FOnSectionClick, write=FOnSectionClick};
  157. __property TfcHeaderSectionNotifyEvent OnSectionResize = {read=FOnSectionResize, write=FOnSectionResize};
  158. __property TfcHeaderSectionTrackEvent OnSectionTrack = {read=FOnSectionTrack, write=FOnSectionTrack};
  159. __property OnStartDrag ;
  160. __property TfcTreeHeaderOptions Options = {read=GetOptions, write=SetOptions, default=7};
  161. __property bool DisableThemes = {read=FDisableThemes, write=FDisableThemes, default=0};
  162. public:
  163. #pragma option push -w-inl
  164. /* TWinControl.CreateParented */ inline __fastcall TfcTreeHeader(HWND ParentWindow) : Extctrls::TCustomPanel(ParentWindow) { }
  165. #pragma option pop
  166. };
  167. class PASCALIMPLEMENTATION TfcTreeHeaderControl : public Controls::TWinControl 
  168. {
  169. typedef Controls::TWinControl inherited;
  170. private:
  171. TfcTreeHeaderSections* FSections;
  172. bool FSectionDragged;
  173. Graphics::TCanvas* FCanvas;
  174. bool FHotTrack;
  175. Controls::TImageList* FImageList;
  176. TfcTreeHeaderOptions FOptions;
  177. Controls::TWinControl* FTree;
  178. TfcTreeHeader* FHeader;
  179. bool __fastcall DoSectionDrag(TfcTreeHeaderSection* FromSection, TfcTreeHeaderSection* ToSection);
  180. void __fastcall SetHotTrack(bool Value);
  181. void __fastcall SetSections(TfcTreeHeaderSections* Value);
  182. void __fastcall UpdateItem(int Message, int Index);
  183. void __fastcall UpdateSection(int Index);
  184. void __fastcall UpdateSections(void);
  185. void __fastcall SetOptions(TfcTreeHeaderOptions val);
  186. void __fastcall SetImageList(Controls::TImageList* val);
  187. MESSAGE void __fastcall CNDrawItem(Messages::TWMDrawItem &Message);
  188. MESSAGE void __fastcall CNNotify(Messages::TWMNotify &Message);
  189. HIDESBASE MESSAGE void __fastcall WMLButtonDown(Messages::TWMMouse &Message);
  190. HIDESBASE MESSAGE void __fastcall WMWindowPosChanged(Messages::TWMWindowPosMsg &Message);
  191. HIDESBASE MESSAGE void __fastcall WMPaint(Messages::TWMPaint &Message);
  192. HIDESBASE MESSAGE void __fastcall CMMouseEnter(Messages::TMessage &Message);
  193. HIDESBASE MESSAGE void __fastcall CMMouseLeave(Messages::TMessage &Message);
  194. protected:
  195. virtual void __fastcall RearrangeTreeColumns(void);
  196. virtual void __fastcall CreateParams(Controls::TCreateParams &Params);
  197. virtual void __fastcall CreateWnd(void);
  198. virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation);
  199. virtual void __fastcall WndProc(Messages::TMessage &Message);
  200. public:
  201. Forms::TCustomForm* DesignerForm;
  202. int HotTrackSection;
  203. __fastcall virtual TfcTreeHeaderControl(Classes::TComponent* AOwner);
  204. __fastcall virtual ~TfcTreeHeaderControl(void);
  205. __property Graphics::TCanvas* Canvas = {read=FCanvas};
  206. __property Controls::TWinControl* Tree = {read=FTree, write=FTree};
  207. __property TfcTreeHeader* Header = {read=FHeader, write=FHeader};
  208. __property bool HotTrack = {read=FHotTrack, write=SetHotTrack, default=0};
  209. __property Controls::TImageList* Images = {read=FImageList, write=SetImageList};
  210. __property TfcTreeHeaderOptions Options = {read=FOptions, write=SetOptions, default=7};
  211. __property TfcTreeHeaderSections* Sections = {read=FSections, write=SetSections};
  212. public:
  213. #pragma option push -w-inl
  214. /* TWinControl.CreateParented */ inline __fastcall TfcTreeHeaderControl(HWND ParentWindow) : Controls::TWinControl(ParentWindow) { }
  215. #pragma option pop
  216. };
  217. class PASCALIMPLEMENTATION TfcTreeHeaderSections : public Classes::TCollection 
  218. {
  219. typedef Classes::TCollection inherited;
  220. public:
  221. TfcTreeHeaderSection* operator[](int Index) { return Items[Index]; }
  222. private:
  223. HIDESBASE TfcTreeHeaderSection* __fastcall GetItem(int Index);
  224. HIDESBASE void __fastcall SetItem(int Index, TfcTreeHeaderSection* Value);
  225. protected:
  226. DYNAMIC Classes::TPersistent* __fastcall GetOwner(void);
  227. virtual void __fastcall Update(Classes::TCollectionItem* Item);
  228. public:
  229. TfcTreeHeaderControl* HeaderControl;
  230. __fastcall TfcTreeHeaderSections(TfcTreeHeaderControl* HeaderControl);
  231. HIDESBASE TfcTreeHeaderSection* __fastcall Add(void);
  232. __property TfcTreeHeaderSection* Items[int Index] = {read=GetItem, write=SetItem/*, default*/};
  233. public:
  234. #pragma option push -w-inl
  235. /* TCollection.Destroy */ inline __fastcall virtual ~TfcTreeHeaderSections(void) { }
  236. #pragma option pop
  237. };
  238. typedef void __fastcall (__closure *TfcHeaderSectionDefaultEvent)(TfcTreeHeader* HeaderControl, TfcTreeHeaderSection* Section, bool &doDefault);
  239. //-- var, const, procedure ---------------------------------------------------
  240. #pragma error Unsupported symbol type (23, fcTreeHeader)
  241. } /* namespace Fctreeheader */
  242. using namespace Fctreeheader;
  243. #pragma option pop // -w-
  244. #pragma option pop // -Vx
  245. #pragma delphiheader end.
  246. //-- end unit ----------------------------------------------------------------
  247. #endif // fcTreeHeader