1{
2 *****************************************************************************
3 *                               Gtk3WSStdCtrls.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 Gtk3WSStdCtrls;
17
18{$mode objfpc}{$H+}
19{$I gtk3defines.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  Graphics, Controls, StdCtrls, LCLType, LCLProc,
42////////////////////////////////////////////////////
43  WSLCLClasses, WSControls, WSStdCtrls, WSProc, Classes, WSFactory, Clipbrd,
44  gtk3widgets, gtk3procs, LazGdk3;
45
46type
47  { TGtk3WSScrollBar }
48
49  TGtk3WSScrollBar = class(TWSScrollBar)
50  published
51    class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle; override;
52    class procedure SetParams(const AScrollBar: TCustomScrollBar); override;
53    class procedure SetKind(const AScrollBar: TCustomScrollBar; const AIsHorizontal: Boolean); override;
54  end;
55  TGtk3WSScrollBarClass = class of TGtk3WSScrollBar;
56
57  { TGtk3WSCustomGroupBox }
58
59  TGtk3WSCustomGroupBox = class(TWSCustomGroupBox)
60  published
61    class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle; override;
62    class procedure GetPreferredSize(const AWinControl: TWinControl;
63                        var PreferredWidth, PreferredHeight: integer;
64                        WithThemeSpace: Boolean); override;
65  end;
66
67  { TGtk3WSGroupBox }
68
69  TGtk3WSGroupBox = class(TGtk3WSCustomGroupBox)
70  published
71  end;
72
73  { TGtk3WSCustomComboBox }
74
75  TGtk3WSCustomComboBox = class(TWSCustomComboBox)
76  published
77    class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle; override;
78
79    class procedure GetPreferredSize(const AWinControl: TWinControl;
80                        var PreferredWidth, PreferredHeight: integer;
81                        WithThemeSpace: Boolean); override;
82
83    class function GetDroppedDown(const ACustomComboBox: TCustomComboBox): Boolean; override;
84    class function GetSelStart(const ACustomComboBox: TCustomComboBox): integer; override;
85    class function GetSelLength(const ACustomComboBox: TCustomComboBox): integer; override;
86    class function GetItemIndex(const ACustomComboBox: TCustomComboBox): integer; override;
87    class function GetMaxLength(const ACustomComboBox: TCustomComboBox): integer; override;
88
89    class procedure SetArrowKeysTraverseList(const ACustomComboBox: TCustomComboBox;
90      NewTraverseList: boolean); override;
91    class procedure SetDropDownCount(const ACustomComboBox: TCustomComboBox; NewCount: Integer); override;
92    class procedure SetDroppedDown(const ACustomComboBox: TCustomComboBox; ADroppedDown: Boolean); override;
93    class procedure SetSelStart(const ACustomComboBox: TCustomComboBox; NewStart: integer); override;
94    class procedure SetSelLength(const ACustomComboBox: TCustomComboBox; NewLength: integer); override;
95    class procedure SetItemIndex(const ACustomComboBox: TCustomComboBox; NewIndex: integer); override;
96    class procedure SetMaxLength(const ACustomComboBox: TCustomComboBox; NewLength: integer); override;
97    class procedure SetStyle(const ACustomComboBox: TCustomComboBox; NewStyle: TComboBoxStyle); override;
98
99    class function  GetItems(const ACustomComboBox: TCustomComboBox): TStrings; override;
100    class procedure Sort(const ACustomComboBox: TCustomComboBox; AList: TStrings; IsSorted: boolean); override;
101
102    class function GetItemHeight(const ACustomComboBox: TCustomComboBox): Integer; override;
103    class procedure SetItemHeight(const ACustomComboBox: TCustomComboBox; const AItemHeight: Integer); override;
104  end;
105  TGtk3WSCustomComboBoxClass = class of TGtk3WSCustomComboBox;
106
107  { TGtk3WSComboBox }
108
109  TGtk3WSComboBox = class(TGtk3WSCustomComboBox)
110  published
111  end;
112
113  { TGtk3WSCustomListBox }
114
115  TGtk3WSCustomListBox = class(TWSCustomListBox)
116  published
117    class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle; override;
118    class function GetIndexAtXY(const ACustomListBox: TCustomListBox; X, Y: integer): integer; override;
119    class function GetItemIndex(const ACustomListBox: TCustomListBox): integer; override;
120    class function GetItemRect(const ACustomListBox: TCustomListBox; Index: integer; var ARect: TRect): boolean; override;
121    class function GetScrollWidth(const ACustomListBox: TCustomListBox): Integer; override;
122    class function GetSelCount(const ACustomListBox: TCustomListBox): integer; override;
123    class function GetSelected(const ACustomListBox: TCustomListBox; const AIndex: integer): boolean; override;
124    class function GetStrings(const ACustomListBox: TCustomListBox): TStrings; override;
125    class procedure FreeStrings(var AStrings: TStrings); override;
126    class function GetTopIndex(const ACustomListBox: TCustomListBox): integer; override;
127
128    class procedure SelectItem(const ACustomListBox: TCustomListBox; AIndex: integer; ASelected: boolean); override;
129
130    class procedure SetBorder(const ACustomListBox: TCustomListBox); override;
131    class procedure SetColumnCount(const ACustomListBox: TCustomListBox; ACount: Integer); override;
132    class procedure SetItemIndex(const ACustomListBox: TCustomListBox; const AIndex: integer); override;
133    class procedure SetScrollWidth(const ACustomListBox: TCustomListBox; const AScrollWidth: Integer); override;
134    class procedure SetSelectionMode(const ACustomListBox: TCustomListBox; const AExtendedSelect,
135      AMultiSelect: boolean); override;
136    class procedure SetStyle(const ACustomListBox: TCustomListBox); override;
137    class procedure SetSorted(const ACustomListBox: TCustomListBox; AList: TStrings; ASorted: boolean); override;
138    class procedure SetTopIndex(const ACustomListBox: TCustomListBox; const NewTopIndex: integer); override;
139  end;
140  TGtk3WSCustomListBoxClass = class of TGtk3WSCustomListBox;
141
142  { TWSListBox }
143
144  TGtk3WSListBox = class(TGtk3WSCustomListBox)
145  published
146  end;
147
148  { TGtk3WSCustomEdit }
149
150  TGtk3WSCustomEdit = class(TWSCustomEdit)
151  published
152    class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle; override;
153    class procedure GetPreferredSize(const AWinControl: TWinControl;
154                        var PreferredWidth, PreferredHeight: integer;
155                        WithThemeSpace: Boolean); override;
156
157    class function GetCanUndo(const ACustomEdit: TCustomEdit): Boolean; override;
158    class function GetCaretPos(const ACustomEdit: TCustomEdit): TPoint; override;
159    class function GetSelStart(const ACustomEdit: TCustomEdit): integer; override;
160    class function GetSelLength(const ACustomEdit: TCustomEdit): integer; override;
161
162    class procedure SetAlignment(const ACustomEdit: TCustomEdit; const AAlignment: TAlignment); override;
163    class procedure SetCaretPos(const ACustomEdit: TCustomEdit; const NewPos: TPoint); override;
164    class procedure SetCharCase(const ACustomEdit: TCustomEdit; NewCase: TEditCharCase); override;
165    class procedure SetEchoMode(const ACustomEdit: TCustomEdit; NewMode: TEchoMode); override;
166    class procedure SetHideSelection(const ACustomEdit: TCustomEdit; NewHideSelection: Boolean); override;
167    class procedure SetMaxLength(const ACustomEdit: TCustomEdit; NewLength: integer); override;
168    class procedure SetPasswordChar(const ACustomEdit: TCustomEdit; NewChar: char); override;
169    class procedure SetReadOnly(const ACustomEdit: TCustomEdit; NewReadOnly: boolean); override;
170    class procedure SetSelStart(const ACustomEdit: TCustomEdit; NewStart: integer); override;
171    class procedure SetSelLength(const ACustomEdit: TCustomEdit; NewLength: integer); override;
172
173    class procedure Cut(const ACustomEdit: TCustomEdit); override;
174    class procedure Copy(const ACustomEdit: TCustomEdit); override;
175    class procedure Paste(const ACustomEdit: TCustomEdit); override;
176    class procedure Undo(const ACustomEdit: TCustomEdit); override;
177  end;
178  TGtk3WSCustomEditClass = class of TGtk3WSCustomEdit;
179
180  { TGtk3WSCustomMemo }
181
182  TGtk3WSCustomMemo = class(TWSCustomMemo)
183  published
184    class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle; override;
185    class procedure GetPreferredSize(const AWinControl: TWinControl;
186                        var PreferredWidth, PreferredHeight: integer;
187                        WithThemeSpace: Boolean); override;
188
189    class function GetStrings(const ACustomMemo: TCustomMemo): TStrings; override;
190    class procedure SetScrollbars(const ACustomMemo: TCustomMemo; const NewScrollbars: TScrollStyle); override;
191    class procedure SetWantTabs(const ACustomMemo: TCustomMemo; const NewWantTabs: boolean); override;
192    class procedure SetWantReturns(const ACustomMemo: TCustomMemo; const NewWantReturns: boolean); override;
193    class procedure SetWordWrap(const ACustomMemo: TCustomMemo; const NewWordWrap: boolean); override;
194
195    class function GetCanUndo(const ACustomEdit: TCustomEdit): Boolean; override;
196    class function GetCaretPos(const ACustomEdit: TCustomEdit): TPoint; override;
197    class function GetSelStart(const ACustomEdit: TCustomEdit): integer; override;
198    class function GetSelLength(const ACustomEdit: TCustomEdit): integer; override;
199
200    class procedure SetAlignment(const ACustomEdit: TCustomEdit; const AAlignment: TAlignment); override;
201    class procedure SetCaretPos(const ACustomEdit: TCustomEdit; const NewPos: TPoint); override;
202    class procedure SetCharCase(const ACustomEdit: TCustomEdit; NewCase: TEditCharCase); override;
203    class procedure SetEchoMode(const ACustomEdit: TCustomEdit; NewMode: TEchoMode); override;
204    class procedure SetHideSelection(const ACustomEdit: TCustomEdit; NewHideSelection: Boolean); override;
205    class procedure SetMaxLength(const ACustomEdit: TCustomEdit; NewLength: integer); override;
206    class procedure SetPasswordChar(const ACustomEdit: TCustomEdit; NewChar: char); override;
207    class procedure SetReadOnly(const ACustomEdit: TCustomEdit; NewReadOnly: boolean); override;
208    class procedure SetSelStart(const ACustomEdit: TCustomEdit; NewStart: integer); override;
209    class procedure SetSelLength(const ACustomEdit: TCustomEdit; NewLength: integer); override;
210
211  end;
212  TGtk3WSCustomMemoClass = class of TGtk3WSCustomMemo;
213
214  { TGtk3WSEdit }
215
216  TGtk3WSEdit = class(TGtk3WSCustomEdit)
217  published
218  end;
219
220  { TGtk3WSMemo }
221
222  TGtk3WSMemo = class(TGtk3WSCustomMemo)
223  published
224  end;
225
226  { TGtk3WSCustomStaticText }
227
228  TGtk3WSCustomStaticText = class(TWSCustomStaticText)
229  published
230    class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle; override;
231    class procedure GetPreferredSize(const AWinControl: TWinControl;
232                        var PreferredWidth, PreferredHeight: integer;
233                        WithThemeSpace: Boolean); override;
234    class procedure SetAlignment(const ACustomStaticText: TCustomStaticText; const NewAlignment: TAlignment); override;
235    class procedure SetStaticBorderStyle(const ACustomStaticText: TCustomStaticText; const NewBorderStyle: TStaticBorderStyle); override;
236  end;
237  TGtk3WSCustomStaticTextClass = class of TGtk3WSCustomStaticText;
238
239  { TGtk3WSStaticText }
240
241  TGtk3WSStaticText = class(TGtk3WSCustomStaticText)
242  published
243  end;
244
245  { TGtk3WSButtonControl }
246
247  TGtk3WSButtonControl = class(TWSButtonControl)
248  published
249    class function GetDefaultColor(const AControl: TControl; const ADefaultColorType: TDefaultColorType): TColor; override;
250  end;
251
252  { TGtk3WSButton }
253
254  TGtk3WSButton = class(TWSButton)
255  published
256    class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle; override;
257    class procedure GetPreferredSize(const AWinControl: TWinControl;
258                        var PreferredWidth, PreferredHeight: integer;
259                        WithThemeSpace: Boolean); override;
260    class procedure SetDefault(const AButton: TCustomButton; ADefault: Boolean); override;
261    class procedure SetShortCut(const AButton: TCustomButton; const ShortCutK1, ShortCutK2: TShortCut); override;
262  end;
263  TGtk3WSButtonClass = class of TGtk3WSButton;
264
265  { TGtk3WSCustomCheckBox }
266
267  TGtk3WSCustomCheckBox = class(TWSCustomCheckBox)
268  published
269    class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle; override;
270    class procedure GetPreferredSize(const AWinControl: TWinControl;
271                        var PreferredWidth, PreferredHeight: integer;
272                        WithThemeSpace: Boolean); override;
273    class function RetrieveState(const ACustomCheckBox: TCustomCheckBox): TCheckBoxState; override;
274    class procedure SetShortCut(const ACustomCheckBox: TCustomCheckBox; const ShortCutK1, ShortCutK2: TShortCut); override;
275    class procedure SetState(const ACustomCheckBox: TCustomCheckBox; const NewState: TCheckBoxState); override;
276  end;
277  TGtk3WSCustomCheckBoxClass = class of TGtk3WSCustomCheckBox;
278
279  { TGtk3WSCheckBox }
280
281  TGtk3WSCheckBox = class(TGtk3WSCustomCheckBox)
282  published
283    class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle; override;
284  end;
285
286  { TWSToggleBox }
287
288  { TGtk3WSToggleBox }
289
290  TGtk3WSToggleBox = class(TGtk3WSCustomCheckBox)
291  published
292    class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle; override;
293  end;
294
295  { TGtk3WSRadioButton }
296
297  TGtk3WSRadioButton = class(TGtk3WSCustomCheckBox)
298  published
299    class function CreateHandle(const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle; override;
300  end;
301
302implementation
303
304uses
305  LResources, gtk3private, LazGObject2;
306
307{ TGtk3WSCustomGroupBox }
308
309class function TGtk3WSCustomGroupBox.CreateHandle(
310  const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle;
311var
312  AGroupBox: TGtk3GroupBox;
313begin
314  AGroupBox := TGtk3GroupBox.Create(AWinControl, AParams);
315  Result := TLCLIntfHandle(AGroupBox);
316end;
317
318class procedure TGtk3WSCustomGroupBox.GetPreferredSize(
319  const AWinControl: TWinControl; var PreferredWidth, PreferredHeight: integer;
320  WithThemeSpace: Boolean);
321begin
322  if not WSCheckHandleAllocated(AWinControl, 'GetPreferredSize') then
323    Exit;
324  TGtk3GroupBox(AWinControl.Handle).preferredSize(PreferredWidth, PreferredHeight, WithThemeSpace);
325end;
326
327{ TGtk3WSRadioButton }
328
329class function TGtk3WSRadioButton.CreateHandle(const AWinControl: TWinControl;
330  const AParams: TCreateParams): TLCLIntfHandle;
331var
332  ARadioButton: TGtk3RadioButton;
333begin
334  ARadioButton := TGtk3RadioButton.Create(AWinControl, AParams);
335  Result := TLCLIntfHandle(ARadioButton);
336end;
337
338{ TGtk3WSToggleBox }
339
340class function TGtk3WSToggleBox.CreateHandle(const AWinControl: TWinControl;
341  const AParams: TCreateParams): TLCLIntfHandle;
342var
343  AToggleBox: TGtk3ToggleButton;
344begin
345  AToggleBox := TGtk3ToggleButton.Create(AWinControl, AParams);
346  Result := TLCLIntfHandle(AToggleBox);
347end;
348
349{ TGtk3WSCheckBox }
350
351class function TGtk3WSCheckBox.CreateHandle(const AWinControl: TWinControl;
352  const AParams: TCreateParams): TLCLIntfHandle;
353var
354  ACheckBox: TGtk3CheckBox;
355begin
356  ACheckBox := TGtk3CheckBox.Create(AWinControl, AParams);
357  Result := TLCLIntfHandle(ACheckBox);
358end;
359
360{ TGtk3WSScrollBar }
361
362class function TGtk3WSScrollBar.CreateHandle(const AWinControl: TWinControl;
363  const AParams: TCreateParams): TLCLIntfHandle;
364var
365  AGtkScrollbar: TGtk3ScrollBar;
366begin
367  AGtkScrollBar := TGtk3ScrollBar.Create(AWinControl, AParams);
368  Result:= TLCLIntfHandle(AGtkScrollBar);
369end;
370
371class procedure TGtk3WSScrollBar.SetParams(const AScrollBar: TCustomScrollBar);
372begin
373  if not WSCheckHandleAllocated(AScrollBar, 'SetParams') then
374    Exit;
375  TGtk3ScrollBar(AScrollBar.Handle).BeginUpdate;
376  TGtk3ScrollBar(AScrollBar.Handle).SetParams;
377  TGtk3ScrollBar(AScrollBar.Handle).EndUpdate;
378end;
379
380class procedure TGtk3WSScrollBar.SetKind(const AScrollBar: TCustomScrollBar;
381  const AIsHorizontal: Boolean);
382begin
383  if not WSCheckHandleAllocated(AScrollBar, 'SetKind') then
384    Exit;
385  RecreateWnd(AScrollBar);
386end;
387
388{ TGtk3WSCustomListBox }
389
390class function TGtk3WSCustomListBox.CreateHandle(
391  const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle;
392var
393  AListBox: TGtk3ListBox;
394begin
395  AListBox := TGtk3ListBox.Create(AWinControl, AParams);
396  AListBox.BorderStyle := TCustomListBox(AWinControl).BorderStyle;
397  Result := TLCLIntfHandle(AListBox);
398end;
399
400class function TGtk3WSCustomListBox.GetIndexAtXY(
401  const ACustomListBox: TCustomListBox; X, Y: integer): integer;
402begin
403  Result := -1;
404end;
405
406class function  TGtk3WSCustomListBox.GetItemIndex(const ACustomListBox: TCustomListBox): integer;
407begin
408  Result := 0;
409  if not WSCheckHandleAllocated(ACustomListBox, 'GetItemIndex') then
410    Exit;
411  Result := TGtk3ListBox(ACustomListBox.Handle).ItemIndex;
412end;
413
414class function TGtk3WSCustomListBox.GetItemRect(
415  const ACustomListBox: TCustomListBox; Index: integer; var ARect: TRect
416  ): boolean;
417begin
418  FillChar(ARect,SizeOf(ARect),0);
419  Result:=false;
420end;
421
422class function TGtk3WSCustomListBox.GetScrollWidth(
423  const ACustomListBox: TCustomListBox): Integer;
424begin
425  Result := 0;
426end;
427
428class function  TGtk3WSCustomListBox.GetSelCount(const ACustomListBox: TCustomListBox): integer;
429begin
430  Result := 0;
431  if not WSCheckHandleAllocated(ACustomListBox, 'GetSelCount') then
432    Exit;
433  Result := TGtk3ListBox(ACustomListBox.Handle).GetSelCount;
434end;
435
436class function  TGtk3WSCustomListBox.GetSelected(const ACustomListBox: TCustomListBox; const AIndex: integer): boolean;
437begin
438  if not WSCheckHandleAllocated(ACustomListBox, 'GetSelected') then
439    Exit(False);
440  //DebugLn('WARNING: TGtk3WSCustomListBox.GetSelected is not implemented.');
441  Result := TGtk3ListBox(ACustomListBox.Handle).GetItemSelected(AIndex);
442end;
443
444class function TGtk3WSCustomListBox.GetStrings(const ACustomListBox: TCustomListBox): TStrings;
445begin
446  if not WSCheckHandleAllocated(ACustomListBox, 'GetStrings') then
447    Exit;
448  //DebugLn('TGtk3WSCustomListBox.GetStrings creating TGtkListStoreStringList ...');
449  Result := TGtkListStoreStringList(g_object_get_data(PGObject(TGtk3ListBox(ACustomListBox.Handle).GetContainerWidget),
450                                     GtkListItemLCLListTag));
451  TGtkListStoreStringList(Result).Sorted := ACustomListBox.Sorted;
452end;
453
454class procedure TGtk3WSCustomListBox.FreeStrings(var AStrings: TStrings);
455begin
456  AStrings.Free;
457  AStrings := nil;
458end;
459
460class function  TGtk3WSCustomListBox.GetTopIndex(const ACustomListBox: TCustomListBox): integer;
461begin
462  Result := 0;
463end;
464
465class procedure TGtk3WSCustomListBox.SelectItem(const ACustomListBox: TCustomListBox; AIndex: integer; ASelected: boolean);
466begin
467  if not WSCheckHandleAllocated(ACustomListBox, 'SelectItem') then
468    Exit;
469  TGtk3ListBox(ACustomListBox.Handle).BeginUpdate;
470  TGtk3ListBox(ACustomListBox.Handle).SelectItem(AIndex, ASelected);
471  TGtk3ListBox(ACustomListBox.Handle).EndUpdate;
472end;
473
474class procedure TGtk3WSCustomListBox.SetBorder(const ACustomListBox: TCustomListBox);
475begin
476
477end;
478
479class procedure TGtk3WSCustomListBox.SetColumnCount(const ACustomListBox: TCustomListBox;
480  ACount: Integer);
481begin
482
483end;
484
485class procedure TGtk3WSCustomListBox.SetItemIndex(const ACustomListBox: TCustomListBox; const AIndex: integer);
486begin
487  if not WSCheckHandleAllocated(ACustomListBox, 'SetItemIndex') then
488    Exit;
489  TGtk3ListBox(ACustomListBox.Handle).BeginUpdate;
490  TGtk3ListBox(ACustomListBox.Handle).ItemIndex := AIndex;
491  TGtk3ListBox(ACustomListBox.Handle).EndUpdate;
492end;
493
494class procedure TGtk3WSCustomListBox.SetScrollWidth(
495  const ACustomListBox: TCustomListBox; const AScrollWidth: Integer);
496begin
497
498end;
499
500class procedure TGtk3WSCustomListBox.SetSelectionMode(const ACustomListBox: TCustomListBox;
501  const AExtendedSelect, AMultiSelect: boolean);
502begin
503  if not WSCheckHandleAllocated(ACustomListBox, 'SetSelectionMode') then
504    Exit;
505  TGtk3ListBox(ACustomListBox.Handle).MultiSelect := AMultiSelect;
506end;
507
508class procedure TGtk3WSCustomListBox.SetStyle(const ACustomListBox: TCustomListBox);
509begin
510  if not WSCheckHandleAllocated(ACustomListBox, 'SetStyle') then
511    Exit;
512  if TGtk3ListBox(ACustomListBox.Handle).ListBoxStyle <> ACustomListBox.Style then
513    RecreateWnd(ACustomListBox);
514end;
515
516class procedure TGtk3WSCustomListBox.SetSorted(const ACustomListBox: TCustomListBox;
517  AList: TStrings; ASorted: boolean);
518begin
519end;
520
521class procedure TGtk3WSCustomListBox.SetTopIndex(const ACustomListBox: TCustomListBox;
522  const NewTopIndex: integer);
523begin
524  if not WSCheckHandleAllocated(ACustomListBox, 'SetTopIndex') then
525    Exit;
526  TGtk3ListBox(ACustomListBox.Handle).SetTopIndex(NewTopIndex);
527end;
528
529{ TGtk3WSCustomComboBox }
530
531class function TGtk3WSCustomComboBox.CreateHandle(
532  const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle;
533var
534  AGtkCombo: TGtk3ComboBox;
535begin
536  {$IFDEF GTK3DEBUGCORE}
537  DebugLn('TGtk3WSCustomComboBox.CreateHandle');
538  {$ENDIF}
539  AGtkCombo := TGtk3ComboBox.Create(AWinControl, AParams);
540  Result := TLCLIntfHandle(AGtkCombo);
541  {$IFDEF GTK3DEBUGCORE}
542  DebugLn('TGtk3WSCustomComboBox.CreateHandle Handle=',dbgs(Result));
543  {$ENDIF}
544end;
545
546class procedure TGtk3WSCustomComboBox.GetPreferredSize(
547  const AWinControl: TWinControl; var PreferredWidth, PreferredHeight: integer;
548  WithThemeSpace: Boolean);
549begin
550  if not WSCheckHandleAllocated(AWinControl, 'GetPreferredSize') then
551    Exit;
552  TGtk3ComboBox(AWinControl.Handle).preferredSize(PreferredWidth, PreferredHeight, WithThemeSpace);
553end;
554
555class function TGtk3WSCustomComboBox.GetDroppedDown(
556  const ACustomComboBox: TCustomComboBox): Boolean;
557begin
558  Result := False;
559  if not WSCheckHandleAllocated(ACustomComboBox, 'GetDroppedDown') then
560    Exit;
561  Result := TGtk3ComboBox(ACustomComboBox.Handle).DroppedDown;
562end;
563
564class function TGtk3WSCustomComboBox.GetSelStart(const ACustomComboBox: TCustomComboBox
565  ): integer;
566begin
567  Result := -1;
568end;
569
570class function TGtk3WSCustomComboBox.GetSelLength(const ACustomComboBox: TCustomComboBox
571  ): integer;
572begin
573  Result := 0;
574end;
575
576class function TGtk3WSCustomComboBox.GetItemIndex(const ACustomComboBox: TCustomComboBox
577  ): integer;
578begin
579  Result := -1;
580  if not WSCheckHandleAllocated(ACustomComboBox, 'GetItemIndex') then
581    Exit;
582  Result := TGtk3ComboBox(ACustomComboBox.Handle).ItemIndex;
583end;
584
585class function TGtk3WSCustomComboBox.GetMaxLength(const ACustomComboBox: TCustomComboBox
586  ): integer;
587begin
588  Result := 0;
589end;
590
591class procedure TGtk3WSCustomComboBox.SetArrowKeysTraverseList(
592  const ACustomComboBox: TCustomComboBox; NewTraverseList: boolean);
593begin
594end;
595
596class procedure TGtk3WSCustomComboBox.SetDropDownCount(
597  const ACustomComboBox: TCustomComboBox; NewCount: Integer);
598begin
599
600end;
601
602class procedure TGtk3WSCustomComboBox.SetDroppedDown(
603  const ACustomComboBox: TCustomComboBox; ADroppedDown: Boolean);
604begin
605  if not WSCheckHandleAllocated(ACustomComboBox, 'SetDroppedDown') then
606    Exit;
607  TGtk3ComboBox(ACustomComboBox.Handle).DroppedDown := ADroppedDown;
608end;
609
610class procedure TGtk3WSCustomComboBox.SetMaxLength(const ACustomComboBox: TCustomComboBox;
611  NewLength: integer);
612begin
613
614end;
615
616class procedure TGtk3WSCustomComboBox.SetSelStart(const ACustomComboBox: TCustomComboBox;
617  NewStart: integer);
618begin
619
620end;
621
622class procedure TGtk3WSCustomComboBox.SetSelLength(const ACustomComboBox: TCustomComboBox;
623  NewLength: integer);
624begin
625
626end;
627
628class procedure TGtk3WSCustomComboBox.SetItemIndex(const ACustomComboBox: TCustomComboBox;
629  NewIndex: integer);
630begin
631  if not WSCheckHandleAllocated(ACustomComboBox, 'SetItemIndex') then
632    Exit;
633  // DebugLn('TGtk3WSCustomComboBox.SetItemIndex ',dbgs(NewIndex));
634  TGtk3ComboBox(ACustomComboBox.Handle).BeginUpdate;
635  TGtk3ComboBox(ACustomComboBox.Handle).ItemIndex := NewIndex;
636  TGtk3ComboBox(ACustomComboBox.Handle).EndUpdate;
637end;
638
639class procedure TGtk3WSCustomComboBox.SetStyle(const ACustomComboBox: TCustomComboBox;
640  NewStyle: TComboBoxStyle);
641begin
642
643end;
644
645class function TGtk3WSCustomComboBox.GetItems(const ACustomComboBox: TCustomComboBox
646  ): TStrings;
647begin
648  Result := nil;
649
650  if not WSCheckHandleAllocated(ACustomComboBox, 'GetItems') then
651  begin
652    Exit;
653  end;
654  // DebugLn('TGtk3WSCustomComboBox.GetItems creating TGtkListStoreStringList ...');
655  Result := TGtkListStoreStringList(g_object_get_data(PGObject(TGtk3ComboBox(ACustomComboBox.Handle).GetContainerWidget),
656                                     GtkListItemLCLListTag));
657end;
658
659class procedure TGtk3WSCustomComboBox.Sort(const ACustomComboBox: TCustomComboBox;
660  AList: TStrings; IsSorted: boolean);
661begin
662end;
663
664class function TGtk3WSCustomComboBox.GetItemHeight(const ACustomComboBox: TCustomComboBox): Integer;
665begin
666  Result := 0;
667end;
668
669class procedure TGtk3WSCustomComboBox.SetItemHeight(const ACustomComboBox: TCustomComboBox; const AItemHeight: Integer);
670begin
671end;
672
673{ TGtk3WSCustomEdit }
674
675class function TGtk3WSCustomEdit.CreateHandle(const AWinControl: TWinControl;
676  const AParams: TCreateParams): TLCLIntfHandle;
677var
678  AGtkEntry: TGtk3Entry;
679begin
680  AGtkEntry := TGtk3Entry.Create(AWinControl, AParams);
681  Result := TLCLIntfHandle(AGtkEntry);
682end;
683
684class procedure TGtk3WSCustomEdit.GetPreferredSize(
685  const AWinControl: TWinControl; var PreferredWidth, PreferredHeight: integer;
686  WithThemeSpace: Boolean);
687begin
688  if not WSCheckHandleAllocated(AWinControl, 'GetPreferredSize') then
689    Exit;
690  TGtk3Entry(AWinControl.Handle).preferredSize(PreferredWidth, PreferredHeight, WithThemeSpace);
691end;
692
693class function TGtk3WSCustomEdit.GetCanUndo(const ACustomEdit: TCustomEdit
694  ): Boolean;
695begin
696  Result := False;
697end;
698
699class function TGtk3WSCustomEdit.GetCaretPos(const ACustomEdit: TCustomEdit): TPoint;
700begin
701  Result := Point(0, 0);
702  if not WSCheckHandleAllocated(ACustomEdit, 'GetCaretPos') then
703    Exit;
704  Result := TGtk3Editable(ACustomEdit.Handle).CaretPos;
705end;
706
707class function  TGtk3WSCustomEdit.GetSelStart(const ACustomEdit: TCustomEdit): integer;
708begin
709  result := -1;
710  if not WSCheckHandleAllocated(ACustomEdit, 'GetSelStart') then
711    Exit;
712  Result := TGtk3Editable(ACustomEdit.Handle).getSelStart;
713end;
714
715class function  TGtk3WSCustomEdit.GetSelLength(const ACustomEdit: TCustomEdit): integer;
716begin
717  result := 0;
718  if not WSCheckHandleAllocated(ACustomEdit, 'GetSelLength') then
719    Exit;
720  Result := TGtk3Editable(ACustomEdit.Handle).getSelLength;
721end;
722
723class procedure TGtk3WSCustomEdit.SetAlignment(const ACustomEdit: TCustomEdit;
724  const AAlignment: TAlignment);
725begin
726  if not WSCheckHandleAllocated(ACustomEdit, 'SetAlignment') then
727    Exit;
728  TGtk3Editable(ACustomEdit.Handle).BeginUpdate;
729  TGtk3Entry(ACustomEdit.Handle).Alignment := AAlignment;
730  TGtk3Editable(ACustomEdit.Handle).EndUpdate;
731end;
732
733class procedure TGtk3WSCustomEdit.SetCaretPos(const ACustomEdit: TCustomEdit; const NewPos: TPoint);
734begin
735  if not WSCheckHandleAllocated(ACustomEdit, 'GetCaretPos') then
736    Exit;
737  TGtk3Editable(ACustomEdit.Handle).BeginUpdate;
738  TGtk3Editable(ACustomEdit.Handle).CaretPos := NewPos;
739  TGtk3Editable(ACustomEdit.Handle).EndUpdate;
740end;
741
742class procedure TGtk3WSCustomEdit.SetCharCase(const ACustomEdit: TCustomEdit; NewCase: TEditCharCase);
743begin
744  if not WSCheckHandleAllocated(ACustomEdit, 'SetCharCase') then
745    Exit;
746end;
747
748class procedure TGtk3WSCustomEdit.SetEchoMode(const ACustomEdit: TCustomEdit; NewMode: TEchoMode);
749begin
750  if not WSCheckHandleAllocated(ACustomEdit, 'SetEchoMode') then
751    Exit;
752  if NewMode in [emNone,emPassword] then
753  begin
754    TGtk3Entry(ACustomEdit.Handle).SetEchoMode(False);
755    SetPasswordChar(ACustomEdit, ACustomEdit.PasswordChar);
756  end else
757  begin
758    TGtk3Entry(ACustomEdit.Handle).SetEchoMode(True);
759  end;
760end;
761
762class procedure TGtk3WSCustomEdit.SetHideSelection(const ACustomEdit: TCustomEdit;
763  NewHideSelection: Boolean);
764begin
765  if not WSCheckHandleAllocated(ACustomEdit, 'SetHideSelection') then
766    Exit;
767end;
768
769class procedure TGtk3WSCustomEdit.SetMaxLength(const ACustomEdit: TCustomEdit; NewLength: integer);
770begin
771  if not WSCheckHandleAllocated(ACustomEdit, 'SetMaxLength') then
772    Exit;
773  TGtk3Entry(ACustomEdit.Handle).SetMaxLength(NewLength);
774end;
775
776class procedure TGtk3WSCustomEdit.SetPasswordChar(const ACustomEdit: TCustomEdit; NewChar: char);
777begin
778  if not WSCheckHandleAllocated(ACustomEdit, 'SetPasswordChar') then
779    Exit;
780  TGtk3Entry(ACustomEdit.Handle).SetPasswordChar(NewChar);
781end;
782
783class procedure TGtk3WSCustomEdit.SetReadOnly(const ACustomEdit: TCustomEdit; NewReadOnly: boolean);
784begin
785  if not WSCheckHandleAllocated(ACustomEdit, 'SetReadOnly') then
786    Exit;
787  TGtk3Editable(ACustomEdit.Handle).ReadOnly := NewReadOnly;
788end;
789
790class procedure TGtk3WSCustomEdit.SetSelStart(const ACustomEdit: TCustomEdit; NewStart: integer);
791begin
792  if not WSCheckHandleAllocated(ACustomEdit, 'SetSelStart') then
793    Exit;
794  TGtk3Editable(ACustomEdit.Handle).BeginUpdate;
795  TGtk3Editable(ACustomEdit.Handle).SetSelStart(NewStart);
796  TGtk3Editable(ACustomEdit.Handle).EndUpdate;
797end;
798
799class procedure TGtk3WSCustomEdit.SetSelLength(const ACustomEdit: TCustomEdit; NewLength: integer);
800begin
801  if not WSCheckHandleAllocated(ACustomEdit, 'SetSelLength') then
802    Exit;
803  TGtk3Editable(ACustomEdit.Handle).BeginUpdate;
804  TGtk3Editable(ACustomEdit.Handle).SetSelLength(NewLength);
805  TGtk3Editable(ACustomEdit.Handle).EndUpdate;
806end;
807
808class procedure TGtk3WSCustomEdit.Cut(const ACustomEdit: TCustomEdit);
809begin
810  ACustomEdit.CopyToClipboard;
811  ACustomEdit.ClearSelection;
812end;
813
814class procedure TGtk3WSCustomEdit.Copy(const ACustomEdit: TCustomEdit);
815begin
816  if (ACustomEdit.EchoMode = emNormal) and (ACustomEdit.SelLength > 0) then
817    Clipboard.AsText := ACustomEdit.SelText;
818end;
819
820class procedure TGtk3WSCustomEdit.Paste(const ACustomEdit: TCustomEdit);
821begin
822  if Clipboard.HasFormat(CF_TEXT) then
823    ACustomEdit.SelText := Clipboard.AsText;
824end;
825
826class procedure TGtk3WSCustomEdit.Undo(const ACustomEdit: TCustomEdit);
827begin
828  // nothing
829end;
830
831{ TGtk3WSCustomMemo }
832
833class function TGtk3WSCustomMemo.CreateHandle(const AWinControl: TWinControl;
834  const AParams: TCreateParams): TLCLIntfHandle;
835var
836  AGtkMemo: TGtk3Memo;
837begin
838  AGtkMemo := TGtk3Memo.Create(AWinControl, AParams);
839  AGtkMemo.BorderStyle := TCustomMemo(AWinControl).BorderStyle;
840  Result := TLCLIntfHandle(AGtkMemo);
841end;
842
843class procedure TGtk3WSCustomMemo.GetPreferredSize(
844  const AWinControl: TWinControl; var PreferredWidth, PreferredHeight: integer;
845  WithThemeSpace: Boolean);
846begin
847  if not WSCheckHandleAllocated(AWinControl, 'GetPreferredSize') then
848    Exit;
849  TGtk3Memo(AWinControl.Handle).preferredSize(PreferredWidth, PreferredHeight, WithThemeSpace);
850end;
851
852class function TGtk3WSCustomMemo.GetStrings(const ACustomMemo: TCustomMemo
853  ): TStrings;
854begin
855  Result := TGtk3MemoStrings.Create(ACustomMemo);
856end;
857
858class procedure TGtk3WSCustomMemo.SetScrollbars(const ACustomMemo: TCustomMemo; const NewScrollbars: TScrollStyle);
859var
860  AScrollStyle: TPoint;
861begin
862  if not WSCheckHandleAllocated(ACustomMemo, 'SetScrollBars') then
863    Exit;
864  AScrollStyle := Gtk3TranslateScrollStyle(ACustomMemo.ScrollBars);
865  TGtk3Memo(ACustomMemo.Handle).BeginUpdate;
866  TGtk3Memo(ACustomMemo.Handle).HScrollBarPolicy := AScrollStyle.X;
867  TGtk3Memo(ACustomMemo.Handle).VScrollBarPolicy := AScrollStyle.Y;
868  TGtk3Memo(ACustomMemo.Handle).EndUpdate;
869end;
870
871class procedure TGtk3WSCustomMemo.SetWantTabs(const ACustomMemo: TCustomMemo; const NewWantTabs: boolean);
872begin
873  if not WSCheckHandleAllocated(ACustomMemo, 'SetWantTabs') then
874    Exit;
875  TGtk3Memo(ACustomMemo.Handle).WantTabs := NewWantTabs;
876end;
877
878class procedure TGtk3WSCustomMemo.SetWantReturns(const ACustomMemo: TCustomMemo; const NewWantReturns: boolean);
879begin
880  // no way
881end;
882
883class procedure TGtk3WSCustomMemo.SetWordWrap(const ACustomMemo: TCustomMemo; const NewWordWrap: boolean);
884begin
885  if not WSCheckHandleAllocated(ACustomMemo, 'SetWordWrap') then
886    Exit;
887  TGtk3Memo(ACustomMemo.Handle).WordWrap := NewWordWrap;
888end;
889
890class function TGtk3WSCustomMemo.GetCanUndo(const ACustomEdit: TCustomEdit
891  ): Boolean;
892begin
893  Result := False;
894end;
895
896class function TGtk3WSCustomMemo.GetCaretPos(const ACustomEdit: TCustomEdit
897  ): TPoint;
898begin
899  Result := Point(0, 0);
900end;
901
902class function TGtk3WSCustomMemo.GetSelStart(const ACustomEdit: TCustomEdit
903  ): integer;
904begin
905  Result := 0;
906end;
907
908class function TGtk3WSCustomMemo.GetSelLength(const ACustomEdit: TCustomEdit
909  ): integer;
910begin
911  Result := 0;
912end;
913
914class procedure TGtk3WSCustomMemo.SetAlignment(const ACustomEdit: TCustomEdit;
915  const AAlignment: TAlignment);
916begin
917  if not WSCheckHandleAllocated(ACustomEdit, 'SetAlignment') then
918    Exit;
919  TGtk3Memo(ACustomEdit.Handle).Alignment := AAlignment;
920end;
921
922class procedure TGtk3WSCustomMemo.SetCaretPos(const ACustomEdit: TCustomEdit;
923  const NewPos: TPoint);
924begin
925  // inherited SetCaretPos(ACustomEdit, NewPos);
926end;
927
928class procedure TGtk3WSCustomMemo.SetCharCase(const ACustomEdit: TCustomEdit;
929  NewCase: TEditCharCase);
930begin
931  // inherited SetCharCase(ACustomEdit, NewCase);
932end;
933
934class procedure TGtk3WSCustomMemo.SetEchoMode(const ACustomEdit: TCustomEdit;
935  NewMode: TEchoMode);
936begin
937  // inherited SetEchoMode(ACustomEdit, NewMode);
938end;
939
940class procedure TGtk3WSCustomMemo.SetHideSelection(
941  const ACustomEdit: TCustomEdit; NewHideSelection: Boolean);
942begin
943  // inherited SetHideSelection(ACustomEdit, NewHideSelection);
944end;
945
946class procedure TGtk3WSCustomMemo.SetMaxLength(const ACustomEdit: TCustomEdit;
947  NewLength: integer);
948begin
949  // inherited SetMaxLength(ACustomEdit, NewLength);
950end;
951
952class procedure TGtk3WSCustomMemo.SetPasswordChar(
953  const ACustomEdit: TCustomEdit; NewChar: char);
954begin
955  // inherited SetPasswordChar(ACustomEdit, NewChar);
956end;
957
958class procedure TGtk3WSCustomMemo.SetReadOnly(const ACustomEdit: TCustomEdit;
959  NewReadOnly: boolean);
960begin
961  if not WSCheckHandleAllocated(ACustomEdit, 'SetReadOnly') then
962    Exit;
963  TGtk3Memo(ACustomEdit.Handle).ReadOnly := NewReadOnly;
964end;
965
966class procedure TGtk3WSCustomMemo.SetSelStart(const ACustomEdit: TCustomEdit;
967  NewStart: integer);
968begin
969  // inherited SetSelStart(ACustomEdit, NewStart);
970end;
971
972class procedure TGtk3WSCustomMemo.SetSelLength(const ACustomEdit: TCustomEdit;
973  NewLength: integer);
974begin
975  // inherited SetSelLength(ACustomEdit, NewLength);
976end;
977
978{ TGtk3WSCustomStaticText }
979
980class function TGtk3WSCustomStaticText.CreateHandle(
981  const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle;
982var
983  AStaticText: TGtk3StaticText;
984begin
985  AStaticText := TGtk3StaticText.Create(AWinControl, AParams);
986  Result := TLCLIntfHandle(AStaticText);
987end;
988
989class procedure TGtk3WSCustomStaticText.GetPreferredSize(
990  const AWinControl: TWinControl; var PreferredWidth, PreferredHeight: integer;
991  WithThemeSpace: Boolean);
992begin
993  if not WSCheckHandleAllocated(AWinControl, 'GetPreferredSize') then
994    Exit;
995  TGtk3StaticText(AWinControl.Handle).preferredSize(PreferredWidth, PreferredHeight, WithThemeSpace);
996end;
997
998class procedure TGtk3WSCustomStaticText.SetAlignment(const ACustomStaticText: TCustomStaticText; const NewAlignment: TAlignment);
999begin
1000  if not WSCheckHandleAllocated(ACustomStaticText, 'SetAlignment') then
1001    Exit;
1002  TGtk3StaticText(ACustomStaticText.Handle).Alignment := NewAlignment;
1003end;
1004
1005class procedure TGtk3WSCustomStaticText.SetStaticBorderStyle(
1006  const ACustomStaticText: TCustomStaticText;
1007  const NewBorderStyle: TStaticBorderStyle);
1008begin
1009  if not WSCheckHandleAllocated(ACustomStaticText, 'SetStaticBorderStyle') then
1010    Exit;
1011  TGtk3StaticText(ACustomStaticText.Handle).StaticBorderStyle := NewBorderStyle;
1012end;
1013
1014{ TGtk3WSButton }
1015
1016class function TGtk3WSButton.CreateHandle(const AWinControl: TWinControl;
1017  const AParams: TCreateParams): TLCLIntfHandle;
1018var
1019  AButton: TGtk3Button;
1020begin
1021  {$IFDEF GTK3DEBUGCORE}
1022  DebugLn('TGtk3WSButton.CreateHandle');
1023  {$ENDIF}
1024  AButton := TGtk3Button.Create(AWinControl, AParams);
1025  Result := TLCLIntfHandle(AButton);
1026  {$IFDEF GTK3DEBUGCORE}
1027  DebugLn('TGtk3WSButton.CreateHandle Handle=',dbgs(Result));
1028  {$ENDIF}
1029end;
1030
1031class procedure TGtk3WSButton.GetPreferredSize(const AWinControl: TWinControl;
1032  var PreferredWidth, PreferredHeight: integer; WithThemeSpace: Boolean);
1033begin
1034  if not WSCheckHandleAllocated(AWinControl, 'GetPreferredSize') then
1035    Exit;
1036  TGtk3Button(AWinControl.Handle).preferredSize(PreferredWidth, PreferredHeight, WithThemeSpace);
1037end;
1038
1039class procedure TGtk3WSButton.SetDefault(const AButton: TCustomButton; ADefault: Boolean);
1040begin
1041  if not WSCheckHandleAllocated(AButton, 'SetDefault') then
1042    Exit;
1043  TGtk3Button(AButton.Handle).SetDefault(ADefault);
1044end;
1045
1046class procedure TGtk3WSButton.SetShortCut(const AButton: TCustomButton;
1047  const ShortCutK1, ShortCutK2: TShortCut);
1048begin;
1049  //TODO:
1050end;
1051
1052{ TGtk3WSCustomCheckBox }
1053
1054class function TGtk3WSCustomCheckBox.CreateHandle(
1055  const AWinControl: TWinControl; const AParams: TCreateParams): TLCLIntfHandle;
1056var
1057  ACheckBox: TGtk3CheckBox;
1058begin
1059  ACheckBox := TGtk3CheckBox.Create(AWinControl, AParams);
1060
1061  Result := TLCLIntfHandle(ACheckBox);
1062end;
1063
1064class procedure TGtk3WSCustomCheckBox.GetPreferredSize(
1065  const AWinControl: TWinControl; var PreferredWidth, PreferredHeight: integer;
1066  WithThemeSpace: Boolean);
1067begin
1068  if not WSCheckHandleAllocated(AWinControl, 'GetPreferredSize') then
1069    Exit;
1070  TGtk3CheckBox(AWinControl.Handle).preferredSize(PreferredWidth, PreferredHeight, WithThemeSpace);
1071end;
1072
1073class function TGtk3WSCustomCheckBox.RetrieveState(const ACustomCheckBox: TCustomCheckBox): TCheckBoxState;
1074begin
1075  Result := cbUnchecked;
1076  if not WSCheckHandleAllocated(ACustomCheckBox, 'RetrieveState') then
1077    Exit;
1078  Result := TGtk3CheckBox(ACustomCheckBox.Handle).State;
1079end;
1080
1081class procedure TGtk3WSCustomCheckBox.SetShortCut(const ACustomCheckBox: TCustomCheckBox;
1082  const ShortCutK1, ShortCutK2: TShortCut);
1083begin
1084  //TODO:
1085end;
1086
1087class procedure TGtk3WSCustomCheckBox.SetState(const ACustomCheckBox: TCustomCheckBox; const NewState: TCheckBoxState);
1088begin
1089  if not WSCheckHandleAllocated(ACustomCheckBox, 'SetState') then
1090    Exit;
1091  TGtk3CheckBox(ACustomCheckBox.Handle).State := NewState;
1092end;
1093
1094{ TGtk3WSButtonControl }
1095
1096class function TGtk3WSButtonControl.GetDefaultColor(const AControl: TControl; const ADefaultColorType: TDefaultColorType): TColor;
1097begin
1098  Result := DefBtnColors[ADefaultColorType];
1099end;
1100
1101end.
1102