fixed statusbar updating all panels

git-svn-id: trunk@5057 -
This commit is contained in:
mattias 2004-01-13 10:41:40 +00:00
parent fc8d6acbae
commit 44c4de4ced
4 changed files with 25 additions and 8 deletions

View File

@ -38,9 +38,8 @@ begin
FBevelInner := bvNone; FBevelInner := bvNone;
FBevelWidth := 1; FBevelWidth := 1;
FAlignment := taCenter; FAlignment := taCenter;
Color:=clBtnface; Color:=clBtnface;// clBackground;
SetInitialBounds(0,0,170,50); SetInitialBounds(0,0,170,50);
// Color := clBackground;
ParentColor := True; ParentColor := True;
end; end;

View File

@ -127,7 +127,7 @@ begin
end; end;
//writeln('TStatusBar.UpdateHandleObject A FHandlePanelCount=',FHandlePanelCount,' PanelIndex=',PanelIndex,' Panels.Count=',Panels.Count,' ',SimplePanel); //writeln('TStatusBar.UpdateHandleObject A FHandlePanelCount=',FHandlePanelCount,' PanelIndex=',PanelIndex,' Panels.Count=',Panels.Count,' ',SimplePanel);
if FHandlePanelCount>PanelIndex then begin if (FHandlePanelCount>PanelIndex) and (PanelIndex>=0) then begin
// update one panel // update one panel
StatusBarPanelUpdate(Self,PanelIndex); StatusBarPanelUpdate(Self,PanelIndex);
end else begin end else begin
@ -175,7 +175,7 @@ end;
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}
procedure TStatusBar.InvalidatePanel(PanelIndex: integer; procedure TStatusBar.InvalidatePanel(PanelIndex: integer;
PanelParts: TPanelParts); PanelParts: TPanelParts);
{$IFDEF OldtatusBar} {$IFDEF OldStatusBar}
var var
PanelRect, TextRect: TRect; PanelRect, TextRect: TRect;
{$ENDIF} {$ENDIF}

View File

@ -29,7 +29,7 @@ begin
else else
PaintMsg:=TLMPaint(TheMessage); PaintMsg:=TLMPaint(TheMessage);
Result := DeliverMessage(Target,PaintMsg) = 0; Result := DeliverMessage(Target,PaintMsg) = 0;
ReleaseDC(0,PaintMsg.DC); FinalizePaintMessage(@PaintMsg);
end; end;
{------------------------------------------------------------------------------- {-------------------------------------------------------------------------------
@ -77,7 +77,7 @@ begin
{$IFDEF DirectPaintMsg} {$IFDEF DirectPaintMsg}
PaintMsg:= GtkPaintMessageToPaintMessage(Msg,true); PaintMsg:= GtkPaintMessageToPaintMessage(Msg,true);
Result := DeliverMessage(Target,PaintMsg) = 0; Result := DeliverMessage(Target,PaintMsg) = 0;
ReleaseDC(0,PaintMsg.DC); FinalizePaintMessage(@PaintMsg);
{$ELSE} {$ELSE}
Result:=DeliverPostMessage(Target,Msg); Result:=DeliverPostMessage(Target,Msg);
{$ENDIF} {$ENDIF}
@ -429,7 +429,7 @@ begin
end else begin end else begin
{$IFDEF VerboseDesignerDraw} {$IFDEF VerboseDesignerDraw}
writeln('gtkDrawAfter', writeln('gtkDrawAfter',
' Widget=',HexStr(Cardinal(Widget),8), ' Widget=',HexStr(Cardinal(Widget),8),'=',GetWidgetClassName(Widget),
' ',TComponent(Data).Name, ' ',TComponent(Data).Name,
' ',area^.x,',',area^.y,',',area^.width,',',area^.height, ' ',area^.x,',',area^.y,',',area^.width,',',area^.height,
''); '');
@ -459,7 +459,7 @@ begin
end else begin end else begin
{$IFDEF VerboseDesignerDraw} {$IFDEF VerboseDesignerDraw}
writeln('gtkExposeAfter', writeln('gtkExposeAfter',
' Widget=',HexStr(Cardinal(Widget),8), ' Widget=',HexStr(Cardinal(Widget),8),'=',GetWidgetClassName(Widget),
' ',TComponent(Data).Name, ' ',TComponent(Data).Name,
' ',Event^.area.x,',',Event^.area.y,',',Event^.area.width,',',Event^.area.height, ' ',Event^.area.x,',',Event^.area.y,',',Event^.area.width,',',Event^.area.height,
''); '');
@ -3227,6 +3227,9 @@ end;
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.212 2004/01/13 10:41:40 mattias
fixed statusbar updating all panels
Revision 1.211 2004/01/09 20:03:13 mattias Revision 1.211 2004/01/09 20:03:13 mattias
implemented new statusbar methods in gtk intf implemented new statusbar methods in gtk intf

View File

@ -127,6 +127,7 @@ var
Widget: PGtkWidget; Widget: PGtkWidget;
TargetObject: TObject; TargetObject: TObject;
IsDoubleBuffered: Boolean; IsDoubleBuffered: Boolean;
PaintWidget: Pointer;
{$ENDIF} {$ENDIF}
begin begin
{$IFDEF Gtk1} {$IFDEF Gtk1}
@ -134,6 +135,17 @@ begin
TargetObject:=GetParentLCLObject(Widget); TargetObject:=GetParentLCLObject(Widget);
IsDoubleBuffered:=(TargetObject is TWinControl) IsDoubleBuffered:=(TargetObject is TWinControl)
and TWinControl(TargetObject).DoubleBuffered; and TWinControl(TargetObject).DoubleBuffered;
// check if Handle is the paint widget of the LCL component
if IsDoubleBuffered then begin
PaintWidget:=GetFixedWidget(PGtkWidget(TWinControl(TargetObject).Handle));
IsDoubleBuffered:=(PaintWidget=Widget);
//if not IsDoubleBuffered then begin
// writeln('TgtkObject.BeginPaint Not the paint widget: ',
// TWinControl(TargetObject).Name,':',TWinControl(TargetObject).ClassName,
// ' PaintWidget=',GetWidgetClassName(PaintWidget),
// ' Widget=',GetWidgetClassName(Widget));
//end;
end;
{$IFNDEF UseGTKDoubleBuf} {$IFNDEF UseGTKDoubleBuf}
IsDoubleBuffered:=false; IsDoubleBuffered:=false;
{$ENDIF} {$ENDIF}
@ -9202,6 +9214,9 @@ end;
{ ============================================================================= { =============================================================================
$Log$ $Log$
Revision 1.316 2004/01/13 10:41:40 mattias
fixed statusbar updating all panels
Revision 1.315 2004/01/12 23:56:10 mattias Revision 1.315 2004/01/12 23:56:10 mattias
improved double buffering, only one issue left: parent gdkwindow paint messages improved double buffering, only one issue left: parent gdkwindow paint messages