mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-08 08:57:30 +01:00
formatting
git-svn-id: trunk@15448 -
This commit is contained in:
parent
565bfc0538
commit
75bb6cfe41
@ -131,31 +131,34 @@ end;
|
||||
|
||||
procedure TStatusBar.UpdateHandleObject(PanelIndex: integer);
|
||||
begin
|
||||
if (not HandleAllocated) or (csDestroying in ComponentState)
|
||||
or ((PanelIndex>0) and SimplePanel) then exit;
|
||||
if (not HandleAllocated) or (csDestroying in ComponentState) or
|
||||
((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));
|
||||
if FHandleObjectNeedsUpdate then begin
|
||||
if FHandleObjectNeedsUpdate then
|
||||
begin
|
||||
// combine multiple updates
|
||||
if (FHandleUpdatePanelIndex>=0)
|
||||
and (FHandleUpdatePanelIndex<>PanelIndex) then begin
|
||||
// at least 2 different panels need update => update all
|
||||
FHandleUpdatePanelIndex:=-1; // update all
|
||||
end;
|
||||
end else begin
|
||||
if (FHandleUpdatePanelIndex>=0) and (FHandleUpdatePanelIndex <> PanelIndex) then
|
||||
FHandleUpdatePanelIndex:=-1; // at least 2 different panels need update => update all
|
||||
end else
|
||||
begin
|
||||
// start an update sequence
|
||||
FHandleObjectNeedsUpdate:=true;
|
||||
FHandleUpdatePanelIndex:=PanelIndex;
|
||||
FHandleObjectNeedsUpdate := True;
|
||||
FHandleUpdatePanelIndex := PanelIndex;
|
||||
end;
|
||||
exit;
|
||||
Exit;
|
||||
end;
|
||||
|
||||
//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
|
||||
TWSStatusBarClass(WidgetSetClass).PanelUpdate(Self,PanelIndex);
|
||||
end else begin
|
||||
TWSStatusBarClass(WidgetSetClass).PanelUpdate(Self, PanelIndex);
|
||||
end else
|
||||
begin
|
||||
// update all panels
|
||||
//DebugLn('TStatusBar.UpdateHandleObject C update all panels');
|
||||
TWSStatusBarClass(WidgetSetClass).Update(Self);
|
||||
|
||||
@ -22,6 +22,7 @@
|
||||
|
||||
type
|
||||
TWinControlAccess = class(TWinControl);
|
||||
TCustomListViewAccess = class(TCustomListView);
|
||||
{*************************************************************}
|
||||
{ callback routines }
|
||||
{*************************************************************}
|
||||
@ -126,7 +127,13 @@ begin
|
||||
end;
|
||||
|
||||
type
|
||||
TEraseBkgndCommand = (ecDefault, ecDiscard, ecDiscardNoRemove, ecDoubleBufferNoRemove);
|
||||
TEraseBkgndCommand =
|
||||
(
|
||||
ecDefault, // todo: add comments
|
||||
ecDiscard, //
|
||||
ecDiscardNoRemove, //
|
||||
ecDoubleBufferNoRemove //
|
||||
);
|
||||
const
|
||||
EraseBkgndStackMask = $3;
|
||||
EraseBkgndStackShift = 2;
|
||||
@ -184,12 +191,6 @@ begin
|
||||
and ((AWinControl = nil) or not (csOpaque in AWinControl.ControlStyle));
|
||||
end;
|
||||
|
||||
type
|
||||
TCustomListViewAccess = class(TCustomListView)
|
||||
end;
|
||||
|
||||
|
||||
|
||||
{------------------------------------------------------------------------------
|
||||
Function: WindowProc
|
||||
Params: Window - The window that receives a message
|
||||
|
||||
@ -279,6 +279,13 @@ end;
|
||||
Everything is updated except the panel width
|
||||
------------------------------------------------------------------------------}
|
||||
procedure UpdateStatusBarPanel(const StatusPanel: TStatusPanel);
|
||||
const
|
||||
StatusBevelMap: array[TStatusPanelBevel] of Integer =
|
||||
(
|
||||
{ pbNone } Windows.SBT_NOBORDERS,
|
||||
{ pbLowered } 0,
|
||||
{ pbRaised } Windows.SBT_POPOUT
|
||||
);
|
||||
var
|
||||
BevelType: integer;
|
||||
Text: string;
|
||||
@ -288,11 +295,7 @@ begin
|
||||
taCenter: Text := #9 + Text;
|
||||
taRightJustify: Text := #9#9 + Text;
|
||||
end;
|
||||
case StatusPanel.Bevel of
|
||||
pbNone: BevelType := Windows.SBT_NOBORDERS;
|
||||
pbLowered: BevelType := 0;
|
||||
pbRaised: BevelType := Windows.SBT_POPOUT;
|
||||
end;
|
||||
BevelType := StatusBevelMap[StatusPanel.Bevel];
|
||||
|
||||
{$ifdef WindowsUnicodeSupport}
|
||||
if UnicodeEnabledOS then
|
||||
@ -453,9 +456,10 @@ begin
|
||||
Windows.SendMessage(AStatusBar.Handle, SB_SIMPLE, WPARAM(AStatusBar.SimplePanel), 0);
|
||||
if AStatusBar.SimplePanel then
|
||||
SetPanelText(AStatusBar, 0)
|
||||
else begin
|
||||
else
|
||||
begin
|
||||
UpdateStatusBarPanelWidths(AStatusBar);
|
||||
for PanelIndex := 0 to AStatusBar.Panels.Count-1 do
|
||||
for PanelIndex := 0 to AStatusBar.Panels.Count - 1 do
|
||||
UpdateStatusBarPanel(AStatusBar.Panels[PanelIndex]);
|
||||
end;
|
||||
end;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user