invisible selected persistents are no longer drawn with grabbers

git-svn-id: trunk@5730 -
This commit is contained in:
mattias 2004-08-04 08:50:23 +00:00
parent 5d5266b9f3
commit 7bf089b375
4 changed files with 19 additions and 14 deletions

View File

@ -113,6 +113,7 @@ type
FIsTComponent: boolean; FIsTComponent: boolean;
FIsTControl: boolean; FIsTControl: boolean;
FIsTWinControl: boolean; FIsTWinControl: boolean;
FIsVisible: boolean;
FMarkerPaintedBounds: TRect; FMarkerPaintedBounds: TRect;
FOldFormRelativeLeftTop: TPoint; FOldFormRelativeLeftTop: TPoint;
FOldHeight: integer; FOldHeight: integer;
@ -159,6 +160,7 @@ type
read FOldFormRelativeLeftTop write FOldFormRelativeLeftTop; read FOldFormRelativeLeftTop write FOldFormRelativeLeftTop;
property Flags: TSelectedControlFlags read FFlags write FFlags; property Flags: TSelectedControlFlags read FFlags write FFlags;
property UseCache: boolean read FUseCache write SetUseCache; property UseCache: boolean read FUseCache write SetUseCache;
property IsVisible: boolean read FIsVisible;
property IsTComponent: boolean read FIsTComponent; property IsTComponent: boolean read FIsTComponent;
property IsTControl: boolean read FIsTControl; property IsTControl: boolean read FIsTControl;
property IsTWinControl: boolean read FIsTWinControl; property IsTWinControl: boolean read FIsTWinControl;
@ -548,6 +550,8 @@ begin
FIsNonVisualComponent:=FIsTComponent and (not FIsTControl); FIsNonVisualComponent:=FIsTComponent and (not FIsTControl);
if FIsTComponent then if FIsTComponent then
FDesignerForm:=GetDesignerForm(TComponent(FPersistent)); FDesignerForm:=GetDesignerForm(TComponent(FPersistent));
FIsVisible:=FIsTComponent
and (not ComponentIsInvisible(TComponent(APersistent)));
end; end;
destructor TSelectedControl.Destroy; destructor TSelectedControl.Destroy;
@ -2056,7 +2060,8 @@ var
end; end;
begin begin
if (Count=0) or (FForm=nil) or LookupRootSelected then exit; if (Count=0) or (FForm=nil) or LookupRootSelected
or OnlyInvisiblePersistensSelected then exit;
Diff:=DC.FormOrigin; Diff:=DC.FormOrigin;
@ -2117,7 +2122,7 @@ begin
if not Items[i].IsTComponent then continue; if not Items[i].IsTComponent then continue;
AComponent:=TComponent(Items[i].Persistent); AComponent:=TComponent(Items[i].Persistent);
if (AComponent=FLookupRoot) if (AComponent=FLookupRoot)
or ComponentIsInvisible(AComponent) then continue; or (not Items[i].IsVisible) then continue;
DoDrawMarker(i,DC); DoDrawMarker(i,DC);
end; end;
end; end;
@ -2171,7 +2176,6 @@ begin
or (AComponent=FLookupRoot) then exit; or (AComponent=FLookupRoot) then exit;
i:=IndexOf(AComponent); i:=IndexOf(AComponent);
if i<0 then exit; if i<0 then exit;
if ComponentIsInvisible(AComponent) then exit;
DoDrawMarker(i,DC); DoDrawMarker(i,DC);
end; end;
@ -2404,8 +2408,7 @@ begin
if cssOnlyInvisibleNeedsUpdate in FStates then begin if cssOnlyInvisibleNeedsUpdate in FStates then begin
Result:=true; Result:=true;
for i:=0 to FControls.Count-1 do begin for i:=0 to FControls.Count-1 do begin
if (not Items[i].IsTComponent) if Items[i].IsVisible then begin
or (not ComponentIsInvisible(TComponent(Items[i].Persistent))) then begin
Result:=false; Result:=false;
break; break;
end; end;

View File

@ -284,7 +284,7 @@ begin
Invisible:=(csNoDesignVisible in AControl.ControlStyle) Invisible:=(csNoDesignVisible in AControl.ControlStyle)
end else begin end else begin
RegComp:=FindComponent(AComponent.ClassName); RegComp:=FindComponent(AComponent.ClassName);
Invisible:=(RegComp<>nil) and (RegComp.PageName=''); Invisible:=(RegComp=nil) or (RegComp.PageName='');
end; end;
end; end;

View File

@ -185,12 +185,13 @@ type
destructor Destroy; override; destructor Destroy; override;
function DoHint(var HintStr: string): Boolean; dynamic; function DoHint(var HintStr: string): Boolean; dynamic;
function Execute: Boolean; override; function Execute: Boolean; override;
public
property AutoCheck: Boolean property AutoCheck: Boolean
read FAutoCheck write SetAutoCheck default False; read FAutoCheck write SetAutoCheck default False;
property Caption: string read FCaption write SetCaption; property Caption: string read FCaption write SetCaption;
property Checked: Boolean read FChecked write SetChecked default False; property Checked: Boolean read FChecked write SetChecked default False;
property DisableIfNoHandler: Boolean property DisableIfNoHandler: Boolean read FDisableIfNoHandler
read FDisableIfNoHandler write FDisableIfNoHandler default False; write FDisableIfNoHandler default False;
property Enabled: Boolean read FEnabled write SetEnabled default True; property Enabled: Boolean read FEnabled write SetEnabled default True;
property GroupIndex: Integer read FGroupIndex write SetGroupIndex default 0; property GroupIndex: Integer read FGroupIndex write SetGroupIndex default 0;
property HelpContext: THelpContext property HelpContext: THelpContext

View File

@ -22,6 +22,7 @@ begin
FImageIndex := -1; FImageIndex := -1;
FVisible := True; FVisible := True;
FSecondaryShortCuts := nil; FSecondaryShortCuts := nil;
FHelpType := htContext;
end; end;
destructor TCustomAction.Destroy; destructor TCustomAction.Destroy;