1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349
|
{
*****************************************************************************
* WSExtCtrls.pp *
* ------------- *
* *
* *
*****************************************************************************
*****************************************************************************
This file is part of the Lazarus Component Library (LCL)
See the file COPYING.modifiedLGPL.txt, included in this distribution,
for details about the license.
*****************************************************************************
}
unit WSExtCtrls;
{$mode objfpc}{$H+}
{$I lcl_defines.inc}
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
////////////////////////////////////////////////////
LCLProc, Controls, ExtCtrls, Classes, ImgList, Graphics, LResources,
////////////////////////////////////////////////////
WSLCLClasses, WSControls, WSStdCtrls, WSFactory;
type
{ TWSPage }
TWSPage = class(TWSCustomControl)
published
end;
{ TWSNotebook }
TWSNotebook = class(TWSCustomControl)
published
class function GetDefaultColor(const AControl: TControl;
const ADefaultColorType: TDefaultColorType): TColor; override;
end;
{ TWSCustomShape }
TWSCustomShape = class(TWSGraphicControl)
published
end;
{ TWSCustomSplitter }
TWSCustomSplitter = class(TWSCustomControl)
published
end;
{ TWSSplitter }
TWSSplitter = class(TWSCustomSplitter)
published
end;
{ TWSPaintBox }
TWSPaintBox = class(TWSGraphicControl)
published
end;
{ TWSCustomImage }
TWSCustomImage = class(TWSGraphicControl)
published
end;
{ TWSImage }
TWSImage = class(TWSCustomImage)
published
end;
{ TWSBevel }
TWSBevel = class(TWSGraphicControl)
published
end;
{ TWSCustomRadioGroup }
TWSCustomRadioGroup = class(TWSCustomGroupBox)
published
end;
{ TWSRadioGroup }
TWSRadioGroup = class(TWSCustomRadioGroup)
published
end;
{ TWSCustomCheckGroup }
TWSCustomCheckGroup = class(TWSCustomGroupBox)
published
end;
{ TWSCheckGroup }
TWSCheckGroup = class(TWSCustomCheckGroup)
published
end;
{ TWSCustomLabeledEdit }
TWSCustomLabeledEdit = class(TWSCustomEdit)
published
end;
{ TWSLabeledEdit }
TWSLabeledEdit = class(TWSCustomLabeledEdit)
published
end;
{ TWSCustomPanel }
TWSCustomPanel = class(TWSCustomControl)
published
class function GetDefaultColor(const AControl: TControl; const ADefaultColorType: TDefaultColorType): TColor; override;
end;
{ TWSPanel }
TWSPanel = class(TWSCustomPanel)
end;
{ TWSCustomTrayIcon }
TWSCustomTrayIcon = class(TWSLCLComponent)
published
class function Hide(const ATrayIcon: TCustomTrayIcon): Boolean; virtual;
class function Show(const ATrayIcon: TCustomTrayIcon): Boolean; virtual;
class procedure InternalUpdate(const ATrayIcon: TCustomTrayIcon); virtual;
class function ShowBalloonHint(const ATrayIcon: TCustomTrayIcon): Boolean; virtual;
class function GetPosition(const ATrayIcon: TCustomTrayIcon): TPoint; virtual;
class function GetCanvas(const ATrayIcon: TCustomTrayIcon): TCanvas; virtual;
end;
TWSCustomTrayIconClass = class of TWSCustomTrayIcon;
{ WidgetSetRegistration }
procedure RegisterCustomShape;
procedure RegisterCustomSplitter;
procedure RegisterPaintBox;
procedure RegisterCustomImage;
procedure RegisterBevel;
procedure RegisterCustomRadioGroup;
procedure RegisterCustomCheckGroup;
procedure RegisterCustomLabeledEdit;
procedure RegisterCustomPanel;
procedure RegisterCustomTrayIcon;
implementation
{ TWSNotebook }
class function TWSNotebook.GetDefaultColor(const AControl: TControl;
const ADefaultColorType: TDefaultColorType): TColor;
begin
Result:=DefBtnColors[ADefaultColorType];
end;
{ TWSCustomTrayIcon }
class function TWSCustomTrayIcon.Hide(const ATrayIcon: TCustomTrayIcon): Boolean;
begin
Result := False;
end;
class function TWSCustomTrayIcon.Show(const ATrayIcon: TCustomTrayIcon): Boolean;
begin
Result := False;
end;
class procedure TWSCustomTrayIcon.InternalUpdate(const ATrayIcon: TCustomTrayIcon);
begin
end;
{*******************************************************************
* TWSCustomTrayIcon.ShowBalloonHint ()
*
* RETURNS: False if we should use the popupnotifier to implement this method
* True if a platform-specific baloon is implemented
*
*******************************************************************}
class function TWSCustomTrayIcon.ShowBalloonHint(const ATrayIcon: TCustomTrayIcon): Boolean;
begin
Result := False;
end;
class function TWSCustomTrayIcon.GetPosition(const ATrayIcon: TCustomTrayIcon): TPoint;
begin
Result := Point(0, 0);
end;
class function TWSCustomTrayIcon.GetCanvas(const ATrayIcon: TCustomTrayIcon): TCanvas;
begin
Result := ATrayIcon.Icon.Canvas;
end;
{ WidgetSetRegistration }
procedure RegisterCustomShape;
const
Done: Boolean = False;
begin
if Done then exit;
WSRegisterCustomShape;
// if not WSRegisterCustomShape then
// RegisterWSComponent(TCustomShape, TWSCustomShape);
Done := True;
end;
procedure RegisterCustomSplitter;
const
Done: Boolean = False;
begin
if Done then exit;
WSRegisterCustomSplitter;
// if not WSRegisterCustomSplitter then
// RegisterWSComponent(TCustomSplitter, TWSCustomSplitter);
Done := True;
end;
procedure RegisterPaintBox;
const
Done: Boolean = False;
begin
if Done then exit;
WSRegisterPaintBox;
// if not WSRegisterPaintBox then
// RegisterWSComponent(TPaintBox, TWSPaintBox);
Done := True;
end;
procedure RegisterCustomImage;
const
Done: Boolean = False;
begin
if Done then exit;
WSRegisterCustomImage;
// if not WSRegisterCustomImage then
// RegisterWSComponent(TCustomImage, TWSCustomImage);
Done := True;
end;
procedure RegisterBevel;
const
Done: Boolean = False;
begin
if Done then exit;
WSRegisterBevel;
// if not WSRegisterBevel then
// RegisterWSComponent(TBevel, TWSBevel);
Done := True;
end;
procedure RegisterCustomRadioGroup;
const
Done: Boolean = False;
begin
if Done then exit;
WSRegisterCustomRadioGroup;
// if not WSRegisterCustomRadioGroup then
// RegisterWSComponent(TCustomRadioGroup, TWSCustomRadioGroup);
Done := True;
end;
procedure RegisterCustomCheckGroup;
const
Done: Boolean = False;
begin
if Done then exit;
WSRegisterCustomCheckGroup;
// if not WSRegisterCustomCheckGroup then
// RegisterWSComponent(TCustomCheckGroup, TWSCustomCheckGroup);
Done := True;
end;
procedure RegisterCustomLabeledEdit;
const
Done: Boolean = False;
begin
if Done then exit;
WSRegisterCustomLabeledEdit;
// if not WSRegisterCustomLabeledEdit then
// RegisterWSComponent(TCustomLabeledEdit, TWSCustomLabeledEdit);
Done := True;
end;
procedure RegisterCustomPanel;
const
Done: Boolean = False;
begin
if Done then exit;
WSRegisterCustomPanel;
RegisterPropertyToSkip(TCustomPanel, 'VerticalAlignment', 'VCL compatibility property', '');
RegisterPropertyToSkip(TCustomPanel, 'ExplicitWidth', 'VCL compatibility property', '');
RegisterPropertyToSkip(TCustomPanel, 'ShowCaption', 'VCL compatibility property', '');
RegisterPropertyToSkip(TCustomPanel, 'ParentBackground', 'VCL compatibility property', '');
RegisterPropertyToSkip(TCustomPanel, 'BevelEdges', 'VCL compatibility property', '');
RegisterPropertyToSkip(TCustomPanel, 'BevelKind', 'VCL compatibility property', '');
// if not WSRegisterCustomPanel then
// RegisterWSComponent(TCustomPanel, TWSCustomPanel);
Done := True;
end;
procedure RegisterCustomTrayIcon;
const
Done: Boolean = False;
begin
if Done then exit;
if not WSRegisterCustomTrayIcon then
RegisterWSComponent(TCustomTrayIcon, TWSCustomTrayIcon);
Done := True;
end;
{ TWSCustomPanel }
class function TWSCustomPanel.GetDefaultColor(const AControl: TControl; const ADefaultColorType: TDefaultColorType): TColor;
begin
Result := DefBtnColors[ADefaultColorType];
end;
end.
|