home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 9 / CDACTUAL9.iso / progs / CB / DATA.Z / TABS.HPP < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-06  |  10.1 KB  |  263 lines

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