home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 1997 May / VPR9705A.ISO / VPR_DATA / PROGRAM / CBTRIAL / SETUP / DATA.Z / TABNOTBK.INT < prev    next >
Text File  |  1997-02-14  |  3KB  |  95 lines

  1.  
  2. {*******************************************************}
  3. {                                                       }
  4. {       Delphi Visual Component Library                 }
  5. {                                                       }
  6. {       Copyright (c) 1995,96 Borland International     }
  7. {                                                       }
  8. {*******************************************************}
  9.  
  10. { This unit defines the TTabbedNotebook Component. }
  11.  
  12. unit Tabnotbk;
  13.  
  14. interface
  15.  
  16. uses Windows, Classes,  Stdctrls, Forms,
  17.   Messages, Graphics, Controls, Dsgnintf, ComCtrls;
  18.  
  19. const
  20.   CM_TABFONTCHANGED = CM_BASE + 100;
  21.  
  22. type
  23.  
  24.   TPageChangeEvent = procedure(Sender: TObject; NewTab: Integer;
  25.     var AllowChange: Boolean) of object;
  26.  
  27.   { Class       : TTabPage
  28.     Description : This class implements the individual tab page behavior.
  29.                   Each instance of this class will hold controls to be
  30.                   displayed when it is the active page of a TTabbedNotebook
  31.                   component. }
  32.   TTabPage = class(TWinControl)
  33.   protected
  34.     procedure ReadState(Reader: TReader); override;
  35.   public
  36.     constructor Create(AOwner: TComponent); override;
  37.   published
  38.     property Caption;
  39.     property Height stored False;
  40.     property TabOrder stored False;
  41.     property Visible stored False;
  42.     property Width stored False;
  43.     property Enabled stored False;
  44.   end;
  45.  
  46.   { Class       : TTabbedNotebook
  47.     Description : This class implements Tabbed notebook component.
  48.                   It holds a collection of TTabPages onto which
  49.                   users can drop controls.  It uses MS-Word style
  50.                   tab buttons to allow the user to control which
  51.                   page is currently active. }
  52.   TTabbedNotebook = class(TCustomTabControl)
  53.   protected
  54.     procedure AlignControls(AControl: TControl; var Rect: TRect); override;
  55.     procedure Change; override;
  56.     procedure Click; override;
  57.     procedure CreateHandle; override;
  58.     procedure CreateParams(var Params: TCreateParams); override;
  59.     function GetChildOwner: TComponent; override;
  60.     procedure GetChildren(Proc: TGetChildProc); override;
  61.     procedure Loaded; override;
  62.     procedure KeyDown(var Key: Word; Shift: TShiftState); override;
  63.     procedure ReadState(Reader: TReader); override;
  64.     procedure SetPageIndex(Value: Integer);
  65.     procedure ShowControl(AControl: TControl); override;
  66.     procedure CMTabFontChanged(var Message: TMessage); message CM_TABFONTCHANGED;
  67.   public
  68.     constructor Create(AOwner: TComponent); override;
  69.     destructor  Destroy; override;
  70.     function GetIndexForPage(const PageName: string): Integer;
  71.     property TopFont: TFont;
  72.     procedure TabFontChanged(Sender: TObject);
  73.   published
  74.     property ActivePage: string;
  75.     property Align;
  76.     property Enabled;
  77.     property PageIndex: Integer default 0;
  78.     property Pages: TStrings;
  79.     property Font;
  80.     property TabsPerRow: Integer default 3;
  81.     property TabFont: TFont;
  82.     property ParentShowHint;
  83.     property PopupMenu;
  84.     property ShowHint;
  85.     property TabOrder;
  86.     property TabStop default True;
  87.     property Visible;
  88.     property OnClick: TNotifyEvent;
  89.     property OnChange: TPageChangeEvent;
  90.     property OnEnter;
  91.     property OnExit;
  92.   end;
  93.  
  94. implementation
  95.