mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-18 21:59:14 +02:00
fixed progressbar SET_PROPERTIES from Micha
git-svn-id: trunk@4323 -
This commit is contained in:
parent
d62057d9dc
commit
5a1d4d5b15
@ -2460,38 +2460,24 @@ begin
|
|||||||
csProgressBar:
|
csProgressBar:
|
||||||
With (TProgressBar(Sender)) Do
|
With (TProgressBar(Sender)) Do
|
||||||
Begin
|
Begin
|
||||||
|
{ smooth and vertical need window recreation }
|
||||||
|
if ((GetWindowLong(Handle, GWL_STYLE) and PBS_SMOOTH ) <>
|
||||||
|
Integer(Smooth) * PBS_SMOOTH) or
|
||||||
|
((GetWindowLong(Handle, GWL_STYLE) and PBS_VERTICAL) <>
|
||||||
|
Integer((Orientation = pbVertical) or (Orientation = pbTopDown)) * PBS_VERTICAL) then
|
||||||
|
Self.RecreateWnd(Sender);
|
||||||
|
|
||||||
SendMessage(Handle, PBM_SETRANGE, 0, MakeLParam(Min, Max));
|
SendMessage(Handle, PBM_SETRANGE, 0, MakeLParam(Min, Max));
|
||||||
SendMessage(Handle, PBM_SETPOS, Position, 0);
|
SendMessage(Handle, PBM_SETPOS, Position, 0);
|
||||||
If Smooth Then
|
|
||||||
SetWindowLong(Handle, GWL_STYLE, GetWindowLong(Handle, GWL_STYLE) Or PBS_SMOOTH)
|
{ TODO: Implementable?
|
||||||
Else
|
|
||||||
SetWindowLong(Handle, GWL_STYLE, GetWindowLong(Handle, GWL_STYLE) And Not PBS_SMOOTH);
|
|
||||||
Case Orientation Of
|
|
||||||
pbVertical:
|
|
||||||
SetWindowLong(Handle, GWL_STYLE, GetWindowLong(Handle, GWL_STYLE) Or PBS_VERTICAL);
|
|
||||||
pbRightToLeft:
|
|
||||||
Begin
|
|
||||||
Assert(False, 'TRACE:TRYING to create a right-to-left progress bar');
|
|
||||||
SetWindowLong(Handle, GWL_EXSTYLE, GetWindowLong(Handle, GWL_EXSTYLE) And Not WS_EX_LTRREADING);
|
|
||||||
End;
|
|
||||||
pbTopDown:
|
|
||||||
Begin
|
|
||||||
Assert(False, 'TRACE: TRYING to create a vertical, top-to-bottom progress bar');
|
|
||||||
SetWindowLong(Handle, GWL_STYLE, GetWindowLong(Handle, GWL_STYLE) Or PBS_VERTICAL);
|
|
||||||
SetWindowLong(Handle, GWL_EXSTYLE, GetWindowLong(Handle, GWL_EXSTYLE) And Not WS_EX_LTRLEADING);
|
|
||||||
End;
|
|
||||||
Else { pbHorizontal is default }
|
|
||||||
Begin
|
|
||||||
SetWindowLong(Handle, GWL_STYLE, GetWindowLong(Handle, GWL_STYLE) And Not PBS_VERTICAL);
|
|
||||||
SetWindowLong(Handle, GWL_EXSTYLE, GetWindowLong(Handle, GWL_EXSTYLE) Or WS_EX_LTRLEADING);
|
|
||||||
End;
|
|
||||||
End;
|
|
||||||
If BarShowText Then
|
If BarShowText Then
|
||||||
Begin
|
Begin
|
||||||
SetWindowText(Handle, StrToPChar((Sender As TControl).Caption));
|
SetWindowText(Handle, StrToPChar((Sender As TControl).Caption));
|
||||||
End
|
End
|
||||||
Else
|
Else
|
||||||
SetWindowText(Handle, Nil);
|
SetWindowText(Handle, Nil);
|
||||||
|
}
|
||||||
End;
|
End;
|
||||||
csScrollBar:
|
csScrollBar:
|
||||||
With (TScrollBar(Sender)) Do
|
With (TScrollBar(Sender)) Do
|
||||||
@ -2674,6 +2660,9 @@ End;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.58 2003/06/26 14:24:50 mattias
|
||||||
|
fixed progressbar SET_PROPERTIES from Micha
|
||||||
|
|
||||||
Revision 1.57 2003/06/25 20:49:58 mattias
|
Revision 1.57 2003/06/25 20:49:58 mattias
|
||||||
fixed menu destroy from Micha
|
fixed menu destroy from Micha
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user