1{ 2 ***************************************************************************** 3 * WSComCtrls.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 WSComCtrls; 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 Classes, 38//////////////////////////////////////////////////// 39// To get as little as posible circles, 40// uncomment only when needed for registration 41//////////////////////////////////////////////////// 42 Graphics, ImgList, Controls, StdCtrls, ComCtrls, 43//////////////////////////////////////////////////// 44 WSLCLClasses, WSControls, WSExtCtrls, WSToolwin, WSFactory; 45 46type 47 { TWSCustomPage } 48 49 TWSCustomPageClass = class of TWSCustomPage; 50 TWSCustomPage = class(TWSWinControl) 51 published 52 class procedure UpdateProperties(const ACustomPage: TCustomPage); virtual; 53 end; 54 55 { TWSCustomTabControl } 56 57 TWSCustomTabControl = class(TWSWinControl) 58 published 59 class procedure AddPage(const ATabControl: TCustomTabControl; const AChild: TCustomPage; const AIndex: integer); virtual; 60 class procedure MovePage(const ATabControl: TCustomTabControl; const AChild: TCustomPage; const NewIndex: integer); virtual; 61 class procedure RemovePage(const ATabControl: TCustomTabControl; const AIndex: integer); virtual; 62 63 class function GetNotebookMinTabHeight(const AWinControl: TWinControl): integer; virtual; 64 class function GetNotebookMinTabWidth(const AWinControl: TWinControl): integer; virtual; 65 class function GetTabIndexAtPos(const ATabControl: TCustomTabControl; const AClientPos: TPoint): integer; virtual; 66 class function GetTabRect(const ATabControl: TCustomTabControl; const AIndex: Integer): TRect; virtual; 67 class function GetCapabilities: TCTabControlCapabilities; virtual; 68 class procedure SetTabSize(const ATabControl: TCustomTabControl; const ATabWidth, ATabHeight: integer); virtual; 69 class procedure SetImageList(const ATabControl: TCustomTabControl; const AImageList: TCustomImageListResolution); virtual; 70 class procedure SetPageIndex(const ATabControl: TCustomTabControl; const AIndex: integer); virtual; 71 class procedure SetTabCaption(const ATabControl: TCustomTabControl; const AChild: TCustomPage; const AText: string); virtual; 72 class procedure SetTabPosition(const ATabControl: TCustomTabControl; const ATabPosition: TTabPosition); virtual; 73 class procedure ShowTabs(const ATabControl: TCustomTabControl; AShowTabs: boolean); virtual; 74 class procedure UpdateProperties(const ATabControl: TCustomTabControl); virtual; 75 end; 76 TWSCustomTabControlClass = class of TWSCustomTabControl; 77 78 { TWSStatusBar } 79 80 TWSStatusBarClass = class of TWSStatusBar; 81 TWSStatusBar = class(TWSWinControl) 82 published 83 class procedure PanelUpdate(const AStatusBar: TStatusBar; PanelIndex: integer); virtual; 84 class procedure SetPanelText(const AStatusBar: TStatusBar; PanelIndex: integer); virtual; 85 class procedure SetSizeGrip(const AStatusBar: TStatusBar; SizeGrip: Boolean); virtual; 86 class procedure Update(const AStatusBar: TStatusBar); virtual; 87 class function GetDefaultColor(const AControl: TControl; const ADefaultColorType: TDefaultColorType): TColor; override; 88 end; 89 90 { TWSTabSheet } 91 92 TWSTabSheet = class(TWSCustomPage) 93 published 94 class function GetDefaultColor(const AControl: TControl; 95 const ADefaultColorType: TDefaultColorType): TColor; override; 96 end; 97 98 { TWSPageControl } 99 100 TWSPageControl = class(TWSCustomTabControl) 101 published 102 end; 103 104 { TWSCustomListView } 105 TWSListViewItemChange = (lvicText, lvicImage); 106 TWSListViewItemChanges = set of TWSListViewItemChange; 107 108 TWSCustomListView = class(TWSWinControl) 109 published 110 // Column 111 class procedure ColumnDelete(const ALV: TCustomListView; const AIndex: Integer); virtual; 112 class function ColumnGetWidth(const ALV: TCustomListView; const AIndex: Integer; const AColumn: TListColumn): Integer; virtual; 113 class procedure ColumnInsert(const ALV: TCustomListView; const AIndex: Integer; const AColumn: TListColumn); virtual; 114 class procedure ColumnMove(const ALV: TCustomListView; const AOldIndex, ANewIndex: Integer; const AColumn: TListColumn); virtual; 115 class procedure ColumnSetAlignment(const ALV: TCustomListView; const AIndex: Integer; const AColumn: TListColumn; const AAlignment: TAlignment); virtual; 116 class procedure ColumnSetAutoSize(const ALV: TCustomListView; const AIndex: Integer; const AColumn: TListColumn; const AAutoSize: Boolean); virtual; 117 class procedure ColumnSetCaption(const ALV: TCustomListView; const AIndex: Integer; const AColumn: TListColumn; const ACaption: String); virtual; 118 class procedure ColumnSetImage(const ALV: TCustomListView; const AIndex: Integer; const AColumn: TListColumn; const AImageIndex: Integer); virtual; 119 class procedure ColumnSetMaxWidth(const ALV: TCustomListView; const AIndex: Integer; const AColumn: TListColumn; const AMaxWidth: Integer); virtual; 120 class procedure ColumnSetMinWidth(const ALV: TCustomListView; const AIndex: Integer; const AColumn: TListColumn; const AMinWidth: integer); virtual; 121 class procedure ColumnSetWidth(const ALV: TCustomListView; const AIndex: Integer; const AColumn: TListColumn; const AWidth: Integer); virtual; 122 class procedure ColumnSetVisible(const ALV: TCustomListView; const AIndex: Integer; const AColumn: TListColumn; const AVisible: Boolean); virtual; 123 class procedure ColumnSetSortIndicator(const ALV: TCustomListView; const AIndex: Integer; const AColumn: TListColumn; const ASortIndicator: TSortIndicator); virtual; 124 125 // Item 126 class procedure ItemDelete(const ALV: TCustomListView; const AIndex: Integer); virtual; 127 class function ItemDisplayRect(const ALV: TCustomListView; const AIndex, ASubItem: Integer; ACode: TDisplayCode): TRect; virtual; 128 class procedure ItemExchange(const ALV: TCustomListView; AItem: TListItem; const AIndex1, AIndex2: Integer); virtual; 129 class procedure ItemMove(const ALV: TCustomListView; AItem: TListItem; const AFromIndex, AToIndex: Integer); virtual; 130 class function ItemGetChecked(const ALV: TCustomListView; const AIndex: Integer; const AItem: TListItem): Boolean; virtual; 131 class function ItemGetPosition(const ALV: TCustomListView; const AIndex: Integer): TPoint; virtual; 132 class function ItemGetState(const ALV: TCustomListView; const AIndex: Integer; const AItem: TListItem; const AState: TListItemState; out AIsSet: Boolean): Boolean; virtual; // returns True if supported 133 class procedure ItemInsert(const ALV: TCustomListView; const AIndex: Integer; const AItem: TListItem); virtual; 134 class procedure ItemSetChecked(const ALV: TCustomListView; const AIndex: Integer; const AItem: TListItem; const AChecked: Boolean); virtual; 135 class procedure ItemSetImage(const ALV: TCustomListView; const AIndex: Integer; const AItem: TListItem; const ASubIndex, AImageIndex: Integer); virtual; 136 class function ItemSetPosition(const ALV: TCustomListView; const AIndex: Integer; const ANewPosition: TPoint): Boolean; virtual; 137 class procedure ItemSetStateImage(const ALV: TCustomListView; const AIndex: Integer; const AItem: TListItem; const ASubIndex, AStateImageIndex: Integer); virtual; 138 class procedure ItemSetState(const ALV: TCustomListView; const AIndex: Integer; const AItem: TListItem; const AState: TListItemState; const AIsSet: Boolean); virtual; 139 class procedure ItemSetText(const ALV: TCustomListView; const AIndex: Integer; const AItem: TListItem; const ASubIndex: Integer; const AText: String); virtual; 140 class procedure ItemShow(const ALV: TCustomListView; const AIndex: Integer; const AItem: TListItem; const PartialOK: Boolean); virtual; 141 class procedure ItemUpdate(const ALV: TCustomListView; const AIndex: Integer; const AItem: TListItem); virtual; 142 143 // LV 144 class procedure BeginUpdate(const ALV: TCustomListView); virtual; 145 class procedure EndUpdate(const ALV: TCustomListView); virtual; 146 147 class function GetBoundingRect(const ALV: TCustomListView): TRect; virtual; 148 class function GetDropTarget(const ALV: TCustomListView): Integer; virtual; 149 class function GetFocused(const ALV: TCustomListView): Integer; virtual; 150 class function GetHitTestInfoAt( const ALV: TCustomListView; X, Y: Integer ) : THitTests; virtual; 151 class function GetHoverTime(const ALV: TCustomListView): Integer; virtual; 152 class function GetItemAt(const ALV: TCustomListView; x,y: integer): Integer; virtual; 153 class function GetSelCount(const ALV: TCustomListView): Integer; virtual; 154 class function GetSelection(const ALV: TCustomListView): Integer; virtual; 155 class function GetTopItem(const ALV: TCustomListView): Integer; virtual; 156 class function GetViewOrigin(const ALV: TCustomListView): TPoint; virtual; 157 class function GetVisibleRowCount(const ALV: TCustomListView): Integer; virtual; 158 159 class procedure SelectAll(const ALV: TCustomListView; const AIsSet: Boolean); virtual; 160 class procedure SetAllocBy(const ALV: TCustomListView; const AValue: Integer); virtual; 161 class procedure SetDefaultItemHeight(const ALV: TCustomListView; const AValue: Integer); virtual; 162 class procedure SetHotTrackStyles(const ALV: TCustomListView; const AValue: TListHotTrackStyles); virtual; 163 class procedure SetHoverTime(const ALV: TCustomListView; const AValue: Integer); virtual; 164 class procedure SetIconArrangement(const ALV: TCustomListView; const AValue: TIconArrangement); virtual; 165 class procedure SetImageList(const ALV: TCustomListView; const AList: TListViewImageList; const AValue: TCustomImageListResolution); virtual; 166 class procedure SetItemsCount(const ALV: TCustomListView; const Avalue: Integer); virtual; 167 class procedure SetOwnerData(const ALV: TCustomListView; const AValue: Boolean); virtual; 168 class procedure SetProperty(const ALV: TCustomListView; const AProp: TListViewProperty; const AIsSet: Boolean); virtual; 169 class procedure SetProperties(const ALV: TCustomListView; const AProps: TListViewProperties); virtual; 170 class procedure SetScrollBars(const ALV: TCustomListView; const AValue: TScrollStyle); virtual; 171 class procedure SetSort(const ALV: TCustomListView; const AType: TSortType; const AColumn: Integer; 172 const ASortDirection: TSortDirection); virtual; 173 class procedure SetViewOrigin(const ALV: TCustomListView; const AValue: TPoint); virtual; 174 class procedure SetViewStyle(const ALV: TCustomListView; const Avalue: TViewStyle); virtual; 175 end; 176 177 TWSCustomListViewClass = class of TWSCustomListView; 178 179 { TWSListView } 180 181 TWSListView = class(TWSCustomListView) 182 published 183 end; 184 185 { TWSProgressBar } 186 187 TWSProgressBarClass = class of TWSProgressBar; 188 TWSProgressBar = class(TWSWinControl) 189 published 190 class procedure ApplyChanges(const AProgressBar: TCustomProgressBar); virtual; 191 class procedure SetPosition(const AProgressBar: TCustomProgressBar; const NewPosition: integer); virtual; 192 class procedure SetStyle(const AProgressBar: TCustomProgressBar; const NewStyle: TProgressBarStyle); virtual; 193 end; 194 195 { TWSCustomUpDown } 196 197 TWSCustomUpDown = class(TWSCustomControl) 198 published 199 class procedure SetIncrement(const AUpDown: TCustomUpDown; AValue: Double); virtual; 200 class procedure SetMaxPosition(const AUpDown: TCustomUpDown; AValue: Double); virtual; 201 class procedure SetMinPosition(const AUpDown: TCustomUpDown; AValue: Double); virtual; 202 class procedure SetOrientation(const AUpDown: TCustomUpDown; AOrientation: TUDOrientation); virtual; 203 class procedure SetPosition(const AUpDown: TCustomUpDown; AValue: Double); virtual; 204 // class procedure SetRepeatInterval(const AUpDown: TWSCustomUpDown; ms: Integer); virtual; 205 class procedure SetUseArrowKeys(const AUpDown: TCustomUpDown; AUseArrow: Boolean); virtual; 206 class procedure SetWrap(const AUpDown: TCustomUpDown; ADoWrap: Boolean); virtual; 207 end; 208 TWSCustomUpDownClass = class of TWSCustomUpDown; 209 210 { TWSUpDown } 211 212 TWSUpDown = class(TWSCustomUpDown) 213 published 214 end; 215 216 { TWSToolButton } 217 218 TWSToolButton = class(TWSCustomControl) 219 published 220 end; 221 222 { TWSToolBar } 223 224 TWSToolbarClass = class of TWSToolbar; 225 TWSToolBar = class(TWSToolWindow) 226 published 227{$ifdef OldToolbar} 228 class function GetButtonCount(const AToolBar: TToolBar): integer; virtual; 229 class procedure InsertToolButton(const AToolBar: TToolbar; const AControl: TControl); virtual; 230 class procedure DeleteToolButton(const AToolBar: TToolbar; const AControl: TControl); virtual; 231{$endif} 232 end; 233 234 { TWSTrackBar } 235 236 TWSTrackBar = class(TWSWinControl) 237 published 238 class procedure ApplyChanges(const ATrackBar: TCustomTrackBar); virtual; 239 class function GetPosition(const ATrackBar: TCustomTrackBar): integer; virtual; 240 class procedure SetOrientation(const ATrackBar: TCustomTrackBar; const AOrientation: TTrackBarOrientation); virtual; 241 class procedure SetPosition(const ATrackBar: TCustomTrackBar; const NewPosition: integer); virtual; 242 class procedure SetTick(const ATrackBar: TCustomTrackBar; const ATick: integer); virtual; 243 end; 244 TWSTrackBarClass = class of TWSTrackBar; 245 246 { TWSCustomTreeView } 247 248 TWSCustomTreeView = class(TWSCustomControl) 249 published 250 end; 251 252 { TWSTreeView } 253 254 TWSTreeView = class(TWSCustomTreeView) 255 published 256 end; 257 258 { WidgetSetRegistration } 259 260 procedure RegisterStatusBar; 261 procedure RegisterTabSheet; 262 procedure RegisterPageControl; 263 procedure RegisterCustomListView; 264 procedure RegisterCustomProgressBar; 265 procedure RegisterCustomUpDown; 266 procedure RegisterCustomToolButton; 267 procedure RegisterToolBar; 268 procedure RegisterCustomTrackBar; 269 procedure RegisterCustomTreeView; 270 271implementation 272 273uses 274 LResources; 275 276{ TWSCustomUpDown } 277 278class procedure TWSCustomUpDown.SetUseArrowKeys(const AUpDown: TCustomUpDown; 279 AUseArrow: Boolean); 280begin 281 282end; 283 284class procedure TWSCustomUpDown.SetMinPosition(const AUpDown: TCustomUpDown; 285 AValue: Double); 286begin 287 288end; 289 290class procedure TWSCustomUpDown.SetMaxPosition(const AUpDown: TCustomUpDown; 291 AValue: Double); 292begin 293 294end; 295 296class procedure TWSCustomUpDown.SetPosition(const AUpDown: TCustomUpDown; 297 AValue: Double); 298begin 299 300end; 301 302class procedure TWSCustomUpDown.SetIncrement(const AUpDown: TCustomUpDown; 303 AValue: Double); 304begin 305 306end; 307 308class procedure TWSCustomUpDown.SetOrientation(const AUpDown: TCustomUpDown; 309 AOrientation: TUDOrientation); 310begin 311 312end; 313 314class procedure TWSCustomUpDown.SetWrap(const AUpDown: TCustomUpDown; 315 ADoWrap: Boolean); 316begin 317 318end; 319 320{ TWSTabSheet } 321 322class function TWSTabSheet.GetDefaultColor(const AControl: TControl; 323 const ADefaultColorType: TDefaultColorType): TColor; 324begin 325 Result:=DefBtnColors[ADefaultColorType]; 326end; 327 328{ TWSCustomPage } 329 330class procedure TWSCustomPage.UpdateProperties(const ACustomPage: TCustomPage); 331begin 332end; 333 334{ TWSCustomTabControl } 335 336{ ----------------------------------------------------------------------------- 337 Method: TWSCustomTabControl.AddPage 338 Params: ATabControl - A notebook control 339 AChild - Page to insert 340 AIndex - The position in the notebook to insert the page 341 Returns: Nothing 342 343 Adds a new page to a notebook 344 ------------------------------------------------------------------------------} 345class procedure TWSCustomTabControl.AddPage(const ATabControl: TCustomTabControl; const AChild: TCustomPage; const AIndex: integer); 346begin 347end; 348 349{------------------------------------------------------------------------------ 350 Method: TWSCustomTabControl.MovePage 351 Params: ATabControl - The notebook control 352 AChild - The page to move 353 NewIndex - The new index of the page 354 Returns: Nothing 355 356 Moves a page in a notebook control 357 ------------------------------------------------------------------------------} 358class procedure TWSCustomTabControl.MovePage(const ATabControl: TCustomTabControl; 359 const AChild: TCustomPage; const NewIndex: integer); 360begin 361end; 362 363{------------------------------------------------------------------------------ 364 Method: TWSCustomTabControl.RemovePage 365 Params: ATabControl - The notebook control 366 AIndex - The index of the page to delete 367 Returns: Nothing 368 369 Removes a page from a notebook control 370 ------------------------------------------------------------------------------} 371class procedure TWSCustomTabControl.RemovePage(const ATabControl: TCustomTabControl; const AIndex: integer); 372begin 373end; 374 375{------------------------------------------------------------------------------- 376 function TWSCustomTabControl.GetNotebookMinTabHeight( 377 const AWinControl: TWinControl): integer; 378 379 Returns the minimum height of the horizontal tabs of a notebook. That is the 380 Notebook with TabPosition in [tpTop,tpBottom] without the client panel. 381-------------------------------------------------------------------------------} 382class function TWSCustomTabControl.GetNotebookMinTabHeight( 383 const AWinControl: TWinControl): integer; 384begin 385 Result:=30; 386end; 387 388{------------------------------------------------------------------------------- 389 function TWSCustomTabControl.GetNotebookMinTabWidth( 390 const AWinControl: TWinControl): integer; 391 392 Returns the minimum width of the vertical tabs of a notebook. That is the 393 Notebook with TabPosition in [tpLeft,tpRight] without the client panel. 394-------------------------------------------------------------------------------} 395class function TWSCustomTabControl.GetNotebookMinTabWidth(const AWinControl: TWinControl 396 ): integer; 397begin 398 Result:=60; 399end; 400 401class function TWSCustomTabControl.GetTabIndexAtPos(const ATabControl: TCustomTabControl; 402 const AClientPos: TPoint): integer; 403begin 404 Result := -1; 405end; 406 407class function TWSCustomTabControl.GetTabRect(const ATabControl: TCustomTabControl; 408 const AIndex: Integer): TRect; 409begin 410 Result := Rect(-1,-1,-1,-1); 411end; 412 413class function TWSCustomTabControl.GetCapabilities: TCTabControlCapabilities; 414begin 415 Result:=[]; 416end; 417 418class procedure TWSCustomTabControl.SetTabSize( 419 const ATabControl: TCustomTabControl; const ATabWidth, ATabHeight: integer); 420begin 421end; 422 423class procedure TWSCustomTabControl.SetImageList( 424 const ATabControl: TCustomTabControl; const AImageList: TCustomImageListResolution); 425begin 426end; 427 428class procedure TWSCustomTabControl.SetPageIndex(const ATabControl: TCustomTabControl; 429 const AIndex: integer); 430begin 431end; 432 433class procedure TWSCustomTabControl.SetTabCaption(const ATabControl: TCustomTabControl; 434 const AChild: TCustomPage; const AText: string); 435begin 436end; 437 438class procedure TWSCustomTabControl.SetTabPosition(const ATabControl: TCustomTabControl; 439 const ATabPosition: TTabPosition); 440begin 441end; 442 443class procedure TWSCustomTabControl.ShowTabs(const ATabControl: TCustomTabControl; 444 AShowTabs: boolean); 445begin 446end; 447 448class procedure TWSCustomTabControl.UpdateProperties( 449 const ATabControl: TCustomTabControl); 450begin 451 452end; 453 454{ TWSStatusBar } 455 456class procedure TWSStatusBar.PanelUpdate(const AStatusBar: TStatusBar; PanelIndex: integer); 457begin 458end; 459 460class procedure TWSStatusBar.SetPanelText(const AStatusBar: TStatusBar; PanelIndex: integer); 461begin 462end; 463 464class procedure TWSStatusBar.SetSizeGrip(const AStatusBar: TStatusBar; 465 SizeGrip: Boolean); 466begin 467end; 468 469class procedure TWSStatusBar.Update(const AStatusBar: TStatusBar); 470begin 471end; 472 473class function TWSStatusBar.GetDefaultColor(const AControl: TControl; const ADefaultColorType: TDefaultColorType): TColor; 474begin 475 Result := DefBtnColors[ADefaultColorType]; 476end; 477 478{ TWSCustomListView } 479 480class procedure TWSCustomListView.ColumnDelete(const ALV: TCustomListView; 481 const AIndex: Integer); 482begin 483end; 484 485class function TWSCustomListView.ColumnGetWidth(const ALV: TCustomListView; 486 const AIndex: Integer; const AColumn: TListColumn): Integer; 487begin 488 Result := -1; 489end; 490 491class procedure TWSCustomListView.ColumnInsert(const ALV: TCustomListView; 492 const AIndex: Integer; const AColumn: TListColumn); 493begin 494end; 495 496class procedure TWSCustomListView.ColumnMove(const ALV: TCustomListView; 497 const AOldIndex, ANewIndex: Integer; const AColumn: TListColumn); 498begin 499end; 500 501class procedure TWSCustomListView.ColumnSetAlignment(const ALV: TCustomListView; 502 const AIndex: Integer; const AColumn: TListColumn; 503 const AAlignment: TAlignment); 504begin 505end; 506 507class procedure TWSCustomListView.ColumnSetAutoSize(const ALV: TCustomListView; 508 const AIndex: Integer; const AColumn: TListColumn; const AAutoSize: Boolean); 509begin 510end; 511 512class procedure TWSCustomListView.ColumnSetCaption(const ALV: TCustomListView; 513 const AIndex: Integer; const AColumn: TListColumn; const ACaption: String); 514begin 515end; 516 517class procedure TWSCustomListView.ColumnSetImage(const ALV: TCustomListView; 518 const AIndex: Integer; const AColumn: TListColumn; const AImageIndex: Integer); 519begin 520end; 521 522class procedure TWSCustomListView.ColumnSetMaxWidth(const ALV: TCustomListView; 523 const AIndex: Integer; const AColumn: TListColumn; const AMaxWidth: Integer); 524begin 525end; 526 527class procedure TWSCustomListView.ColumnSetMinWidth(const ALV: TCustomListView; 528 const AIndex: Integer; const AColumn: TListColumn; const AMinWidth: integer); 529begin 530end; 531 532class procedure TWSCustomListView.ColumnSetWidth(const ALV: TCustomListView; 533 const AIndex: Integer; const AColumn: TListColumn; const AWidth: Integer); 534begin 535end; 536 537class procedure TWSCustomListView.ColumnSetVisible(const ALV: TCustomListView; 538 const AIndex: Integer; const AColumn: TListColumn; const AVisible: Boolean); 539begin 540end; 541 542class procedure TWSCustomListView.ColumnSetSortIndicator( 543 const ALV: TCustomListView; const AIndex: Integer; 544 const AColumn: TListColumn; const ASortIndicator: TSortIndicator); 545begin 546 547end; 548 549class procedure TWSCustomListView.ItemDelete(const ALV: TCustomListView; 550 const AIndex: Integer); 551begin 552end; 553 554class function TWSCustomListView.ItemDisplayRect(const ALV: TCustomListView; const AIndex, ASubItem: Integer; ACode: TDisplayCode): TRect; 555begin 556 Result := Rect(0,0,0,0); 557end; 558 559class procedure TWSCustomListView.ItemExchange(const ALV: TCustomListView; 560 AItem: TListItem; const AIndex1, AIndex2: Integer); 561begin 562end; 563 564class procedure TWSCustomListView.ItemMove(const ALV: TCustomListView; 565 AItem: TListItem; const AFromIndex, AToIndex: Integer); 566begin 567end; 568 569class function TWSCustomListView.ItemGetChecked(const ALV: TCustomListView; const AIndex: Integer; const AItem: TListItem): Boolean; 570begin 571 Result := False; 572end; 573 574class function TWSCustomListView.ItemGetPosition(const ALV: TCustomListView; 575 const AIndex: Integer): TPoint; 576begin 577 Result := Point(0, 0); 578end; 579 580class function TWSCustomListView.ItemGetState(const ALV: TCustomListView; 581 const AIndex: Integer; const AItem: TListItem; const AState: TListItemState; 582 out AIsSet: Boolean): Boolean; 583begin 584 // returns True if supported 585 Result := False; 586 AIsSet:=false; 587end; 588 589class procedure TWSCustomListView.ItemInsert(const ALV: TCustomListView; 590 const AIndex: Integer; const AItem: TListItem); 591begin 592end; 593 594class procedure TWSCustomListView.ItemSetChecked(const ALV: TCustomListView; const AIndex: Integer; const AItem: TListItem; const AChecked: Boolean); 595begin 596end; 597 598class procedure TWSCustomListView.ItemSetImage(const ALV: TCustomListView; 599 const AIndex: Integer; const AItem: TListItem; 600 const ASubIndex, AImageIndex: Integer); 601begin 602end; 603 604class function TWSCustomListView.ItemSetPosition(const ALV: TCustomListView; 605 const AIndex: Integer; const ANewPosition: TPoint): Boolean; 606begin 607 Result := False; 608end; 609 610class procedure TWSCustomListView.ItemSetStateImage(const ALV: TCustomListView; 611 const AIndex: Integer; const AItem: TListItem; 612 const ASubIndex, AStateImageIndex: Integer); 613begin 614end; 615 616class procedure TWSCustomListView.ItemSetState(const ALV: TCustomListView; 617 const AIndex: Integer; const AItem: TListItem; const AState: TListItemState; 618 const AIsSet: Boolean); 619begin 620end; 621 622class procedure TWSCustomListView.ItemSetText(const ALV: TCustomListView; 623 const AIndex: Integer; const AItem: TListItem; const ASubIndex: Integer; 624 const AText: String); 625begin 626end; 627 628class procedure TWSCustomListView.ItemShow(const ALV: TCustomListView; 629 const AIndex: Integer; const AItem: TListItem; const PartialOK: Boolean); 630begin 631end; 632 633class procedure TWSCustomListView.ItemUpdate(const ALV: TCustomListView; 634 const AIndex: Integer; const AItem: TListItem); 635begin 636end; 637 638class procedure TWSCustomListView.BeginUpdate(const ALV: TCustomListView); 639begin 640end; 641 642class procedure TWSCustomListView.EndUpdate(const ALV: TCustomListView); 643begin 644end; 645 646class function TWSCustomListView.GetBoundingRect(const ALV: TCustomListView): TRect; 647begin 648 Result := Rect(0,0,0,0); 649end; 650 651class function TWSCustomListView.GetDropTarget(const ALV: TCustomListView): Integer; 652begin 653 Result := -1; 654end; 655 656class function TWSCustomListView.GetFocused(const ALV: TCustomListView): Integer; 657begin 658 Result := -1; 659end; 660 661class function TWSCustomListView.GetHitTestInfoAt( const ALV: TCustomListView; X, Y: Integer ) : THitTests; 662begin 663 Result := []; 664end; 665 666class function TWSCustomListView.GetHoverTime(const ALV: TCustomListView): Integer; 667begin 668 Result := -1; 669end; 670 671class function TWSCustomListView.GetItemAt(const ALV: TCustomListView; x,y: integer): Integer; 672begin 673 result:=-1; 674end; 675 676class function TWSCustomListView.GetSelCount(const ALV: TCustomListView): Integer; 677begin 678 Result := 0; 679end; 680 681class function TWSCustomListView.GetSelection(const ALV: TCustomListView): Integer; 682begin 683 Result := -1; 684end; 685 686class function TWSCustomListView.GetTopItem(const ALV: TCustomListView): Integer; 687begin 688 Result := -1; 689end; 690 691class function TWSCustomListView.GetViewOrigin(const ALV: TCustomListView): TPoint; 692begin 693 Result := Point(0, 0); 694end; 695 696class function TWSCustomListView.GetVisibleRowCount(const ALV: TCustomListView): Integer; 697begin 698 Result := 0; 699end; 700 701class procedure TWSCustomListView.SetAllocBy(const ALV: TCustomListView; const AValue: Integer); 702begin 703end; 704 705class procedure TWSCustomListView.SetDefaultItemHeight(const ALV: TCustomListView; const AValue: Integer); 706begin 707end; 708 709class procedure TWSCustomListView.SetHotTrackStyles(const ALV: TCustomListView; const AValue: TListHotTrackStyles); 710begin 711end; 712 713class procedure TWSCustomListView.SetHoverTime(const ALV: TCustomListView; const AValue: Integer); 714begin 715end; 716 717class procedure TWSCustomListView.SetIconArrangement( 718 const ALV: TCustomListView; const AValue: TIconArrangement); 719begin 720end; 721 722class procedure TWSCustomListView.SetImageList(const ALV: TCustomListView; 723 const AList: TListViewImageList; const AValue: TCustomImageListResolution); 724begin 725end; 726 727class procedure TWSCustomListView.SetOwnerData(const ALV: TCustomListView; 728 const AValue: Boolean); 729begin 730end; 731 732class procedure TWSCustomListView.SetProperty(const ALV: TCustomListView; const AProp: TListViewProperty; const AIsSet: Boolean); 733begin 734end; 735 736// Default implementation based on SetProperty 737class procedure TWSCustomListView.SetProperties(const ALV: TCustomListView; const AProps: TListViewProperties); 738begin 739 SetProperty(ALV, lvpAutoArrange, lvpAutoArrange in AProps); 740 SetProperty(ALV, lvpCheckboxes, lvpCheckboxes in AProps); 741 SetProperty(ALV, lvpColumnClick, lvpColumnClick in AProps); 742 SetProperty(ALV, lvpFlatScrollBars, lvpFlatScrollBars in AProps); 743 SetProperty(ALV, lvpFullDrag, lvpFullDrag in AProps); 744 SetProperty(ALV, lvpGridLines, lvpGridLines in AProps); 745 SetProperty(ALV, lvpHideSelection, lvpHideSelection in AProps); 746 SetProperty(ALV, lvpHotTrack, lvpHotTrack in AProps); 747 SetProperty(ALV, lvpMultiSelect, lvpMultiSelect in AProps); 748 SetProperty(ALV, lvpOwnerDraw, lvpOwnerDraw in AProps); 749 SetProperty(ALV, lvpReadOnly, lvpReadOnly in AProps); 750 SetProperty(ALV, lvpRowSelect, lvpRowSelect in AProps); 751 SetProperty(ALV, lvpShowColumnHeaders, lvpShowColumnHeaders in AProps); 752 SetProperty(ALV, lvpShowWorkAreas, lvpShowWorkAreas in AProps); 753 SetProperty(ALV, lvpWrapText, lvpWrapText in AProps); 754 SetProperty(ALV, lvpToolTips, lvpToolTips in AProps); 755end; 756 757class procedure TWSCustomListView.SetScrollBars(const ALV: TCustomListView; const AValue: TScrollStyle); 758begin 759end; 760 761class procedure TWSCustomListView.SetSort(const ALV: TCustomListView; 762 const AType: TSortType; const AColumn: Integer; 763 const ASortDirection: TSortDirection); 764begin 765end; 766 767class procedure TWSCustomListView.SetViewOrigin(const ALV: TCustomListView; const AValue: TPoint); 768begin 769end; 770 771class procedure TWSCustomListView.SetViewStyle(const ALV: TCustomListView; const Avalue: TViewStyle); 772begin 773end; 774 775class procedure TWSCustomListView.SetItemsCount(const ALV: TCustomListView; const Avalue: Integer); 776begin 777end; 778 779class procedure TWSCustomListView.SelectAll(const ALV: TCustomListView; 780 const AIsSet: Boolean); 781begin 782 783end; 784 785{ TWSProgressBar } 786 787class procedure TWSProgressBar.ApplyChanges(const AProgressBar: TCustomProgressBar); 788begin 789end; 790 791class procedure TWSProgressBar.SetPosition(const AProgressBar: TCustomProgressBar; 792 const NewPosition: integer); 793begin 794end; 795 796class procedure TWSProgressBar.SetStyle(const AProgressBar: TCustomProgressBar; 797 const NewStyle: TProgressBarStyle); 798begin 799end; 800 801{ TWSToolbar } 802 803{$ifdef OldToolbar} 804 805class function TWSToolbar.GetButtonCount(const AToolBar: TToolBar): integer; 806begin 807 Result := 0; 808end; 809 810class procedure TWSToolbar.InsertToolButton(const AToolBar: TToolbar; const AControl: TControl); 811begin 812end; 813 814class procedure TWSToolbar.DeleteToolButton(const AToolBar: TToolbar; const AControl: TControl); 815begin 816end; 817 818{$endif} 819 820{ TWSTrackBar } 821 822class procedure TWSTrackBar.ApplyChanges(const ATrackBar: TCustomTrackBar); 823begin 824end; 825 826class function TWSTrackBar.GetPosition(const ATrackBar: TCustomTrackBar): integer; 827begin 828 Result := 0; 829end; 830 831class procedure TWSTrackBar.SetOrientation(const ATrackBar: TCustomTrackBar; 832 const AOrientation: TTrackBarOrientation); 833begin 834 RecreateWnd(ATrackBar); 835end; 836 837class procedure TWSTrackBar.SetPosition(const ATrackBar: TCustomTrackBar; const NewPosition: integer); 838begin 839end; 840 841class procedure TWSTrackBar.SetTick(const ATrackBar: TCustomTrackBar; const ATick: integer); 842begin 843end; 844 845{ WidgetSetRegistration } 846 847procedure RegisterStatusBar; 848const 849 Done: Boolean = False; 850begin 851 if Done then exit; 852 WSRegisterStatusBar; 853 RegisterPropertyToSkip(TStatusBar, 'Font', 'VCL compatibility property', ''); 854 RegisterPropertyToSkip(TStatusBar, 'TabOrder', 'VCL compatibility property', ''); 855 RegisterPropertyToSkip(TStatusBar, 'TabStop', 'VCL compatibility property', ''); 856 RegisterPropertyToSkip(TStatusBar, 'UseSystemFont', 'VCL compatibility property', ''); 857// if not WSRegisterStatusBar then 858// RegisterWSComponent(TStatusBar, TWSStatusBar); 859 Done := True; 860end; 861 862procedure RegisterTabSheet; 863const 864 Done: Boolean = False; 865begin 866 if Done then exit; 867 WSRegisterTabSheet; 868// if not WSRegisterTabSheet then 869// RegisterWSComponent(TTabSheet, TWSTabSheet) 870 Done := True; 871end; 872 873procedure RegisterPageControl; 874const 875 Done: Boolean = False; 876begin 877 if Done then exit; 878 WSRegisterPageControl; 879 RegisterPropertyToSkip(TPageControl, 'Style', 'VCL compatibility property', ''); 880 RegisterPropertyToSkip(TPageControl, 'HotTrack', 'VCL compatibility property', ''); 881 RegisterPropertyToSkip(TPageControl, 'MultiLine', 'VCL compatibility property', ''); 882 RegisterPropertyToSkip(TPageControl, 'TabWidth', 'VCL compatibility property', ''); 883 RegisterPropertyToSkip(TPageControl, 'TabHeight', 'VCL compatibility property', ''); 884 RegisterPropertyToSkip(TPageControl, 'OnPageChanged', 'Was removed in Laz 0.9.31 due to incompatibilities with OnChange, which does the same thing.', ''); 885// if not WSRegisterPageControl then 886// RegisterWSComponent(TPageControl, TWSPageControl); 887 Done := True; 888end; 889 890procedure RegisterCustomListView; 891const 892 Done: Boolean = False; 893begin 894 if Done then exit; 895 WSRegisterCustomListView; 896 RegisterPropertyToSkip(TListColumn, 'WidthType', 'VCL compatibility property', ''); 897// if not WSRegisterCustomListView then 898// RegisterWSComponent(TCustomListView, TWSCustomListView); 899 Done := True; 900end; 901 902procedure RegisterCustomProgressBar; 903const 904 Done: Boolean = False; 905begin 906 if Done then exit; 907 WSRegisterCustomProgressBar; 908// if not WSRegisterCustomProgressBar then 909// RegisterWSComponent(TCustomProgressBar, TWSCustomProgressBar); 910 Done := True; 911end; 912 913procedure RegisterCustomUpDown; 914const 915 Done: Boolean = False; 916begin 917 if Done then exit; 918 WSRegisterCustomUpDown; 919// if not WSRegisterCustomUpDown then 920// RegisterWSComponent(TCustomUpDown, TWSCustomUpDown); 921 Done := True; 922end; 923 924procedure RegisterCustomToolButton; 925const 926 Done: Boolean = False; 927begin 928 if Done then exit; 929 WSRegisterCustomToolButton; 930// if not WSRegisterCustomToolButton then 931// RegisterWSComponent(TCustomToolButton, TWSToolButton); 932 Done := True; 933end; 934 935procedure RegisterToolBar; 936const 937 Done: Boolean = False; 938begin 939 if Done then exit; 940 WSRegisterToolBar; 941// if not WSRegisterToolBar then 942// RegisterWSComponent(TToolBar, TWSToolBar); 943 Done := True; 944end; 945 946procedure RegisterCustomTrackBar; 947const 948 Done: Boolean = False; 949begin 950 if Done then exit; 951 WSRegisterCustomTrackBar; 952 RegisterPropertyToSkip(TCustomTrackBar, 'ThumbLength', 'VCL compatibility property', ''); 953// if not WSRegisterCustomTrackBar then 954// RegisterWSComponent(TCustomTrackBar, TWSCustomTrackBar); 955 Done := True; 956end; 957 958procedure RegisterCustomTreeView; 959const 960 Done: Boolean = False; 961begin 962 if Done then exit; 963 WSRegisterCustomTreeView; 964 RegisterPropertyToSkip(TCustomTreeView, 'BevelInner', 'VCL compatibility property', ''); 965 RegisterPropertyToSkip(TCustomTreeView, 'MultiSelect', 'VCL compatibility property', ''); 966// if not WSRegisterStatusBar then 967// RegisterWSComponent(TCustomTreeView, TWSCustomTreeView); 968 Done := True; 969end; 970 971end. 972