⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ksskinspinbuttons.pas

📁 小区水费管理系统源代码水费收费管理系统 水费收费管理系统
💻 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 + -