1{ 2 ***************************************************************************** 3 * WSButtons.pp * 4 * ------------ * 5 * * 6 * * 7 ***************************************************************************** 8 9 ***************************************************************************** 10 This file is part of the Lazarus Component Library (LCL) 11 12 See the file COPYING.modifiedLGPL.txt, included in this distribution, 13 for details about the license. 14 ***************************************************************************** 15} 16unit WSButtons; 17 18{$mode objfpc}{$H+} 19{$I lcl_defines.inc} 20 21interface 22//////////////////////////////////////////////////// 23// I M P O R T A N T 24//////////////////////////////////////////////////// 25// 1) Only class methods allowed 26// 2) Class methods have to be published and virtual 27// 3) To get as little as posible circles, the uses 28// clause should contain only those LCL units 29// needed for registration. WSxxx units are OK 30// 4) To improve speed, register only classes in the 31// initialization section which actually 32// implement something 33// 5) To enable your XXX widgetset units, look at 34// the uses clause of the XXXintf.pp 35//////////////////////////////////////////////////// 36uses 37//////////////////////////////////////////////////// 38// To get as little as posible circles, 39// uncomment only when needed for registration 40//////////////////////////////////////////////////// 41 Classes, Controls, Buttons, Graphics, 42//////////////////////////////////////////////////// 43 WSLCLClasses, WSStdCtrls, WSControls, LCLType, LCLIntf, WSFactory; 44 45type 46 47 { TWSBitBtn } 48 49 TWSBitBtnClass = class of TWSBitBtn; 50 TWSBitBtn = class(TWSButton) 51 published 52 class procedure SetGlyph(const ABitBtn: TCustomBitBtn; const AValue: TButtonGlyph); virtual; 53 class procedure SetLayout(const ABitBtn: TCustomBitBtn; const AValue: TButtonLayout); virtual; 54 class procedure SetMargin(const ABitBtn: TCustomBitBtn; const AValue: Integer); virtual; 55 class procedure SetSpacing(const ABitBtn: TCustomBitBtn; const AValue: Integer); virtual; 56 end; 57 58 { TWSSpeedButton } 59 60 TWSSpeedButtonClass = class of TWSSpeedButton; 61 TWSSpeedButton = class(TWSGraphicControl) 62 published 63 end; 64 65 { WidgetSetRegistration } 66 67 procedure RegisterCustomBitBtn; 68 procedure RegisterCustomSpeedButton; 69 70implementation 71 72uses 73 LResources; 74 75 76// TODO: Can't be virtual abstract ? 77 78{ TWSCustomBitBtn } 79 80class procedure TWSBitBtn.SetGlyph(const ABitBtn: TCustomBitBtn; 81 const AValue: TButtonGlyph); 82begin 83end; 84 85class procedure TWSBitBtn.SetLayout(const ABitBtn: TCustomBitBtn; 86 const AValue: TButtonLayout); 87begin 88end; 89 90class procedure TWSBitBtn.SetMargin(const ABitBtn: TCustomBitBtn; 91 const AValue: Integer); 92begin 93end; 94 95class procedure TWSBitBtn.SetSpacing(const ABitBtn: TCustomBitBtn; 96 const AValue: Integer); 97begin 98end; 99 100{ WidgetSetRegistration } 101 102procedure RegisterCustomBitBtn; 103const 104 Done: Boolean = False; 105begin 106 if Done then exit; 107 WSRegisterCustomBitBtn; 108 RegisterPropertyToSkip(TBitBtn, 'Style', 'VCL compatibility property', ''); 109// if not WSRegisterCustomBitBtn then 110// RegisterWSComponent(TCustomBitBtn, TWSBitBtn); 111 Done := True; 112end; 113 114procedure RegisterCustomSpeedButton; 115const 116 Done: Boolean = False; 117begin 118 if Done then exit; 119 WSRegisterCustomSpeedButton; 120// if not WSRegisterCustomSpeedButton then 121// RegisterWSComponent(TCustomSpeedButton, TWSSpeedButton); 122 Done := True; 123end; 124 125end. 126