formatting

git-svn-id: trunk@15448 -
This commit is contained in:
paul 2008-06-17 07:32:09 +00:00
parent 565bfc0538
commit 75bb6cfe41
3 changed files with 38 additions and 30 deletions

View File

@ -131,31 +131,34 @@ end;
procedure TStatusBar.UpdateHandleObject(PanelIndex: integer); procedure TStatusBar.UpdateHandleObject(PanelIndex: integer);
begin begin
if (not HandleAllocated) or (csDestroying in ComponentState) if (not HandleAllocated) or (csDestroying in ComponentState) or
or ((PanelIndex>0) and SimplePanel) then exit; ((PanelIndex>0) and SimplePanel) then
Exit;
if (csLoading in ComponentState) or (FUpdateLock>0) then begin if (csLoading in ComponentState) or (FUpdateLock > 0) then
begin
//DebugLn('TStatusBar.UpdateHandleObject Caching FHandleObjectNeedsUpdate=',dbgs(FHandleObjectNeedsUpdate),' FHandleUpdatePanelIndex=',dbgs(FHandleUpdatePanelIndex),' PanelIndex=',dbgs(PanelIndex)); //DebugLn('TStatusBar.UpdateHandleObject Caching FHandleObjectNeedsUpdate=',dbgs(FHandleObjectNeedsUpdate),' FHandleUpdatePanelIndex=',dbgs(FHandleUpdatePanelIndex),' PanelIndex=',dbgs(PanelIndex));
if FHandleObjectNeedsUpdate then begin if FHandleObjectNeedsUpdate then
begin
// combine multiple updates // combine multiple updates
if (FHandleUpdatePanelIndex>=0) if (FHandleUpdatePanelIndex>=0) and (FHandleUpdatePanelIndex <> PanelIndex) then
and (FHandleUpdatePanelIndex<>PanelIndex) then begin FHandleUpdatePanelIndex:=-1; // at least 2 different panels need update => update all
// at least 2 different panels need update => update all end else
FHandleUpdatePanelIndex:=-1; // update all begin
end;
end else begin
// start an update sequence // start an update sequence
FHandleObjectNeedsUpdate:=true; FHandleObjectNeedsUpdate := True;
FHandleUpdatePanelIndex:=PanelIndex; FHandleUpdatePanelIndex := PanelIndex;
end; end;
exit; Exit;
end; end;
//DebugLn('TStatusBar.UpdateHandleObject A FHandlePanelCount=',dbgs(FHandlePanelCount),' PanelIndex=',dbgs(PanelIndex),' Panels.Count=',dbgs(Panels.Count),' SimplePanel=',dbgs(SimplePanel)); //DebugLn('TStatusBar.UpdateHandleObject A FHandlePanelCount=',dbgs(FHandlePanelCount),' PanelIndex=',dbgs(PanelIndex),' Panels.Count=',dbgs(Panels.Count),' SimplePanel=',dbgs(SimplePanel));
if (FHandlePanelCount>PanelIndex) and (PanelIndex>=0) then begin if (FHandlePanelCount > PanelIndex) and (PanelIndex >= 0) then
begin
// update one panel // update one panel
TWSStatusBarClass(WidgetSetClass).PanelUpdate(Self,PanelIndex); TWSStatusBarClass(WidgetSetClass).PanelUpdate(Self, PanelIndex);
end else begin end else
begin
// update all panels // update all panels
//DebugLn('TStatusBar.UpdateHandleObject C update all panels'); //DebugLn('TStatusBar.UpdateHandleObject C update all panels');
TWSStatusBarClass(WidgetSetClass).Update(Self); TWSStatusBarClass(WidgetSetClass).Update(Self);

View File

@ -22,6 +22,7 @@
type type
TWinControlAccess = class(TWinControl); TWinControlAccess = class(TWinControl);
TCustomListViewAccess = class(TCustomListView);
{*************************************************************} {*************************************************************}
{ callback routines } { callback routines }
{*************************************************************} {*************************************************************}
@ -126,7 +127,13 @@ begin
end; end;
type type
TEraseBkgndCommand = (ecDefault, ecDiscard, ecDiscardNoRemove, ecDoubleBufferNoRemove); TEraseBkgndCommand =
(
ecDefault, // todo: add comments
ecDiscard, //
ecDiscardNoRemove, //
ecDoubleBufferNoRemove //
);
const const
EraseBkgndStackMask = $3; EraseBkgndStackMask = $3;
EraseBkgndStackShift = 2; EraseBkgndStackShift = 2;
@ -184,12 +191,6 @@ begin
and ((AWinControl = nil) or not (csOpaque in AWinControl.ControlStyle)); and ((AWinControl = nil) or not (csOpaque in AWinControl.ControlStyle));
end; end;
type
TCustomListViewAccess = class(TCustomListView)
end;
{------------------------------------------------------------------------------ {------------------------------------------------------------------------------
Function: WindowProc Function: WindowProc
Params: Window - The window that receives a message Params: Window - The window that receives a message

View File

@ -279,6 +279,13 @@ end;
Everything is updated except the panel width Everything is updated except the panel width
------------------------------------------------------------------------------} ------------------------------------------------------------------------------}
procedure UpdateStatusBarPanel(const StatusPanel: TStatusPanel); procedure UpdateStatusBarPanel(const StatusPanel: TStatusPanel);
const
StatusBevelMap: array[TStatusPanelBevel] of Integer =
(
{ pbNone } Windows.SBT_NOBORDERS,
{ pbLowered } 0,
{ pbRaised } Windows.SBT_POPOUT
);
var var
BevelType: integer; BevelType: integer;
Text: string; Text: string;
@ -288,11 +295,7 @@ begin
taCenter: Text := #9 + Text; taCenter: Text := #9 + Text;
taRightJustify: Text := #9#9 + Text; taRightJustify: Text := #9#9 + Text;
end; end;
case StatusPanel.Bevel of BevelType := StatusBevelMap[StatusPanel.Bevel];
pbNone: BevelType := Windows.SBT_NOBORDERS;
pbLowered: BevelType := 0;
pbRaised: BevelType := Windows.SBT_POPOUT;
end;
{$ifdef WindowsUnicodeSupport} {$ifdef WindowsUnicodeSupport}
if UnicodeEnabledOS then if UnicodeEnabledOS then
@ -453,9 +456,10 @@ begin
Windows.SendMessage(AStatusBar.Handle, SB_SIMPLE, WPARAM(AStatusBar.SimplePanel), 0); Windows.SendMessage(AStatusBar.Handle, SB_SIMPLE, WPARAM(AStatusBar.SimplePanel), 0);
if AStatusBar.SimplePanel then if AStatusBar.SimplePanel then
SetPanelText(AStatusBar, 0) SetPanelText(AStatusBar, 0)
else begin else
begin
UpdateStatusBarPanelWidths(AStatusBar); UpdateStatusBarPanelWidths(AStatusBar);
for PanelIndex := 0 to AStatusBar.Panels.Count-1 do for PanelIndex := 0 to AStatusBar.Panels.Count - 1 do
UpdateStatusBarPanel(AStatusBar.Panels[PanelIndex]); UpdateStatusBarPanel(AStatusBar.Panels[PanelIndex]);
end; end;
end; end;