SkinCtrls.pas
上传用户:hylc_2004
上传日期:2014-01-23
资源大小:46800k
文件大小:456k
- {*******************************************************************}
- { }
- { Almediadev Visual Component Library }
- { DynamicSkinForm }
- { Version 4.98 }
- { }
- { Copyright (c) 2000-2002 Almediadev }
- { ALL RIGHTS RESERVED }
- { }
- { Home: http://www.almdev.com }
- { Support: support@almdev.com }
- { }
- {*******************************************************************}
- unit SkinCtrls;
- {$P+,S-,W-,R-}
- {$WARNINGS OFF}
- interface
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- Menus, ExtCtrls, SkinData, spEffBmp, StdCtrls, SkinMenus, ComCtrls;
- type
- TspControlButton = record
- R: TRect;
- MouseIn: Boolean;
- Down: Boolean;
- end;
- TspSkinControl = class(TCustomControl)
- protected
- FSD: TspSkinData;
- FAreaName: String;
- FSkinDataName: String;
- FRgn: HRgn;
- FDrawDefault: Boolean;
- CursorIndex: Integer;
- FOnMouseEnter, FOnMouseLeave: TNotifyEvent;
- FAlphaBlend: Boolean;
- FAlphaBlendValue: Byte;
- FUseSkinCursor: Boolean;
- procedure SetAlphaBlend(AValue: Boolean); virtual;
- procedure SetAlphaBlendValue(AValue: Byte); virtual;
- procedure Paint; override;
- procedure Notification(AComponent: TComponent; Operation: TOperation); override;
- procedure GetSkinData; virtual;
- procedure WMMOVE(var Msg: TWMMOVE); message WM_MOVE;
- procedure WMEraseBkgnd(var Msg: TWMEraseBkgnd); message WM_ERASEBKGND;
- procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
- procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER;
- procedure SetSkinData(Value: TspSkinData); virtual;
- procedure CreateControlDefaultImage(B: TBitMap); virtual;
- procedure CreateControlSkinImage(B: TBitMap); virtual;
- public
- FIndex: Integer;
- procedure ChangeSkinData; virtual;
- procedure BeforeChangeSkinData; virtual;
- destructor Destroy; override;
- constructor Create(AOwner: TComponent); override;
- published
- property Anchors;
- property TabOrder;
- property Visible;
- property DrawDefault: Boolean
- read FDrawDefault write FDrawDefault;
- property SkinData: TspSkinData read FSD write SetSkinData;
- property AreaName: String read FAreaName write FAreaName;
- property SkinDataName: String read FSkinDataName write FSkinDataName;
- property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter;
- property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave;
- property AlphaBlend: Boolean read FAlphaBlend write SetAlphaBlend;
- property AlphaBlendValue: Byte
- read FAlphaBlendValue write SetAlphaBlendValue;
- property UseSkinCursor: Boolean read FUseSkinCursor write FUseSkinCursor;
- end;
- TspSkinCustomControl = class(TspSkinControl)
- protected
- FUseSkinFont: Boolean;
- FDefaultWidth: Integer;
- FDefaultHeight: Integer;
- FDefaultFont: TFont;
- LTPt, RTPt, LBPt, RBPt: TPoint;
- SkinRect, ClRect: TRect;
- NewLTPoint, NewRTPoint, NewLBPoint, NewRBPoint: TPoint;
- NewClRect: TRect;
- Picture, MaskPicture: TBitMap;
- ResizeMode: Integer;
- procedure OnDefaultFontChange(Sender: TObject);
- procedure SetDefaultWidth(Value: Integer);
- procedure SetDefaultHeight(Value: Integer);
- procedure SetDefaultFont(Value: TFont);
- procedure DefaultFontChange; virtual;
- function GetNewRect(R: TRect): TRect;
- function GetResizeMode: Integer;
- procedure CalcSize(var W, H: Integer); virtual;
- procedure CreateSkinControlImage(B, SB: TBitMap; R: TRect);
- procedure GetSkinData; override;
- procedure CreateControlRegion;
- procedure SetControlRegion; virtual;
- procedure CreateControlDefaultImage(B: TBitMap); override;
- procedure CreateControlSkinImage(B: TBitMap); override;
- public
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override;
- procedure ChangeSkinData; override;
- published
- property DefaultFont: TFont read FDefaultFont write SetDefaultFont;
- property UseSkinFont: Boolean read FUseSkinFont write FUseSkinFont;
- property DefaultWidth: Integer read FDefaultWidth write SetDefaultWidth;
- property DefaultHeight: Integer read FDefaultHeight write SetDefaultHeight;
- end;
- TspFrameSkinControl = class(TspSkinControl)
- protected
- FRgn: HRgn;
- FFrame: Integer;
- FrameW, FrameH: Integer;
- Picture, MaskPicture: TBitMap;
- FDefaultImage: TBitMap;
- FDefaultMask: TBitMap;
- FDefaultFramesCount: Integer;
- FDefaultFramesPlacement: TFramesPlacement;
- procedure CalcDefaultFrameSize; virtual;
- procedure SetDefaultImage(Value: TBitMap);
- procedure SetDefaultMask(Value: TBitMap);
- procedure SetDefaultFramesCount(Value: Integer);
- procedure SetDefaultFramesPlacement(Value: TFramesPlacement);
- procedure SetFrame(Value: Integer);
- procedure SetControlRegion;
- procedure GetSkinData; override;
- procedure CreateControlDefaultImage(B: TBitMap); override;
- procedure CreateControlSkinImage(B: TBitMap); override;
- procedure Loaded; override;
- public
- SkinRect: TRect;
- FramesCount: Integer;
- FramesPlacement: TFramesPlacement;
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override;
- procedure ChangeSkinData; override;
- property Frame: Integer read FFrame write SetFrame;
- published
- property DefaultImage: TBitMap read FDefaultImage write SetDefaultImage;
- property DefaultMask: TBitMap read FDefaultMask write SetDefaultMask;
- property DefaultFramesPlacement: TFramesPlacement
- read FDefaultFramesPlacement write SetDefaultFramesPlacement;
- property DefaultFramesCount: Integer
- read FDefaultFramesCount write SetDefaultFramesCount;
- property ShowHint;
- end;
- TspSkinSwitchState = (swOff, swOn);
- TspSkinSwitch = class(TspFrameSkinControl)
- protected
- FAnimateTimer: TTimer;
- FState: TspSkinSwitchState;
- FOnChange: TNotifyEvent;
- FMouseIn: Boolean;
- function GetTimerInterval: Cardinal;
- procedure SetTimerInterval(Value: Cardinal);
- procedure SetState(Value: TspSkinSwitchState);
- procedure ChangeState(Value: TspSkinSwitchState);
- procedure MouseUp(Button: TMouseButton; Shift: TShiftState;
- X, Y: Integer); override;
- procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
- procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER;
- procedure DoAnimate(Sender: TObject);
- procedure Start;
- procedure Stop;
- public
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- procedure ChangeSkinData; override;
- published
- property TimerInterval: Cardinal read GetTimerInterval write SetTimerInterval;
- property State: TspSkinSwitchState read FState write SetState;
- property OnChange: TNotifyEvent read FOnChange write FOnChange;
- property OnMouseDown;
- property OnMouseMove;
- property OnMouseUp;
- property OnClick;
- end;
- TspSkinAnimate = class(TspFrameSkinControl)
- protected
- FAnimateTimer: TTimer;
- FCycleMode: Boolean;
- FButtonMode: Boolean;
- FMouseIn: Boolean;
- FOnStart: TNotifyEvent;
- FOnStop: TNotifyEvent;
- FActive: Boolean;
- procedure SetActive(Value: Boolean);
- function GetTimerInterval: Cardinal;
- procedure SetTimerInterval(Value: Cardinal);
- procedure DoAnimate(Sender: TObject);
- procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
- procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER;
- public
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- procedure Start;
- procedure Stop;
- published
- property Active: Boolean read FActive write SetActive;
- property Enabled;
- property CycleMode: Boolean read FCycleMode write FCycleMode;
- property ButtonMode: Boolean read FButtonMode write FButtonMode;
- property TimerInterval: Cardinal read GetTimerInterval write SetTimerInterval;
- property OnStart: TNotifyEvent read FOnStart write FOnStart;
- property OnStop: TNotifyEvent read FOnStop write FOnStop;
- property OnMouseDown;
- property OnMouseMove;
- property OnMouseUp;
- property OnClick;
- end;
- TspSkinFrameGauge = class(TspFrameSkinControl)
- protected
- FMinValue, FMaxValue, FValue: Integer;
- FVertical: Boolean;
- FOnChange: TNotifyEvent;
- procedure SetMinValue(AValue: Integer);
- procedure SetMaxValue(AValue: Integer);
- procedure SetValue(AValue: Integer);
- procedure CalcFrame;
- public
- procedure ChangeSkinData; override;
- constructor Create(AOwner: TComponent); override;
- published
- property Value: Integer read FValue write SetValue;
- property MinValue: Integer read FMinValue write SetMinValue;
- property MaxValue: Integer read FMaxValue write SetMaxValue;
- property Align;
- property Enabled;
- property OnMouseDown;
- property OnMouseMove;
- property OnMouseUp;
- property OnResize;
- property PopupMenu;
- property ShowHint;
- end;
- TspSkinFrameRegulator = class(TspFrameSkinControl)
- protected
- FPixInc, FValInc: Integer;
- FDown: Boolean;
- StartV, CurV, TempValue: Integer;
- FMinValue, FMaxValue, FValue: Integer;
- FOnChange: TNotifyEvent;
- FDefaultKind: TRegulatorKind;
- procedure CalcDefaultFrameSize; override;
- procedure SetDefaultKind(Value: TRegulatorKind);
- procedure SetMinValue(AValue: Integer);
- procedure SetMaxValue(AValue: Integer);
- procedure SetValue(AValue: Integer);
- procedure GetSkinData; override;
- procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
- X, Y: Integer); override;
- procedure MouseUp(Button: TMouseButton; Shift: TShiftState;
- X, Y: Integer); override;
- procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
- procedure CalcValue;
- procedure CalcFrame;
- public
- Kind: TRegulatorKind;
- constructor Create(AOwner: TComponent); override;
- procedure ChangeSkinData; override;
- published
- property DefaultKind: TRegulatorKind read FDefaultKind write SetDefaultKind;
- property Value: Integer read FValue write SetValue;
- property MinValue: Integer read FMinValue write SetMinValue;
- property MaxValue: Integer read FMaxValue write SetMaxValue;
- property OnChange: TNotifyEvent read FOnChange write FOnChange;
- property Align;
- property Enabled;
- property OnMouseDown;
- property OnMouseMove;
- property OnMouseUp;
- property OnResize;
- property PopupMenu;
- property ShowHint;
- end;
- TspSkinBorderStyle = (bvRaised, bvLowered, bvNone, bvFrame);
- TspSkinPanelNumGlyphs = 1..2;
- TspSkinPanel = class(TspSkinCustomControl)
- protected
- FCheckedMode: Boolean;
- FChecked: Boolean;
- FOnChecked: TNotifyEvent;
- FAutoEnabledControls: Boolean;
- FGlyph: TBitMap;
- FNumGlyphs: TspSkinPanelNumGlyphs;
- FSpacing: Integer;
- FOldHeight: Integer;
- FRollUpState: Boolean;
- FRollUpMode: Boolean;
- FCaptionMode: Boolean;
- FBorderStyle: TspSkinBorderStyle;
- FDefaultCaptionHeight: Integer;
- FDefaultAlignment: TAlignment;
- VisibleControls: TList;
- procedure SetCheckedMode(Value: Boolean);
- procedure SetChecked(Value: Boolean);
- procedure SetGlyph(Value: TBitMap);
- procedure SetNumGlyphs(Value: TspSkinPanelNumGlyphs);
- procedure SetSpacing(Value: Integer);
- procedure SetRollUpMode(Value: Boolean);
- procedure SetDefaultAlignment(Value: TAlignment);
- procedure SetDefaultCaptionHeight(Value: Integer); virtual;
- procedure SetBorderStyle(Value: TspSkinBorderStyle);
- procedure SetRollUpState(Value: Boolean);
- procedure SetCaptionMode(Value: Boolean); virtual;
- procedure SetAlphaBlend(AValue: Boolean); override;
- procedure SetAlphaBlendValue(AValue: Byte); override;
- procedure CreateParams(var Params: TCreateParams); override;
- procedure AdjustClientRect(var Rect: TRect); override;
- procedure GetSkinData; override;
- procedure CMTextChanged(var Message: TMessage); message CM_TEXTCHANGED;
- procedure MouseUp(Button: TMouseButton; Shift: TShiftState;
- X, Y: Integer); override;
- procedure CreateControlDefaultImage(B: TBitMap); override;
- procedure CreateControlSkinImage(B: TBitMap); override;
- procedure HideControls;
- procedure ShowControls;
- procedure SkinDrawCheckImage(X, Y: Integer; Cnvs: TCanvas; IR: TRect; DestCnvs: TCanvas);
- public
- FontName: String;
- FontStyle: TFontStyles;
- FontHeight: Integer;
- FontColor: TColor;
- Alignment: TAlignment;
- CaptionRect: TRect;
- NewCaptionRect: TRect;
- RollUpMarkerRect: TRect;
- RestoreMarkerRect: TRect;
- NewRollUpMarkerRect: TRect;
- BGPictureIndex: Integer;
- CheckImageRect, UnCheckImageRect: TRect;
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- procedure ChangeSkinData; override;
- procedure DoRollUp(ARollUp: Boolean);
- procedure Paint; override;
- procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override;
- published
- property AutoEnabledControls: Boolean
- read FAutoEnabledControls write FAutoEnabledControls;
- property CheckedMode: Boolean read FCheckedMode write SetCheckedMode;
- property Checked: Boolean read FChecked write SetChecked;
- property Glyph: TBitMap read FGlyph write SetGlyph;
- property NumGlyphs: TspSkinPanelNumGlyphs read FNumGlyphs write SetNumGlyphs;
- property Spacing: Integer read FSpacing write SetSpacing;
- property DefaultAlignment: TAlignment
- read FDefaultAlignment write SetDefaultAlignment;
- property DefaultCaptionHeight: Integer
- read FDefaultCaptionHeight write SetDefaultCaptionHeight;
- property BorderStyle: TspSkinBorderStyle
- read FBorderStyle write SetBorderStyle;
- property CaptionMode: Boolean read FCaptionMode write SetCaptionMode;
- property RollUpMode: Boolean read FRollUpMode write SetRollUpMode;
- property RollUpState: Boolean read FRollUpState write SetRollUpState;
- property Caption;
- property Align;
- property DockSite;
- property DragCursor;
- property DragKind;
- property DragMode;
- property Enabled;
- property ParentShowHint;
- property PopupMenu;
- property ShowHint;
- property TabOrder;
- property TabStop;
- property Visible;
- property OnChecked: TNotifyEvent read FOnChecked write FOnChecked;
- property OnCanResize;
- property OnClick;
- property OnConstrainedResize;
- property OnDockDrop;
- property OnDockOver;
- property OnDblClick;
- property OnDragDrop;
- property OnDragOver;
- property OnEndDock;
- property OnEndDrag;
- property OnEnter;
- property OnExit;
- property OnGetSiteInfo;
- property OnMouseDown;
- property OnMouseMove;
- property OnMouseUp;
- property OnResize;
- property OnStartDock;
- property OnStartDrag;
- property OnUnDock;
- end;
- TspExPanelRollKind = (rkRollHorizontal, rkRollVertical);
- TspSkinExPanel = class(TspSkinCustomControl)
- private
- FOnChangeRollState: TNotifyEvent;
- FOnClose: TNotifyEvent;
- StopCheckSize: Boolean;
- FRollState: Boolean;
- FRollKind: TspExPanelRollKind;
- FDefaultCaptionHeight: Integer;
- VisibleControls: TList;
- FRealWidth, FRealHEight: Integer;
- FShowRollButton: Boolean;
- FShowCloseButton: Boolean;
- function GetRollWidth: Integer;
- function GetRollHeight: Integer;
- procedure SetShowRollButton(Value: Boolean);
- procedure SetShowCloseButton(Value: Boolean);
- protected
- Buttons: array[0..1] of TspControlButton;
- OldActiveButton, ActiveButton, CaptureButton: Integer;
- procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
- procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER;
- procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
- X, Y: Integer); override;
- procedure MouseUp(Button: TMouseButton; Shift: TShiftState;
- X, Y: Integer); override;
- procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
- procedure CreateControlDefaultImage(B: TBitMap); override;
- procedure CreateControlSkinImage(B: TBitMap); override;
- procedure SetDefaultCaptionHeight(Value: Integer);
- procedure AdjustClientRect(var Rect: TRect); override;
- procedure HideControls;
- procedure ShowControls;
- procedure SetRollState(Value: Boolean);
- procedure SetRollKind(Value: TspExPanelRollKind);
- //
- procedure ButtonDown(I: Integer; X, Y: Integer);
- procedure ButtonUp(I: Integer; X, Y: Integer);
- procedure ButtonEnter(I: Integer);
- procedure ButtonLeave(I: Integer);
- procedure DrawButton(Cnvs: TCanvas; i: Integer);
- procedure TestActive(X, Y: Integer);
- procedure CMTextChanged(var Message: TMessage); message CM_TEXTCHANGED;
- procedure GetSkinData; override;
- public
- //
- RollHSkinRect, RollVSkinRect: TRect;
- RollLeftOffset, RollRightOffset,
- RollTopOffset, RollBottomOffset: Integer;
- RollVCaptionRect, RollHCaptionRect: TRect;
- CloseButtonRect, CloseButtonActiveRect, CloseButtonDownRect: TRect;
- HRollButtonRect, HRollButtonActiveRect, HRollButtonDownRect: TRect;
- HRestoreButtonRect, HRestoreButtonActiveRect, HRestoreButtonDownRect: TRect;
- VRollButtonRect, VRollButtonActiveRect, VRollButtonDownRect: TRect;
- VRestoreButtonRect, VRestoreButtonActiveRect, VRestoreButtonDownRect: TRect;
- CaptionRect: TRect;
- FontName: String;
- FontStyle: TFontStyles;
- FontHeight: Integer;
- FontColor: TColor;
- //
- constructor Create(AOwner: TComponent); override;
- procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override;
- procedure ChangeSkinData; override;
- procedure Close;
- property RealWidth: Integer read FRealWidth;
- property RealHeight: Integer read FRealHeight;
- published
- property ShowRollButton: Boolean
- read FShowRollButton write SetShowRollButton;
- property ShowCloseButton: Boolean
- read FShowCloseButton write SetShowCloseButton;
- property DefaultCaptionHeight: Integer
- read FDefaultCaptionHeight write SetDefaultCaptionHeight;
- property RollState: Boolean read FRollState write SetRollState;
- property RollKind: TspExPanelRollKind read FRollKind write SetRollKind;
- property Align;
- property Caption;
- property DockSite;
- property DragCursor;
- property DragKind;
- property DragMode;
- property Enabled;
- property ParentShowHint;
- property PopupMenu;
- property ShowHint;
- property TabOrder;
- property TabStop;
- property Visible;
- property OnCanResize;
- property OnClick;
- property OnConstrainedResize;
- property OnDockDrop;
- property OnDockOver;
- property OnDblClick;
- property OnDragDrop;
- property OnDragOver;
- property OnEndDock;
- property OnEndDrag;
- property OnEnter;
- property OnExit;
- property OnGetSiteInfo;
- property OnMouseDown;
- property OnMouseMove;
- property OnMouseUp;
- property OnResize;
- property OnStartDock;
- property OnStartDrag;
- property OnUnDock;
- property OnChangeRollState: TNotifyEvent
- read FOnChangeRollState write FOnChangeRollState;
- property OnClose: TNotifyEvent read FOnClose write FOnClose;
- end;
- TspSkinGroupBox = class(TspSkinPanel)
- public
- constructor Create(AOwner: TComponent); override;
- end;
- TspNumGlyphs = 1..4;
- TspButtonLayout = (blGlyphLeft, blGlyphRight, blGlyphTop, blGlyphBottom);
- TspSkinButton = class(TspSkinCustomControl)
- protected
- RepeatTimer: TTimer;
- FRepeatMode: Boolean;
- FRepeatInterval: Integer;
- FActive: Boolean;
- FAllowAllUp: Boolean;
- FAllowAllUpCheck: Boolean;
- FDefault: Boolean;
- FCancel: Boolean;
- FModalResult: TModalResult;
- FClicksDisabled: Boolean;
- FCanFocused: Boolean;
- FMorphKf: Double;
- FDown: Boolean;
- FMouseIn, FMouseDown: Boolean;
- FGroupIndex: Integer;
- FGlyph: TBitMap;
- FNumGlyphs: TspNumGlyphs;
- FOnClick: TNotifyEvent;
- FMargin: Integer;
- FSpacing: Integer;
- FLayout: TspButtonLayout;
- MorphTimer: TTimer;
- procedure RepeatTimerProc(Sender: TObject);
- procedure StartRepeat;
- procedure StopRepeat;
- procedure StartMorph;
- procedure StopMorph;
- procedure SetDefault(Value: Boolean);
- function IsFocused: Boolean;
- procedure SetCanFocused(Value: Boolean);
- procedure DoMorph(Sender: TObject);
- procedure CreateButtonImage(B: TBitMap; R: TRect;
- ADown, AMouseIn: Boolean); virtual;
- procedure SetLayout(Value : TspButtonLayout);
- procedure SetGroupIndex(Value: Integer);
- procedure SetDown(Value: Boolean);
- procedure SetMargin(Value: Integer);
- procedure SetSpacing(Value: Integer);
- procedure DoAllUp;
- procedure SetNumGlyphs(Value: TspNumGlyphs);
- procedure SetGlyph(Value: TBitMap);
- procedure GetSkinData; override;
- procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
- procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER;
- procedure CMTextChanged(var Message: TMessage); message CM_TEXTCHANGED;
- procedure CMFocusChanged(var Message: TCMFocusChanged); message CM_FOCUSCHANGED;
- procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
- X, Y: Integer); override;
- procedure MouseUp(Button: TMouseButton; Shift: TShiftState;
- X, Y: Integer); override;
- procedure ReDrawControl;
- procedure CreateControlDefaultImage(B: TBitMap); override;
- procedure CreateControlSkinImage(B: TBitMap); override;
- procedure ActionChange(Sender: TObject; CheckDefaults: Boolean); override;
- procedure WMSETFOCUS(var Message: TWMSETFOCUS); message WM_SETFOCUS;
- procedure WMKILLFOCUS(var Message: TWMKILLFOCUS); message WM_KILLFOCUS;
- procedure WndProc(var Message: TMessage); override;
- procedure CMEnabledChanged(var Message: TMessage); message CM_ENABLEDCHANGED;
- procedure CMDialogChar(var Message: TCMDialogChar); message CM_DIALOGCHAR;
- procedure CMDialogKey(var Message: TCMDialogKey); message CM_DIALOGKEY;
- procedure ButtonClick; virtual;
- procedure CreateWnd; override;
- public
- FontName: String;
- FontStyle: TFontStyles;
- FontHeight: Integer;
- FontColor, ActiveFontColor, DownFontColor, DisabledFontColor: TColor;
- ActiveSkinRect, DownSkinRect, DisabledSkinRect: TRect;
- Morphing: Boolean;
- MorphKind: TMorphKind;
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- procedure ChangeSkinData; override;
- procedure Paint; override;
- published
- property RepeatMode: Boolean read FRepeatMode write FRepeatMode;
- property RepeatInterval: Integer
- read FRepeatInterval write FRepeatInterval;
- property AllowAllUp: Boolean read FAllowAllUp write FAllowAllUp;
- property PopupMenu;
- property ShowHint;
- property TabStop;
- property TabOrder;
- property CanFocused: Boolean read FCanFocused write SetCanFocused;
- property Action;
- property Down: Boolean read FDown write SetDown;
- property GroupIndex: Integer read FGroupIndex write SetGroupIndex;
- property Caption;
- property Glyph: TBitMap read FGlyph write SetGlyph;
- property NumGlyhps: TspNumGlyphs read FNumGlyphs write SetNumGlyphs;
- property Align;
- property Margin: Integer read FMargin write SetMargin default -1;
- property Spacing: Integer read FSpacing write SetSpacing default 4;
- property Layout: TspButtonLayout read FLayout write SetLayout default blGlyphLeft;
- property Enabled;
- property Cancel: Boolean read FCancel write FCancel default False;
- property Default: Boolean read FDefault write SetDefault default False;
- property ModalResult: TModalResult read FModalResult write FModalResult default 0;
- property OnClick: TNotifyEvent read FOnClick write FOnClick;
- property OnMouseDown;
- property OnMouseMove;
- property OnMouseUp;
- property OnResize;
- property OnKeyDown;
- property OnKeyPress;
- property OnKeyUp;
- end;
- TspSkinMenuButton = class(TspSkinButton)
- protected
- FOnShowTrackMenu: TNotifyEvent;
- FOnHideTrackMenu: TNotifyEvent;
- FTrackButtonMode: Boolean;
- FMenuTracked: Boolean;
- FSkinPopupMenu: TspSkinPopupMenu;
- procedure CreateButtonImage(B: TBitMap; R: TRect;
- ADown, AMouseIn: Boolean); override;
- function CanMenuTrack(X, Y: Integer): Boolean;
- procedure TrackMenu;
- procedure SetTrackButtonMode(Value: Boolean);
- procedure GetSkinData; override;
- procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
- X, Y: Integer); override;
- procedure MouseUp(Button: TMouseButton; Shift: TShiftState;
- X, Y: Integer); override;
- procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
- procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER;
- procedure Notification(AComponent: TComponent;
- Operation: TOperation); override;
- procedure WMCLOSESKINMENU(var Message: TMessage); message WM_CLOSESKINMENU;
- function GetNewTrackButtonRect: TRect;
- procedure WndProc(var Message: TMessage); override;
- procedure CMDialogChar(var Message: TCMDialogChar); message CM_DIALOGCHAR;
- procedure CreateControlDefaultImage(B: TBitMap); override;
- public
- TrackButtonRect: TRect;
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- published
- property SkinPopupMenu: TspSkinPopupMenu read FSkinPopupMenu
- write FSkinPopupMenu;
- property TrackButtonMode: Boolean read FTrackButtonMode
- write SetTrackButtonMode;
- property OnShowTrackMenu: TNotifyEvent read FOnShowTrackMenu
- write FOnShowTrackMenu;
- property OnHideTrackMenu: TNotifyEvent read FOnHideTrackMenu
- write FOnHideTrackMenu;
- end;
- TspSkinCheckRadioBox = class(TspSkinCustomControl)
- protected
- FFlat: Boolean;
- FClicksDisabled: Boolean;
- FCanFocused: Boolean;
- FMouseIn: Boolean;
- FGroupIndex: Integer;
- FOnClick: TNotifyEvent;
- FChecked: Boolean;
- CIRect, NewTextArea: TRect;
- FRadio: Boolean;
- MorphTimer: TTimer;
- FMorphKf: Double;
- procedure StartMorph;
- procedure StopMorph;
- function IsFocused: Boolean;
- procedure SetCheckState;
- procedure SetFlat(Value: Boolean);
- procedure SetCanFocused(Value: Boolean);
- procedure SetRadio(Value: Boolean);
- procedure SetChecked(Value: Boolean);
- procedure DoMorph(Sender: TObject);
- procedure CreateImage(B: TBitMap; R: TRect; AMouseIn: Boolean);
- procedure UnCheckAll;
- procedure GetSkinData; override;
- procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
- procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER;
- procedure CMTextChanged(var Message: TMessage); message CM_TEXTCHANGED;
- procedure MouseUp(Button: TMouseButton; Shift: TShiftState;
- X, Y: Integer); override;
- procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
- X, Y: Integer); override;
- procedure ReDrawControl;
- procedure CalcSize(var W, H: Integer); override;
- procedure ActionChange(Sender: TObject; CheckDefaults: Boolean); override;
- procedure WMSETFOCUS(var Message: TWMSETFOCUS); message WM_SETFOCUS;
- procedure WMMOVE(var Message: TWMSETFOCUS); message WM_MOVE;
- procedure WMKILLFOCUS(var Message: TWMKILLFOCUS); message WM_KILLFOCUS;
- procedure WndProc(var Message: TMessage); override;
- procedure CMDialogChar(var Message: TCMDialogChar); message CM_DIALOGCHAR;
- procedure CreateControlDefaultImage(B: TBitMap); override;
- procedure SkinDrawCheckImage(X, Y: Integer; Cnvs: TCanvas; IR: TRect; DestCnvs: TCanvas);
- public
- FontName: String;
- FontStyle: TFontStyles;
- FontHeight: Integer;
- FontColor, ActiveFontColor, FrameFontColor, UnEnabledFontColor: TColor;
- ActiveSkinRect, CheckImageArea, TextArea,
- CheckImageRect, UnCheckImageRect: TRect;
- ActiveCheckImageRect, ActiveUnCheckImageRect: TRect;
- UnEnabledCheckImageRect, UnEnabledUnCheckImageRect: TRect;
- Morphing: Boolean;
- MorphKind: TMorphKind;
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- procedure ChangeSkinData; override;
- procedure Paint; override;
- published
- property PopupMenu;
- property ShowHint;
- property TabStop;
- property TabOrder;
- property CanFocused: Boolean read FCanFocused write SetCanFocused;
- property Action;
- property Radio: Boolean read FRadio write SetRadio;
- property Checked: Boolean read FChecked write SetChecked;
- property GroupIndex: Integer read FGroupIndex write FGroupIndex;
- property Flat: Boolean read FFlat write SetFlat;
- property Caption;
- property OnClick: TNotifyEvent read FOnClick write FOnClick;
- property Align;
- property Enabled;
- property OnMouseDown;
- property OnMouseMove;
- property OnMouseUp;
- property OnResize;
- property OnKeyDown;
- property OnKeyPress;
- property OnKeyUp;
- end;
- TspSkinGauge = class(TspSkinCustomControl)
- protected
- FMinValue, FMaxValue, FValue: Integer;
- FVertical: Boolean;
- FProgressText: String;
- FShowPercent: Boolean;
- FShowProgressText: Boolean;
- FTextAlphaBlend: Boolean;
- FTextAlphaBlendValue: Byte;
- procedure SetTextAlphaBlendValue(Value: Byte);
- procedure SetTextAlphaBlend(Value: Boolean);
- procedure SetShowProgressText(Value: Boolean);
- procedure SetShowPercent(Value: Boolean);
- procedure SetProgressText(Value: String);
- procedure SetVertical(AValue: Boolean);
- procedure SetMinValue(AValue: Integer);
- procedure SetMaxValue(AValue: Integer);
- procedure SetValue(AValue: Integer);
- procedure GetSkinData; override;
- procedure CreateImage(B: TBitMap);
- procedure CalcSize(var W, H: Integer); override;
- procedure DrawProgressText(C: TCanvas);
- procedure CreateControlDefaultImage(B: TBitMap); override;
- procedure CreateControlSkinImage(B: TBitMap); override;
- public
- ProgressRect, ProgressArea: TRect;
- NewProgressArea: TRect;
- BeginOffset, EndOffset: Integer;
- FontName: String;
- FontStyle: TFontStyles;
- FontHeight: Integer;
- FontColor: TColor;
- constructor Create(AOwner: TComponent); override;
- function CalcProgressRect(R: TRect; AV: Boolean): TRect;
- published
- property TextAlphaBlend: Boolean read FTextAlphaBlend
- write SetTextAlphaBlend;
- property TextAlphaBlendValue: Byte read FTextAlphaBlendValue
- write SetTextAlphaBlendValue;
- property ProgressText: String read FProgressText write SetProgressText;
- property ShowProgressText: Boolean read FShowProgressText write SetShowProgressText;
- property ShowPercent: Boolean read FShowPercent write SetShowPercent;
- property MinValue: Integer read FMinValue write SetMinValue;
- property MaxValue: Integer read FMaxValue write SetMaxValue;
- property Value: Integer read FValue write SetValue;
- property Vertical: Boolean
- read FVertical write SetVertical;
- property Align;
- property Enabled;
- property OnMouseDown;
- property OnMouseMove;
- property OnMouseUp;
- property OnResize;
- property PopupMenu;
- property ShowHint;
- end;
- TspSkinButtonLabel = class(TGraphicControl)
- protected
- FMouseIn, FDown: Boolean;
- FIndex: Integer;
- FSD: TspSkinData;
- FSkinDataName: String;
- FDefaultFont: TFont;
- FUseSkinFont: Boolean;
- FDefaultActiveFontColor: TColor;
- FGlyph: TBitMap;
- FNumGlyphs: TspNumGlyphs;
- FMargin: Integer;
- FSpacing: Integer;
- FLayout: TspButtonLayout;
- procedure Notification(AComponent: TComponent;
- Operation: TOperation); override;
- procedure SetSkinData(Value: TspSkinData);
- procedure SetDefaultFont(Value: TFont);
- procedure SetLayout(Value : TspButtonLayout);
- procedure SetMargin(Value: Integer);
- procedure SetSpacing(Value: Integer);
- procedure SetNumGlyphs(Value: TspNumGlyphs);
- procedure SetGlyph(Value: TBitMap);
- procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
- procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER;
- procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
- X, Y: Integer); override;
- procedure MouseUp(Button: TMouseButton; Shift: TShiftState;
- X, Y: Integer); override;
- public
- FontColor: TColor;
- ActiveFontColor: TColor;
- FontName: String;
- FontHeight: Integer;
- FontStyle: TFontStyles;
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- procedure ChangeSkinData;
- procedure Paint; override;
- published
- property Glyph: TBitMap read FGlyph write SetGlyph;
- property NumGlyphs: TspNumGlyphs read FNumGlyphs write SetNumGlyphs;
- property Margin: Integer read FMargin write SetMargin default -1;
- property Spacing: Integer read FSpacing write SetSpacing default 4;
- property Layout: TspButtonLayout read FLayout write SetLayout default blGlyphLeft;
- property UseSkinFont: Boolean read FUseSkinFont write FUseSkinFont;
- property DefaultActiveFontColor: TColor
- read FDefaultActiveFontColor write FDefaultActiveFontColor;
- property DefaultFont: TFont read FDefaultFont write SetDefaultFont;
- property SkinData: TspSkinData read FSD write SetSkinData;
- property SkinDataName: String read FSkinDataName write FSkinDataName;
- property Align;
- property Anchors;
- property AutoSize;
- property BiDiMode;
- property Caption;
- property Constraints;
- property DragCursor;
- property DragKind;
- property DragMode;
- property Enabled;
- property ParentBiDiMode;
- property ParentColor;
- property ParentFont;
- property ParentShowHint;
- property PopupMenu;
- property ShowHint;
- property Visible;
- property OnClick;
- property OnDblClick;
- property OnDragDrop;
- property OnDragOver;
- property OnEndDock;
- property OnEndDrag;
- property OnMouseDown;
- property OnMouseMove;
- property OnMouseUp;
- property OnStartDock;
- property OnStartDrag;
- end;
- TspSkinLinkImage = class(TImage)
- private
- FURL: String;
- protected
- procedure Click; override;
- public
- constructor Create(AOwner : TComponent); override;
- published
- property URL: string read FURL write FURL;
- end;
- TspSkinLinkLabel = class(TCustomLabel)
- protected
- FMouseIn: Boolean;
- FIndex: Integer;
- FSD: TspSkinData;
- FSkinDataName: String;
- FDefaultFont: TFont;
- FUseSkinFont: Boolean;
- FDefaultActiveFontColor: TColor;
- FURL: String;
- procedure Notification(AComponent: TComponent;
- Operation: TOperation); override;
- procedure SetSkinData(Value: TspSkinData);
- procedure SetDefaultFont(Value: TFont);
- property Transparent;
- procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
- procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER;
- procedure GetSkinData;
- procedure DoDrawText(var Rect: TRect; Flags: Longint); override;
- public
- FontName: String;
- FontStyle: TFontStyles;
- FontHeight: Integer;
- FontColor, ActiveFontColor: TColor;
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- procedure ChangeSkinData;
- procedure Click; override;
- published
- property UseSkinFont: Boolean read FUseSkinFont write FUseSkinFont;
- property DefaultActiveFontColor: TColor
- read FDefaultActiveFontColor write FDefaultActiveFontColor;
- property URL: String read FURL write FURL;
- property DefaultFont: TFont read FDefaultFont write SetDefaultFont;
- property SkinData: TspSkinData read FSD write SetSkinData;
- property SkinDataName: String read FSkinDataName write FSkinDataName;
- property Font;
- property Align;
- property Alignment;
- property Anchors;
- property AutoSize;
- property BiDiMode;
- property Caption;
- property Color;
- property Constraints;
- property DragCursor;
- property DragKind;
- property DragMode;
- property Enabled;
- property FocusControl;
- property ParentBiDiMode;
- property ParentColor;
- property ParentFont;
- property ParentShowHint;
- property PopupMenu;
- property ShowAccelChar;
- property ShowHint;
- property Layout;
- property Visible;
- property WordWrap;
- property OnClick;
- property OnDblClick;
- property OnDragDrop;
- property OnDragOver;
- property OnEndDock;
- property OnEndDrag;
- property OnMouseDown;
- property OnMouseMove;
- property OnMouseUp;
- property OnStartDock;
- property OnStartDrag;
- end;
- TspSkinTextLabel = class(TGraphicControl)
- private
- FIndex: Integer;
- FSD: TspSkinData;
- FSkinDataName: String;
- FDefaultFont: TFont;
- FUseSkinFont: Boolean;
- //
- FLines: TStrings;
- FAlignment: TAlignment;
- FAutoSize: Boolean;
- FLayout: TTextLayout;
- FWordWrap: Boolean;
- procedure SetSkinData(Value: TspSkinData);
- procedure SetDefaultFont(Value: TFont);
- procedure SetLines(Value: TStrings);
- procedure SetAlignment(Value: TAlignment);
- procedure SetLayout(Value: TTextLayout);
- procedure SetWordWrap(Value: Boolean);
- procedure CMFontChanged(var Message: TMessage); message CM_FONTCHANGED;
- protected
- procedure AdjustBounds; dynamic;
- function GetLabelText: string; virtual;
- procedure Loaded; override;
- procedure Notification(AComponent: TComponent;
- Operation: TOperation); override;
- procedure SetAutoSize(Value: Boolean); virtual;
- procedure DoDrawText(var Rect: TRect; Flags: Longint);
- public
- FontName: String;
- FontStyle: TFontStyles;
- FontHeight: Integer;
- FontColor: TColor;
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- property Canvas;
- procedure ChangeSkinData;
- procedure GetSkinData;
- procedure Paint; override;
- published
- property UseSkinFont: Boolean read FUseSkinFont write FUseSkinFont;
- property Lines: TStrings read FLines write SetLines;
- property DefaultFont: TFont read FDefaultFont write SetDefaultFont;
- property SkinData: TspSkinData read FSD write SetSkinData;
- property SkinDataName: String read FSkinDataName write FSkinDataName;
- property Font;
- property Align;
- property Alignment: TAlignment read FAlignment write SetAlignment
- default taLeftJustify;
- property AutoSize: Boolean read FAutoSize write SetAutoSize default True;
- property Layout: TTextLayout read FLayout write SetLayout default tlTop;
- property WordWrap: Boolean read FWordWrap write SetWordWrap default False;
- property Anchors;
- property BiDiMode;
- property Constraints;
- property DragCursor;
- property DragKind;
- property DragMode;
- property Enabled;
- property ParentBiDiMode;
- property ParentColor;
- property ParentFont;
- property ParentShowHint;
- property PopupMenu;
- property ShowHint;
- property Visible;
- property OnClick;
- property OnDblClick;
- property OnDragDrop;
- property OnDragOver;
- property OnEndDock;
- property OnEndDrag;
- property OnMouseDown;
- property OnMouseMove;
- property OnMouseUp;
- property OnStartDock;
- property OnStartDrag;
- end;
- TspSkinStdLabel = class(TCustomLabel)
- protected
- FIndex: Integer;
- FSD: TspSkinData;
- FSkinDataName: String;
- FDefaultFont: TFont;
- FUseSkinFont: Boolean;
- procedure Notification(AComponent: TComponent;
- Operation: TOperation); override;
- procedure SetSkinData(Value: TspSkinData);
- procedure SetDefaultFont(Value: TFont);
- property Transparent;
- procedure DoDrawText(var Rect: TRect; Flags: Longint); override;
- public
- FontName: String;
- FontStyle: TFontStyles;
- FontHeight: Integer;
- FontColor: TColor;
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- procedure GetSkinData;
- procedure ChangeSkinData;
- published
- property UseSkinFont: Boolean read FUseSkinFont write FUseSkinFont;
- property DefaultFont: TFont read FDefaultFont write SetDefaultFont;
- property SkinData: TspSkinData read FSD write SetSkinData;
- property SkinDataName: String read FSkinDataName write FSkinDataName;
- property Font;
- property Align;
- property Alignment;
- property Anchors;
- property AutoSize;
- property BiDiMode;
- property Caption;
- property Color;
- property Constraints;
- property DragCursor;
- property DragKind;
- property DragMode;
- property Enabled;
- property FocusControl;
- property ParentBiDiMode;
- property ParentColor;
- property ParentFont;
- property ParentShowHint;
- property PopupMenu;
- property ShowAccelChar;
- property ShowHint;
- property Layout;
- property Visible;
- property WordWrap;
- property OnClick;
- property OnDblClick;
- property OnDragDrop;
- property OnDragOver;
- property OnEndDock;
- property OnEndDrag;
- property OnMouseDown;
- property OnMouseMove;
- property OnMouseUp;
- property OnStartDock;
- property OnStartDrag;
- end;
- TspSkinLabel = class(TspSkinCustomControl)
- protected
- FAlignment: TAlignment;
- FAutoSize: Boolean;
- FBorderStyle: TspSkinBorderStyle;
- procedure SetBorderStyle(Value: TspSkinBorderStyle);
- procedure DrawLabelText(Cnvs: TCanvas; R: TRect);
- function CalcWidthOffset: Integer;
- procedure AdjustBounds;
- procedure PaintLabel(B: TBitMap);
- procedure SetAutoSizeX(Value: Boolean);
- procedure SetAlignment(Value: TAlignment);
- procedure CMTextChanged(var Message: TMessage); message CM_TEXTCHANGED;
- procedure CalcSize(var W, H: Integer); override;
- procedure GetSkinData; override;
- procedure CreateControlDefaultImage(B: TBitMap); override;
- procedure CreateControlSkinImage(B: TBitMap); override;
- public
- FontName: String;
- FontStyle: TFontStyles;
- FontHeight: Integer;
- FontColor: TColor;
- constructor Create(AOwner: TComponent); override;
- published
- property BorderStyle: TspSkinBorderStyle
- read FBorderStyle write SetBorderStyle;
- property Alignment: TAlignment read FAlignment write SetAlignment
- default taLeftJustify;
- property AutoSize: Boolean read FAutoSize write SetAutoSizeX;
- property Align;
- property Caption;
- property DragCursor;
- property DragKind;
- property DragMode;
- property Enabled;
- property PopupMenu;
- property ShowHint;
- property Visible;
- property OnClick;
- property OnDblClick;
- property OnDragDrop;
- property OnDragOver;
- property OnEndDock;
- property OnEndDrag;
- property OnMouseDown;
- property OnMouseMove;
- property OnMouseUp;
- property OnStartDock;
- property OnStartDrag;
- end;
- TspSkinBitLabel = class(TspSkinCustomControl)
- protected
- FAutoSize: Boolean;
- FFixLength: Integer;
- function GetFixWidth: Integer;
- procedure SetFixLength(Value: Integer);
- procedure AdjustBounds;
- procedure GetSkinData; override;
- procedure PaintLabel(B: TBitMap);
- procedure CalcSize(var W, H: Integer); override;
- procedure CMTextChanged(var Message: TMessage); message CM_TEXTCHANGED;
- procedure CreateControlDefaultImage(B: TBitMap); override;
- procedure CreateControlSkinImage(B: TBitMap); override;
- public
- SkinTextRect: TRect;
- SymbolWidth: Integer;
- SymbolHeight: Integer;
- Symbols: TStrings;
- procedure SetAutoSizeX(Value: Boolean);
- constructor Create(AOwner: TComponent); override;
- published
- property Caption;
- property AutoSize: Boolean read FAutoSize write SetAutoSizeX;
- property FixLength: Integer read FFixLength write SetFixLength;
- property OnMouseDown;
- property OnMouseMove;
- property OnMouseUp;
- end;
-
- TspSkinTrackBar = class(TspSkinCustomControl)
- protected
- FClicksDisabled: Boolean;
- FCanFocused: Boolean;
- Offset1, Offset2, BOffset: Integer;
- BR: TRect;
- FMinValue, FMaxValue, FValue: Integer;
- FVertical: Boolean;
- FMouseSupport, FDown: Boolean;
- OMPos: Integer;
- OldBOffset: Integer;
- FOnChange: TNotifyEvent;
- function IsFocused: Boolean;
- procedure SetCanFocused(Value: Boolean);
- procedure SetVertical(AValue: Boolean);
- procedure SetMinValue(AValue: Integer);
- procedure SetMaxValue(AValue: Integer);
- procedure SetValue(AValue: Integer);
- procedure GetSkinData; override;
- procedure CreateImage(B: TBitMap);
- procedure CalcSize(var W, H: Integer); override;
- function CalcButtonRect(R: TRect; AV: Boolean): TRect;
- function CalcValue(AOffset: Integer): Integer;
- procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
- X, Y: Integer); override;
- procedure MouseUp(Button: TMouseButton; Shift: TShiftState;
- X, Y: Integer); override;
- procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
- procedure WMMOUSEWHEEL(var Message: TMessage); message WM_MOUSEWHEEL;
- procedure WMSETFOCUS(var Message: TWMSETFOCUS); message WM_SETFOCUS;
- procedure WMKILLFOCUS(var Message: TWMKILLFOCUS); message WM_KILLFOCUS;
- procedure WndProc(var Message: TMessage); override;
- procedure CMWantSpecialKey(var Msg: TCMWantSpecialKey); message CM_WANTSPECIALKEY;
- procedure KeyDown(var Key: Word; Shift: TShiftState); override;
- procedure CreateControlDefaultImage(B: TBitMap); override;
- procedure CreateControlSkinImage(B: TBitMap); override;
- public
- TrackArea, NewTrackArea, ButtonRect, ActiveButtonRect: TRect;
- constructor Create(AOwner: TComponent); override;
- published
- property PopupMenu;
- property ShowHint;
- property TabStop;
- property TabOrder;
- property CanFocused: Boolean read FCanFocused write SetCanFocused;
- property MouseSupport: Boolean read FMouseSupport write FMouseSupport;
- property MinValue: Integer read FMinValue write SetMinValue;
- property MaxValue: Integer read FMaxValue write SetMaxValue;
- property Value: Integer read FValue write SetValue;
- property Vertical: Boolean read FVertical write SetVertical;
- property OnChange: TNotifyEvent read FOnChange write FOnChange;
- property Align;
- property Enabled;
- property OnMouseDown;
- property OnMouseMove;
- property OnMouseUp;
- property OnResize;
- property OnKeyDown;
- property OnKeyPress;
- property OnKeyUp;
- end;
- TspSkinScrollBar = class(TspSkinCustomControl)
- private
- FNormalSkinDataName: String;
- FBothSkinDataName: String;
- Offset1, Offset2, BOffset: Integer;
- NewTrackArea: TRect;
- FDown: Boolean;
- OMPos, OldPosition, FScrollWidth: Integer;
- OldBOffset: Integer;
- WaitMode: Boolean;
- MX, MY: Integer;
- MouseD: Boolean;
- FOnUpButtonClick: TNotifyEvent;
- FOnDownButtonClick: TNotifyEvent;
- protected
- FBothMarkerWidth: Integer;
- FClicksDisabled: Boolean;
- FCanFocused: Boolean;
- FOnChange: TNotifyEvent;
- FOnLastChange: TNotifyEvent;
- TimerMode: Integer;
- ActiveButton, OldActiveButton, CaptureButton: Integer;
- Buttons: array[0..2] of TspControlButton;
- FMin, FMax, FSmallChange,
- FLargeChange, FPosition: Integer;
- FKind: TScrollBarKind;
- FPageSize: Integer;
- procedure SetBothMarkerWidth(Value: Integer);
- function IsFocused: Boolean;
- procedure SetCanFocused(Value: Boolean);
- procedure TestActive(X, Y: Integer);
- procedure SetPageSize(AValue: Integer);
- procedure ButtonDown(I: Integer; X, Y: Integer);
- procedure ButtonUp(I: Integer; X, Y: Integer);
- procedure ButtonEnter(I: Integer);
- procedure ButtonLeave(I: Integer);
- procedure CalcRects;
- function CalcValue(AOffset: Integer): Integer;
- procedure SetKind(AValue: TScrollBarKind);
- procedure SetPosition(AValue: Integer);
- procedure SetMin(AValue: Integer);
- procedure SetMax(AValue: Integer);
- procedure SetSmallChange(AValue: Integer);
- procedure SetLargeChange(AValue: Integer);
- procedure SetBoth(Value: Boolean);
- procedure CalcSize(var W, H: Integer); override;
- procedure GetSkinData; override;
- procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
- X, Y: Integer); override;
- procedure MouseUp(Button: TMouseButton; Shift: TShiftState;
- X, Y: Integer); override;
- procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
- procedure WMTimer(var Message: TWMTimer); message WM_Timer;
- procedure StartScroll;
- procedure StopTimer;
- procedure DrawButton(Cnvs: TCanvas; i: Integer);
- procedure WMMOUSEWHEEL(var Message: TMessage); message WM_MOUSEWHEEL;
- procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
- procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER;
- procedure CMEnabledChanged(var Message: TMessage); message CM_ENABLEDCHANGED;
- procedure WMSETFOCUS(var Message: TWMSETFOCUS); message WM_SETFOCUS;
- procedure WMKILLFOCUS(var Message: TWMKILLFOCUS); message WM_KILLFOCUS;
- procedure WndProc(var Message: TMessage); override;
- procedure CMWantSpecialKey(var Msg: TCMWantSpecialKey); message CM_WANTSPECIALKEY;
- procedure KeyDown(var Key: Word; Shift: TShiftState); override;
- procedure CreateControlDefaultImage(B: TBitMap); override;
- procedure CreateControlSkinImage(B: TBitMap); override;
-
- public
- FBoth: Boolean;
- TrackArea: TRect;
- UpButtonRect, ActiveUpButtonRect, DownUpButtonRect: TRect;
- DownButtonRect, ActiveDownButtonRect, DownDownButtonRect: TRect;
- ThumbRect, ActiveThumbRect, DownThumbRect: TRect;
- ThumbOffset1, ThumbOffset2: Integer;
- GlyphRect, ActiveGlyphRect, DownGlyphRect: TRect;
- procedure SimplySetPosition(AValue: Integer);
- constructor Create(AOwner: TComponent); override;
- procedure SetRange(AMin, AMax, APosition, APageSize: Integer);
- published
- property Both: Boolean read FBoth write SetBoth;
- property BothMarkerWidth: Integer
- read FBothMarkerWidth write SetBothMarkerWidth;
- property BothSkinDataName: String
- read FBothSkinDataName write FBothSkinDataName;
- property TabStop;
- property TabOrder;
- property CanFocused: Boolean read FCanFocused write SetCanFocused;
- property Align;
- property Kind: TScrollBarKind read FKind write SetKind;
- property PageSize: Integer read FPageSize write SetPageSize;
- property Min: Integer read FMin write SetMin;
- property Max: Integer read FMax write SetMax;
- property Position: Integer read FPosition write SetPosition;
- property SmallChange: Integer read FSmallChange write SetSmallChange;
- property LargeChange: Integer read FLargeChange write SetLargeChange;
- property OnUpButtonClick: TNotifyEvent read FOnUpButtonClick write FOnUpButtonClick;
- property OnDownButtonClick: TNotifyEvent read FOnDownButtonClick write FOnDownButtonClick;
- property OnChange: TNotifyEvent read FOnChange write FOnChange;
- property OnLastChange: TNotifyEvent read FOnLastChange write FOnLastChange;
- property OnKeyDown;
- property OnKeyPress;
- property OnKeyUp;
- property OnMouseDown;
- property OnMouseMove;
- property OnMouseUp;
- property OnResize;
- end;
- TspSkinControlBar = class(TCustomControlBar)
- protected
- FSkinBevel: Boolean;
- FIndex: Integer;
- FSD: TspSkinData;
- FSkinDataName: String;
- procedure PaintNCSkin;
- procedure SetSkinBevel(Value: Boolean);
- procedure SetSkinData(Value: TspSkinData);
- procedure WMEraseBkgnd(var Message: TWMEraseBkgnd); message WM_ERASEBKGND;
- procedure CreateParams(var Params: TCreateParams); override;
- procedure WMNCCALCSIZE(var Message: TWMNCCalcSize); message WM_NCCALCSIZE;
- procedure WMSIZE(var Message: TWMSIZE); message WM_SIZE;
- procedure WMNCPAINT(var Message: TMessage); message WM_NCPAINT;
- procedure Notification(AComponent: TComponent;
- Operation: TOperation); override;
- procedure PaintControlFrame(Canvas: TCanvas; AControl: TControl;
- var ARect: TRect); override;
- public
- LTPt, RTPt, LBPt, RBPt: TPoint;
- SkinRect, ClRect, NewClRect, ItemRect: TRect;
- NewLTPoint, NewRTPoint, NewLBPoint, NewRBPoint: TPoint;
- FSkinPicture: TBitMap;
- BGPictureIndex: Integer;
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- procedure Paint; override;
- property Canvas;
- procedure GetSkinData;
- procedure ChangeSkinData;
- published
- property SkinDataName: String read FSkinDataName write FSkinDataName;
- property SkinData: TspSkinData read FSD write SetSkinData;
- property SkinBevel: Boolean read FSkinBevel write SetSkinBevel;
- property Align;
- property Anchors;
- property AutoDrag;
- property AutoSize;
- property BevelEdges;
- property BevelInner;
- property BevelOuter;
- property BevelKind;
- property BevelWidth;
- property BorderWidth;
- property Color;
- property Constraints;
- property DockSite;
- property DragCursor;
- property DragKind;
- property DragMode;
- property Enabled;
- property ParentColor;
- property ParentCtl3D;
- property ParentFont;
- property ParentShowHint;
- property Picture;
- property PopupMenu;
- property RowSize;
- property RowSnap;
- property ShowHint;
- property TabOrder;
- property TabStop;
- property Visible;
- property OnBandDrag;
- property OnBandInfo;
- property OnBandMove;
- property OnBandPaint;
- property OnCanResize;
- property OnClick;
- property OnConstrainedResize;
- property OnDockDrop;
- property OnDockOver;
- property OnDblClick;
- property OnDragDrop;
- property OnDragOver;
- property OnEndDock;
- property OnEndDrag;
- property OnEnter;
- property OnExit;
- property OnGetSiteInfo;
- property OnMouseDown;
- property OnMouseMove;
- property OnMouseUp;
- property OnPaint;
- property OnResize;
- property OnStartDock;
- property OnStartDrag;
- property OnUnDock;
- end;
- TspSkinSplitter = class(TSplitter)
- protected
- FDefaultSize: Integer;
- FIndex: Integer;
- FSD: TspSkinData;
- FSkinDataName: String;
- procedure SetSkinData(Value: TspSkinData);
- procedure Notification(AComponent: TComponent;
- Operation: TOperation); override;
-
- public
- LTPt, RTPt, LBPt: TPoint;
- SkinRect: TRect;
- FSkinPicture: TBitMap;
- procedure GetSkinData;
- procedure ChangeSkinData;
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- procedure Paint; override;
- published
- property DefaultSize: Integer read FDefaultSize write FDefaultSize;
- property SkinDataName: String read FSkinDataName write FSkinDataName;
- property SkinData: TspSkinData read FSD write SetSkinData;
- end;
- TspSkinCustomRadioGroup = class(TspSkinGroupBox)
- private
- FButtonSkinDataName: String;
- FButtons: TList;
- FItems: TStrings;
- FItemIndex: Integer;
- FColumns: Integer;
- FReading: Boolean;
- FUpdating: Boolean;
- procedure SetButtonSkinDataName(Value: String);
- procedure ArrangeButtons;
- procedure ButtonClick(Sender: TObject);
- procedure ItemsChange(Sender: TObject);
- procedure SetButtonCount(Value: Integer);
- procedure SetColumns(Value: Integer);
- procedure SetItemIndex(Value: Integer);
- procedure SetItems(Value: TStrings);
- procedure UpdateButtons;
- procedure CMEnabledChanged(var Message: TMessage); message CM_ENABLEDCHANGED;
- procedure CMFontChanged(var Message: TMessage); message CM_FONTCHANGED;
- procedure WMSize(var Message: TWMSize); message WM_SIZE;
- protected
- procedure SetSkinData(Value: TspSkinData); override;
- procedure Loaded; override;
- procedure ReadState(Reader: TReader); override;
- function CanModify: Boolean; virtual;
- procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override;
- property Columns: Integer read FColumns write SetColumns default 1;
- property ItemIndex: Integer read FItemIndex write SetItemIndex default -1;
- property Items: TStrings read FItems write SetItems;
- public
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- procedure ChangeSkinData; override;
- procedure FlipChildren(AllLevels: Boolean); override;
- property ButtonSkinDataName: String
- read FButtonSkinDataName write SetButtonSkinDataName;
- end;
- TspSkinCustomCheckGroup = class(TspSkinGroupBox)
- private
- FItemIndex: Integer;
- FButtonSkinDataName: String;
- FButtons: TList;
- FItems: TStrings;
- FColumns: Integer;
- FReading: Boolean;
- FUpdating: Boolean;
- FButtonDefaultFont: TFont;
- procedure SetButtonDefaultFont(Value: TFont);
- procedure SetButtonSkinDataName(Value: String);
- procedure ArrangeButtons;
- procedure ButtonClick(Sender: TObject);
- procedure ItemsChange(Sender: TObject);
- procedure SetButtonCount(Value: Integer);
- procedure SetColumns(Value: Integer);
- procedure SetItems(Value: TStrings);
- procedure CMEnabledChanged(var Message: TMessage); message CM_ENABLEDCHANGED;
- procedure CMFontChanged(var Message: TMessage); message CM_FONTCHANGED;
- procedure WMSize(var Message: TWMSize); message WM_SIZE;
- protected
- procedure UpdateButtons;
- procedure SetSkinData(Value: TspSkinData); override;
- procedure Loaded; override;
- procedure ReadState(Reader: TReader); override;
- function CanModify: Boolean; virtual;
- procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override;
- function GetCheckedStatus(Index: Integer): Boolean;
- procedure SetCheckedStatus(Index: Integer; Value: Boolean);
- property Columns: Integer read FColumns write SetColumns default 1;
- property Items: TStrings read FItems write SetItems;
- public
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- procedure ChangeSkinData; override;
- procedure FlipChildren(AllLevels: Boolean); override;
- property ButtonDefaultFont: TFont
- read FButtonDefaultFont write SetButtonDefaultFont;
- property ButtonSkinDataName: String
- read FButtonSkinDataName write SetButtonSkinDataName;
- property Checked[Index: Integer]: Boolean read GetCheckedStatus write SetCheckedStatus;
- property ItemIndex: Integer read FItemIndex;
- end;
- TspSkinCheckGroup = class(TspSkinCustomCheckGroup)
- published
- property ButtonSkinDataName;
- property ButtonDefaultFont;
- property Align;
- property Anchors;
- property BiDiMode;
- property Caption;
- property Color;
- property Columns;
- property Ctl3D;
- property DragCursor;
- property DragKind;
- property DragMode;
- property Enabled;
- property Font;
- property Items;
- property ItemIndex;
- property Constraints;
- property ParentBiDiMode;
- property ParentColor;
- property ParentCtl3D;
- property ParentFont;
- property ParentShowHint;
- property PopupMenu;
- property ShowHint;
- property TabOrder;
- property TabStop;
- property Visible;
- property OnClick;
- property OnContextPopup;
- property OnDragDrop;
- property OnDragOver;
- property OnEndDock;
- property OnEndDrag;
- property OnEnter;
- property OnExit;
- property OnStartDock;
- property OnStartDrag;
- end;
- TspSkinRadioGroup = class(TspSkinCustomRadioGroup)
- published
- property ButtonSkinDataName;
- property Align;
- property Anchors;
- property BiDiMode;
- property Caption;
- property Color;
- property Columns;
- property Ctl3D;
- property DragCursor;
- property DragKind;
- property DragMode;
- property Enabled;
- property Font;
- property ItemIndex;
- property Items;
- property Constraints;
- property ParentBiDiMode;
- property ParentColor;
- property ParentCtl3D;
- property ParentFont;
- property ParentShowHint;
- property PopupMenu;
- property ShowHint;
- property TabOrder;
- property TabStop;
- property Visible;
- property OnClick;
- {$IFDEF VER130}
- property OnContextPopup;
- {$ENDIF}
- {$IFDEF VER140}
- property OnContextPopup;
- {$ENDIF}
- {$IFDEF VER150}
- property OnContextPopup;
- {$ENDIF}
- property OnDragDrop;
- property OnDragOver;
- property OnEndDock;
- property OnEndDrag;
- property OnEnter;
- property OnExit;
- property OnStartDock;
- property OnStartDrag;
- end;
- TspSkinCustomTreeView = class(TCustomTreeView)
- protected
- FInCheckScrollBars: Boolean;
- FSD: TspSkinData;
- FSkinDataName: String;
- FIndex: Integer;
- FDefaultFont: TFont;
- FDefaultColor: TColor;
- FVScrollBar: TspSkinScrollBar;
- FHScrollBar: TspSkinScrollBar;
- procedure Notification(AComponent: TComponent;
- Operation: TOperation); override;
- procedure SetDefaultColor(Value: TColor);
- procedure SetDefaultFont(Value: TFont);
- procedure SetSkinData(Value: TspSkinData);
- procedure SetVScrollBar(Value: TspSkinScrollBar);
- procedure SetHScrollBar(Value: TspSkinScrollBar);
- procedure WMNCCALCSIZE(var Message: TWMNCCalcSize); message WM_NCCALCSIZE;
- procedure WMNCPAINT(var Message: TWMNCPAINT); message WM_NCPAINT;
- procedure WndProc(var Message: TMessage); override;
- procedure CMVisibleChanged(var Message: TMessage); message CM_VISIBLECHANGED;
- procedure OnVScrollBarChange(Sender: TObject);
- procedure OnHScrollBarChange(Sender: TObject);
- procedure CreateParams(var Params: TCreateParams); override;
- procedure Change(Node: TTreeNode); override;
- procedure Loaded; override;
- public
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- procedure ChangeSkinData;
- procedure UpDateScrollBars;
- property HScrollBar: TspSkinScrollBar read FHScrollBar
- write SetHScrollBar;
- property VScrollBar: TspSkinScrollBar read FVScrollBar
- write SetVScrollBar;
- property DefaultFont: TFont read FDefaultFont write SetDefaultFont;
- property SkinData: TspSkinData read FSD write SetSkinData;
- property SkinDataName: String read FSkinDataName write FSkinDataName;
- property DefaultColor: TColor read FDefaultColor write SetDefaultColor;
- end;
- TspSkinTreeView = class(TspSkinCustomTreeView)
- published
- property Items;
- property HScrollBar;
- property VScrollBar;
- property DefaultFont;
- property SkinData;
- property SkinDataName;
- property DefaultColor;
- property Align;
- property Anchors;
- property AutoExpand;
- property BiDiMode;
- property ChangeDelay;
- property Color;
- property Constraints;
- property DragKind;
- property DragCursor;
- property DragMode;
- property Enabled;
- property Font;
- property HideSelection;
- property HotTrack;
- property Images;
- property Indent;
- {$IFDEF VER140}
- property MultiSelect;
- property MultiSelectStyle;
- {$ENDIF}
- {$IFDEF VER150}
- property MultiSelect;
- property MultiSelectStyle;
- {$ENDIF}
- property ParentBiDiMode;
- property ParentColor default False;
- property ParentCtl3D;
- property ParentFont;
- property ParentShowHint;
- property PopupMenu;
- property ReadOnly;
- property RightClickSelect;
- property RowSelect;
- property ShowButtons;
- property ShowHint;
- property ShowLines;
- property ShowRoot;
- property SortType;
- property StateImages;
- property TabOrder;
- property TabStop default True;
- property ToolTips;
- property Visible;
- {$IFDEF VER140}
- property OnAddition;
- {$ENDIF}
- {$IFDEF VER150}
- property OnAddition;
- {$ENDIF}
- property OnAdvancedCustomDraw;
- property OnAdvancedCustomDrawItem;
- property OnChange;
- property OnChanging;
- property OnClick;
- property OnCollapsed;
- property OnCollapsing;
- property OnCompare;
- property OnContextPopup;
- {$IFDEF VER140}
- property OnCreateNodeClass;
- {$ENDIF}
- {$IFDEF VER150}
- property OnCreateNodeClass;
- {$ENDIF}
- property OnCustomDraw;
- property OnCustomDrawItem;
- property OnDblClick;
- property OnDeletion;
- property OnDragDrop;
- property OnDragOver;
- property OnEdited;
- property OnEditing;
- property OnEndDock;
- property OnEndDrag;
- property OnEnter;
- property OnExit;
- property OnExpanding;
- property OnExpanded;
- property OnGetImageIndex;
- property OnGetSelectedIndex;
- property OnKeyDown;
- property OnKeyPress;
- property OnKeyUp;
- property OnMouseDown;
- property OnMouseMove;
- property OnMouseUp;
- property OnStartDock;
- property OnStartDrag;
- end;
- TspSkinCustomListView = class(TCustomListView)
- protected
- FHeaderSkinDataName: String;
- FInCheckScrollBars: Boolean;
- FromSB: Boolean;
- FSD: TspSkinData;
- FSkinDataName: String;
- FIndex: Integer;
- FDefaultFont: TFont;
- FDefaultColor: TColor;
- //
- FVScrollBar: TspSkinScrollBar;
- FHScrollBar: TspSkinScrollBar;
- FOldVScrollBarPos: Integer;
- FOldHScrollBarPos: Integer;
- //
- FHeaderHandle: HWND;
- FHeaderInstance: Pointer;
- FDefHeaderProc: Pointer;
- FActiveSection: Integer;
- FHeaderDown: Boolean;
- FHeaderInDivider: Boolean;
- //
- FHIndex: Integer;
- HLTPt, HRTPt, HLBPt, HRBPt: TPoint;
- HSkinRect, HClRect: TRect;
- HNewLTPoint, HNewRTPoint, HNewLBPoint, HNewRBPoint: TPoint;
- HNewClRect: TRect;
- HPicture: TBitMap;
- HFontColor, HActiveFontColor, HDownFontColor: TColor;
- HActiveSkinRect, HDownSkinRect: TRect;
- //
- procedure HGetSkinData;
- function GetHeaderSectionRect(Index: Integer): TRect;
- procedure Notification(AComponent: TComponent;
- Operation: TOperation); override;
- procedure SetDefaultColor(Value: TColor);
- procedure SetDefaultFont(Value: TFont);
- procedure SetSkinData(Value: TspSkinData);
- procedure UpDateScrollBars1;
- procedure UpDateScrollBars2;
- procedure UpDateScrollBars3;
- procedure SetVScrollBar(Value: TspSkinScrollBar);
- procedure SetHScrollBar(Value: TspSkinScrollBar);
- procedure WMNCCALCSIZE(var Message: TWMNCCalcSize); message WM_NCCALCSIZE;
- procedure WMNCPAINT(var Message: TWMNCPAINT); message WM_NCPAINT;
- procedure CMVisibleChanged(var Message: TMessage); message CM_VISIBLECHANGED;
- procedure WndProc(var Message: TMessage); override;
- procedure OnVScrollBarChange(Sender: TObject);
- procedure OnHScrollBarChange(Sender: TObject);
- procedure CreateParams(var Params: TCreateParams); override;
- procedure Loaded; override;
- //
- procedure HeaderWndProc(var Message: TMessage);
- procedure DrawHeaderSection(Cnvs: TCanvas; Column: TListColumn;
- Active, Pressed: Boolean; R: TRect);
- procedure PaintHeader(DC: HDC);
- procedure CreateWnd; override;
- //
- public
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- procedure UpDateScrollBars;
- procedure ChangeSkinData;
- property HScrollBar: TspSkinScrollBar read FHScrollBar
- write SetHScrollBar;
- property VScrollBar: TspSkinScrollBar read FVScrollBar
- write SetVScrollBar;
- property DefaultFont: TFont read FDefaultFont write SetDefaultFont;
- property SkinData: TspSkinData read FSD write SetSkinData;
- property SkinDataName: String read FSkinDataName write FSkinDataName;
- property DefaultColor: TColor read FDefaultColor write SetDefaultColor;
- property HeaderSkinDataName: String
- read FHeaderSkinDataName write FHeaderSkinDataName;
- end;
- TspSkinListView = class(TspSkinCustomListView)
- published
- property Action;
- property Align;
- property AllocBy;
- property Anchors;
- property BiDiMode;
- property Checkboxes;
- property Color;
- property Columns;
- property ColumnClick;
- property Constraints;
- property DragCursor;
- property DragKind;
- property DragMode;
- property Enabled;
- property Font;
- property FullDrag;
- property GridLines;
- property HideSelection;
- property HotTrack;
- property HotTrackStyles;
- property HoverTime;
- property IconOptions;
- property Items;
- property LargeImages;
- property MultiSelect;
- property OwnerData;
- property OwnerDraw;
- property ReadOnly default False;
- property RowSelect;
- property ParentBiDiMode;
- property ParentColor default False;
- property ParentFont;
- property ParentShowHint;
- property PopupMenu;
- property ShowColumnHeaders;
- property ShowWorkAreas;
- property ShowHint;
- property SmallImages;
- property SortType;
- property StateImages;
- property TabOrder;
- property TabStop default True;
- property ViewStyle;
- property Visible;
- property HeaderSkinDataName;
- property HScrollBar;
- property VScrollBar;
- property DefaultFont;
- property SkinData;
- property SkinDataName;
- property DefaultColor;
- property OnAdvancedCustomDraw;
- property OnAdvancedCustomDrawItem;
- property OnAdvancedCustomDrawSubItem;
- property OnChange;
- property OnChanging;
- property OnClick;
- property OnColumnClick;
- property OnColumnDragged;
- property OnColumnRightClick;
- property OnCompare;
- property OnContextPopup;
- property OnCustomDraw;
- property OnCustomDrawItem;
- property OnCustomDrawSubItem;
- property OnData;
- property OnDataFind;
- property OnDataHint;
- property OnDataStateChange;
- property OnDblClick;
- property OnDeletion;
- property OnDrawItem;
- property OnEdited;
- property OnEditing;
- property OnEndDock;
- property OnEndDrag;
- property OnEnter;
- property OnExit;
- property OnGetImageIndex;
- property OnGetSubItemImage;
- property OnDragDrop;
- property OnDragOver;
- property OnInfoTip;
- property OnInsert;
- property OnKeyDown;
- property OnKeyPress;
- property OnKeyUp;
- property OnMouseDown;
- property OnMouseMove;
- property OnMouseUp;
- property OnResize;
- property OnSelectItem;
- property OnStartDock;
- property OnStartDrag;
- end;
- TspStatusPanelNumGlyphs = 1..2;
- TspSkinStatusPanel = class(TspSkinLabel)
- private
- FGlyph: TBitMap;
- FNumGlyphs: TspStatusPanelNumGlyphs;
- procedure SetNumGlyphs(Value: TspStatusPanelNumGlyphs);
- procedure SetGlyph(Value: TBitMap);
- protected
- procedure CMEnabledChanged(var Message: TMessage); message CM_ENABLEDCHANGED;
- procedure CreateControlDefaultImage(B: TBitMap); override;
- procedure CreateControlSkinImage(B: TBitMap); override;
- public
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- published
- property Glyph: TBitMap read FGlyph write SetGlyph;
- property NumGlyphs: TspStatusPanelNumGlyphs read FNumGlyphs write SetNumGlyphs;
- end;
- TspSkinRichEdit = class(TCustomRichEdit)
- protected
- FSkinSupport: Boolean;
- FSD: TspSkinData;
- FSkinDataName: String;
- FIndex: Integer;
- FDefaultFont: TFont;
- FDefaultColor: TColor;
- //
- FVScrollBar: TspSkinScrollBar;
- FHScrollBar: TspSkinScrollBar;
- FOldVScrollBarPos: Integer;
- FOldHScrollBarPos: Integer;
- procedure Notification(AComponent: TComponent;
- Operation: TOperation); override;
- procedure SetDefaultColor(Value: TColor);
- procedure SetDefaultFont(Value: TFont);
- procedure SetSkinData(Value: TspSkinData);
- procedure SetVScrollBar(Value: TspSkinScrollBar);
- procedure SetHScrollBar(Value: TspSkinScrollBar);
- procedure WMNCCALCSIZE(var Message: TWMNCCalcSize); message WM_NCCALCSIZE;
- procedure WMNCPAINT(var Message: TWMNCPAINT); message WM_NCPAINT;
- procedure WndProc(var Message: TMessage); override;
- procedure OnVScrollBarChange(Sender: TObject);
- procedure OnHScrollBarChange(Sender: TObject);
- procedure Loaded; override;
- procedure CreateParams(var Params: TCreateParams); override;
- procedure OnVScrollBarUpButtonClick(Sender: TObject);
- procedure OnVScrollBarDownButtonClick(Sender: TObject);
- procedure Change; override;
- public
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- procedure UpDateScrollBars;
- procedure ChangeSkinData;
- published
- property Align;
- property Alignment;
- property Anchors;
- property BiDiMode;
- property Color;
- property DragCursor;
- property DragKind;
- property DragMode;
- property Enabled;
- property Font;
- property HideSelection;
- property ImeMode;
- property ImeName;
- property Constraints;
- property Lines;
- property MaxLength;
- property ParentBiDiMode;
- property ParentFont;
- property ParentShowHint;
- property PlainText;
- property PopupMenu;
- property ReadOnly;
- property ShowHint;
- property TabOrder;
- property TabStop default True;
- property Visible;
- property WantTabs;
- property WantReturns;
- property WordWrap;
- property SkinSupport: Boolean read FSkinSupport write FSkinSupport;
- property HScrollBar: TspSkinScrollBar read FHScrollBar
- write SetHScrollBar;
- property VScrollBar: TspSkinScrollBar read FVScrollBar
- write SetVScrollBar;
- property DefaultFont: TFont read FDefaultFont write SetDefaultFont;
- property SkinData: TspSkinData read FSD write SetSkinData;
- property SkinDataName: String read FSkinDataName write FSkinDataName;
- property DefaultColor: TColor read FDefaultColor write SetDefaultColor;
- property OnChange;
- property OnDragDrop;
- property OnDragOver;
- property OnEndDock;
- property OnEndDrag;
- property OnEnter;
- property OnExit;
- property OnKeyDown;
- property OnKeyPress;
- property OnKeyUp;
- property OnMouseDown;
- property OnMouseMove;
- property OnMouseUp;
- property OnMouseWheel;
- property OnMouseWheelDown;
- property OnMouseWheelUp;
- property OnProtectChange;
- property OnResizeRequest;
- property OnSaveClipboard;
- property OnSelectionChange;
- property OnStartDock;
- property OnStartDrag;
- end;
- TspGraphicSkinControl = class(TGraphicControl)
- protected
- FSD: TspSkinData;
- FAreaName: String;
- FSkinDataName: String;
- FDrawDefault: Boolean;
- CursorIndex: Integer;
- FOnMouseEnter, FOnMouseLeave: TNotifyEvent;
- FAlphaBlend: Boolean;
- FAlphaBlendValue: Byte;
- FUseSkinCursor: Boolean;
- procedure SetAlphaBlend(AValue: Boolean); virtual;
- procedure SetAlphaBlendValue(AValue: Byte); virtual;
- procedure Paint; override;
- procedure Notification(AComponent: TComponent; Operation: TOperation); override;
- procedure GetSkinData; virtual;
- procedure WMMOVE(var Msg: TWMMOVE); message WM_MOVE;
- procedure WMEraseBkgnd(var Msg: TWMEraseBkgnd); message WM_ERASEBKGND;
- procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
- procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER;
- procedure SetSkinData(Value: TspSkinData); virtual;
- procedure CreateControlDefaultImage(B: TBitMap); virtual;
- procedure CreateControlSkinImage(B: TBitMap); virtual;
- public
- FIndex: Integer;
- procedure ChangeSkinData; virtual;
- procedure BeforeChangeSkinData; virtual;
- destructor Destroy; override;
- constructor Create(AOwner: TComponent); override;
- published
- property Anchors;
- property Visible;
- property DrawDefault: Boolean
- read FDrawDefault write FDrawDefault;
- property SkinData: TspSkinData read FSD write SetSkinData;
- property AreaName: String read FAreaName write FAreaName;
- property SkinDataName: String read FSkinDataName write FSkinDataName;
- property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter;
- property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave;
- property AlphaBlend: Boolean read FAlphaBlend write SetAlphaBlend;
- property AlphaBlendValue: Byte
- read FAlphaBlendValue write SetAlphaBlendValue;
- property UseSkinCursor: Boolean read FUseSkinCursor write FUseSkinCursor;
- end;
- TspGraphicSkinCustomControl = class(TspGraphicSkinControl)
- protected
- FDefaultWidth: Integer;
- FDefaultHeight: Integer;
- FDefaultFont: TFont;
- FUseSkinFont: Boolean;
- LTPt, RTPt, LBPt, RBPt: TPoint;
- SkinRect, ClRect: TRect;
- NewLTPoint, NewRTPoint, NewLBPoint, NewRBPoint: TPoint;
- NewClRect: TRect;
- Picture: TBitMap;
- ResizeMode: Integer;
- procedure OnDefaultFontChange(Sender: TObject);
- procedure SetDefaultWidth(Value: Integer);
- procedure SetDefaultHeight(Value: Integer);
- procedure SetDefaultFont(Value: TFont);
- procedure DefaultFontChange; virtual;
- function GetNewRect(R: TRect): TRect;
- function GetResizeMode: Integer;
- procedure CalcSize(var W, H: Integer); virtual;
- procedure CreateSkinControlImage(B, SB: TBitMap; R: TRect);
- procedure GetSkinData; override;
- procedure CreateControlDefaultImage(B: TBitMap); override;
- procedure CreateControlSkinImage(B: TBitMap); override;
- public
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override;
- procedure ChangeSkinData; override;
- published
- property DefaultFont: TFont read FDefaultFont write SetDefaultFont;
- property UseSkinFont: Boolean read FUseSkinFont write FUseSkinFont;
- property DefaultWidth: Integer read FDefaultWidth write SetDefaultWidth;
- property DefaultHeight: Integer read FDefaultHeight write SetDefaultHeight;
- end;
- TspSkinSpeedButton = class(TspGraphicSkinCustomControl)
- protected
- RepeatTimer: TTimer;
- FRepeatMode: Boolean;
- FRepeatInterval: Integer;
- FFlat: Boolean;
- FAllowAllUp: Boolean;
- FAllowAllUpCheck: Boolean;
- FClicksDisabled: Boolean;
- FMorphKf: Double;
- FDown: Boolean;
- FMouseIn, FMouseDown: Boolean;
- FGroupIndex: Integer;
- FGlyph: TBitMap;
- FNumGlyphs: TspNumGlyphs;
- FOnClick: TNotifyEvent;
- FMargin: Integer;
- FSpacing: Integer;
- FLayout: TspButtonLayout;
- MorphTimer: TTimer;
- procedure RepeatTimerProc(Sender: TObject);
- procedure StartRepeat;
- procedure StopRepeat;
- procedure SetFlat(Value: Boolean);
- procedure StartMorph;
- procedure StopMorph;
- procedure DoMorph(Sender: TObject);
- procedure CreateButtonImage(B: TBitMap; R: TRect;
- ADown, AMouseIn: Boolean); virtual;
- procedure SetLayout(Value : TspButtonLayout);
- procedure SetGroupIndex(Value: Integer);
- procedure SetDown(Value: Boolean);
- procedure SetMargin(Value: Integer);
- procedure SetSpacing(Value: Integer);
- procedure DoAllUp;
- procedure SetNumGlyphs(Value: TspNumGlyphs);
- procedure SetGlyph(Value: TBitMap);
- procedure GetSkinData; override;
- procedure CMEnabledChanged(var Message: TMessage); message CM_ENABLEDCHANGED;
- procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
- procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER;
- procedure CMTextChanged(var Message: TMessage); message CM_TEXTCHANGED;
- procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
- X, Y: Integer); override;
- procedure MouseUp(Button: TMouseButton; Shift: TShiftState;
- X, Y: Integer); override;
- procedure ReDrawControl;
- procedure CreateControlDefaultImage(B: TBitMap); override;
- procedure CreateControlSkinImage(B: TBitMap); override;
- procedure ActionChange(Sender: TObject; CheckDefaults: Boolean); override;
- procedure ButtonClick; virtual;
- public
- FontName: String;
- FontStyle: TFontStyles;
- FontHeight: Integer;
- FontColor, ActiveFontColor, DownFontColor, DisabledFontColor: TColor;
- ActiveSkinRect, DownSkinRect, DisabledSkinRect: TRect;
- Morphing: Boolean;
- MorphKind: TMorphKind;
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- procedure ChangeSkinData; override;
- procedure Paint; override;
- published
- property RepeatMode: Boolean read FRepeatMode write FRepeatMode;
- property RepeatInterval: Integer
- read FRepeatInterval write FRepeatInterval;
- property Flat: Boolean read FFlat write SetFlat;
- property AllowAllUp: Boolean read FAllowAllUp write FAllowAllUp;
- property PopupMenu;
- property ShowHint;
- property Action;
- property Down: Boolean read FDown write SetDown;
- property GroupIndex: Integer read FGroupIndex write SetGroupIndex;
- property Caption;
- property Glyph: TBitMap read FGlyph write SetGlyph;
- property NumGlyhps: TspNumGlyphs read FNumGlyphs write SetNumGlyphs;
- property Align;
- property Margin: Integer read FMargin write SetMargin default -1;
- property Spacing: Integer read FSpacing write SetSpacing default 4;
- property Layout: TspButtonLayout read FLayout write SetLayout default blGlyphLeft;
- property Enabled;
- property OnClick: TNotifyEvent read FOnClick write FOnClick;
- property OnMouseDown;
- property OnMouseMove;
- property OnMouseUp;
- property OnResize;
- end;
- TspSkinMenuSpeedButton = class(TspSkinSpeedButton)
- protected
- FOnShowTrackMenu: TNotifyEvent;
- FOnHideTrackMenu: TNotifyEvent;
- FTrackButtonMode: Boolean;
- FMenuTracked: Boolean;
- FSkinPopupMenu: TspSkinPopupMenu;
- procedure CreateButtonImage(B: TBitMap; R: TRect;
- ADown, AMouseIn: Boolean); override;
- function CanMenuTrack(X, Y: Integer): Boolean;
- procedure TrackMenu;
- procedure SetTrackButtonMode(Value: Boolean);
- procedure GetSkinData; override;
- procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
- X, Y: Integer); override;
- procedure MouseUp(Button: TMouseButton; Shift: TShiftState;
- X, Y: Integer); override;
- procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
- procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER;
- procedure Notification(AComponent: TComponent;
- Operation: TOperation); override;
- procedure WMCLOSESKINMENU(var Message: TMessage); message WM_CLOSESKINMENU;
- function GetNewTrackButtonRect: TRect;
- procedure CreateControlDefaultImage(B: TBitMap); override;
- public
- TrackButtonRect: TRect;
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- procedure Paint; override;
- published
- property SkinPopupMenu: TspSkinPopupMenu read FSkinPopupMenu
- write FSkinPopupMenu;
- property TrackButtonMode: Boolean read FTrackButtonMode
- write SetTrackButtonMode;
- property OnShowTrackMenu: TNotifyEvent read FOnShowTrackMenu
- write FOnShowTrackMenu;
- property OnHideTrackMenu: TNotifyEvent read FOnHideTrackMenu
- write FOnHideTrackMenu;
- end;
- TspCustomDrawSkinSectionEvent = procedure(HeaderControl: THeaderControl;
- Section: THeaderSection; const Rect: TRect; Active, Pressed: Boolean;
- Cnvs: TCanvas) of object;
- TspSkinHeaderControl = class(THeaderControl)
- protected
- //
- FSD: TspSkinData;
- FSkinDataName: String;
- FIndex: Integer;
- FDefaultFont: TFont;
- FUseSkinFont: Boolean;
- FDefaultHeight: Integer;
- //
- InDivider: Boolean;
- FDown: Boolean;
- FInTracking: Boolean;
- FActiveSection, FOldActiveSection: Integer;
- FOnSkinSectionClick: TSectionNotifyEvent;
- FOnDrawSkinSection: TspCustomDrawSkinSectionEvent;
- procedure SetDefaultHeight(Value: Integer);
- function GetSkinItemRect(Index: Integer): TRect;
- procedure PaintWindow(DC: HDC); override;
- procedure WMPaint(var Msg: TWMPaint); message WM_PAINT;
- procedure WMEraseBkgnd(var Message: TWMEraseBkgnd); message WM_ERASEBKGND;
- function DrawSkinSection(Cnvs: TCanvas; Index: Integer; Active, Pressed: Boolean): TRect;
- procedure DrawSkinSectionR(Cnvs: TCanvas; Section: THeaderSection; Active, Pressed: Boolean; R: TRect);
- procedure CreateParams(var Params: TCreateParams); override;
- procedure TestActive(X, Y: Integer);
- procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
- X, Y: Integer); override;
- procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
- procedure MouseUp(Button: TMouseButton; Shift: TShiftState;
- X, Y: Integer); override;
- procedure CMMouseEnter(var Message: TMessage); message CM_MOUSEENTER;
- procedure CMMouseLeave(var Message: TMessage); message CM_MOUSELEAVE;
- procedure WndProc(var Message:TMessage); override;
- procedure CreateWnd; override;
- procedure DrawSection(Section: THeaderSection; const Rect: TRect;
- Pressed: Boolean); override;
- procedure SetDefaultFont(Value: TFont);
- procedure SetSkinData(Value: TspSkinData);
- procedure Notification(AComponent: TComponent; Operation: TOperation); override;
- public
- LTPt, RTPt, LBPt, RBPt: TPoint;
- SkinRect, ClRect: TRect;
- NewLTPoint, NewRTPoint, NewLBPoint, NewRBPoint: TPoint;
- NewClRect: TRect;
- Picture: TBitMap;
- FontName: String;
- FontStyle: TFontStyles;
- FontHeight: Integer;
- FontColor, ActiveFontColor, DownFontColor: TColor;
- ActiveSkinRect, DownSkinRect: TRect;
- //
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- procedure GetSkinData;
- procedure ChangeSkinData;
- procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override;
- published
- property DefaultFont: TFont read FDefaultFont write SetDefaultFont;
- property DefaultHeight: Integer read FDefaultHeight write SetDefaultHeight;
- property UseSkinFont: Boolean read FUseSkinFont write FUseSkinFont;
- property SkinData: TspSkinData read FSD write SetSkinData;
- property SkinDataName: String read FSkinDataName write FSkinDataName;
- property OnSkinSectionClick: TSectionNotifyEvent
- read FOnSkinSectionClick write FOnSkinSectionClick;
- property OnDrawSkinSection: TspCustomDrawSkinSectionEvent
- read FOnDrawSkinSection write FOnDrawSkinSection;
- end;
- TspNumThumbStates = 1..2;
- TspSliderOrientation = (soHorizontal, soVertical);
- TspSliderOption = (soShowFocus, soShowPoints, soSmooth,
- soRulerOpaque, soThumbOpaque);
- TspSliderOptions = set of TspSliderOption;
- TspSliderImage = (siHThumb, siHRuler, siVThumb, siVRuler);
- TspSliderImages = set of TspSliderImage;
- TspSliderImageArray = array[TspSliderImage] of TBitmap;
- TspJumpMode = (jmNone, jmHome, jmEnd, jmNext, jmPrior);
- TspSkinCustomSlider = class(TspSkinControl)
- private
- FUseSkinThumb: Boolean;
- FTransparent: Boolean;
- FUserImages: TspSliderImages;
- FImages: TspSliderImageArray;
- FEdgeSize: Integer;
- FRuler: TBitmap;
- FPaintBuffered: Boolean;
- FRulerOrg: TPoint;
- FThumbRect: TRect;
- FThumbDown: Boolean;
- FNumThumbStates: TspNumThumbStates;
- FPointsRect: TRect;
- FOrientation: TspSliderOrientation;
- FOptions: TspSliderOptions;
- FBevelWidth: Integer;
- FMinValue: Longint;
- FMaxValue: Longint;
- FIncrement: Longint;
- FValue: Longint;
- FHit: Integer;
- FFocused: Boolean;
- FSliding: Boolean;
- FTracking: Boolean;
- FTimerActive: Boolean;
- FMousePos: TPoint;
- FStartJump: TspJumpMode;
- FReadOnly: Boolean;
- FOnChange: TNotifyEvent;
- FOnChanged: TNotifyEvent;
- FOnDrawPoints: TNotifyEvent;
- procedure SetTransparent(Value: Boolean);
- function GetImage(Index: Integer): TBitmap;
- procedure SetImage(Index: Integer; Value: TBitmap);
- procedure SliderImageChanged(Sender: TObject);
- procedure SetEdgeSize(Value: Integer);
- function GetNumThumbStates: TspNumThumbStates;
- procedure SetNumThumbStates(Value: TspNumThumbStates);
- procedure SetOrientation(Value: TspSliderOrientation);
- procedure SetOptions(Value: TspSliderOptions);
- procedure SetMinValue(Value: Longint);
- procedure SetMaxValue(Value: Longint);
- procedure SetIncrement(Value: Longint);
- procedure SetReadOnly(Value: Boolean);
- function GetThumbOffset: Integer;
- procedure SetThumbOffset(Value: Integer);
- procedure SetValue(Value: Longint);
- procedure ThumbJump(Jump: TspJumpMode);
- function GetThumbPosition(var Offset: Integer): TPoint;
- function JumpTo(X, Y: Integer): TspJumpMode;
- procedure InvalidateThumb;
- procedure StopTracking;
- procedure TimerTrack;
- function StoreImage(Index: Integer): Boolean;
- procedure CreateElements;
- procedure BuildRuler(R: TRect);
- procedure BuildSkinRuler(R: TRect);
- procedure AdjustElements;
- procedure ReadUserImages(Stream: TStream);
- procedure WriteUserImages(Stream: TStream);
- procedure InternalDrawPoints(ACanvas: TCanvas; PointsStep, PointsHeight,
- ExtremePointsHeight: Longint);
- procedure DrawThumb(Canvas: TCanvas; Origin: TPoint; Highlight: Boolean);
- procedure DrawSkinThumb(Canvas: TCanvas; Origin: TPoint; Highlight: Boolean);
- function GetValueByOffset(Offset: Integer): Longint;
- function GetOffsetByValue(Value: Longint): Integer;
- function GetRulerLength: Integer;
- procedure CMEnabledChanged(var Message: TMessage); message CM_ENABLEDCHANGED;
- procedure CMFocusChanged(var Message: TCMFocusChanged); message CM_FOCUSCHANGED;
- procedure WMGetDlgCode(var Msg: TWMGetDlgCode); message WM_GETDLGCODE;
- procedure WMPaint(var Message: TWMPaint); message WM_PAINT;
- procedure WMSize(var Message: TWMSize); message WM_SIZE;
- procedure WMTimer(var Message: TMessage); message WM_TIMER;
- procedure WMMOVE(var Msg: TWMMOVE); message WM_MOVE;
- protected
- procedure AlignControls(AControl: TControl; var Rect: TRect); override;
- procedure DefineProperties(Filer: TFiler); override;
- procedure KeyDown(var Key: Word; Shift: TShiftState); override;
- procedure Loaded; override;
- procedure MouseDown(Button: TMouseButton; Shift: TShiftState;
- X, Y: Integer); override;
- procedure MouseMove(Shift: TShiftState; X, Y: Integer); override;
- procedure MouseUp(Button: TMouseButton; Shift: TShiftState;
- X, Y: Integer); override;
- procedure Paint; override;
- function CanModify: Boolean; virtual;
- function GetSliderRect: TRect; virtual;
- function GetSliderValue: Longint; virtual;
- procedure Change; dynamic;
- procedure Changed; dynamic;
- procedure Sized; virtual;
- procedure RangeChanged; virtual;
- procedure SetRange(Min, Max: Longint);
- procedure ThumbMouseDown(Button: TMouseButton; Shift: TShiftState;
- X, Y: Integer); virtual;
- procedure ThumbMouseMove(Shift: TShiftState; X, Y: Integer); virtual;
- procedure ThumbMouseUp(Button: TMouseButton; Shift: TShiftState;
- X, Y: Integer); virtual;
- property ThumbOffset: Integer read GetThumbOffset write SetThumbOffset;
- property SliderRect: TRect read GetSliderRect;
- property ImageHThumb: TBitmap index Ord(siHThumb) read GetImage
- write SetImage stored StoreImage;
- property ImageHRuler: TBitmap index Ord(siHRuler) read GetImage
- write SetImage stored StoreImage;
- property ImageVThumb: TBitmap index Ord(siVThumb) read GetImage
- write SetImage stored StoreImage;
- property ImageVRuler: TBitmap index Ord(siVRuler) read GetImage
- write SetImage stored StoreImage;
- property NumThumbStates: TspNumThumbStates read GetNumThumbStates
- write SetNumThumbStates default 2;
- property Orientation: TspSliderOrientation read FOrientation
- write SetOrientation default soHorizontal;
- property EdgeSize: Integer read FEdgeSize write SetEdgeSize default 2;
- property Options: TspSliderOptions read FOptions write SetOptions
- default [soShowFocus, soShowPoints, soSmooth];
- property ReadOnly: Boolean read FReadOnly write SetReadOnly default False;
- property OnChange: TNotifyEvent read FOnChange write FOnChange;
- property OnChanged: TNotifyEvent read FOnChanged write FOnChanged;
- property OnDrawPoints: TNotifyEvent read FOnDrawPoints write FOnDrawPoints;
- procedure GetSkinData; override;
- public
- HRulerRect: TRect;
- HThumbRect: TRect;
- VRulerRect: TRect;
- VThumbRect: TRect;
- SkinEdgeSize: Integer;
- BGColor: TColor;
- PointsColor: TColor;
- Picture: TBitMap;
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- procedure DefaultDrawPoints(PointsStep, PointsHeight,
- ExtremePointsHeight: Longint); virtual;
- procedure ChangeSkinData; override;
- property Canvas;
- property Increment: Longint read FIncrement write SetIncrement default 10;
- property MinValue: Longint read FMinValue write SetMinValue default 0;
- property MaxValue: Longint read FMaxValue write SetMaxValue default 100;
- property Value: Longint read FValue write SetValue default 0;
- property Transparent: Boolean read FTransparent write SetTransparent;
- property UseSkinThumb: Boolean read FUseSkinThumb write FUseSkinThumb;
- end;
- { TspSlider }
- TspSkinSlider = class(TspSkinCustomSlider)
- published
- property Align;
- property Color;
- property Cursor;
- property DragMode;
- property DragCursor;
- property Enabled;
- property ImageHThumb;
- property ImageHRuler;
- property ImageVThumb;
- property ImageVRuler;
- property Increment;
- property MinValue;
- property MaxValue;
- property NumThumbStates;
- property Orientation;
- property EdgeSize;
- property Options;
- property ParentColor;
- property ParentShowHint;
- property PopupMenu;
- property ShowHint;
- property TabOrder;
- property TabStop default True;
- property Value;
- property Transparent;
- property UseSkinThumb;
- property Visible;
- property Anchors;
- property Constraints;
- property DragKind;
- property OnChange;
- property OnChanged;
- property OnDrawPoints;
- property OnClick;
- property OnDblClick;
- property OnEnter;
- property OnExit;
- property OnMouseMove;
- property OnMouseDown;
- property OnMouseUp;
- property OnKeyDown;
- property OnKeyUp;
- property OnKeyPress;
- property OnDragOver;
- property OnDragDrop;
- property OnEndDrag;
- property OnStartDrag;
- property OnContextPopup;
- property OnMouseWheelDown;
- property OnMouseWheelUp;
- property OnEndDock;
- property OnStartDock;
- end;
- TspSkinBevel = class(TBevel)
- protected
- FSD: TspSkinData;
- FSkinDataName: String;
- FIndex: Integer;
- FDividerMode: Boolean;
- procedure SetDividerMode(Value: Boolean);
- procedure SetSkinData(Value: TspSkinData);
- public
- LightColor, DarkColor: TColor;
- constructor Create(AOwner: TComponent); override;
- procedure Paint; override;
- procedure ChangeSkinData;
- published
- property SkinData: TspSkinData read FSD write SetSkinData;
- property SkinDataName: String read FSkinDataName write FSkinDataName;
- property DividerMode: Boolean read FDividerMode write SetDividerMode;
- end;
- TspSkinButtonsBar = class;
- TspButtonBarSection = class;
- TspButtonBarItems = class;
- TspButtonBarItem = class(TCollectionItem)
- private
- FText: String;
- FImageIndex: Integer;
- FOnClick: TNotifyEvent;
- procedure SetText(const Value: string);
- procedure SetImageIndex(const Value: Integer);
- procedure ItemClick(const Value: TNotifyEvent);
- protected
- function GetDisplayName: string; override;
- procedure Click;
- public
- constructor Create(Collection: TCollection); override;
- procedure Assign(Source: TPersistent); override;
- published
- property Text: string read FText write SetText;
- property ImageIndex:integer read FImageIndex write SetImageIndex;
- property OnClick:TNotifyEvent read FonClick write ItemClick;
- end;
- TspButtonBarItems = class(TCollection)
- private
- FSection: TspButtonBarSection;
- function GetItem(Index: Integer): TspButtonBarItem;
- procedure SetItem(Index: Integer; Value: TspButtonBarItem);
- protected
- function GetOwner: TPersistent; override;
- procedure Update(Item: TCollectionItem); override;
- public
- constructor Create(Section: TspButtonBarSection);
- function Add: TspButtonBarItem;
- property Items[Index: Integer]: TspButtonBarItem read GetItem write SetItem; default;
- end;
- TspButtonBarSection = class(TCollectionItem)
- private
- FText: string;
- FItems: TspButtonBarItems;
- FOnClick: TNotifyEvent;
- FImageIndex: Integer;
- procedure SetText(const Value: string);
- procedure SetItems(const Value: TspButtonBarItems);
- procedure SectionClick(const Value: TNotifyEvent);
- procedure SetImageIndex(Value: Integer);
- protected
- function GetDisplayName: string; override;
- procedure Click;
- public
- constructor Create(Collection: TCollection); override;
- destructor Destroy;override;
- procedure Assign(Source: TPersistent); override;
- published
- property Text: string read FText write SetText;
- property Items: TspButtonBarItems read FItems write SetItems;
- property OnClick:TNotifyEvent read FOnClick write SectionClick;
- property ImageIndex: Integer read FImageIndex write SetImageIndex;
- end;
- TspButtonBarSections = class(TCollection)
- private
- FButtonsBar: TspSkinButtonsBar;
- function GetItem(Index: Integer): TspButtonBarSection;
- procedure SetItem(Index: Integer; Value: TspButtonBarSection);
- protected
- function GetOwner: TPersistent; override;
- procedure Update(Item: TCollectionItem); override;
- public
- function GetButtonsBar: TspSkinButtonsBar;
- constructor Create(ButtonsBar: TspSkinButtonsBar);
- function Add: TspButtonBarSection;
- property Items[Index: Integer]: TspButtonBarSection read GetItem write SetItem; default;
- end;
- TspSectionButton = class(TspSkinSpeedButton)
- private
- FItemIndex: Integer;
- FButtonsBar: TspSkinButtonsBar;
- public
- constructor CreateEx(AOwner: TComponent; AButtonsBar: TspSkinButtonsBar; AIndex: Integer);
- procedure ButtonClick; override;
- end;
- TspSectionItem = class(TspSkinSpeedButton)
- private
- FItemIndex: Integer;
- FButtonsBar: TspSkinButtonsBar;
- FSectionIndex: Integer;
- public
- constructor CreateEx(AOwner: TComponent; AButtonsBar: TspSkinButtonsBar; ASectionIndex, AIndex: Integer);
- procedure ButtonClick; override;
- end;
- TspSkinButtonsBar = class(TspSkinPanel)
- private
- FShowButtons: Boolean;
- FDefaultSectionFont: TFont;
- FDefaultItemFont: TFont;
- FUpButton, FDownButton: TspSkinButton;
- TopIndex: Integer;
- VisibleCount: Integer;
- FItemHeight: Integer;
- FItemsTransparent: Boolean;
- FItemsPanel: TspSkinPanel;
- FSections: TspButtonBarSections;
- FSectionIndex: Integer;
- FItemImages: TImagelist;
- FSectionImages: TImageList;
- FSectionButtons: TList;
- FSectionItems: TList;
- FSectionButtonSkinDataName: String;
- FDefaultButtonHeight: Integer;
- procedure SetShowButtons(Value: Boolean);
- procedure SetDefaultButtonHeight(Value: Integer);
- procedure SetDefaultSectionFont(Value: TFont);
- procedure SetDefaultItemFont(Value: TFont);
- procedure SetItemHeight(Value: Integer);
- procedure SetItemsTransparent(Value: Boolean);
- procedure SetSections(Value: TspButtonBarSections);
- procedure UpdateSection(Index: Integer);
- procedure UpdateSections;
- procedure UpdateItems;
- procedure SetSectionIndex(const Value: integer);
- procedure SetItemImages(const Value: TImagelist);
- procedure SetSectionImages(const Value: TImageList);
- procedure CheckVisibleItems;
- procedure OnItemPanelResize(Sender: TObject);
- protected
- procedure CreateWnd; override;
- procedure SetSkinData(Value: TspSkinData); override;
- procedure ClearSections;
- procedure ClearItems;
- procedure OpenSection(Index: Integer);
- procedure ArangeItems;
- procedure ShowUpButton;
- procedure ShowDownButton;
- procedure HideUpButton;
- procedure HideDownButton;
- procedure UpButtonClick(Sender: TObject);
- procedure DownButtonClick(Sender: TObject);
- public
- procedure ScrollUp;
- procedure ScrollDown;
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- procedure Notification(AComponent:TComponent; Operation:TOperation);override;
- procedure UpDateSectionButtons;
- procedure ChangeSkinData; override;
- published
- property ShowButtons: Boolean read FShowButtons write SetShowButtons;
- property DefaultSectionFont: TFont read FDefaultSectionFont write SetDefaultSectionFont;
- property DefaultButtonHeight: Integer
- read FDefaultButtonHeight write SetDefaultButtonHeight;
- property DefaultItemFont: TFont read FDefaultItemFont write SetDefaultItemFont;
- property Align default alLeft;
- property Enabled;
- property SectionButtonSkinDataName: String
- read FSectionButtonSkinDataName
- write FSectionButtonSkinDataName;
- property ItemHeight: Integer read FItemHeight write SetItemHeight;
- property ItemsTransparent: Boolean read FItemsTransparent write SetItemsTransparent;
- property ItemImages: TImagelist read FItemImages write SetItemImages;
- property SectionImages:TImageList read FSectionImages write SetSectionImages;
- property Sections: TspButtonBarSections read FSections write SetSections;
- property SectionIndex:integer read FSectionIndex write SetSectionIndex;
- property PopupMenu;
- property ShowHint;
- property Hint;
- property Visible;
- property OnClick;
- property OnContextPopup;
- property OnMouseDown;
- property OnMouseMove;
- property OnMouseUp;
- property OnResize;
- end;
- {TspSkinNoteBook}
- TspSkinPage = class(TspSkinPanel)
- private
- procedure WMNCHitTest(var Message: TWMNCHitTest); message WM_NCHITTEST;
- protected
- FImageIndex: Integer;
- procedure ReadState(Reader: TReader); override;
- public
- constructor Create(AOwner: TComponent); override;
- published
- property ImageIndex: Integer read FImageIndex write FImageIndex;
- property Caption;
- property Height stored False;
- property TabOrder stored False;
- property Visible stored False;
- property Width stored False;
- end;
- TspSkinNotebook = class(TspSkinPanel)
- private
- FAccess: TStrings;
- FPageIndex: Integer;
- FOnPageChanged: TNotifyEvent;
- FButtonsMode: Boolean;
- FButtons: TList;
- FImages: TImageList;
- FButtonSkinDataName: String;
- procedure SetImages(const Value: TImageList);
- procedure ClearButtons;
- procedure SetPages(Value: TStrings);
- procedure SetActivePage(const Value: string);
- function GetActivePage: string;
- procedure SetPageIndex(Value: Integer);
- procedure SetButtonsMode(Value: Boolean);
- protected
- procedure Notification(AComponent: TComponent; Operation: TOperation); override;
- procedure CreateParams(var Params: TCreateParams); override;
- function GetChildOwner: TComponent; override;
- procedure GetChildren(Proc: TGetChildProc; Root: TComponent); override;
- procedure ReadState(Reader: TReader); override;
- procedure ShowControl(AControl: TControl); override;
- procedure UpdateButtons;
- public
- FPageList: TList;
- procedure UpdateButton(APageIndex: Integer; ACaption: String);
- procedure Loaded; override;
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- published
- property ActivePage: string read GetActivePage write SetActivePage stored False;
- property ButtonsMode: Boolean read FButtonsMode write SetButtonsMode;
- property ButtonSkinDataName: String
- read FButtonSkinDataName
- write FButtonSkinDataName;
- property Images: TImageList read FImages write SetImages;
- property Align;
- property Anchors;
- property DragCursor;
- property DragKind;
- property DragMode;
- property Font;
- property Enabled;
- property Constraints;
- property PageIndex: Integer read FPageIndex write SetPageIndex default 0;
- property Pages: TStrings read FAccess write SetPages stored False;
- property ParentShowHint;
- property PopupMenu;
- property ShowHint;
- property TabOrder;
- property TabStop;
- property Visible;
- property OnClick;
- property OnContextPopup;
- property OnDblClick;
- property OnDragDrop;
- property OnDragOver;
- property OnEndDock;
- property OnEndDrag;
- property OnEnter;
- property OnExit;
- property OnMouseDown;
- property OnMouseMove;
- property OnMouseUp;
- property OnPageChanged: TNotifyEvent read FOnPageChanged write FOnPageChanged;
- property OnStartDock;
- property OnStartDrag;
- end;
- TspPageButton = class(TspSkinSpeedButton)
- private
- FPageIndex: Integer;
- FNoteBook: TspSkinNoteBook;
- public
- constructor CreateEx(AOwner: TComponent; ANoteBook: TspSkinNoteBook; APageIndex: Integer);
- procedure ButtonClick; override;
- end;
- TspSkinXFormButton = class(TspSkinButton)
- private
- FDefImage: TBitMap;
- FDefActiveImage: TBitMap;
- FDefDownImage: TBitMap;
- FDefMask: TBitMap;
- FDefActiveFontColor: TColor;
- FDefDownFontColor: TColor;
- procedure SetDefImage(Value: TBitMap);
- procedure SetDefActiveImage(Value: TBitMap);
- procedure SetDefDownImage(Value: TBitMap);
- procedure SetDefMask(Value: TBitMap);
- protected
- procedure SetControlRegion; override;
- procedure DrawDefaultButton(C: TCanvas);
- procedure CreateControlDefaultImage(B: TBitMap); override;
- procedure Loaded; override;
- public
- constructor Create(AOwner: TComponent); override;
- destructor Destroy; override;
- procedure ChangeSkinData; override;
- procedure SetBounds(ALeft, ATop, AWidth, AHeight: Integer); override;
- published
- property DefImage: TBitMap read FDefImage write SetDefImage;
- property DefActiveImage: TBitMap read FDefActiveImage write SetDefActiveImage;
- property DefDownImage: TBitMap read FDefDownImage write SetDefDownImage;
- property DefMask: TBitMap read FDefMask write SetDefMask;
- property DefActiveFontColor: TColor
- read FDefActiveFontColor write FDefActiveFontColor;
- property DefDownFontColor: TColor
- read FDefDownFontColor write FDefDownFontColor;
- end;
- procedure NotebookHandlesNeeded(Notebook: TspSkinNotebook);
- implementation
- {$R *.res}
- Uses spUtils, DynamicSkinForm, ActnList, ImgList, SkinTabs, CommCtrl, ShellAPI;
- const
- MorphTimerInterval = 20;
- type
- TParentControl = class(TWinControl);
- const
- ImagesResNames: array[TspSliderImage] of PChar =
- ('SP_HTB', 'SP_HRL', 'SP_VTB', 'SP_VRL');
- Indent = 6;
- JumpInterval = 400;
- // Call HandleNeeded for each page in notebook. Used to allow anchors to work
- // on invisible pages.
- procedure NotebookHandlesNeeded(Notebook: TspSkinNotebook);
- var
- I: Integer;
- begin
- if Notebook <> nil then
- for I := 0 to Notebook.FPageList.Count - 1 do
- with TspSkinPage(Notebook.FPageList[I]) do
- begin
- DisableAlign;
- try
- HandleNeeded;
- ControlState := ControlState - [csAlignmentNeeded];
- finally
- EnableAlign;
- end;
- end;
- end;
- procedure CalcLCoord(Layout: TspButtonLayout; R: TRect; gw, gh, tw, th: Integer;
- Spacing, Margin: Integer; var tx, ty, gx, gy: Integer);
- var
- H, W, H1, W1: Integer;
- begin
- H := R.Top + RectHeight(R) div 2;
- W := R.Left + RectWidth(R) div 2;
- if Margin = -1
- then
- begin
- W1 := (tw + gw + Spacing) div 2;
- H1 := (th + gh + Spacing) div 2;
- case Layout of
- blGlyphRight:
- begin
- tx := W - W1;
- ty := H - th div 2;
- gx := W + W1 - gw;
- gy := H - gh div 2;
- end;
- blGlyphLeft:
- begin
- gx := W - W1;
- gy := H - gh div 2;
- tx := W + W1 - tw;
- ty := H - th div 2;
- end;
- blGlyphTop:
- begin
- tx := W - tw div 2;
- ty := H + H1 - th;
- gx := W - gw div 2;
- gy := H - H1;
- end;
- blGlyphBottom:
- begin
- gx := W - gw div 2;
- gy := H + H1 - gh;
- tx := W - tw div 2;
- ty := H - H1;
- end;
- end;
- end
- else
- begin
- case Layout of
- blGlyphRight:
- begin
- gy := H - gh div 2;
- gx := R.Right - gw - Margin;
- tx := gx - Spacing - tw;
- ty := H - th div 2;
- end;
- blGlyphLeft:
- begin
- gy := H - gh div 2;
- gx := R.Left + Margin;
- tx := gx + gw + Spacing;
- ty := H - th div 2;
- end;
- blGlyphTop:
- begin
- gy := R.Top + Margin;
- gx := W - gw div 2;
- ty := gy + gh + Spacing;
- tx := W - tw div 2;
- end;
- blGlyphBottom:
- begin
- gy := R.Bottom - gh - Margin;
- gx := W - gw div 2;
- ty := gy - Spacing - th;
- tx := W - tw div 2;
- end;
- end;
- end;
- end;
- procedure DrawGlyphAndText(Cnvs: TCanvas;
- R: TRect; Margin, Spacing: Integer; Layout: TspButtonLayout;
- Caption: String; Glyph: TBitMap; NumGlyphs, GlyphNum: Integer; ADown: Boolean);
- var
- gw, gh: Integer;
- tw, th: Integer;
- TX, TY, GX, GY: Integer;
- TR: TRect;
- begin
- if Glyph.Empty
- then
- begin
- gw := 0;
- gh := 0;
- end
- else
- begin
- gw := Glyph.Width div NumGlyphs;
- gh := Glyph.Height;
- end;
- with Cnvs do
- begin
- TR := NullRect;
- DrawText(Handle, PChar(Caption), Length(Caption), TR,
- DT_CALCRECT);
- tw := RectWidth(TR);
- th := RectHeight(TR);
- Brush.Style := bsClear;
- end;
- CalcLCoord(Layout, R, gw, gh, tw, th, Spacing, Margin, TX, TY, GX, GY);
- if ADown
- then
- begin
- Inc(GX); Inc(GY);
- Inc(TX); Inc(TY);
- end;
- TR := Rect(TX, TY, TX, TY);
- DrawText(Cnvs.Handle, PChar(Caption), Length(Caption), TR, DT_CALCRECT);
- Inc(TR.Right, 2);
- DrawText(Cnvs.Handle, PChar(Caption), Length(Caption), TR, DT_VCENTER or DT_CENTER);
- if not Glyph.Empty then DrawGlyph(Cnvs, GX, GY, Glyph, NumGlyphs, GlyphNum);
- end;
- constructor TspSkinControl.Create;
- begin
- inherited Create(AOwner);
- FSD := nil;
- FAreaName := '';
- Frgn := 0;
- FIndex := -1;
- FDrawDefault := True;
- CursorIndex := -1;
- FAlphaBlend := False;
- FAlphaBlendValue := 200;
- FUseSkinCursor := False;
- end;
- destructor TspSkinControl.Destroy;
- begin
- inherited Destroy;
- end;
- procedure TspSkinControl.SetAlphaBlend;
- begin
- FAlphaBlend := AValue;
- RePaint;
- end;
- procedure TspSkinControl.SetAlphaBlendValue;
- begin
- FAlphaBlendValue := AValue;
- RePaint;
- end;
- procedure TspSkinControl.CMMouseEnter;
- begin
- inherited;
- if Assigned(FOnMouseEnter) then FOnMouseEnter(Self);
- end;
- procedure TspSkinControl.CMMouseLeave;
- begin
- inherited;
- if Assigned(FOnMouseLeave) then FOnMouseLeave(Self);
- end;
- procedure TspSkinControl.WMEraseBkGnd;
- begin
- end;
- procedure TspSkinControl.WMMOVE;
- begin
- inherited;
- if FAlphaBlend then RePaint;
- end;
- procedure TspSkinControl.BeforeChangeSkinData;
- begin
- FIndex := -1;
- end;
- procedure TspSkinControl.ChangeSkinData;
- begin
- GetSkinData;
- if FUseSkinCursor
- then
- if CursorIndex <> -1
- then
- Cursor := FSD.StartCursorIndex + CursorIndex
- else
- Cursor := crDefault;
- RePaint;
- end;
- procedure TspSkinControl.SetSkinData;
- begin
- FSD := Value;
- if (FSD <> nil) then
- if not FSD.Empty and not (csDesigning in ComponentState)
- then
- ChangeSkinData;
- end;
- procedure TspSkinControl.GetSkinData;
- begin
- if (FSD = nil) or FSD.Empty
- then
- FIndex := -1
- else
- FIndex := FSD.GetControlIndex(FSkinDataName);
- end;
- procedure TspSkinControl.Paint;
- var
- Buffer: TBitMap;
- ParentImage: TBitMap;
- PBuffer, PIBuffer: TspEffectBmp;
- kf: Double;
- begin
- if (Width <= 0) or (Height <= 0) then Exit;
- GetSkinData;
- Buffer := TBitMap.Create;
- Buffer.Width := Width;
- Buffer.Height := Height;
- if FIndex <> -1
- then
- CreateControlSkinImage(Buffer)
- else
- if FDrawDefault
- then
- CreateControlDefaultImage(Buffer);
- if FAlphaBlend
- then
- begin
- ParentImage := TBitMap.Create;
- ParentImage.Width := Width;
- ParentImage.Height := Height;
- GetParentImage(Self, ParentImage.Canvas);
- PBuffer := TspEffectBmp.CreateFromhWnd(Buffer.Handle);
- PIBuffer := TspEffectBmp.CreateFromhWnd(ParentImage.Handle);
- kf := 1 - FAlphaBlendValue / 255;
- PBuffer.Morph(PIBuffer, Kf);
- PBuffer.Draw(Canvas.Handle, 0, 0);
- PBuffer.Free;
- PIBuffer.Free;
- ParentImage.Free;
- end
- else
- Canvas.Draw(0, 0, Buffer);
- Buffer.Free;
- end;
- procedure TspSkinControl.CreateControlDefaultImage;
- begin
- end;
- procedure TspSkinControl.CreateControlSkinImage;
- begin
- end;
- procedure TspSkinControl.Notification;
- begin
- inherited Notification(AComponent, Operation);
- if (Operation = opRemove) and (AComponent = FSD) then FSD := nil;
- end;
- constructor TspFrameSkinControl.Create(AOwner: TComponent);
- begin
- inherited;
- FFrame := 1;
- FrameW := 0;
- FrameH := 0;
- Picture := nil;
- MaskPicture := nil;
- FDefaultImage := TBitMap.Create;
- FDefaultMask := TBitMap.Create;
- FDefaultFramesCount := 1;
- end;
- destructor TspFrameSkinControl.Destroy;
- begin
- FDefaultImage.Free;
- FDefaultMask.Free;
- if FRgn <> 0
- then
- begin
- DeleteObject(FRgn);
- FRgn := 0;
- end;
- inherited;
- end;
- procedure TspFrameSkinControl.Loaded;
- begin
- inherited;
- CalcDefaultFrameSize;
- if (FIndex = -1) and (FSD = nil)
- then
- SetControlRegion;
- end;
- procedure TspFrameSkinControl.CalcDefaultFrameSize;
- begin
- if FDefaultImage.Empty then Exit;
- FramesCount := FDefaultFramesCount;
- FramesPlacement := FDefaultFramesPlacement;
- case FramesPlacement of
- fpHorizontal:
- begin
- FrameW := FDefaultImage.Width div FramesCount;
- FrameH := FDefaultImage.Height;
- end;
- fpVertical:
- begin
- FrameW := FDefaultImage.Width;
- FrameH := FDefaultImage.Height div FramesCount;
- end;
- end;
- end;
- procedure TspFrameSkinControl.SetDefaultMask;
- begin
- FDefaultMask.Assign(Value);
- SetControlRegion;
- RePaint;
- end;
- procedure TspFrameSkinControl.SetDefaultImage;
- begin
- FDefaultImage.Assign(Value);
- FFrame := 1;
- CalcDefaultFrameSize;
- SetBounds(Left, Top, FrameW, FrameH);
- RePaint;
- end;
- procedure TspFrameSkinControl.SetDefaultFramesCount;
- begin
- if Value <= 0
- then
- FDefaultFramesCount := 1
- else
- FDefaultFramesCount := Value;
- CalcDefaultFrameSize;
- SetBounds(Left, Top, FrameW, FrameH);
- RePaint;
- end;
- procedure TspFrameSkinControl.SetDefaultFramesPlacement;
- begin
- FDefaultFramesPlacement := Value;
- CalcDefaultFrameSize;
- SetBounds(Left, Top, FrameW, FrameH);
- RePaint;
- end;
- procedure TspFrameSkinControl.GetSkinData;
- begin
- inherited;
- if FIndex <> -1
- then
- if TspDataSkinControl(FSD.CtrlList.Items[FIndex]) is TspDataSkinFrameControl
- then
- begin
- with TspDataSkinFrameControl(FSD.CtrlList.Items[FIndex]) do
- begin
- Self.SkinRect := SkinRect;
- Self.CursorIndex := CursorIndex;
- if (PictureIndex <> -1) and (PictureIndex < FSD.FActivePictures.Count)
- then
- Picture := TBitMap(FSD.FActivePictures.Items[PictureIndex])
- else
- Picture := nil;
- if (MaskPictureIndex <> -1) and (MaskPictureIndex < FSD.FActivePictures.Count)
- then
- MaskPicture := TBitMap(FSD.FActivePictures.Items[MaskPictureIndex])
- else
- MaskPicture := nil;
- Self.FramesCount := FramesCount;
- Self.FramesPlacement := FramesPlacement;
- end;
- if FramesCount < 2 then FramesCount := 2;
- case FramesPlacement of
- fpHorizontal:
- begin
- FrameW := RectWidth(SkinRect) div FramesCount;
- FrameH := RectHeight(SkinRect);
- end;
- fpVertical:
- begin
- FrameH := RectHeight(SkinRect) div FramesCount;
- FrameW := RectWidth(SkinRect);
- end;
- end;
- end;
- end;
- procedure TspFrameSkinControl.SetBounds;
- var
- UpDate: Boolean;
- begin
- GetSkinData;
- UpDate := ((Width <> AWidth) or (Height <> AHeight)) and
- ((FIndex <> -1) or (not FDefaultImage.Empty and (FIndex = -1)));
- if UpDate
- then
- begin
- AWidth := FrameW;
- AHeight := FrameH;
- end;
- inherited;
- if UpDate
- then
- begin
- SetControlRegion;
- RePaint;
- end;
- end;
- procedure TspFrameSkinControl.ChangeSkinData;
- var
- UpDate: Boolean;
- begin
- GetSkinData;
- if (FIndex = -1) and (not FDefaultImage.Empty)
- then
- begin
- CalcDefaultFrameSize;
- SetControlRegion;
- SetBounds(Left, Top, FrameW, FrameH);
- RePaint;
- Exit;
- end;
- if (FIndex <> -1) and (FFrame > FramesCount)
- then FFrame := FramesCount;
- if FUseSkinCursor
- then
- if (CursorIndex <> -1) and (FIndex <> -1)
- then
- Cursor := FSD.StartCursorIndex + CursorIndex
- else
- Cursor := crDefault;
- if FIndex <> -1
- then
- begin
- UpDate := (Width <> FrameW) or (Height <> FrameH);
- SetBounds(Left, Top, FrameW, FrameH);
- end
- else
- UpDate := False;
- if not UpDate
- then
- begin
- SetControlRegion;
- RePaint;
- end;
- end;
- procedure TspFrameSkinControl.CreateControlDefaultImage;
- var
- R: TRect;
- begin
- if FDefaultImage.Empty
- then
- begin
- with B.Canvas do
- begin
- R := ClientRect;
- Brush.Color := clBtnFace;
- FillRect(R);
- end;
- Frame3D(B.Canvas, R, clBtnShadow, clBtnShadow, 1);
- end
- else
- begin
- CalcDefaultFrameSize;
- if B.Width <> FrameW then B.Width := FrameW;
- if B.Height <> FrameH then B.Height := FrameH;
- case FramesPlacement of
- fpHorizontal:
- R := Rect((FFrame - 1) * FrameW, 0,
- FFrame * FrameW, FrameH);
- fpVertical:
- R := Rect(0, (FFrame - 1) * FrameH,
- FrameW, FFrame * FrameH);
- end;
- B.Canvas.CopyRect(Rect(0, 0, FrameW, FrameH), FDefaultImage.Canvas, R);
- end;
- end;
- procedure TspFrameSkinControl.CreateControlSkinImage;
- var
- R: TRect;
- begin
- if B.Width <> FrameW then B.Width := FrameW;
- if B.Height <> FrameH then B.Height := FrameH;
- case FramesPlacement of
- fpHorizontal:
- R := Rect(SkinRect.Left + (FFrame - 1) * FrameW, SkinRect.Top,
- SkinRect.Left + FFrame * FrameW, SkinRect.Top + FrameH);
- fpVertical:
- R := Rect(SkinRect.Left, SkinRect.Top + (FFrame - 1) * FrameH,
- SkinRect.Left + FrameW, SkinRect.Top + FFrame * FrameH);
- end;
- B.Canvas.CopyRect(Rect(0, 0, FrameW, FrameH), Picture.Canvas, R);
- end;
- procedure TspFrameSkinControl.SetControlRegion;
- var
- TempRgn: HRgn;
- begin
- if (FIndex = -1) and not FDefaultMask.Empty
- then
- begin
- TempRgn := FRgn;
- CreateSkinSimplyRegion(FRgn, FDefaultMask);
- SetWindowRgn(Handle, FRgn, True);
- if TempRgn <> 0 then DeleteObject(TempRgn);
- end
- else
- if ((MaskPicture = nil) or (FIndex = -1)) and (FRgn <> 0)
- then
- begin
- SetWindowRgn(Handle, 0, True);
- DeleteObject(FRgn);
- FRgn := 0;
- end
- else
- if (MaskPicture <> nil) and (FIndex <> -1)
- then
- begin
- TempRgn := FRgn;
- CreateSkinSimplyRegion(FRgn, MaskPicture);
- SetWindowRgn(Handle, FRgn, True);
- if TempRgn <> 0 then DeleteObject(TempRgn);
- end;
- end;
- procedure TspFrameSkinControl.SetFrame;
- begin
- if (FIndex = -1) and FDefaultImage.Empty then Exit;
- if Value < 1 then Value := 1 else
- if Value > FramesCount then Value := FramesCount;
- if FFrame <> Value
- then
- begin
- FFrame := Value;
- RePaint;
- end;
- end;
- constructor TspSkinSwitch.Create;
- begin
- inherited Create(AOwner);
- Width := 25;
- Height := 50;
- FMouseIn := False;
- FAnimateTimer := TTimer.Create(Self);
- FAnimateTimer.Interval := 50;
- FAnimateTimer.Enabled := False;
- FAnimateTimer.OnTimer := DoAnimate;
- end;
- destructor TspSkinSwitch.Destroy;
- begin
- FAnimateTimer.Free;
- inherited;
- end;
- procedure TspSkinSwitch.DoAnimate;
- begin
- if (FIndex = -1) and FDefaultImage.Empty then Exit;
- if State = swOff
- then
- begin
- if Frame > 0 then Frame := Frame - 1 else Stop;
- end
- else
- begin
- if Frame < FramesCount then Frame := Frame + 1 else Stop;
- end;
- end;
- procedure TspSkinSwitch.Start;
- begin
- FAnimateTimer.Enabled := True;
- end;
- procedure TspSkinSwitch.Stop;
- begin
- FAnimateTimer.Enabled := False;
- end;
- procedure TspSkinSwitch.CMMouseEnter;
- begin
- inherited;
- FMouseIn := True;
- end;
- procedure TspSkinSwitch.CMMouseLeave;
- begin
- inherited;
- FMouseIn := False;
- end;
- procedure TspSkinSwitch.MouseUp(Button: TMouseButton; Shift: TShiftState;
- X, Y: Integer);
- begin
- if (Button = mbLeft) and FMouseIn
- then
- begin
- if State = swOff then State := swOn else State := swOff;
- end;
- inherited;
- end;
- procedure TspSkinSwitch.ChangeSkinData;
- begin
- inherited;
- if (FIndex <> -1) or ((FIndex = -1) and not FDefaultImage.Empty)
- then
- if FState = swOn
- then Frame := FramesCount
- else Frame := 1;
- end;
- procedure TspSkinSwitch.ChangeState;
- begin
- if (FIndex <> -1) or ((FIndex = -1) and not FDefaultImage.Empty)
- then
- begin
- if FramesCount = 2
- then
- begin
- if FState = swOn
- then Frame := 2
- else Frame := 1;
- end
- else
- Start;
- end
- else
- RePaint;
- end;
- procedure TspSkinSwitch.SetState;
- begin
- FState := Value;
- ChangeState(Value);
- if not (csDesigning in ComponentState)
- then
- if Assigned(FOnChange) then FOnChange(Self);
- end;
- procedure TspSkinSwitch.SetTimerInterval;
- begin
- FAnimateTimer.Interval := Value;
- end;
- function TspSkinSwitch.GetTimerInterval;
- begin
- Result := FAnimateTimer.Interval;
- end;
- constructor TspSkinAnimate.Create(AOwner: TComponent);
- begin
- inherited Create(AOwner);
- FAnimateTimer := TTimer.Create(Self);
- FAnimateTimer.Interval := 50;
- FAnimateTimer.Enabled := False;
- FAnimateTimer.OnTimer := DoAnimate;
- Width := 50;
- Height := 50;
- end;
- destructor TspSkinAnimate.Destroy;
- begin
- FAnimateTimer.Enabled := False;
- FAnimateTimer.Free;
- inherited;
- end;
- procedure TspSkinAnimate.SetActive;
- begin
- FActive := Value;
- if (FIndex <> -1) or ((FIndex = -1) and not FDefaultImage.Empty)
- then
- if FActive then Start else Stop;
- end;
- procedure TspSkinAnimate.SetTimerInterval;
- begin
- FAnimateTimer.Interval := Value;
- end;
- function TspSkinAnimate.GetTimerInterval;
- begin
- Result := FAnimateTimer.Interval;
- end;
- procedure TspSkinAnimate.DoAnimate;
- begin
- if (FIndex = -1) and FDefaultImage.Empty then Exit;
- if FButtonMode and not FMouseIn
- then
- begin
- if Frame > 0 then Frame := Frame - 1 else Stop;
- end
- else
- begin
- if Frame = FramesCount
- then
- begin
- if FCycleMode then Frame := 0
- end
- else
- begin
- if Frame < FramesCount then Frame := Frame + 1 else Stop;
- end;
- end;
- end;
- procedure TspSkinAnimate.CMMouseEnter(var Message: TMessage);
- begin
- inherited;
- if (FIndex = -1) and FDefaultImage.Empty then Exit;
- FMouseIn := True;
- if FButtonMode then Start;
- end;
- procedure TspSkinAnimate.CMMouseLeave(var Message: TMessage);
- begin
- inherited;
- if (FIndex = -1) and FDefaultImage.Empty then Exit;
- FMouseIn := False;
- if FButtonMode then Start;
- end;
- procedure TspSkinAnimate.Start;
- begin
- if not FCycleMode and not FButtonMode then FFrame := 1;
- FAnimateTimer.Enabled := True;
- if Assigned(FOnStart) then FOnStart(Self);
- end;
- procedure TspSkinAnimate.Stop;
- begin
- FAnimateTimer.Enabled := False;
- if Assigned(FOnStop) then FOnStop(Self);
- end;
- constructor TspSkinFrameGauge.Create;
- begin
- inherited;
- FMinValue := 0;
- FMaxValue := 100;
- FValue := 50;
- Width := 50;
- Height := 50;
- end;
- procedure TspSkinFrameGauge.ChangeSkinData;
- begin
- inherited;
- if (FIndex <> -1) or ((FIndex = -1) and not FDefaultImage.Empty)
- then CalcFrame;
- end;
- procedure TspSkinFrameGauge.CalcFrame;
- var
- FValInc: Integer;
- begin
- FValInc := (FMaxValue - FMinValue) div (FramesCount - 1);
- Frame := Abs(FValue - FMinValue) div FValInc + 1;
- end;
- procedure TspSkinFrameGauge.SetMinValue;
- begin
- FMinValue := AValue;
- if (FIndex <> -1) or ((FIndex = -1) and not FDefaultImage.Empty)
- then
- begin
- if FValue < FMinValue then FValue := FMinValue;
- CalcFrame;
- end;
- end;
- procedure TspSkinFrameGauge.SetMaxValue;
- begin
- FMaxValue := AValue;
- if (FIndex <> -1) or ((FIndex = -1) and not FDefaultImage.Empty)
- then
- begin
- if FValue > FMaxValue then FValue := FMaxValue;
- CalcFrame;
- end;
- end;
- procedure TspSkinFrameGauge.SetValue;
- begin
- if (FValue = AValue) or (AValue > FMaxValue) or
- (AValue < FMinValue) then Exit;
- FValue := AValue;
- if (FIndex <> -1) or ((FIndex = -1) and not FDefaultImage.Empty) then CalcFrame;
- end;
- constructor TspSkinFrameRegulator.Create;
- begin
- inherited;
- FMinValue := 0;
- FMaxValue := 100;
- FValue := 50;
- Width := 50;
- Height := 50;
- FDown := False;
- FFrame := 1;
- Kind := rkRound;
- end;
- procedure TspSkinFrameRegulator.SetDefaultKind;
- begin
- FDefaultKind := Value;
- Kind := FDefaultKind;
- end;
- procedure TspSkinFrameRegulator.CalcDefaultFrameSize;
- begin
- inherited;
- Kind := FDefaultKind;
- end;
- procedure TspSkinFrameRegulator.ChangeSkinData;
- begin
- inherited;
- if (FIndex <> -1) or ((FIndex = -1) and not FDefaultImage.Empty) then CalcFrame;
- end;
- procedure TspSkinFrameRegulator.CalcValue;
- var
- Offset: Integer;
- Plus: Boolean;
- FW: Integer;
- FC: Integer;
- begin
- if (FIndex = -1) and not FDefaultImage.Empty then CalcDefaultFrameSize;
- FW := 0;
- case Kind of
- rkRound: if FrameW > FrameH then FW := FrameH else FW := FrameW;
- rkVertical: FW := FrameH;
- rkHorizontal: FW := FrameW;
- end;
- if FramesCount - 1 > 0 then FC := FramesCount - 1 else FC := 1;
- FPixInc := FW div FC;
- FValInc := (FMaxValue - FMinValue) div FC;
- if FPixInc = 0 then FPixInc := 1;
- if FValInc = 0 then FValInc := 1;
- Plus := CurV >= StartV;
- if Plus
- then Offset := CurV - StartV
- else Offset := StartV - CurV;
- if Offset >= FPixInc
- then
- begin
- StartV := CurV;
- if Plus
- then TempValue := TempValue + FValInc
- else TempValue := TempValue - FValInc;
- if TempValue < FMinValue then TempValue := FMinValue;
- if TempValue > FMaxValue then TempValue := FMaxValue;
- Value := TempValue;
- end;
- end;
- procedure TspSkinFrameRegulator.CalcFrame;
- var
- FC: Integer;
- begin
- if (FIndex = -1) and not FDefaultImage.Empty then CalcDefaultFrameSize;
- if FramesCount - 1 > 0 then FC := FramesCount - 1 else FC := 1;
- FValInc := (FMaxValue - FMinValue) div FC;
- Frame := Abs(FValue - FMinValue) div FValInc + 1;
- end;
- procedure TspSkinFrameRegulator.SetMinValue;
- begin
- FMinValue := AValue;
- if (FIndex <> -1) or ((FIndex = -1) and not FDefaultImage.Empty)
- then
- begin
- if FValue < FMinValue then FValue := FMinValue;
- CalcFrame;
- end;
- end;
- procedure TspSkinFrameRegulator.SetMaxValue;
- begin
- FMaxValue := AValue;
- if (FIndex <> -1) or ((FIndex = -1) and not FDefaultImage.Empty)
- then
- begin
- if FValue > FMaxValue then FValue := FMaxValue;
- CalcFrame;
- end;
- end;
- procedure TspSkinFrameRegulator.SetValue;
- begin
- if (FValue = AValue) or (AValue > FMaxValue) or
- (AValue < FMinValue) then Exit;
- FValue := AValue;
- if (FIndex <> -1) or ((FIndex = -1) and not FDefaultImage.Empty) then CalcFrame;
- if Assigned(FOnChange) then FOnChange(Self);
- end;
- procedure TspSkinFrameRegulator.GetSkinData;
- begin
- inherited;
- if (FIndex <> -1)
- then
- if TspDataSkinControl(FSD.CtrlList.Items[FIndex]) is TspDataSkinFrameRegulator
- then
- with TspDataSkinFrameRegulator(FSD.CtrlList.Items[FIndex]) do
- begin
- Self.Kind := Kind;
- end;
- end;
- procedure TspSkinFrameRegulator.MouseDown;
- begin
- FDown := True;
- TempValue := FValue;
- case Kind of
- rkRound: StartV := X - Y;
- rkVertical: StartV := -Y;
- rkHorizontal: StartV := X;
- end;
- inherited;
- end;
- procedure TspSkinFrameRegulator.MouseUp;
- begin
- FDown := False;
- inherited;
- end;
- procedure TspSkinFrameRegulator.MouseMove;
- begin
- if FDown and ((FIndex <> -1) or ((FIndex = -1) and not FDefaultImage.Empty))
- then
- begin
- case Kind of
- rkRound: CurV := X - Y;
- rkVertical: CurV := -Y;
- rkHorizontal: CurV := X;
- end;
- CalcValue;
- end;
- inherited;
- end;
- constructor TspSkinCustomControl.Create;
- begin
- inherited Create(AOwner);
- FDefaultWidth := 0;
- FDefaultHeight := 0;
- FDefaultFont := TFont.Create;
- FDefaultFont.OnChange := OnDefaultFontChange;
- with FDefaultFont do
- begin
- Name := 'Arial';
- Style := [];
- Height := 14;
- end;
- FUseSkinFont := True;
- end;
- destructor TspSkinCustomControl.Destroy;
- begin
- if FRgn <> 0
- then
- begin
- DeleteObject(FRgn);
- FRgn := 0;
- end;
- FDefaultFont.Free;
- inherited Destroy;
- end;
- procedure TspSkinCustomControl.SetDefaultWidth;
- begin
- FDefaultWidth := Value;
- if (FIndex = -1) and (FDefaultWidth > 0) then Width := FDefaultWidth;
- end;
- procedure TspSkinCustomControl.SetDefaultHeight;
- begin
- FDefaultHeight := Value;
- if (FIndex = -1) and (FDefaultHeight > 0) then Height := FDefaultHeight;
- end;
- procedure TspSkinCustomControl.DefaultFontChange;
- begin
- end;
- procedure TspSkinCustomControl.SetDefaultFont;
- begin
- FDefaultFont.Assign(Value);
- DefaultFontChange;
- end;
- procedure TspSkinCustomControl.OnDefaultFontChange;
- begin
- DefaultFontChange;
- if FIndex = -1 then RePaint;
- end;
- procedure TspSkinCustomControl.CreateControlDefaultImage;
- var
- R: TRect;
- begin
- with B.Canvas do
- begin
- Brush.Color := clBtnFace;
- R := ClientRect;
- FillRect(R);
- end;
- end;
- procedure TspSkinCustomControl.ChangeSkinData;
- var
- W, H: Integer;
- UpDate: Boolean;
- begin
- GetSkinData;
- if FUseSkinCursor
- then
- if CursorIndex <> -1
- then
- Cursor := FSD.StartCursorIndex + CursorIndex
- else
- Cursor := crDefault;
- W := Width;
- H := Height;
- if FIndex <> -1
- then
- begin
- CalcSize(W, H);
- Update := (W <> Width) or (H <> Height);
- if W <> Width then Width := W;
- if H <> Height then Height := H;
- end
- else
- begin
- UpDate := False;
- if FDefaultWidth > 0 then Width := FDefaultWidth;
- if FDefaultHeight > 0 then Height := FDefaultHeight;
- end;
- if (not UpDate) or (FIndex = -1)
- then
- begin
- SetControlRegion;
- RePaint;
- end;
-
- end;
- procedure TspSkinCustomControl.SetBounds;
- var
- UpDate: Boolean;
- begin
- GetSkinData;
- UpDate := ((Width <> AWidth) or (Height <> AHeight)) and (FIndex <> -1);
- if UpDate
- then
- begin
- CalcSize(AWidth, AHeight);
- if ResizeMode = 0 then NewClRect := ClRect;
- end;
- inherited;
- if UpDate
- then
- begin
- SetControlRegion;
- RePaint;
- end;
- end;
- procedure TspSkinCustomControl.CalcSize;
- var
- XO, YO: Integer;
- begin
- if ResizeMode > 0
- then
- begin
- XO := W - RectWidth(SkinRect);
- YO := H - RectHeight(SkinRect);
- NewLTPoint := LTPt;
- case ResizeMode of
- 1:
- begin
- NewRTPoint := Point(RTPt.X + XO, RTPt.Y);
- NewLBPoint := Point(LBPt.X, LBPt.Y + YO);
- NewRBPoint := Point(RBPt.X + XO, RBPt.Y + YO);
- NewClRect := Rect(CLRect.Left, ClRect.Top,
- CLRect.Right + XO, ClRect.Bottom + YO);
- end;
- 2:
- begin
- H := RectHeight(SkinRect);
- NewRTPoint := Point(RTPt.X + XO, RTPt.Y );
- NewClRect := ClRect;
- Inc(NewClRect.Right, XO);
- end;
- 3:
- begin
- W := RectWidth(SkinRect);
- NewLBPoint := Point(LBPt.X, LBPt.Y + YO);
- NewClRect := ClRect;
- Inc(NewClRect.Bottom, YO);
- end;
- end;
- end
- else
- if (FIndex <> -1) and (ResizeMode = 0)
- then
- begin
- W := RectWidth(SkinRect);
- H := RectHeight(SkinRect);
- NewClRect := CLRect;
- end;
- end;
- procedure TspSkinCustomControl.CreateControlSkinImage;
- begin
- CreateSkinControlImage(B, Picture, SkinRect);
- end;
- procedure TspSkinCustomControl.CreateSkinControlImage;
- begin
- case ResizeMode of
- 0:
- begin
- B.Width := RectWidth(R);
- B.Height := RectHeight(R);
- B.Canvas.CopyRect(Rect(0, 0, B.Width, B.Height), SB.Canvas, R);
- end;
- 1: CreateSkinImage(LTPt, RTPt, LBPt, RBPt, CLRect,
- NewLtPoint, NewRTPoint, NewLBPoint, NewRBPoint, NewCLRect,
- B, SB, R, Width, Height, True);
- 2: CreateHSkinImage(LTPt.X, RectWidth(SkinRect) - RTPt.X,
- B, SB, R, Width, Height);
- 3: CreateVSkinImage(LTPt.Y, RectHeight(SkinRect) - LBPt.Y,
- B, SB, R, Width, Height);
- end;
- end;
- function TspSkinCustomControl.GetResizeMode;
- begin
- if IsNullRect(SkinRect)
- then
- Result := -1
- else
- if (RBPt.X <> 0) and (RBPt.Y <> 0)
- then
- Result := 1
- else
- if (RTPt.X <> 0) or (RTPT.Y <> 0)
- then
- Result := 2
- else
- if (LBPt.X <> 0) or (LBPt.Y <> 0)
- then
- Result := 3
- else
- Result := 0;
- end;
- function TspSkinCustomControl.GetNewRect;
- var
- XO, YO: Integer;
- LeftTop, LeftBottom, RightTop, RightBottom: TRect;
- function CorrectResizeRect: TRect;
- var
- NR: TRect;
- begin
- NR := R;
- if PointInRect(LeftTop, R.TopLeft) and
- PointInRect(RightBottom, R.BottomRight)
- then
- begin
- Inc(NR.Right, XO);
- Inc(NR.Bottom, YO);
- end
- else
- if PointInRect(LeftTop, R.TopLeft) and
- PointInRect(RightTop, R.BottomRight)
- then
- Inc(NR.Right, XO)
- else
- if PointInRect(LeftBottom, R.TopLeft) and
- PointInRect(RightBottom, R.BottomRight)
- then
- begin
- Inc(NR.Right, XO);
- OffsetRect(NR, 0, YO);
- end
- else
- if PointInRect(LeftTop, R.TopLeft) and
- PointInRect(LeftBottom, R.BottomRight)
- then
- Inc(NR.Bottom, YO)
- else
- if PointInRect(RightTop, R.TopLeft) and
- PointInRect(RightBottom, R.BottomRight)
- then
- begin
- OffsetRect(NR, XO, 0);
- Inc(NR.Bottom, YO);
- end;
- Result := NR;
- end;
- begin
- XO := Width - RectWidth(SkinRect);
- YO := Height - RectHeight(SkinRect);
- Result := R;
- case ResizeMode of
- 1:
- begin
- LeftTop := Rect(0, 0, LTPt.X, LTPt.Y);
- LeftBottom := Rect(0, LBPt.Y, LBPt.X, RectHeight(SkinRect));
- RightTop := Rect(RTPt.X, 0, RectWidth(SkinRect), RTPt.Y);
- RightBottom := Rect(RBPt.X, RBPt.Y,
- RectWidth(SkinRect), RectHeight(SkinRect));
- Result := R;
- if RectInRect(R, LeftTop)
- then Result := R
- else
- if RectInRect(R, RightTop)
- then OffsetRect(Result, XO, 0)
- else
- if RectInRect(R, LeftBottom)
- then OffsetRect(Result, 0, YO)
- else
- if RectInRect(R, RightBottom)
- then
- OffsetRect(Result, XO, YO)
- else