Unit ExPage

===================== EXTENDED PAGE CONTROL ================================== // For some reason Borland did not fully implement all of the tab styles in the TPageControl and TTabSheet components. This extension fills in the remaining tab styles. The most useful ones are the button style, the owner draw style and the ability to add glyphs onto each tab. // The ownerdraw style is written to operate in exactly the same way as, say, the TListBox owner draw style. So you can look up the help on that component's ownerdraw and apply the techniques to the TExPageControl. The TExPageControl has a canvas for each tab in the control to draw on. // The ability to add glyphs to each tab is made by loading the glyphs into a TImageList and linking the list into the Glyphs property. This technique is the native Windows API way of doing it, with messages set up to create the link. When an individual glyph is about to be used an event is called with the tab number and the glyph number, the glyph number can be altered by the event to allow a different glyph/tab mapping. An alternative to using a TImageList and the in built glyph methods would be to use the ownerdraw style. // This component also illustrates how to make a property that is visible in the object inspector in the ancestor component, disappear in the derived component. A number of articles in the press have said you can't do this. TPageControl has a MultiLine property. In the TExPageControl, multiline is put into a styles set; to make the Multiline property disappear from the object inspector it is declared with no "write" statement definition. It can still be accessed in the ancestor by using the "inherited" reserved word. // Version 1.00 Grahame Marsh 19 January 1997 // Freeware - you get it for free, I take nothing, I make no promises! // Please feel free to contact me: grahame.s.marsh@corp.courtaulds.co.uk

Classes

TExPageControl -
TExTabSheet - redeclare TTabSheet so it can have a component editor declared here

Functions

Register - Register the component and editor.

Types

TGlyphMapEvent
TTabStyle
TTabStyles

Constants

Variables


Functions


procedure Register;

Register the component and editor. I put the TExPageControl on the Win95 palette along with TPageControl. You can put it elsewhere if you like.

Types


TGlyphMapEvent = procedure(Control: TWinControl; PageIndex : integer; var GlyphIndex : integer) of object
event to allow different mapping of glyphs from the imagelist component
TTabStyle  = (tabButton, tabMultiline, tabRightJustify,
                tabIconLeft, tabLabelLeft, tabOwnerDraw);
tab styles - search win32 api help for TCS_ for info on what each style does
TTabStyles = set of TTabStyle

Constants


Variables