home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Internet 2000 May / MICD_2000_05.iso / CBuilder5 / INSTALL / DATA1.CAB / Program_Built_Files / Include / Vcl / tabs.hpp < prev    next >
C/C++ Source or Header  |  2000-02-01  |  10KB  |  274 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) 'Tabs.pas' rev: 5.00
  6.  
  7. #ifndef TabsHPP
  8. #define TabsHPP
  9.  
  10. #pragma delphiheader begin
  11. #pragma option push -w-
  12. #pragma option push -Vx
  13. #include <Menus.hpp>    // Pascal unit
  14. #include <Messages.hpp>    // Pascal unit
  15. #include <Controls.hpp>    // Pascal unit
  16. #include <Forms.hpp>    // Pascal unit
  17. #include <Graphics.hpp>    // Pascal unit
  18. #include <Classes.hpp>    // Pascal unit
  19. #include <Windows.hpp>    // Pascal unit
  20. #include <SysInit.hpp>    // Pascal unit
  21. #include <System.hpp>    // Pascal unit
  22.  
  23. //-- user supplied -----------------------------------------------------------
  24.  
  25. namespace Tabs
  26. {
  27. //-- type declarations -------------------------------------------------------
  28. #pragma option push -b-
  29. enum TScrollBtn { sbLeft, sbRight };
  30. #pragma option pop
  31.  
  32. class DELPHICLASS TScroller;
  33. class PASCALIMPLEMENTATION TScroller : public Controls::TCustomControl 
  34. {
  35.     typedef Controls::TCustomControl inherited;
  36.     
  37. private:
  38.     int FMin;
  39.     int FMax;
  40.     int FPosition;
  41.     Classes::TNotifyEvent FOnClick;
  42.     int FChange;
  43.     Graphics::TBitmap* Bitmap;
  44.     bool Pressed;
  45.     bool Down;
  46.     TScrollBtn Current;
  47.     int pWidth;
  48.     int pHeight;
  49.     void __fastcall SetMin(int Value);
  50.     void __fastcall SetMax(int Value);
  51.     void __fastcall SetPosition(int Value);
  52.     bool __fastcall CanScrollLeft(void);
  53.     bool __fastcall CanScrollRight(void);
  54.     HIDESBASE void __fastcall DoMouseDown(int X);
  55.     HIDESBASE MESSAGE void __fastcall WMLButtonDown(Messages::TWMMouse &Message);
  56.     HIDESBASE MESSAGE void __fastcall WMLButtonDblClk(Messages::TWMMouse &Message);
  57.     HIDESBASE MESSAGE void __fastcall WMMouseMove(Messages::TWMMouse &Message);
  58.     HIDESBASE MESSAGE void __fastcall WMLButtonUp(Messages::TWMMouse &Message);
  59.     HIDESBASE MESSAGE void __fastcall WMSize(Messages::TWMSize &Message);
  60.     
  61. public:
  62.     __fastcall virtual TScroller(Classes::TComponent* AOwner);
  63.     __fastcall virtual ~TScroller(void);
  64.     virtual void __fastcall Paint(void);
  65.     
  66. __published:
  67.     __property Classes::TNotifyEvent OnClick = {read=FOnClick, write=FOnClick};
  68.     __property int Min = {read=FMin, write=SetMin, default=0};
  69.     __property int Max = {read=FMax, write=SetMax, default=0};
  70.     __property int Position = {read=FPosition, write=SetPosition, default=0};
  71.     __property int Change = {read=FChange, write=FChange, default=1};
  72. public:
  73.     #pragma option push -w-inl
  74.     /* TWinControl.CreateParented */ inline __fastcall TScroller(HWND ParentWindow) : Controls::TCustomControl(
  75.         ParentWindow) { }
  76.     #pragma option pop
  77.     
  78. };
  79.  
  80.  
  81. class DELPHICLASS TTabList;
  82. class DELPHICLASS TTabSet;
  83. #pragma option push -b-
  84. enum TTabStyle { tsStandard, tsOwnerDraw };
  85. #pragma option pop
  86.  
  87. typedef void __fastcall (__closure *TMeasureTabEvent)(System::TObject* Sender, int Index, int &TabWidth
  88.     );
  89.  
  90. typedef void __fastcall (__closure *TDrawTabEvent)(System::TObject* Sender, Graphics::TCanvas* TabCanvas
  91.     , const Windows::TRect &R, int Index, bool Selected);
  92.  
  93. typedef void __fastcall (__closure *TTabChangeEvent)(System::TObject* Sender, int NewTab, bool &AllowChange
  94.     );
  95.  
  96. #pragma option push -b-
  97. enum TEdgeType { etNone, etFirstIsSel, etFirstNotSel, etLastIsSel, etLastNotSel, etNotSelToSel, etSelToNotSel, 
  98.     etNotSelToNotSel };
  99. #pragma option pop
  100.  
  101. class PASCALIMPLEMENTATION TTabSet : public Controls::TCustomControl 
  102. {
  103.     typedef Controls::TCustomControl inherited;
  104.     
  105. private:
  106.     int FStartMargin;
  107.     int FEndMargin;
  108.     Classes::TStrings* FTabs;
  109.     int FTabIndex;
  110.     int FFirstIndex;
  111.     int FVisibleTabs;
  112.     Graphics::TColor FSelectedColor;
  113.     Graphics::TColor FUnselectedColor;
  114.     Graphics::TColor FBackgroundColor;
  115.     bool FDitherBackground;
  116.     bool FAutoScroll;
  117.     TTabStyle FStyle;
  118.     int FOwnerDrawHeight;
  119.     TMeasureTabEvent FOnMeasureTab;
  120.     TDrawTabEvent FOnDrawTab;
  121.     TTabChangeEvent FOnChange;
  122.     Controls::TImageList* ImageList;
  123.     Graphics::TBitmap* MemBitmap;
  124.     Graphics::TBitmap* BrushBitmap;
  125.     Classes::TList* TabPositions;
  126.     int FTabHeight;
  127.     TScroller* Scroller;
  128.     bool FDoFix;
  129.     void __fastcall SetSelectedColor(Graphics::TColor Value);
  130.     void __fastcall SetUnselectedColor(Graphics::TColor Value);
  131.     void __fastcall SetBackgroundColor(Graphics::TColor Value);
  132.     void __fastcall SetDitherBackground(bool Value);
  133.     void __fastcall SetAutoScroll(bool Value);
  134.     void __fastcall SetStartMargin(int Value);
  135.     void __fastcall SetEndMargin(int Value);
  136.     void __fastcall SetTabIndex(int Value);
  137.     void __fastcall SetFirstIndex(int Value);
  138.     void __fastcall SetTabList(Classes::TStrings* Value);
  139.     void __fastcall SetTabStyle(TTabStyle Value);
  140.     void __fastcall SetTabHeight(int Value);
  141.     HIDESBASE MESSAGE void __fastcall WMSize(Messages::TWMSize &Message);
  142.     HIDESBASE MESSAGE void __fastcall CMSysColorChange(Messages::TMessage &Message);
  143.     HIDESBASE MESSAGE void __fastcall CMFontChanged(Messages::TMessage &Message);
  144.     void __fastcall PaintEdge(int X, int Y, int H, TEdgeType Edge);
  145.     void __fastcall CreateBrushPattern(Graphics::TBitmap* Bitmap);
  146.     int __fastcall CalcTabPositions(int Start, int Stop, Graphics::TCanvas* Canvas, int First);
  147.     void __fastcall CreateScroller(void);
  148.     void __fastcall InitBitmaps(void);
  149.     void __fastcall DoneBitmaps(void);
  150.     void __fastcall CreateEdgeParts(void);
  151.     void __fastcall FixTabPos(void);
  152.     MESSAGE void __fastcall WMGetDlgCode(Messages::TWMNoParams &Message);
  153.     HIDESBASE MESSAGE void __fastcall CMDialogChar(Messages::TWMKey &Message);
  154.     void __fastcall ScrollClick(System::TObject* Sender);
  155.     void __fastcall ReadIntData(Classes::TReader* Reader);
  156.     void __fastcall ReadBoolData(Classes::TReader* Reader);
  157.     
  158. protected:
  159.     virtual void __fastcall CreateParams(Controls::TCreateParams &Params);
  160.     DYNAMIC void __fastcall MouseDown(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, 
  161.         int Y);
  162.     virtual void __fastcall Paint(void);
  163.     virtual void __fastcall DrawTab(Graphics::TCanvas* TabCanvas, const Windows::TRect &R, int Index, bool 
  164.         Selected);
  165.     bool __fastcall CanChange(int NewIndex);
  166.     DYNAMIC void __fastcall GetChildren(Classes::TGetChildProc Proc, Classes::TComponent* Root);
  167.     virtual void __fastcall MeasureTab(int Index, int &TabWidth);
  168.     virtual void __fastcall DefineProperties(Classes::TFiler* Filer);
  169.     
  170. public:
  171.     __fastcall virtual TTabSet(Classes::TComponent* AOwner);
  172.     __fastcall virtual ~TTabSet(void);
  173.     int __fastcall ItemAtPos(const Windows::TPoint &Pos);
  174.     Windows::TRect __fastcall ItemRect(int Item);
  175.     HIDESBASE void __fastcall SelectNext(bool Direction);
  176.     __property Canvas ;
  177.     __property int FirstIndex = {read=FFirstIndex, write=SetFirstIndex, default=0};
  178.     
  179. __published:
  180.     __property Align ;
  181.     __property Anchors ;
  182.     __property bool AutoScroll = {read=FAutoScroll, write=SetAutoScroll, default=1};
  183.     __property Graphics::TColor BackgroundColor = {read=FBackgroundColor, write=SetBackgroundColor, default=-2147483633
  184.         };
  185.     __property Constraints ;
  186.     __property bool DitherBackground = {read=FDitherBackground, write=SetDitherBackground, default=1};
  187.     __property DragCursor ;
  188.     __property DragKind ;
  189.     __property DragMode ;
  190.     __property Enabled ;
  191.     __property int EndMargin = {read=FEndMargin, write=SetEndMargin, default=5};
  192.     __property Font ;
  193.     __property ParentShowHint ;
  194.     __property PopupMenu ;
  195.     __property ShowHint ;
  196.     __property int StartMargin = {read=FStartMargin, write=SetStartMargin, default=5};
  197.     __property Graphics::TColor SelectedColor = {read=FSelectedColor, write=SetSelectedColor, default=-2147483633
  198.         };
  199.     __property TTabStyle Style = {read=FStyle, write=SetTabStyle, default=0};
  200.     __property int TabHeight = {read=FOwnerDrawHeight, write=SetTabHeight, default=20};
  201.     __property Classes::TStrings* Tabs = {read=FTabs, write=SetTabList};
  202.     __property int TabIndex = {read=FTabIndex, write=SetTabIndex, default=-1};
  203.     __property Graphics::TColor UnselectedColor = {read=FUnselectedColor, write=SetUnselectedColor, default=-2147483643
  204.         };
  205.     __property Visible ;
  206.     __property int VisibleTabs = {read=FVisibleTabs, nodefault};
  207.     __property OnClick ;
  208.     __property TTabChangeEvent OnChange = {read=FOnChange, write=FOnChange};
  209.     __property OnDragDrop ;
  210.     __property OnDragOver ;
  211.     __property TDrawTabEvent OnDrawTab = {read=FOnDrawTab, write=FOnDrawTab};
  212.     __property OnEndDock ;
  213.     __property OnEndDrag ;
  214.     __property OnEnter ;
  215.     __property OnExit ;
  216.     __property OnMouseDown ;
  217.     __property OnMouseMove ;
  218.     __property OnMouseUp ;
  219.     __property TMeasureTabEvent OnMeasureTab = {read=FOnMeasureTab, write=FOnMeasureTab};
  220.     __property OnStartDock ;
  221.     __property OnStartDrag ;
  222. public:
  223.     #pragma option push -w-inl
  224.     /* TWinControl.CreateParented */ inline __fastcall TTabSet(HWND ParentWindow) : Controls::TCustomControl(
  225.         ParentWindow) { }
  226.     #pragma option pop
  227.     
  228. };
  229.  
  230.  
  231. class PASCALIMPLEMENTATION TTabList : public Classes::TStringList 
  232. {
  233.     typedef Classes::TStringList inherited;
  234.     
  235. private:
  236.     TTabSet* Tabs;
  237.     
  238. public:
  239.     virtual void __fastcall Insert(int Index, const AnsiString S);
  240.     virtual void __fastcall Delete(int Index);
  241.     virtual int __fastcall Add(const AnsiString S);
  242.     virtual void __fastcall Put(int Index, const AnsiString S);
  243.     virtual void __fastcall Clear(void);
  244.     virtual void __fastcall AddStrings(Classes::TStrings* Strings);
  245. public:
  246.     #pragma option push -w-inl
  247.     /* TStringList.Destroy */ inline __fastcall virtual ~TTabList(void) { }
  248.     #pragma option pop
  249.     
  250. public:
  251.     #pragma option push -w-inl
  252.     /* TObject.Create */ inline __fastcall TTabList(void) : Classes::TStringList() { }
  253.     #pragma option pop
  254.     
  255. };
  256.  
  257.  
  258. #pragma option push -b-
  259. enum TEdgePart { epSelectedLeft, epUnselectedLeft, epSelectedRight, epUnselectedRight };
  260. #pragma option pop
  261.  
  262. //-- var, const, procedure ---------------------------------------------------
  263.  
  264. }    /* namespace Tabs */
  265. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  266. using namespace Tabs;
  267. #endif
  268. #pragma option pop    // -w-
  269. #pragma option pop    // -Vx
  270.  
  271. #pragma delphiheader end.
  272. //-- end unit ----------------------------------------------------------------
  273. #endif    // Tabs
  274.