mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-12-08 06:38:11 +01:00
send LM_CHANGE message for trackbar
git-svn-id: trunk@6493 -
This commit is contained in:
parent
0ce582b720
commit
6815fe14f7
@ -386,6 +386,28 @@ Var
|
|||||||
DisposeWindowInfo(Buddy);
|
DisposeWindowInfo(Buddy);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure HandleScrollMessage(LMsg: integer);
|
||||||
|
var
|
||||||
|
TargetWindow: HWND;
|
||||||
|
begin
|
||||||
|
TargetWindow := HWND(LParam);
|
||||||
|
if TargetWindow<>0 then
|
||||||
|
lWinControl := GetWindowInfo(TargetWindow)^.WinControl;
|
||||||
|
if lWinControl is TCustomTrackBar then begin
|
||||||
|
LMessage.Msg := LM_CHANGED;
|
||||||
|
end
|
||||||
|
else begin
|
||||||
|
PLMsg:=@LMScroll;
|
||||||
|
With LMScroll Do
|
||||||
|
Begin
|
||||||
|
Msg := LMsg;
|
||||||
|
ScrollCode := SmallInt(Lo(WParam));
|
||||||
|
Pos := SmallInt(Hi(WParam));
|
||||||
|
ScrollBar := TargetWindow;
|
||||||
|
End;
|
||||||
|
end;
|
||||||
|
end;
|
||||||
|
|
||||||
Begin
|
Begin
|
||||||
Assert(False, 'Trace:WindowProc - Start');
|
Assert(False, 'Trace:WindowProc - Start');
|
||||||
|
|
||||||
@ -666,21 +688,7 @@ Begin
|
|||||||
then DrawBitBtnImage(TCustomBitBtn(lWinControl), PChar(TCustomBitBtn(lWinControl).Caption));
|
then DrawBitBtnImage(TCustomBitBtn(lWinControl), PChar(TCustomBitBtn(lWinControl).Caption));
|
||||||
End;
|
End;
|
||||||
WM_HSCROLL:
|
WM_HSCROLL:
|
||||||
Begin
|
HandleScrollMessage(LM_HSCROLL);
|
||||||
PLMsg:=@LMScroll;
|
|
||||||
With LMScroll Do
|
|
||||||
Begin
|
|
||||||
Msg := LM_HSCROLL;
|
|
||||||
ScrollCode := SmallInt(Lo(WParam));
|
|
||||||
Pos := SmallInt(Hi(WParam));
|
|
||||||
ScrollBar := HWND(LParam);
|
|
||||||
if ScrollBar <> 0 then
|
|
||||||
begin
|
|
||||||
// send message to actual scrollbar window
|
|
||||||
lWinControl := GetWindowInfo(ScrollBar)^.WinControl;
|
|
||||||
end;
|
|
||||||
End;
|
|
||||||
End;
|
|
||||||
WM_ERASEBKGND:
|
WM_ERASEBKGND:
|
||||||
Begin
|
Begin
|
||||||
eraseBkgndCommand := TEraseBkgndCommand(EraseBkgndStack and EraseBkgndStackMask);
|
eraseBkgndCommand := TEraseBkgndCommand(EraseBkgndStack and EraseBkgndStackMask);
|
||||||
@ -1068,21 +1076,7 @@ Begin
|
|||||||
LMessage.LParam := LParam;
|
LMessage.LParam := LParam;
|
||||||
End;
|
End;
|
||||||
WM_VSCROLL:
|
WM_VSCROLL:
|
||||||
Begin
|
HandleScrollMessage(LM_VSCROLL);
|
||||||
PLMsg:=@LMScroll;
|
|
||||||
With LMScroll Do
|
|
||||||
Begin
|
|
||||||
Msg := LM_VSCROLL;
|
|
||||||
ScrollCode := SmallInt(Lo(WParam));
|
|
||||||
Pos := SmallInt(Hi(WParam));
|
|
||||||
ScrollBar := HWND(LParam);
|
|
||||||
if ScrollBar <> 0 then
|
|
||||||
begin
|
|
||||||
// send message to actual scrollbar window
|
|
||||||
lWinControl := GetWindowInfo(ScrollBar)^.WinControl;
|
|
||||||
end;
|
|
||||||
End;
|
|
||||||
End;
|
|
||||||
WM_WINDOWPOSCHANGED:
|
WM_WINDOWPOSCHANGED:
|
||||||
Begin
|
Begin
|
||||||
With TLMWindowPosMsg(LMessage) Do
|
With TLMWindowPosMsg(LMessage) Do
|
||||||
@ -1499,6 +1493,9 @@ end;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.181 2005/01/07 10:51:07 vincents
|
||||||
|
send LM_CHANGE message for trackbar
|
||||||
|
|
||||||
Revision 1.180 2005/01/03 15:50:35 micha
|
Revision 1.180 2005/01/03 15:50:35 micha
|
||||||
WM_SIZE can also mean windowstate change, always send message
|
WM_SIZE can also mean windowstate change, always send message
|
||||||
|
|
||||||
|
|||||||
@ -848,16 +848,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
function TWin32WSTrackBar.GetPosition(const ATrackBar: TCustomTrackBar): integer;
|
function TWin32WSTrackBar.GetPosition(const ATrackBar: TCustomTrackBar): integer;
|
||||||
var
|
|
||||||
Handle: HWND;
|
|
||||||
begin
|
begin
|
||||||
if ATrackBar.HandleAllocated then
|
Result := SendMessage(ATrackBar.Handle, TBM_GETPOS, 0, 0)
|
||||||
begin
|
|
||||||
Handle := ATrackBar.Handle;
|
|
||||||
Result := SendMessage(Handle, TBM_GETRANGEMAX, 0, 0) -
|
|
||||||
SendMessage(Handle, TBM_GETRANGEMIN, 0, 0);
|
|
||||||
end else
|
|
||||||
Result := 0;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure TWin32WSTrackBar.SetPosition(const ATrackBar: TCustomTrackBar; const NewPosition: integer);
|
procedure TWin32WSTrackBar.SetPosition(const ATrackBar: TCustomTrackBar; const NewPosition: integer);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user