fixed loading TSpeedButton.Down from Yoyong

git-svn-id: trunk@6775 -
This commit is contained in:
mattias 2005-02-09 11:25:19 +00:00
parent 17db4911f7
commit f91a0b7b97
3 changed files with 39 additions and 17 deletions

View File

@ -1215,6 +1215,8 @@ Var
Begin
Result:=nil;
Temp:=nil;
ParentComponent:=nil;
AParent:=nil;
try
DebugLn('[TCustomFormEditor.CreateComponent] Class='''+TypeClass.ClassName+'''');
{$IFDEF IDE_MEM_CHECK}CheckHeapWrtMemCnt('TCustomFormEditor.CreateComponent A');{$ENDIF}
@ -1257,12 +1259,10 @@ Begin
end else begin
AParent := TControl(ParentComponent).Parent;
end;
DebugLn('Parent is '''+AParent.Name+'''');
DebugLn('Parent is '''+dbgsName(AParent)+'''');
end else begin
// create a toplevel component
// -> a form or a datamodule or a custom component
ParentComponent:=nil;
AParent:=nil;
JITList:=GetJITListOfType(TypeClass);
if JITList=nil then
RaiseException('TCustomFormEditor.CreateComponent '+TypeClass.ClassName);
@ -1281,8 +1281,7 @@ Begin
on e: Exception do begin
MessageDlg('Error naming component',
'Error setting the name of a component '
+Temp.Component.Name+':'+Temp.Component.ClassName
+' to '+NewComponentName,
+dbgsName(Temp.Component)+' to '+NewComponentName,
mtError,[mbCancel],0);
exit;
end;

View File

@ -253,6 +253,7 @@ type
private
FAllowAllUp: Boolean;
FDown: Boolean;
FDownBuffered : Boolean;//buffered value of FDown
FDragging: Boolean;
FFlat: Boolean;
FGlyph: TButtonGlyph;
@ -296,6 +297,7 @@ type
property MouseInControl: Boolean read FMouseInControl;
procedure ActionChange(Sender: TObject; CheckDefaults: Boolean); override;
function GetActionLinkClass: TControlActionLinkClass; override;
procedure Loaded; override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
@ -387,6 +389,9 @@ end.
{ =============================================================================
$Log$
Revision 1.88 2005/02/09 11:25:19 mattias
fixed loading TSpeedButton.Down from Yoyong
Revision 1.87 2005/02/08 21:46:22 vincents
fixed fpc 1.0.x compilation

View File

@ -102,19 +102,28 @@ var
OldState: TButtonState;
OldDown: Boolean;
begin
if FGroupIndex = 0 then Value:= false;
if FDown <> Value then begin
if FDown and not FAllowAllUp then Exit;
OldDown:=FDown;
FDown := Value;
OldState := fState;
if FDown then begin
fState := bsExclusive;
end else begin
FState := bsUp;
//since Down needs GroupIndex, then we need to wait that all properties
//loaded before we continue
if (csLoading in ComponentState) then begin
FDownBuffered := Value;
exit;
end else begin
if FGroupIndex = 0 then Value:= false;
if FDown <> Value then begin
if FDown and not FAllowAllUp then Exit;
OldDown:=FDown;
FDown := Value;
OldState := fState;
if FDown then begin
fState := bsExclusive;
end else begin
FState := bsUp;
end;
if (OldDown<>FDown) or (OldState<>FState) then Invalidate;
if Value then begin
UpdateExclusive;
end;
end;
if (OldDown<>FDown) or (OldState<>FState) then Invalidate;
if Value then UpdateExclusive;
end;
end;
@ -668,6 +677,12 @@ begin
end;
end;
procedure TCustomSpeedButton.Loaded;
begin
inherited Loaded;
if FDownBuffered then SetDown(FDownBuffered);
end;
{------------------------------------------------------------------------------
Method: TCustomSpeedButton.CMEnabledChanged
@ -769,6 +784,9 @@ end;
{ =============================================================================
$Log$
Revision 1.64 2005/02/09 11:25:19 mattias
fixed loading TSpeedButton.Down from Yoyong
Revision 1.63 2005/02/05 16:09:52 marc
* first 64bit changes