?? ksskinspinbuttons.pas
字號:
{==============================================================================
SkinEngine's SpinButtons
Copyright (C) 2000-2002 by Evgeny Kryukov
All rights reserved
All conTeThements of this file and all other files included in this archive
are Copyright (C) 2002 Evgeny Kryukov. Use and/or distribution of
them requires acceptance of the License Agreement.
See License.txt for licence information
$Id: KsSkinSpinButtons.pas,v 1.1.1.1 2002/08/05 12:12:14 Evgeny Exp $
===============================================================================}
unit KsSkinSpinButtons;
{$I se_define.inc}
{$T-,W-,X+,P+}
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
ExtCtrls, Menus, Buttons, se_controls, KsSkinSpeedButtons,
KsSkinVersion, KsSkinObjects, KsSkinSource, KsSkinEngine;
type
{ TSeSkinSpinButton }
TSeSkinSpinButton = class (TSeCustomSpinButton)
private
FSkinEngine: TSeSkinEngine;
FSkinObject: string;
function GetVersion: TSeSkinVersion;
procedure SetSkinEngine(const Value: TSeSkinEngine);
procedure SetVersion(const Value: TSeSkinVersion);
procedure SetSkinObject(const Value: string);
protected
procedure WMInvalidateSkinObject(var Msg: TMessage); message WM_INVALIDATESKINOBJECT;
procedure WMBeforeChange(var Msg: TMessage); message WM_BEFORECHANGE;
procedure WMSkinChange(var Msg: TMessage); message WM_SKINCHANGE;
function CreateButton: TSeCustomSpeedButton; override;
{ VCL protected }
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
public
constructor Create(AOwner: TComponent); override;
procedure Loaded; override;
published
property SkinEngine: TSeSkinEngine read FSkinEngine write SetSkinEngine;
property SkinObject: string read FSkinObject write SetSkinObject;
property Version: TSeSkinVersion read GetVersion write SetVersion
stored false;
end;
implementation {===============================================================}
{ TSeSkinSpinButton }
constructor TSeSkinSpinButton.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FSkinObject := 'SpinButton';
end;
procedure TSeSkinSpinButton.Loaded;
begin
inherited;
SkinEngine := FSkinEngine;
end;
procedure TSeSkinSpinButton.WMBeforeChange(var Msg: TMessage);
begin
if Pointer(Msg.LParam) = nil then Exit;
if TSeSkinEngine(Msg.LParam) <> FSkinEngine then Exit;
if UpButton <> nil then
begin
UpButton.Perform(Msg.Msg, Msg.wParam, Msg.lParam);
DownButton.Perform(Msg.Msg, Msg.wParam, Msg.lParam);
end;
end;
procedure TSeSkinSpinButton.WMSkinChange(var Msg: TMessage);
begin
if Pointer(Msg.LParam) = nil then Exit;
if TSeSkinEngine(Msg.LParam) <> FSkinEngine then Exit;
if UpButton <> nil then
begin
UpButton.Perform(Msg.Msg, Msg.wParam, Msg.lParam);
DownButton.Perform(Msg.Msg, Msg.wParam, Msg.lParam);
end;
end;
procedure TSeSkinSpinButton.WMInvalidateSkinObject(var Msg: TMessage);
begin
Invalidate;
if UpButton <> nil then
begin
(UpButton as TSeSkinSpeedButton).SkinEngine := FSkinEngine;
(DownButton as TSeSkinSpeedButton).SkinEngine := FSkinEngine;
end;
end;
function TSeSkinSpinButton.CreateButton: TSeCustomSpeedButton;
begin
Result := TSeSkinSpeedButton.Create(Self);
(Result as TSeSkinSpeedButton).SkinObject := 'SpinButton';
(Result as TSeSkinSpeedButton).Flat := true;
end;
procedure TSeSkinSpinButton.Notification(AComponent: TComponent;
Operation: TOperation);
begin
inherited;
if (Operation = opRemove) and (AComponent = FSkinEngine) then
SkinEngine := nil;
end;
{ Properties }
function TSeSkinSpinButton.GetVersion: TSeSkinVersion;
begin
Result := sSeSkinVersion;
end;
procedure TSeSkinSpinButton.SetSkinEngine(const Value: TSeSkinEngine);
begin
FSkinEngine := Value;
if UpButton <> nil then
begin
(UpButton as TSeSkinSpeedButton).SkinEngine := Value;
(DownButton as TSeSkinSpeedButton).SkinEngine := Value;
end;
Invalidate;
end;
procedure TSeSkinSpinButton.SetVersion(const Value: TSeSkinVersion);
begin
end;
procedure TSeSkinSpinButton.SetSkinObject(const Value: string);
begin
FSkinObject := Value;
if UpButton <> nil then
begin
(UpButton as TSeSkinSpeedButton).SkinObject := Value;
(DownButton as TSeSkinSpeedButton).SkinObject := Value;
(UpButton as TSeSkinSpeedButton).SkinEngine := FSkinEngine;
(DownButton as TSeSkinSpeedButton).SkinEngine := FSkinEngine;
SkinEngine := FSkinEngine;
end;
end;
end.
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -