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

Delphi控件源码

开发平台:

Delphi

  1. // Borland C++ Builder
  2. // Copyright (c) 1995, 1999 by Borland International
  3. // All rights reserved
  4. // (DO NOT EDIT: machine generated header) 'fcTreeHeader.pas' rev: 5.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(void);
  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 Windows::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. };
  77. public:
  78. #pragma option push -w-inl
  79. /* TCollectionItem.Destroy */ inline __fastcall virtual ~TfcTreeHeaderSection(void) { }
  80. #pragma option pop
  81. };
  82. class DELPHICLASS TfcTreeHeaderSections;
  83. class DELPHICLASS TfcTreeHeaderControl;
  84. class DELPHICLASS TfcTreeHeader;
  85. typedef void __fastcall (__closure *TfcHeaderDrawSectionEvent)(TfcTreeHeader* HeaderControl, TfcTreeHeaderSection* 
  86. Section, const Windows::TRect &Rect, bool Pressed);
  87. typedef void __fastcall (__closure *TfcHeaderSectionMoveEvent)(TfcTreeHeader* HeaderControl, TfcTreeHeaderSection* 
  88. Section, int DragFrom, int DragTo, bool &AllowMove);
  89. typedef void __fastcall (__closure *TfcHeaderSectionNotifyEvent)(TfcTreeHeader* HeaderControl, TfcTreeHeaderSection* 
  90. Section);
  91. typedef void __fastcall (__closure *TfcHeaderSectionTrackEvent)(TfcTreeHeader* HeaderControl, TfcTreeHeaderSection* 
  92. Section, int Width, Comctrls::TSectionTrackState State);
  93. typedef void __fastcall (__closure *TfcSectionDragEvent)(System::TObject* Sender, TfcTreeHeaderSection* 
  94. FromSection, TfcTreeHeaderSection* ToSection);
  95. class PASCALIMPLEMENTATION TfcTreeHeader : public Extctrls::TCustomPanel 
  96. {
  97. typedef Extctrls::TCustomPanel inherited;
  98. private:
  99. TfcHeaderDrawSectionEvent FOnDrawSection;
  100. Classes::TNotifyEvent FOnResize;
  101. TfcHeaderSectionMoveEvent FOnSectionMove;
  102. TfcHeaderSectionNotifyEvent FOnSectionClick;
  103. TfcHeaderSectionNotifyEvent FOnSectionResize;
  104. TfcHeaderSectionTrackEvent FOnSectionTrack;
  105. TfcSectionDragEvent FOnSectionDrag;
  106. bool FDisableThemes;
  107. HIDESBASE MESSAGE void __fastcall WMSize(Messages::TWMSize &Message);
  108. HIDESBASE MESSAGE void __fastcall WMEraseBkgnd(Messages::TWMEraseBkgnd &Message);
  109. void __fastcall SetSections(TfcTreeHeaderSections* Value);
  110. TfcTreeHeaderSections* __fastcall GetSections(void);
  111. bool __fastcall GetHotTrack(void);
  112. void __fastcall SetHotTrack(bool Value);
  113. Controls::TImageList* __fastcall GetImageList(void);
  114. void __fastcall SetImageList(Controls::TImageList* Value);
  115. void __fastcall SetOptions(TfcTreeHeaderOptions val);
  116. TfcTreeHeaderOptions __fastcall GetOptions(void);
  117. Graphics::TCanvas* __fastcall GetCanvas(void);
  118. Controls::TWinControl* __fastcall GetTree(void);
  119. Controls::TMouseEvent __fastcall GetMouseDown(void);
  120. void __fastcall SetMouseDown(Controls::TMouseEvent Value);
  121. Controls::TMouseEvent __fastcall GetMouseUp(void);
  122. void __fastcall SetMouseUp(Controls::TMouseEvent Value);
  123. Controls::TMouseMoveEvent __fastcall GetMouseMove(void);
  124. void __fastcall SetMouseMove(Controls::TMouseMoveEvent Value);
  125. protected:
  126. DYNAMIC void __fastcall DrawSection(TfcTreeHeaderSection* Section, const Windows::TRect &Rect, bool 
  127. Pressed);
  128. DYNAMIC void __fastcall SectionMove(TfcTreeHeaderSection* Section, int DragFrom, int DragTo, bool &
  129. AllowMove);
  130. DYNAMIC void __fastcall SectionClick(TfcTreeHeaderSection* Section);
  131. DYNAMIC void __fastcall SectionResize(TfcTreeHeaderSection* Section);
  132. DYNAMIC void __fastcall SectionTrack(TfcTreeHeaderSection* Section, int Width, Comctrls::TSectionTrackState 
  133. State);
  134. DYNAMIC void __fastcall SectionDrag(TfcTreeHeaderSection* FromSection, TfcTreeHeaderSection* ToSection
  135. );
  136. public:
  137. TfcTreeHeaderControl* HeaderControl;
  138. __fastcall virtual TfcTreeHeader(Classes::TComponent* AOwner);
  139. __fastcall virtual ~TfcTreeHeader(void);
  140. virtual void __fastcall CreateWnd(void);
  141. __property Graphics::TCanvas* Canvas = {read=GetCanvas};
  142. __property Controls::TWinControl* Tree = {read=GetTree};
  143. __published:
  144. __property DragCursor ;
  145. __property DragMode ;
  146. __property Enabled ;
  147. __property Font ;
  148. __property bool HotTrack = {read=GetHotTrack, write=SetHotTrack, default=0};
  149. __property TfcTreeHeaderSections* Sections = {read=GetSections, write=SetSections};
  150. __property ShowHint ;
  151. __property ParentFont ;
  152. __property ParentShowHint ;
  153. __property PopupMenu ;
  154. __property Visible ;
  155. __property Controls::TImageList* Images = {read=GetImageList, write=SetImageList};
  156. __property TfcSectionDragEvent OnSectionDrag = {read=FOnSectionDrag, write=FOnSectionDrag};
  157. __property OnDragDrop ;
  158. __property OnDragOver ;
  159. __property OnEndDrag ;
  160. __property Controls::TMouseEvent OnMouseDown = {read=GetMouseDown, write=SetMouseDown};
  161. __property Controls::TMouseMoveEvent OnMouseMove = {read=GetMouseMove, write=SetMouseMove};
  162. __property Controls::TMouseEvent OnMouseUp = {read=GetMouseUp, write=SetMouseUp};
  163. __property TfcHeaderDrawSectionEvent OnDrawSection = {read=FOnDrawSection, write=FOnDrawSection};
  164. __property Classes::TNotifyEvent OnResize = {read=FOnResize, write=FOnResize};
  165. __property TfcHeaderSectionMoveEvent OnSectionMove = {read=FOnSectionMove, write=FOnSectionMove};
  166. __property TfcHeaderSectionNotifyEvent OnSectionClick = {read=FOnSectionClick, write=FOnSectionClick
  167. };
  168. __property TfcHeaderSectionNotifyEvent OnSectionResize = {read=FOnSectionResize, write=FOnSectionResize
  169. };
  170. __property TfcHeaderSectionTrackEvent OnSectionTrack = {read=FOnSectionTrack, write=FOnSectionTrack
  171. };
  172. __property OnStartDrag ;
  173. __property TfcTreeHeaderOptions Options = {read=GetOptions, write=SetOptions, default=7};
  174. __property bool DisableThemes = {read=FDisableThemes, write=FDisableThemes, default=0};
  175. public:
  176. #pragma option push -w-inl
  177. /* TWinControl.CreateParented */ inline __fastcall TfcTreeHeader(HWND ParentWindow) : Extctrls::TCustomPanel(
  178. ParentWindow) { }
  179. #pragma option pop
  180. };
  181. class PASCALIMPLEMENTATION TfcTreeHeaderControl : public Controls::TWinControl 
  182. {
  183. typedef Controls::TWinControl inherited;
  184. private:
  185. TfcTreeHeaderSections* FSections;
  186. bool FSectionDragged;
  187. Graphics::TCanvas* FCanvas;
  188. bool FHotTrack;
  189. Controls::TImageList* FImageList;
  190. TfcTreeHeaderOptions FOptions;
  191. Controls::TWinControl* FTree;
  192. TfcTreeHeader* FHeader;
  193. bool __fastcall DoSectionDrag(TfcTreeHeaderSection* FromSection, TfcTreeHeaderSection* ToSection);
  194. void __fastcall SetHotTrack(bool Value);
  195. void __fastcall SetSections(TfcTreeHeaderSections* Value);
  196. void __fastcall UpdateItem(int Message, int Index);
  197. void __fastcall UpdateSection(int Index);
  198. void __fastcall UpdateSections(void);
  199. void __fastcall SetOptions(TfcTreeHeaderOptions val);
  200. void __fastcall SetImageList(Controls::TImageList* val);
  201. MESSAGE void __fastcall CNDrawItem(Messages::TWMDrawItem &Message);
  202. MESSAGE void __fastcall CNNotify(Messages::TWMNotify &Message);
  203. HIDESBASE MESSAGE void __fastcall WMLButtonDown(Messages::TWMMouse &Message);
  204. HIDESBASE MESSAGE void __fastcall WMWindowPosChanged(Messages::TWMWindowPosMsg &Message);
  205. HIDESBASE MESSAGE void __fastcall WMPaint(Messages::TWMPaint &Message);
  206. HIDESBASE MESSAGE void __fastcall CMMouseEnter(Messages::TMessage &Message);
  207. HIDESBASE MESSAGE void __fastcall CMMouseLeave(Messages::TMessage &Message);
  208. protected:
  209. virtual void __fastcall RearrangeTreeColumns(void);
  210. virtual void __fastcall CreateParams(Controls::TCreateParams &Params);
  211. virtual void __fastcall CreateWnd(void);
  212. virtual void __fastcall Notification(Classes::TComponent* AComponent, Classes::TOperation Operation
  213. );
  214. virtual void __fastcall WndProc(Messages::TMessage &Message);
  215. public:
  216. Forms::TCustomForm* DesignerForm;
  217. int HotTrackSection;
  218. __fastcall virtual TfcTreeHeaderControl(Classes::TComponent* AOwner);
  219. __fastcall virtual ~TfcTreeHeaderControl(void);
  220. __property Graphics::TCanvas* Canvas = {read=FCanvas};
  221. __property Controls::TWinControl* Tree = {read=FTree, write=FTree};
  222. __property TfcTreeHeader* Header = {read=FHeader, write=FHeader};
  223. __property bool HotTrack = {read=FHotTrack, write=SetHotTrack, default=0};
  224. __property Controls::TImageList* Images = {read=FImageList, write=SetImageList};
  225. __property TfcTreeHeaderOptions Options = {read=FOptions, write=SetOptions, default=7};
  226. __property TfcTreeHeaderSections* Sections = {read=FSections, write=SetSections};
  227. public:
  228. #pragma option push -w-inl
  229. /* TWinControl.CreateParented */ inline __fastcall TfcTreeHeaderControl(HWND ParentWindow) : Controls::TWinControl(
  230. ParentWindow) { }
  231. #pragma option pop
  232. };
  233. class PASCALIMPLEMENTATION TfcTreeHeaderSections : public Classes::TCollection 
  234. {
  235. typedef Classes::TCollection inherited;
  236. private:
  237. HIDESBASE TfcTreeHeaderSection* __fastcall GetItem(int Index);
  238. HIDESBASE void __fastcall SetItem(int Index, TfcTreeHeaderSection* Value);
  239. protected:
  240. DYNAMIC Classes::TPersistent* __fastcall GetOwner(void);
  241. virtual void __fastcall Update(Classes::TCollectionItem* Item);
  242. public:
  243. TfcTreeHeaderControl* HeaderControl;
  244. __fastcall TfcTreeHeaderSections(TfcTreeHeaderControl* HeaderControl);
  245. HIDESBASE TfcTreeHeaderSection* __fastcall Add(void);
  246. __property TfcTreeHeaderSection* Items[int Index] = {read=GetItem, write=SetItem/*, default*/};
  247. public:
  248. #pragma option push -w-inl
  249. /* TCollection.Destroy */ inline __fastcall virtual ~TfcTreeHeaderSections(void) { }
  250. #pragma option pop
  251. };
  252. typedef void __fastcall (__closure *TfcHeaderSectionDefaultEvent)(TfcTreeHeader* HeaderControl, TfcTreeHeaderSection* 
  253. Section, bool &doDefault);
  254. //-- var, const, procedure ---------------------------------------------------
  255. } /* namespace Fctreeheader */
  256. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  257. using namespace Fctreeheader;
  258. #endif
  259. #pragma option pop // -w-
  260. #pragma option pop // -Vx
  261. #pragma delphiheader end.
  262. //-- end unit ----------------------------------------------------------------
  263. #endif // fcTreeHeader