TStatuBar:

- publish more events and properties
- allow have any align/anchors
- win32: don't reposition StatusBar to bottom if it have another align (0010386)

git-svn-id: trunk@14588 -
This commit is contained in:
paul 2008-03-20 03:54:21 +00:00
parent 3cb1419cb4
commit df0c6930b5
4 changed files with 20 additions and 12 deletions

View File

@ -152,18 +152,26 @@ type
published
property Action;
property Align default alBottom;
property Anchors;
property AutoSize default true;
property Panels: TStatusPanels read FPanels write SetPanels;
property SimpleText: String read FSimpleText write SetSimpleText;
property SimplePanel: Boolean read FSimplePanel write SetSimplePanel default True;
property Visible default true;
property Color default clBtnFace;
property OnClick;
property OnContextPopup;
property OnDblClick;
property OnDragDrop;
property OnDragOver;
property OnEndDock;
property OnEndDrag;
property OnHint: TNotifyEvent read FOnHint write FOnHint;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnResize;
property OnStartDock;
property OnStartDrag;
end;

View File

@ -27,9 +27,8 @@ begin
FSimplePanel := True;
FPanels := CreatePanels;
Color := clBtnFace;
Anchors:=[akLeft,akRight,akBottom];
Align := alBottom;
AutoSize:=true;
AutoSize := True;
end;
@ -123,19 +122,20 @@ begin
//DebugLn('TStatusBar.UpdateHandleObject C update all panels');
TWSStatusBarClass(WidgetSetClass).Update(Self);
if SimplePanel then
FHandlePanelCount:=1
FHandlePanelCount := 1
else
FHandlePanelCount:=Panels.Count;
FHandlePanelCount := Panels.Count;
end;
FHandleObjectNeedsUpdate:=false;
FHandleObjectNeedsUpdate := False;
end;
procedure TStatusBar.CalculatePreferredSize(var PreferredWidth,
PreferredHeight: integer; WithThemeSpace: Boolean);
begin
inherited CalculatePreferredSize(PreferredWidth,PreferredHeight,WithThemeSpace);
PreferredWidth:=0;
if PreferredHeight<=0 then PreferredHeight:=25;
inherited CalculatePreferredSize(PreferredWidth, PreferredHeight, WithThemeSpace);
PreferredWidth := 0;
if PreferredHeight <= 0 then
PreferredHeight := 25;
end;
function TStatusBar.ColorIsStored: boolean;

View File

@ -2150,6 +2150,9 @@ begin
ThemeServices.UpdateThemes;
ThemeServices.IntfDoOnThemeChange;
end;
WM_SIZE:
if lWinControl is TStatusBar then
WinProcess := False;
{ >= WM_USER }

View File

@ -342,13 +342,10 @@ begin
begin
pClassName := STATUSCLASSNAME;
WindowTitle := StrCaption;
Left := LongInt(CW_USEDEFAULT);
Top := LongInt(CW_USEDEFAULT);
Width := LongInt(CW_USEDEFAULT);
Height := LongInt(CW_USEDEFAULT);
end;
// create window
FinishCreateWindow(AWinControl, Params, false);
Params.WindowInfo^.needParentPaint := false;
// need to set handle for Update method
AWinControl.Handle := Params.Window;
Update(TStatusBar(AWinControl));