📄 mxoutlookbarpro.pas
字号:
// ****************************************************************************
// * An Outlook style sidebar component for Delphi.
// ****************************************************************************
// * Copyright 2002, Bitvad醩z Kft. Hungary . All Rights Reserved.
// ****************************************************************************
// * Feel free to contact me if you have any questions, comments or suggestions
// * at support@maxcomponents.net
// ****************************************************************************
// * Web page: www.maxcomponents.net
// ****************************************************************************
// * Date last modified: 11.10.2002
// ****************************************************************************
// * TmxOutlookBarPro v2.13
// ****************************************************************************
// * Description:
// *
// * The TmxOutlookBarPro 100% native VCL component with many added features to
// * support the look, feel, and behavior introduced in Microsoft Office 97,
// * 2000, and new Internet Explorer. It has got many features including
// * scrolling headers, icon highlighting and positioning, small and large
// * icons,gradient and bitmap Backgrounds. The header sections and buttons
// * can be added, deleted and moved at design time. The header tabs can
// * have individual font, alignment, tabcolor, glyph, tiled Background
// * images. And many many more posibilities.
// *
// * This component is an advanced version of original TmxOutlookBar, but
// * please note that this release is not compible to the old one.
// *
// ****************************************************************************
Unit mxOutlookBarPro;
Interface
// *************************************************************************************
// ** List of used units
// *************************************************************************************
{$I MAX.INC}
Uses Windows,
Classes,
Graphics,
SysUtils,
Controls,
Messages,
Forms,
CommCtrl,
Stdctrls,
Buttons,
Menus,
Extctrls,
ActnList,
Imglist,
ActiveX,
Consts;
Const
mxOutlookVersion = $020D; // ** 2.13 **
SubRelease = '';
DefaultHeaderHeight = 22;
DefaultExplorerAddon = 12;
// the OutlookBar's own clipboard formats,
CFSTR_MXOUTLOOKBARPRO = 'mxOutlookBarPro Resource';
CFSTR_MXOUTLOOKBARPROREFERENCE = 'mxOutlookBarPro Reference';
Const
mxStreamData = 1;
ButtonStreamData = 2;
Const
CloseTimer = 1;
ScrollTimer = 2;
ChangeTimer = 3;
ButtonTimer = 4;
AlertTimer = 5;
Resourcestring
sDuplicatedHeaderName = 'This bar already contains header with name %s'#10#13'Please type another one to continue.';
sDuplicatedButtonName = 'This header already contains button with name %s'#10#13'Please type another one to continue.';
SEtcInvalidItem = 'FormatEtcList: Invalid item index.';
Type
TStreamDataHeader = Record
DataType: Integer;
DataSize: Integer;
End;
TBaseStreamDataBody = Packed Record
HeaderIndex: Integer;
ButtonIndex: Integer;
End;
TBaseStreamData = Packed Record
Header: TStreamDataHeader;
Body: TBaseStreamDataBody;
End;
mxNavigatorException = Exception;
TmxHeaderScrollType = (
stNone,
stLinear,
stAccelerated );
TmxBitmapCopy = (
bcMergeCopy,
bcMergePaint,
bcSrcCopy,
bcSrcErase,
bcSrcPaint );
TmxBackgroundStyle = (
btBitmap,
btGradient,
btSolid,
btTileBitmap,
btTransparent );
TmxGradientDirection = (
gdNormal,
gdInverse
);
TmxGradientStyle = (
gtCornerTopLeft,
gtCornerTopRight,
gtCornerBottomRight,
gtCornerBottomLeft,
gtDiagonalRising,
gtDiagonalFalling,
gtEllipse,
gtPyramid,
gtVerticalToCenter,
gtHorizontalToCenter,
gtLeftToRight,
gtTopToBottom );
TmxVerticalAlignment = (
vaTopJustify,
vaCenter,
vaBottomJustify );
TmxViewStyle = (
vsExplorerBar,
vsOutlook );
TmxButtonStyle = (
bsLarge,
bsSmall );
TmxButtonView = (
bvBig,
bvExplorer,
bvNormal,
bvToolBox,
bvWindows2000,
bvWindowsXP );
TmxButtonState = (
hbsUp,
hbsDown,
hbsFocused,
hbsDisabled );
TmxButtonKind = (
bkButton,
bkLabel,
bkCheckBox,
bkPushButton,
bkRadioButton );
TmxGlyphLayout = (
glGlyphLeft,
glGlyphRight,
glGlyphCenter );
TmxHeaderOption = (
hoActivateOnSelect,
hoAlwaysFlat,
hoButtonDown,
hoCustomSettings,
hoDrawBorder,
hoDrawCaptionBorder,
hoDrawDisabledButton,
hoDrawDownButton,
hoDrawFocusedButton,
hoFocusDisabled,
hoNoCaption,
hoReadOnlyCaption,
hoRoundedHeader,
hoShowSelectedImage,
hoShowStatusButton,
hoUseHighlightFont );
TmxHeaderOptions = Set Of TmxHeaderOption;
TmxCaptionStyle = (
csButtonStyle,
csCustomDraw
);
TmxExplorerMethod = (
emStandard,
emCloseUp
);
TmxBarOption = (
boAcceptOLEDrop,
boActivateToolBoxScroller,
boAlwaysFlatScroller,
boAutoScroll,
boAutoChangeHeader,
boChangeToDisabled,
boExplorerBorder,
boFocusOnMouseEnter,
boHeaderFrame,
boInternalDrop,
hoShowFocusRect
);
TmxBarOptions = Set Of TmxBarOption;
TmxHeaderState = (
hsOpened,
hsClosed
);
TmxBorderStyle = (
mxNone,
mxFlat,
mxFocusedFlat,
mxSolid,
mxSingle,
mxButton,
mxDefault,
mxFlatButton,
mxFlatButtonDown,
mxSpeedUp );
TmxButtonOption = (
boAutoWidthLabel,
boCustomFont,
boCustomStyle,
boCustomView,
boUnderlineFont,
boReadOnlyCaption
);
TmxButtonOptions = Set Of TmxButtonOption;
TmxScrollView = (
ssNormal,
ssExpress,
ssToolBox
);
TmxPreSet = (
psOutlook,
psFlatOutlook,
psOutlookExpress,
psOffice,
psOfficeXP,
psOffice2000,
psToolBox,
psFlatToolBox,
psExplorerBar,
psExplorerBarXP,
psExplorerBar2000
);
// Modes to determine drop position further
TmxDropMode = (
dmNowhere,
dmButton
);
TmxOutlookBarStates = Set Of (
tsDragPending,
tsDragging,
tsClearPending
);
PCardinal = ^Cardinal;
TmxHitPosition = (
hpUnknown,
hpAbove,
hpInsert,
hpBelow
);
TmxHitType = (
xhtNowhere,
xhtHeaderButton,
xhtHeaderBackground,
xhtButton
);
TmxGlyphPosition = (
gpTopLeft,
gpTopRight,
gpBottomLeft,
gpBottomRight,
gpCenter
);
Var
CF_OUTLOOKBARPRO,
CF_OUTLOOKBARPROREFERENCE: Word;
StandardOLEFormat: TFormatEtc = (
cfFormat: 0;
ptd: Nil;
dwAspect: DVASPECT_CONTENT;
lindex: - 1;
tymed: TYMED_HGLOBAL
);
// ************************************************************************
// ************************************************************************
// ************************************************************************
Type
TmxButton = Class;
TmxButtons = Class;
TmxHeader = Class;
TmxHeaders = Class;
TmxOutlookBarPro = Class;
PmxReference = ^TmxReference;
TmxReference = Record
Process: Cardinal;
Bar: TmxOutlookBarPro;
End;
// ************************************************************************
// ************************************************************************
// ************************************************************************
TmxEventDrawHeaderButtons = Procedure( Sender: TObject; ACanvas: TCanvas; ARect: TRect; ActiveIndex: Integer ) Of Object;
TmxEventDrawButton = Procedure( Sender: TObject; ACanvas: TCanvas; ARect: TRect; AState: TmxButtonState ) Of Object;
TmxEventDrawStatusButton = Procedure( Sender: TObject; ACanvas: TCanvas; ARect: TRect; AState: TmxHeaderState ) Of Object;
TmxEventDrawHeader = Procedure( Sender: TObject; ACanvas: TCanvas; ARect: TRect ) Of Object;
TmxEventHeaderChange = Procedure( Sender: TObject; OldIndex, NewIndex: Integer ) Of Object;
TmxEventCanChangeHeader = Procedure( Sender: TObject; NewHeader: TmxHeader; Var CanChange: Boolean ) Of Object;
TmxEventChangeViewStyle = Procedure( Sender: TObject; OldStyle, NewStyle: TmxViewStyle; Var CanChange: Boolean ) Of Object;
TmxEventCheckScroll = Procedure( Sender: TObject; Var ScrollUpNeed, ScrollDownNeed, Automatic: Boolean ) Of Object;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -