lazarus/lcl/widgetset/wsbuttons.pp
paul ee80b0fd46 ImageList:
- InsertBitmap improved to add multiple bitmaps from one big
- GetBitmap extended to get Bitmaps with different effects
- add DrawToDC to win32 imagelist to give ability to draw without TCanvas (having only HDC)

TButtonGlyph:
- use internal imagelist to perform different state drawing of glyph

TBitBtn:
- send ButtonGlyph to widgetset instead of TBitmap to perform different state drawing

git-svn-id: trunk@12779 -
2007-11-08 08:36:03 +00:00

107 lines
3.9 KiB
ObjectPascal

{ $Id$}
{
*****************************************************************************
* WSButtons.pp *
* ------------ *
* *
* *
*****************************************************************************
*****************************************************************************
* *
* This file is part of the Lazarus Component Library (LCL) *
* *
* See the file COPYING.modifiedLGPL, included in this distribution, *
* for details about the copyright. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. *
* *
*****************************************************************************
}
unit WSButtons;
{$mode objfpc}{$H+}
interface
////////////////////////////////////////////////////
// I M P O R T A N T
////////////////////////////////////////////////////
// 1) Only class methods allowed
// 2) Class methods have to be published and virtual
// 3) To get as little as posible circles, the uses
// clause should contain only those LCL units
// needed for registration. WSxxx units are OK
// 4) To improve speed, register only classes in the
// initialization section which actually
// implement something
// 5) To enable your XXX widgetset units, look at
// the uses clause of the XXXintf.pp
////////////////////////////////////////////////////
uses
////////////////////////////////////////////////////
// To get as little as posible circles,
// uncomment only when needed for registration
////////////////////////////////////////////////////
Classes, Controls, Buttons, Graphics,
////////////////////////////////////////////////////
WSLCLClasses, WSStdCtrls, WSControls, LCLType, LCLIntf;
type
{ TWSBitBtn }
TWSBitBtnClass = class of TWSBitBtn;
TWSBitBtn = class(TWSButton)
class procedure SetGlyph(const ABitBtn: TCustomBitBtn; const AValue: TButtonGlyph); virtual;
class procedure SetLayout(const ABitBtn: TCustomBitBtn; const AValue: TButtonLayout); virtual;
class procedure SetMargin(const ABitBtn: TCustomBitBtn; const AValue: Integer); virtual;
class procedure SetSpacing(const ABitBtn: TCustomBitBtn; const AValue: Integer); virtual;
end;
{ TWSSpeedButton }
TWSSpeedButtonClass = class of TWSSpeedButton;
TWSSpeedButton = class(TWSGraphicControl)
end;
implementation
// TODO: Can't be virtual abstract ?
{ TWSCustomBitBtn }
class procedure TWSBitBtn.SetGlyph(const ABitBtn: TCustomBitBtn;
const AValue: TButtonGlyph);
begin
end;
class procedure TWSBitBtn.SetLayout(const ABitBtn: TCustomBitBtn;
const AValue: TButtonLayout);
begin
end;
class procedure TWSBitBtn.SetMargin(const ABitBtn: TCustomBitBtn;
const AValue: Integer);
begin
end;
class procedure TWSBitBtn.SetSpacing(const ABitBtn: TCustomBitBtn;
const AValue: Integer);
begin
end;
initialization
////////////////////////////////////////////////////
// To improve speed, register only classes
// which actually implement something
////////////////////////////////////////////////////
// RegisterWSComponent(TCustomButton, TWSButton);
// RegisterWSComponent(TCustomBitBtn, TWSBitBtn);
// RegisterWSComponent(TCustomSpeedButton, TWSSpeedButton);
////////////////////////////////////////////////////
end.