tvplanit: Remove calls to DoubleBuffered in the units (flicker fixed in Laz trunk)

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@6455 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2018-06-04 10:36:57 +00:00
parent 394c8032df
commit 9ce59d21d5
9 changed files with 57 additions and 19 deletions

View File

@ -38,7 +38,7 @@ interface
uses uses
{$IFDEF LCL} {$IFDEF LCL}
LCLProc, LCLType, LCLIntf, LazFileUtils, LCLProc, LCLType, LCLIntf, LazFileUtils,
PropEdits, LazarusPackageIntf, FieldsEditor, ComponentEditors, PropEdits, GraphPropEdits, LazarusPackageIntf, FieldsEditor, ComponentEditors,
{$ELSE} {$ELSE}
Windows, Windows,
{$IFDEF VERSION6} {$IFDEF VERSION6}
@ -47,10 +47,16 @@ uses
DsgnIntf, DsgnIntf,
{$ENDIF} {$ENDIF}
{$ENDIF} {$ENDIF}
Dialogs, Classes, Controls, TypInfo, Forms, SysUtils, Dialogs, Classes, Controls, TypInfo, Forms, SysUtils, ImgList,
VpDatePropEdit; VpDatePropEdit;
type type
{ TVpCategoryInfoImageIndexProperty }
TVpCategoryInfoImageIndexProperty = class(TImageIndexPropertyEditor)
protected
function GetImageList: TCustomImageList; overload;
end;
{TDBStringProperty} {TDBStringProperty}
TDBStringProperty = class(TStringProperty) TDBStringProperty = class(TStringProperty)
public public
@ -202,6 +208,25 @@ uses
VpFlxDSEd1; { Field mapper component editor for the FlexDS } VpFlxDSEd1; { Field mapper component editor for the FlexDS }
(*****************************************************************************)
{ TVpCategoryInfoImageIndexProperty }
function TVpCategoryInfoImageIndexProperty.GetImageList: TCustomImageList;
var
P: TPersistent;
begin
P := GetComponent(0);
if P is TVpCategoryInfo then begin
if TVpCategoryInfo(P).Owner is TVpCustomDatastore then begin
P := TVpCategoryInfo(P).Owner;
Result := TVpCustomDataStore(P).Images;
exit;
end;
end;
Result := nil;
end;
(*****************************************************************************) (*****************************************************************************)
{ TDBStringProperty } { TDBStringProperty }
@ -615,6 +640,9 @@ begin
'DefaultEventSound', TWavFilenameProperty); 'DefaultEventSound', TWavFilenameProperty);
{$ENDIF} {$ENDIF}
RegisterPropertyEditor(TypeInfo(TImageIndex), TVpCategoryInfo,
'ImageIndex', TVpCategoryInfoImageIndexProperty);
RegisterPropertyEditor(TypeInfo(String), TVpCustomDatastore, RegisterPropertyEditor(TypeInfo(String), TVpCustomDatastore,
'DefaultEventSound', TVpWavFilenameProperty); 'DefaultEventSound', TVpWavFilenameProperty);

View File

