~ubuntu-branches/ubuntu/saucy/lazarus/saucy

« back to all changes in this revision

Viewing changes to lcl/widgetset/wscomctrls.pp

  • Committer: Package Import Robot
  • Author(s): Paul Gevers, Abou Al Montacir, Bart Martens, Paul Gevers
  • Date: 2013-06-08 14:12:17 UTC
  • mfrom: (1.1.9)
  • Revision ID: package-import@ubuntu.com-20130608141217-7k0cy9id8ifcnutc
Tags: 1.0.8+dfsg-1
[ Abou Al Montacir ]
* New upstream major release and multiple maintenace release offering many
  fixes and new features marking a new milestone for the Lazarus development
  and its stability level.
  - The detailed list of changes can be found here:
    http://wiki.lazarus.freepascal.org/Lazarus_1.0_release_notes
    http://wiki.lazarus.freepascal.org/Lazarus_1.0_fixes_branch
* LCL changes:
  - LCL is now a normal package.
      + Platform independent parts of the LCL are now in the package LCLBase
      + LCL is automatically recompiled when switching the target platform,
        unless pre-compiled binaries for this target are already installed.
      + No impact on existing projects.
      + Linker options needed by LCL are no more added to projects that do
        not use the LCL package.
  - Minor changes in LCL basic classes behaviour
      + TCustomForm.Create raises an exception if a form resource is not
        found.
      + TNotebook and TPage: a new implementation of these classes was added.
      + TDBNavigator: It is now possible to have focusable buttons by setting
        Options = [navFocusableButtons] and TabStop = True, useful for
        accessibility and for devices with neither mouse nor touch screen.
      + Names of TControlBorderSpacing.GetSideSpace and GetSpace were swapped
        and are now consistent. GetSideSpace = Around + GetSpace.
      + TForm.WindowState=wsFullscreen was added
      + TCanvas.TextFitInfo was added to calculate how many characters will
        fit into a specified Width. Useful for word-wrapping calculations.
      + TControl.GetColorResolvingParent and
        TControl.GetRGBColorResolvingParent were added, simplifying the work
        to obtain the final color of the control while resolving clDefault
        and the ParentColor.
      + LCLIntf.GetTextExtentExPoint now has a good default implementation
        which works in any platform not providing a specific implementation.
        However, Widgetset specific implementation is better, when available.
      + TTabControl was reorganized. Now it has the correct class hierarchy
        and inherits from TCustomTabControl as it should.
  - New unit in the LCL:
      + lazdialogs.pas: adds non-native versions of various native dialogs,
        for example TLazOpenDialog, TLazSaveDialog, TLazSelectDirectoryDialog.
        It is used by widgetsets which either do not have a native dialog, or
        do not wish to use it because it is limited. These dialogs can also be
        used by user applications directly.
      + lazdeviceapis.pas: offers an interface to more hardware devices such
        as the accelerometer, GPS, etc. See LazDeviceAPIs
      + lazcanvas.pas: provides a TFPImageCanvas descendent implementing
        drawing in a LCL-compatible way, but 100% in Pascal.
      + lazregions.pas. LazRegions is a wholly Pascal implementation of
        regions for canvas clipping, event clipping, finding in which control
        of a region tree one an event should reach, for drawing polygons, etc.
      + customdrawncontrols.pas, customdrawndrawers.pas,
        customdrawn_common.pas, customdrawn_android.pas and
        customdrawn_winxp.pas: are the Lazarus Custom Drawn Controls -controls
        which imitate the standard LCL ones, but with the difference that they
        are non-native and support skinning.
  - New APIs added to the LCL to improve support of accessibility software
    such as screen readers.
* IDE changes:
  - Many improvments.
  - The detailed list of changes can be found here:
    http://wiki.lazarus.freepascal.org/New_IDE_features_since#v1.0_.282012-08-29.29
    http://wiki.lazarus.freepascal.org/Lazarus_1.0_release_notes#IDE_Changes
