From 6fcd18e2a6f2be20ce3a3577a6ffd4e8f0644ed7 Mon Sep 17 00:00:00 2001 From: lazarus Date: Mon, 2 Apr 2001 14:45:26 +0000 Subject: [PATCH] MG: bugfixes for TBevel git-svn-id: trunk@250 - --- lcl/include/bevel.inc | 13 ++++++++++--- lcl/include/control.inc | 26 ++++++++++++++++---------- lcl/include/graphiccontrol.inc | 26 ++++++++++++++++++++++---- lcl/include/wincontrol.inc | 5 ++++- 4 files changed, 52 insertions(+), 18 deletions(-) diff --git a/lcl/include/bevel.inc b/lcl/include/bevel.inc index fe310ffe04..8c4f4107e7 100644 --- a/lcl/include/bevel.inc +++ b/lcl/include/bevel.inc @@ -1,8 +1,11 @@ Constructor TBevel.Create(AOwner:TComponent); Begin - Inherited Create(aOwner); + Inherited Create(AOwner); + ControlStyle:=ControlStyle-[csSetCaption]; FStyle:=bsLowered; FShape:=bsBox; + + SetBounds(0,0,50,50); End; Destructor TBevel.Destroy; @@ -43,7 +46,7 @@ Begin End; End; -(*Procedure TBevel.Paint; +Procedure TBevel.Paint; Var Colora, Colorb:TColor; Begin @@ -133,8 +136,8 @@ Begin End; End; - *) +{ Procedure TBevel.Paint; Var Colora, Colorb:TColor; @@ -221,9 +224,13 @@ Begin End; End; End; +} { $Log$ + Revision 1.3 2001/04/02 14:45:26 lazarus + MG: bugfixes for TBevel + Revision 1.2 2001/03/27 14:27:43 lazarus Changes from Nagy Zsolt Shane diff --git a/lcl/include/control.inc b/lcl/include/control.inc index 3649881ad4..70fafe896d 100644 --- a/lcl/include/control.inc +++ b/lcl/include/control.inc @@ -746,13 +746,15 @@ end; {------------------------------------------------------------------------------} procedure TControl.SetName(const Value: TComponentName); var - ChangeText: Boolean; - + ChangeText: Boolean; begin - ChangeText := (csSetCaption in ControlStyle) and (Name = text); + ChangeText := (csSetCaption in ControlStyle) and + not (csLoading in ComponentState) and (Name = Text) and + ((Owner = nil) or not (Owner is TControl) or + not (csLoading in TControl(Owner).ComponentState)); - inherited SetName(Value); - if ChangeText then text := Value; + inherited SetName(Value); + if ChangeText then Text := Value; end; {------------------------------------------------------------------------------} @@ -1077,11 +1079,12 @@ end; {------------------------------------------------------------------------------} procedure TControl.SetVisible(Value : Boolean); begin - if FVisible <> Value then - begin - FVisible := Value; - Perform(CM_VISIBLECHANGED, Ord(Value), 0); - end; +if classname='TBEVEL' then writeln('[TControl.SetVisible] ',Value,' ',FVisible); + if FVisible <> Value then + begin + FVisible := Value; + Perform(CM_VISIBLECHANGED, Ord(Value), 0); + end; end; {------------------------------------------------------------------------------} @@ -1308,6 +1311,9 @@ end; { ============================================================================= $Log$ + Revision 1.19 2001/04/02 14:45:26 lazarus + MG: bugfixes for TBevel + Revision 1.18 2001/03/27 21:12:53 lazarus MWE: + Turned on longstrings diff --git a/lcl/include/graphiccontrol.inc b/lcl/include/graphiccontrol.inc index e1c0aa4ab0..96becab7a8 100644 --- a/lcl/include/graphiccontrol.inc +++ b/lcl/include/graphiccontrol.inc @@ -40,11 +40,26 @@ end; ------------------------------------------------------------------------------} procedure TGraphicControl.WMPaint(var Message: TLMPaint); begin -// Canvas.Lock; - try + // tspeedbutton is buggy: this is a workaround + if lowercase(Classname)='tspeedbutton' then begin Paint; - finally -// Canvas.Unlock; + exit; + end; + // end of workaround + + if Message.DC <> 0 then + begin +// Canvas.Lock; + try + Canvas.Handle := Message.DC; + try + Paint; + finally + Canvas.Handle := 0; + end; + finally +// Canvas.Unlock; + end; end; end; @@ -63,6 +78,9 @@ end; { ============================================================================= $Log$ + Revision 1.2 2001/04/02 14:45:26 lazarus + MG: bugfixes for TBevel + Revision 1.1 2000/07/13 10:28:25 michael + Initial import diff --git a/lcl/include/wincontrol.inc b/lcl/include/wincontrol.inc index 45eea6a24a..47e052df3b 100644 --- a/lcl/include/wincontrol.inc +++ b/lcl/include/wincontrol.inc @@ -1589,7 +1589,7 @@ end; ------------------------------------------------------------------------------} procedure TWinControl.WMWindowPosChanged(var Message : TLMWindowPosChanged); begin -Writeln('[TWINCONTROL].WMWINDOWPOSCHANGED'); +//Writeln('[TWINCONTROL].WMWINDOWPOSCHANGED'); if Message.WindowPos <> nil then with Message.WindowPos^ do begin @@ -1965,6 +1965,9 @@ end; { ============================================================================= $Log$ + Revision 1.28 2001/04/02 14:45:26 lazarus + MG: bugfixes for TBevel + Revision 1.27 2001/03/27 14:27:43 lazarus Changes from Nagy Zsolt Shane