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