@ -198,8 +198,11 @@ type
end; end;
{TVpCategoryColorMap} {TVpCategoryColorMap}
TVpCategoryColorMap = class;
TVpCategoryInfo= class(TPersistent) TVpCategoryInfo= class(TPersistent)
private private
FOwner: TComponent; // This is the DataStore.
FCategoryIndex: Integer; FCategoryIndex: Integer;
protected protected
FBackgroundColor: TColor; FBackgroundColor: TColor;
@ -214,8 +217,9 @@ type
procedure SetDescription(Value: string); procedure SetDescription(Value: string);
procedure SetImageIndex(Value: TImageIndex); procedure SetImageIndex(Value: TImageIndex);
public public
constructor Create; constructor Create(AOwner: TComponent);
destructor Destroy; override; destructor Destroy; override;
property Owner: TComponent read FOwner;
published published
property BackgroundColor: TColor property BackgroundColor: TColor
read FBackgroundColor write SetBackgroundColor default clWindow; read FBackgroundColor write SetBackgroundColor default clWindow;
@ -228,10 +232,11 @@ type
TVpCategoryColorMap = class(TPersistent) TVpCategoryColorMap = class(TPersistent)
protected protected
FOwner: TComponent;
FCat: array[0..9] of TVpCategoryInfo; FCat: array[0..9] of TVpCategoryInfo;
procedure SetCat(AIndex: Integer; AValue: TVpCategoryInfo); procedure SetCat(AIndex: Integer; AValue: TVpCategoryInfo);
public public
constructor Create; constructor Create(AOwner: TComponent);
destructor Destroy; override; destructor Destroy; override;
function GetColor(Index: Integer): TColor; function GetColor(Index: Integer): TColor;
function GetName(Index: Integer):string; function GetName(Index: Integer):string;
@ -695,7 +700,7 @@ end;
(*****************************************************************************) (*****************************************************************************)
{ TVpCategoryColorMap } { TVpCategoryColorMap }
constructor TVpCategoryColorMap.Create; constructor TVpCategoryColorMap.Create(AOwner: TComponent);
const const
CAT_COLORS: Array[0..9] of TColor = ( CAT_COLORS: Array[0..9] of TColor = (
clNavy, clRed, clYellow, clLime, clPurple, clTeal, clFuchsia, clOlive, clAqua, clMaroon clNavy, clRed, clYellow, clLime, clPurple, clTeal, clFuchsia, clOlive, clAqua, clMaroon
@ -704,9 +709,10 @@ var
i: Integer; i: Integer;
begin begin
inherited Create; inherited Create;
FOwner := AOwner;
for i:=0 to High(FCat) do for i:=0 to High(FCat) do
begin begin
FCat[i] := TVpCategoryInfo.Create; FCat[i] := TVpCategoryInfo.Create(FOwner);
FCat[i].FIndex := i; FCat[i].FIndex := i;
FCat[i].Color := CAT_COLORS[i]; FCat[i].Color := CAT_COLORS[i];
FCat[i].Description := Format(RSCategoryDesc, [i]); FCat[i].Description := Format(RSCategoryDesc, [i]);
@ -751,9 +757,10 @@ end;
(*****************************************************************************) (*****************************************************************************)
{ TVpCategoryInfo } { TVpCategoryInfo }
constructor TVpCategoryInfo.Create; constructor TVpCategoryInfo.Create(AOwner: TComponent);
begin begin
inherited Create; inherited Create;
FOwner := AOwner;
FBitmap := TBitmap.Create; FBitmap := TBitmap.Create;
FBackgroundColor := clWindow; FBackgroundColor := clWindow;
FImageIndex := -1; FImageIndex := -1;

View File

@ -456,8 +456,8 @@ begin
FResources := TVpResources.Create(Self); FResources := TVpResources.Create(Self);
FTimeRange := TVpTimeRange.Create(Self); FTimeRange := TVpTimeRange.Create(Self);
FCategoryColorMap := TVpCategoryColorMap.Create; FCategoryColorMap := TVpCategoryColorMap.Create(Self);
FHiddenCategories := TVpCategoryInfo.Create; FHiddenCategories := TVpCategoryInfo.Create(Self);
with FHiddenCategories do begin with FHiddenCategories do begin
BackgroundColor := clSilver; BackgroundColor := clSilver;
Color := clGray; Color := clGray;

View File

@ -351,7 +351,7 @@ begin
TabStop := False; TabStop := False;
BorderStyle := bsNone; BorderStyle := bsNone;
{$IFDEF VERSION4} {$IFDEF VERSION4}
DoubleBuffered := False; // DoubleBuffered := False;
{$ENDIF} {$ENDIF}
{ make it tiny } { make it tiny }
Height := 1; Height := 1;
@ -446,7 +446,7 @@ begin
{ Set styles and initialize internal variables } { Set styles and initialize internal variables }
{$IFDEF VERSION4} {$IFDEF VERSION4}
DoubleBuffered := true; // DoubleBuffered := true;
{$ENDIF} {$ENDIF}
FVisibleContacts := 0; FVisibleContacts := 0;
FAllowInPlaceEdit := true; FAllowInPlaceEdit := true;

View File

@ -540,7 +540,7 @@ begin
inherited Create(AOwner); inherited Create(AOwner);
TabStop := False; TabStop := False;
BorderStyle := bsNone; BorderStyle := bsNone;
DoubleBuffered := False; // DoubleBuffered := False;
end; end;
{=====} {=====}
@ -804,7 +804,7 @@ begin
{ Set styles and initialize internal variables } { Set styles and initialize internal variables }
{$IFDEF VERSION4} {$IFDEF VERSION4}
DoubleBuffered := true; // DoubleBuffered := true;
{$ENDIF} {$ENDIF}
NumDays := 1; NumDays := 1;
dvInLinkHandler := false; dvInLinkHandler := false;

View File

@ -1599,7 +1599,10 @@ begin
ppi := FDayView.Font.PixelsPerInch; ppi := FDayView.Font.PixelsPerInch;
f := FDayView.GetCanvasScaleFactor; f := FDayView.GetCanvasScaleFactor;
w96 := FDayView.DataStore.ImagesWidth; w96 := FDayView.DataStore.ImagesWidth;
w := imgList.SizeForPPI[w96, ppi].CX; if imgList <> nil then
w := imgList.SizeForPPI[w96, ppi].CX
else
w := w96;
{$IFEND} {$IFEND}
{$ENDIF} {$ENDIF}

View File

@ -457,7 +457,7 @@ begin
{ Set styles and initialize internal variables } { Set styles and initialize internal variables }
{$IFDEF VERSION4} {$IFDEF VERSION4}
DoubleBuffered := true; // DoubleBuffered := true;
{$ENDIF} {$ENDIF}
FShowEvents := true; FShowEvents := true;
FEventDayStyle := []; FEventDayStyle := [];

View File

@ -426,7 +426,7 @@ begin
TabStop := False; TabStop := False;
BorderStyle := bsNone; BorderStyle := bsNone;
{$IFDEF VERSION4} {$IFDEF VERSION4}
DoubleBuffered := False; // DoubleBuffered := False;
{$ENDIF} {$ENDIF}
end; end;
{=====} {=====}
@ -501,7 +501,7 @@ begin
{ Set styles and initialize internal variables } { Set styles and initialize internal variables }
{$IFDEF VERSION4} {$IFDEF VERSION4}
DoubleBuffered := true; // DoubleBuffered := true;
{$ENDIF} {$ENDIF}
tlItemsBefore := 0; tlItemsBefore := 0;
tlItemsAfter := 0; tlItemsAfter := 0;

View File

@ -333,7 +333,7 @@ begin
TabStop := False; TabStop := False;
BorderStyle := bsNone; BorderStyle := bsNone;
{$IFDEF VERSION4} {$IFDEF VERSION4}
DoubleBuffered := False; // DoubleBuffered := False;
{$ENDIF} {$ENDIF}
end; end;
{=====} {=====}
@ -472,7 +472,7 @@ begin
{ Set styles and initialize internal variables } { Set styles and initialize internal variables }
{$IFDEF VERSION4} {$IFDEF VERSION4}
DoubleBuffered := true; // DoubleBuffered := true;
{$ENDIF} {$ENDIF}
FWeekStartsOn := dtMonday; FWeekStartsOn := dtMonday;