* Debugger / Editor changes:
  - Added pascal sources and breakpoints to the disassembler
  - Added threads dialog.
* Components changes:
  - TAChart: many fixes and new features
  - CodeTool: support Delphi style generics and new syntax extensions.
  - AggPas: removed to honor free licencing. (Closes: Bug#708695)
[Bart Martens]
* New debian/watch file fixing issues with upstream RC release.
[Abou Al Montacir]
* Avoid changing files in .pc hidden directory, these are used by quilt for
  internal purpose and could lead to surprises during build.
[Paul Gevers]
* Updated get-orig-source target and it compinion script orig-tar.sh so that they
  repack the source file, allowing bug 708695 to be fixed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
{ $Id: wscomctrls.pp 28312 2010-11-18 09:28:03Z paul $}
 
1
{ $Id: wscomctrls.pp 33537 2011-11-15 07:28:07Z sekelsenmat $}
2
2
{
3
3
 *****************************************************************************
4
4
 *                               WSComCtrls.pp                               * 
50
50
  WSLCLClasses, WSControls, WSExtCtrls, WSToolwin, WSFactory;
51
51
 
52
52
type
 
53
  { TWSCustomPage }
 
54
 
 
55
  TWSCustomPageClass = class of TWSCustomPage;
 
56
  TWSCustomPage = class(TWSWinControl)
 
57
  published
 
58
    class procedure UpdateProperties(const ACustomPage: TCustomPage); virtual;
 
59
  end;
 
60
 
 
61
  { TWSCustomTabControl }
 
62
 
 
63
  TWSCustomTabControl = class(TWSWinControl)
 
64
  published
 
65
    class procedure AddPage(const ATabControl: TCustomTabControl; const AChild: TCustomPage; const AIndex: integer); virtual;
 
66
    class procedure MovePage(const ATabControl: TCustomTabControl; const AChild: TCustomPage; const NewIndex: integer); virtual;
 
67
    class procedure RemovePage(const ATabControl: TCustomTabControl; const AIndex: integer); virtual;
 
68
 
 
69
    class function GetNotebookMinTabHeight(const AWinControl: TWinControl): integer; virtual;
 
70
    class function GetNotebookMinTabWidth(const AWinControl: TWinControl): integer; virtual;
 
71
    class function GetTabIndexAtPos(const ATabControl: TCustomTabControl; const AClientPos: TPoint): integer; virtual;
 
72
    class function GetTabRect(const ATabControl: TCustomTabControl; const AIndex: Integer): TRect; virtual;
 
73
    class function GetCapabilities: TCTabControlCapabilities; virtual;
 
74
    class procedure SetImageList(const ATabControl: TCustomTabControl; const AImageList: TCustomImageList); virtual;
 
75
    class procedure SetPageIndex(const ATabControl: TCustomTabControl; const AIndex: integer); virtual;
 
76
    class procedure SetTabCaption(const ATabControl: TCustomTabControl; const AChild: TCustomPage; const AText: string); virtual;
 
77
    class procedure SetTabPosition(const ATabControl: TCustomTabControl; const ATabPosition: TTabPosition); virtual;
 
78
    class procedure ShowTabs(const ATabControl: TCustomTabControl; AShowTabs: boolean); virtual;
 
79
    class procedure UpdateProperties(const ATabControl: TCustomTabControl); virtual;
 
80
  end;
 
81
  TWSCustomTabControlClass = class of TWSCustomTabControl;
 
82
 
53
83
  { TWSStatusBar }
54
84
 
55
85
  TWSStatusBarClass = class of TWSStatusBar;
70
100
 
71
101
  { TWSPageControl }
72
102
 
73
 
  TWSPageControl = class(TWSCustomNotebook)
 
103
  TWSPageControl = class(TWSCustomTabControl)
74
104
  published
75
105
  end;
76
106
 
78
108
  TWSListViewItemChange = (lvicText, lvicImage);
79
109
  TWSListViewItemChanges = set of TWSListViewItemChange;
80
110
 
81
 
  TWSCustomListViewClass = class of TWSCustomListView;
82
111
  TWSCustomListView = class(TWSWinControl)
83
112
  published
84
113
    // Column
98
127
    // Item          
99
128
    class procedure ItemDelete(const ALV: TCustomListView; const AIndex: Integer); virtual;
100
129
    class function  ItemDisplayRect(const ALV: TCustomListView; const AIndex, ASubItem: Integer; ACode: TDisplayCode): TRect; virtual;
 
130
    class procedure ItemExchange(const ALV: TCustomListView; AItem: TListItem; const AIndex1, AIndex2: Integer); virtual;
 
131
    class procedure ItemMove(const ALV: TCustomListView; AItem: TListItem; const AFromIndex, AToIndex: Integer); virtual;
101
132
    class function  ItemGetChecked(const ALV: TCustomListView; const AIndex: Integer; const AItem: TListItem): Boolean; virtual;
102
133
    class function  ItemGetPosition(const ALV: TCustomListView; const AIndex: Integer): TPoint; virtual;
103
134
    class function  ItemGetState(const ALV: TCustomListView; const AIndex: Integer; const AItem: TListItem; const AState: TListItemState; out AIsSet: Boolean): Boolean; virtual; // returns True if supported
138
169
    class procedure SetProperty(const ALV: TCustomListView; const AProp: TListViewProperty; const AIsSet: Boolean); virtual;
139
170
    class procedure SetProperties(const ALV: TCustomListView; const AProps: TListViewProperties); virtual;
140
171
    class procedure SetScrollBars(const ALV: TCustomListView; const AValue: TScrollStyle); virtual;
141
 
    class procedure SetSort(const ALV: TCustomListView; const AType: TSortType; const AColumn: Integer); virtual;
 
172
    class procedure SetSort(const ALV: TCustomListView; const AType: TSortType; const AColumn: Integer;
 
173
      const ASortDirection: TSortDirection); virtual;
142
174
    class procedure SetViewOrigin(const ALV: TCustomListView; const AValue: TPoint); virtual;
143
175
    class procedure SetViewStyle(const ALV: TCustomListView; const Avalue: TViewStyle); virtual;
144
176
  end;
145
177
 
 
178
  TWSCustomListViewClass = class of TWSCustomListView;
 
179
 
146
180
  { TWSListView }                             
147
181
 
148
182
  TWSListView = class(TWSCustomListView)
195
229
  published
196
230
    class procedure ApplyChanges(const ATrackBar: TCustomTrackBar); virtual;
197
231
    class function GetPosition(const ATrackBar: TCustomTrackBar): integer; virtual;
 
232
    class procedure SetOrientation(const ATrackBar: TCustomTrackBar; const AOrientation: TTrackBarOrientation); virtual;
198
233
    class procedure SetPosition(const ATrackBar: TCustomTrackBar; const NewPosition: integer); virtual;
199
234
    class procedure SetTick(const ATrackBar: TCustomTrackBar; const ATick: integer); virtual;
200
235
  end;
230
265
uses
231
266
  LResources;
232
267
 
 
268
{ TWSCustomPage }
 
269
 
 
270
class procedure TWSCustomPage.UpdateProperties(const ACustomPage: TCustomPage);
 
271
begin
 
272
end;
 
273
 
 
274
{ TWSCustomTabControl }
 
275
 
 
276
{ -----------------------------------------------------------------------------
 
277
  Method: TWSCustomTabControl.AddPage
 
278
  Params: ATabControl - A notebook control
 
279
          AChild - Page to insert
 
280
          AIndex  - The position in the notebook to insert the page
 
281
  Returns: Nothing
 
282
 
 
283
  Adds a new page to a notebook
 
284
 ------------------------------------------------------------------------------}
 
285
class procedure TWSCustomTabControl.AddPage(const ATabControl: TCustomTabControl; const AChild: TCustomPage; const AIndex: integer);
 
286
begin
 
287
end;
 
288
 
 
289
{------------------------------------------------------------------------------
 
290
  Method: TWSCustomTabControl.MovePage
 
291
  Params: ATabControl - The notebook control
 
292
          AChild    - The page to move
 
293
          NewIndex  - The new index of the page
 
294
  Returns: Nothing
 
295
 
 
296
  Moves a page in a notebook control
 
297
 ------------------------------------------------------------------------------}
 
298
class procedure TWSCustomTabControl.MovePage(const ATabControl: TCustomTabControl;
 
299
  const AChild: TCustomPage; const NewIndex: integer);
 
300
begin
 
301
end;
 
302
 
 
303
{------------------------------------------------------------------------------
 
304
  Method: TWSCustomTabControl.RemovePage
 
305
  Params: ATabControl - The notebook control
 
306
          AIndex    - The index of the page to delete
 
307
  Returns: Nothing
 
308
 
 
309
  Removes a page from a notebook control
 
310
 ------------------------------------------------------------------------------}
 
311
class procedure TWSCustomTabControl.RemovePage(const ATabControl: TCustomTabControl; const AIndex: integer);
 
312
begin
 
313
end;
 
314
 
 
315
{-------------------------------------------------------------------------------
 
316
  function TWSCustomTabControl.GetNotebookMinTabHeight(
 
317
    const AWinControl: TWinControl): integer;
 
318
 
 
319
  Returns the minimum height of the horizontal tabs of a notebook. That is the
 
320
  Notebook with TabPosition in [tpTop,tpBottom] without the client panel.
 
321
-------------------------------------------------------------------------------}
 
322
class function  TWSCustomTabControl.GetNotebookMinTabHeight(
 
323
  const AWinControl: TWinControl): integer;
 
324
begin
 
325
  Result:=30;
 
326
end;
 
327
 
 
328
{-------------------------------------------------------------------------------
 
329
  function TWSCustomTabControl.GetNotebookMinTabWidth(
 
330
    const AWinControl: TWinControl): integer;
 
331
 
 
332
  Returns the minimum width of the vertical tabs of a notebook. That is the
 
333
  Notebook with TabPosition in [tpLeft,tpRight] without the client panel.
 
334
-------------------------------------------------------------------------------}
 
335
class function TWSCustomTabControl.GetNotebookMinTabWidth(const AWinControl: TWinControl
 
336
  ): integer;
 
337
begin
 
338
  Result:=60;
 
339
end;
 
340
 
 
341
class function TWSCustomTabControl.GetTabIndexAtPos(const ATabControl: TCustomTabControl;
 
342
  const AClientPos: TPoint): integer;
 
343
begin
 
344
  Result := -1;
 
345
end;
 
346
 
 
347
class function TWSCustomTabControl.GetTabRect(const ATabControl: TCustomTabControl;
 
348
  const AIndex: Integer): TRect;
 
349
begin
 
350
  Result := Rect(-1,-1,-1,-1);
 
351
end;
 
352
 
 
353
class function TWSCustomTabControl.GetCapabilities: TCTabControlCapabilities;
 
354
begin
 
355
  Result:=[];
 
356
end;
 
357
 
 
358
class procedure TWSCustomTabControl.SetImageList(
 
359
  const ATabControl: TCustomTabControl; const AImageList: TCustomImageList);
 
360
begin
 
361
end;
 
362
 
 
363
class procedure TWSCustomTabControl.SetPageIndex(const ATabControl: TCustomTabControl;
 
364
  const AIndex: integer);
 
365
begin
 
366
end;
 
367
 
 
368
class procedure TWSCustomTabControl.SetTabCaption(const ATabControl: TCustomTabControl;
 
369
  const AChild: TCustomPage; const AText: string);
 
370
begin
 
371
end;
 
372
 
 
373
class procedure TWSCustomTabControl.SetTabPosition(const ATabControl: TCustomTabControl;
 
374
  const ATabPosition: TTabPosition);
 
375
begin
 
376
end;
 
377
 
 
378
class procedure TWSCustomTabControl.ShowTabs(const ATabControl: TCustomTabControl;
 
379
  AShowTabs: boolean);
 
380
begin
 
381
end;
 
382
 
 
383
class procedure TWSCustomTabControl.UpdateProperties(
 
384
  const ATabControl: TCustomTabControl);
 
385
begin
 
386
 
 
387
end;
233
388
 
234
389
{ TWSStatusBar }
235
390
 
334
489
  Result := Rect(0,0,0,0);
335
490
end;
336
491
 
 
492
class procedure TWSCustomListView.ItemExchange(const ALV: TCustomListView;
 
493
  AItem: TListItem; const AIndex1, AIndex2: Integer);
 
494
begin
 
495
end;
 
496
 
 
497
class procedure TWSCustomListView.ItemMove(const ALV: TCustomListView;
 
498
  AItem: TListItem; const AFromIndex, AToIndex: Integer);
 
499
begin
 
500
end;
 
501
 
337
502
class function TWSCustomListView.ItemGetChecked(const ALV: TCustomListView; const AIndex: Integer; const AItem: TListItem): Boolean;
338
503
begin
339
504
  Result := False;
507
672
begin
508
673
end;
509
674
 
510
 
class procedure TWSCustomListView.SetSort(const ALV: TCustomListView; const AType: TSortType; const AColumn: Integer);
 
675
class procedure TWSCustomListView.SetSort(const ALV: TCustomListView;
 
676
  const AType: TSortType; const AColumn: Integer;
 
677
  const ASortDirection: TSortDirection);
511
678
begin
512
679
end;
513
680
 
569
736
  Result := 0;
570
737
end;
571
738
 
 
739
class procedure TWSTrackBar.SetOrientation(const ATrackBar: TCustomTrackBar;
 
740
  const AOrientation: TTrackBarOrientation);
 
741
begin
 
742
  RecreateWnd(ATrackBar);
 
743
end;
 
744
 
572
745
class procedure TWSTrackBar.SetPosition(const ATrackBar: TCustomTrackBar; const NewPosition: integer);
573
746
begin
574
747
end;
586
759
  if Done then exit;
587
760
  WSRegisterStatusBar;
588
761
  RegisterPropertyToSkip(TStatusBar, 'Font', 'VCL compatibility property', '');
 
762
  RegisterPropertyToSkip(TStatusBar, 'TabOrder', 'VCL compatibility property', '');
 
763
  RegisterPropertyToSkip(TStatusBar, 'TabStop', 'VCL compatibility property', '');
589
764
  RegisterPropertyToSkip(TStatusBar, 'UseSystemFont', 'VCL compatibility property', '');
590
765
//  if not WSRegisterStatusBar then
591
766
//    RegisterWSComponent(TStatusBar, TWSStatusBar);
612
787
  RegisterPropertyToSkip(TPageControl, 'Style', 'VCL compatibility property', '');
613
788
  RegisterPropertyToSkip(TPageControl, 'HotTrack', 'VCL compatibility property', '');
614
789
  RegisterPropertyToSkip(TPageControl, 'MultiLine', 'VCL compatibility property', '');
 
790
  RegisterPropertyToSkip(TPageControl, 'TabWidth', 'VCL compatibility property', '');
 
791
  RegisterPropertyToSkip(TPageControl, 'TabHeight', 'VCL compatibility property', '');
 
792
  RegisterPropertyToSkip(TPageControl, 'OnPageChanged', 'Was removed in Laz 0.9.31 due to incompatibilities with OnChange, which does the same thing.', '');
615
793
//  if not WSRegisterPageControl then
616
794
//    RegisterWSComponent(TPageControl, TWSPageControl);
617
795
  Done := True;