mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-12 20:39:23 +02:00
fix formatting a bit (decapitalize Begin and End keywords)
git-svn-id: trunk@12249 -
This commit is contained in:
parent
8dca013550
commit
2ea337b331
@ -46,7 +46,7 @@ const
|
|||||||
Enumerates and removes properties for the target window
|
Enumerates and removes properties for the target window
|
||||||
-----------------------------------------------------------------------------}
|
-----------------------------------------------------------------------------}
|
||||||
Function PropEnumProc(Window: Hwnd; Str: PChar; Data: Handle): LongBool; StdCall;
|
Function PropEnumProc(Window: Hwnd; Str: PChar; Data: Handle): LongBool; StdCall;
|
||||||
Begin
|
begin
|
||||||
Result:=false;
|
Result:=false;
|
||||||
if PtrUInt(Str) <= $FFFF then exit; // global atom handle
|
if PtrUInt(Str) <= $FFFF then exit; // global atom handle
|
||||||
Assert(False, 'Trace:PropEnumProc - Start');
|
Assert(False, 'Trace:PropEnumProc - Start');
|
||||||
@ -55,7 +55,7 @@ Begin
|
|||||||
RemoveProp(Window, Str);
|
RemoveProp(Window, Str);
|
||||||
Result := True;
|
Result := True;
|
||||||
Assert(False, 'Trace:PropEnumProc - Exit');
|
Assert(False, 'Trace:PropEnumProc - Exit');
|
||||||
End;
|
end;
|
||||||
|
|
||||||
{------------------------------------------------------------------------------
|
{------------------------------------------------------------------------------
|
||||||
Function: CallDefaultWindowProc
|
Function: CallDefaultWindowProc
|
||||||
@ -1115,20 +1115,20 @@ begin
|
|||||||
|
|
||||||
Case Msg Of
|
Case Msg Of
|
||||||
WM_ACTIVATE:
|
WM_ACTIVATE:
|
||||||
Begin
|
begin
|
||||||
Case LOWORD(WParam) Of
|
Case LOWORD(WParam) Of
|
||||||
WA_ACTIVE, WA_CLICKACTIVE:
|
WA_ACTIVE, WA_CLICKACTIVE:
|
||||||
Begin
|
begin
|
||||||
LMessage.Msg := LM_ACTIVATE
|
LMessage.Msg := LM_ACTIVATE
|
||||||
End;
|
end;
|
||||||
WA_INACTIVE:
|
WA_INACTIVE:
|
||||||
Begin
|
begin
|
||||||
LMessage.Msg := LM_DEACTIVATE;
|
LMessage.Msg := LM_DEACTIVATE;
|
||||||
End;
|
end;
|
||||||
End;
|
end;
|
||||||
End;
|
end;
|
||||||
WM_ACTIVATEAPP:
|
WM_ACTIVATEAPP:
|
||||||
Begin
|
begin
|
||||||
if Window = TWin32WidgetSet(WidgetSet).AppHandle then
|
if Window = TWin32WidgetSet(WidgetSet).AppHandle then
|
||||||
begin
|
begin
|
||||||
if WParam <> 0 then
|
if WParam <> 0 then
|
||||||
@ -1144,33 +1144,33 @@ begin
|
|||||||
CallDefaultWindowProc(Application.MainForm.Handle, WM_NCACTIVATE, WParam, 0);
|
CallDefaultWindowProc(Application.MainForm.Handle, WM_NCACTIVATE, WParam, 0);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
End;
|
end;
|
||||||
BM_SETCHECK:
|
BM_SETCHECK:
|
||||||
Begin
|
begin
|
||||||
LMessage.Msg := LM_CHANGED;
|
LMessage.Msg := LM_CHANGED;
|
||||||
End;
|
end;
|
||||||
WM_CAPTURECHANGED:
|
WM_CAPTURECHANGED:
|
||||||
Begin
|
begin
|
||||||
LMessage.Msg := LM_CAPTURECHANGED;
|
LMessage.Msg := LM_CAPTURECHANGED;
|
||||||
End;
|
end;
|
||||||
CB_DELETESTRING, LB_DELETESTRING:
|
CB_DELETESTRING, LB_DELETESTRING:
|
||||||
Begin
|
begin
|
||||||
LMessage.Msg := LM_DELETETEXT;
|
LMessage.Msg := LM_DELETETEXT;
|
||||||
End;
|
end;
|
||||||
CB_INSERTSTRING, LB_INSERTSTRING:
|
CB_INSERTSTRING, LB_INSERTSTRING:
|
||||||
Begin
|
begin
|
||||||
PLMsg:=@LMInsertText;
|
PLMsg:=@LMInsertText;
|
||||||
With LMInsertText Do
|
With LMInsertText Do
|
||||||
Begin
|
begin
|
||||||
Msg := LM_INSERTTEXT;
|
Msg := LM_INSERTTEXT;
|
||||||
Position := WParam;
|
Position := WParam;
|
||||||
NewText := PChar(LParam);
|
NewText := PChar(LParam);
|
||||||
Length := System.Length(NewText);
|
Length := System.Length(NewText);
|
||||||
// UserData := Pointer(GetWindowLong(Window, GWL_USERDATA));
|
// UserData := Pointer(GetWindowLong(Window, GWL_USERDATA));
|
||||||
End;
|
end;
|
||||||
End;
|
end;
|
||||||
WM_CHAR:
|
WM_CHAR:
|
||||||
Begin
|
begin
|
||||||
if not UnicodeEnabledOS or not HandleUnicodeChar(Word(WParam)) then
|
if not UnicodeEnabledOS or not HandleUnicodeChar(Word(WParam)) then
|
||||||
begin
|
begin
|
||||||
PLMsg:=@LMChar;
|
PLMsg:=@LMChar;
|
||||||
@ -1339,15 +1339,15 @@ begin
|
|||||||
LMessage.Msg := LM_CLEARSEL;
|
LMessage.Msg := LM_CLEARSEL;
|
||||||
end;
|
end;
|
||||||
WM_COPY:
|
WM_COPY:
|
||||||
Begin
|
begin
|
||||||
LMessage.Msg := LM_COPYTOCLIP;
|
LMessage.Msg := LM_COPYTOCLIP;
|
||||||
End;
|
end;
|
||||||
WM_CUT:
|
WM_CUT:
|
||||||
Begin
|
begin
|
||||||
LMessage.Msg := LM_CUTTOCLIP;
|
LMessage.Msg := LM_CUTTOCLIP;
|
||||||
End;
|
end;
|
||||||
WM_DESTROY:
|
WM_DESTROY:
|
||||||
Begin
|
begin
|
||||||
Assert(False, 'Trace:WindowProc - Got WM_DESTROY');
|
Assert(False, 'Trace:WindowProc - Got WM_DESTROY');
|
||||||
if lWinControl is TCheckListBox then
|
if lWinControl is TCheckListBox then
|
||||||
TWin32CheckListBoxStrings.DeleteItemRecords(Window);
|
TWin32CheckListBoxStrings.DeleteItemRecords(Window);
|
||||||
@ -1358,9 +1358,9 @@ begin
|
|||||||
if WindowInfo^.Overlay<>HWND(nil) then
|
if WindowInfo^.Overlay<>HWND(nil) then
|
||||||
Windows.DestroyWindow(WindowInfo^.Overlay);
|
Windows.DestroyWindow(WindowInfo^.Overlay);
|
||||||
LMessage.Msg := LM_DESTROY;
|
LMessage.Msg := LM_DESTROY;
|
||||||
End;
|
end;
|
||||||
WM_DESTROYCLIPBOARD:
|
WM_DESTROYCLIPBOARD:
|
||||||
Begin
|
begin
|
||||||
if assigned(OnClipBoardRequest) then begin
|
if assigned(OnClipBoardRequest) then begin
|
||||||
{$IFDEF VerboseWin32Clipbrd}
|
{$IFDEF VerboseWin32Clipbrd}
|
||||||
debugln('WM_DESTROYCLIPBOARD');
|
debugln('WM_DESTROYCLIPBOARD');
|
||||||
@ -1369,9 +1369,9 @@ begin
|
|||||||
OnClipBoardRequest := nil;
|
OnClipBoardRequest := nil;
|
||||||
LMessage.Result := 0;
|
LMessage.Result := 0;
|
||||||
end;
|
end;
|
||||||
End;
|
end;
|
||||||
WM_DRAWITEM:
|
WM_DRAWITEM:
|
||||||
Begin
|
begin
|
||||||
if (WParam = 0) and (PDrawItemStruct(LParam)^.ctlType = ODT_MENU) then
|
if (WParam = 0) and (PDrawItemStruct(LParam)^.ctlType = ODT_MENU) then
|
||||||
begin
|
begin
|
||||||
menuItem := TObject(PDrawItemStruct(LParam)^.itemData);
|
menuItem := TObject(PDrawItemStruct(LParam)^.itemData);
|
||||||
@ -1424,9 +1424,9 @@ begin
|
|||||||
end;
|
end;
|
||||||
WinProcess := false;
|
WinProcess := false;
|
||||||
end;
|
end;
|
||||||
End;
|
end;
|
||||||
WM_ENABLE:
|
WM_ENABLE:
|
||||||
Begin
|
begin
|
||||||
If WParam <> 0 Then
|
If WParam <> 0 Then
|
||||||
LMessage.Msg := LM_SETEDITABLE;
|
LMessage.Msg := LM_SETEDITABLE;
|
||||||
If Window=TWin32WidgetSet(WidgetSet).FAppHandle then
|
If Window=TWin32WidgetSet(WidgetSet).FAppHandle then
|
||||||
@ -1443,9 +1443,9 @@ begin
|
|||||||
if not ThemeServices.ThemesEnabled
|
if not ThemeServices.ThemesEnabled
|
||||||
and (lWinControl is TCustomBitBtn)
|
and (lWinControl is TCustomBitBtn)
|
||||||
then DrawBitBtnImage(TCustomBitBtn(lWinControl), PChar(TCustomBitBtn(lWinControl).Caption));
|
then DrawBitBtnImage(TCustomBitBtn(lWinControl), PChar(TCustomBitBtn(lWinControl).Caption));
|
||||||
End;
|
end;
|
||||||
WM_ERASEBKGND:
|
WM_ERASEBKGND:
|
||||||
Begin
|
begin
|
||||||
eraseBkgndCommand := TEraseBkgndCommand(EraseBkgndStack and EraseBkgndStackMask);
|
eraseBkgndCommand := TEraseBkgndCommand(EraseBkgndStack and EraseBkgndStackMask);
|
||||||
{$ifdef MSG_DEBUG}
|
{$ifdef MSG_DEBUG}
|
||||||
case eraseBkgndCommand of
|
case eraseBkgndCommand of
|
||||||
@ -1487,16 +1487,16 @@ begin
|
|||||||
LMessage.Result := 1;
|
LMessage.Result := 1;
|
||||||
end;
|
end;
|
||||||
WinProcess := false;
|
WinProcess := false;
|
||||||
End;
|
end;
|
||||||
WM_EXITMENULOOP:
|
WM_EXITMENULOOP:
|
||||||
// is it a popup menu
|
// is it a popup menu
|
||||||
if longbool(WPARAM) and assigned(WindowInfo^.PopupMenu) then
|
if longbool(WPARAM) and assigned(WindowInfo^.PopupMenu) then
|
||||||
WindowInfo^.PopupMenu.Close;
|
WindowInfo^.PopupMenu.Close;
|
||||||
WM_GETDLGCODE:
|
WM_GETDLGCODE:
|
||||||
Begin
|
begin
|
||||||
LMessage.Result := DLGC_WANTALLKEYS;
|
LMessage.Result := DLGC_WANTALLKEYS;
|
||||||
WinProcess := false;
|
WinProcess := false;
|
||||||
End;
|
end;
|
||||||
{
|
{
|
||||||
* TODO: make it work... icon does not show up yet, so better disable it
|
* TODO: make it work... icon does not show up yet, so better disable it
|
||||||
WM_GETICON:
|
WM_GETICON:
|
||||||
@ -1513,61 +1513,61 @@ begin
|
|||||||
WM_HSCROLL:
|
WM_HSCROLL:
|
||||||
HandleScrollMessage(LM_HSCROLL);
|
HandleScrollMessage(LM_HSCROLL);
|
||||||
WM_KEYDOWN:
|
WM_KEYDOWN:
|
||||||
Begin
|
begin
|
||||||
NotifyUserInput := True;
|
NotifyUserInput := True;
|
||||||
PLMsg:=@LMKey;
|
PLMsg:=@LMKey;
|
||||||
With LMKey Do
|
With LMKey Do
|
||||||
Begin
|
begin
|
||||||
Msg := CN_KEYDOWN;
|
Msg := CN_KEYDOWN;
|
||||||
KeyData := LParam;
|
KeyData := LParam;
|
||||||
CharCode := Word(WParam);
|
CharCode := Word(WParam);
|
||||||
Result := 0;
|
Result := 0;
|
||||||
Assert(False,Format('WM_KEYDOWN KeyData= %d CharCode= %d ',[KeyData,CharCode]));
|
Assert(False,Format('WM_KEYDOWN KeyData= %d CharCode= %d ',[KeyData,CharCode]));
|
||||||
Assert(False,' lWinControl= '+TComponent(lWinControl).Name+':'+lWinControl.ClassName);
|
Assert(False,' lWinControl= '+TComponent(lWinControl).Name+':'+lWinControl.ClassName);
|
||||||
End;
|
end;
|
||||||
WinProcess := false;
|
WinProcess := false;
|
||||||
End;
|
end;
|
||||||
WM_KEYUP:
|
WM_KEYUP:
|
||||||
Begin
|
begin
|
||||||
NotifyUserInput := True;
|
NotifyUserInput := True;
|
||||||
PLMsg:=@LMKey;
|
PLMsg:=@LMKey;
|
||||||
With LMKey Do
|
With LMKey Do
|
||||||
Begin
|
begin
|
||||||
Msg := CN_KEYUP;
|
Msg := CN_KEYUP;
|
||||||
KeyData := LParam;
|
KeyData := LParam;
|
||||||
CharCode := Word(WParam);
|
CharCode := Word(WParam);
|
||||||
Result := 0;
|
Result := 0;
|
||||||
Assert(False,Format('WM_KEYUP KeyData= %d CharCode= %d ',[KeyData,CharCode]));
|
Assert(False,Format('WM_KEYUP KeyData= %d CharCode= %d ',[KeyData,CharCode]));
|
||||||
End;
|
end;
|
||||||
WinProcess := false;
|
WinProcess := false;
|
||||||
End;
|
end;
|
||||||
WM_KILLFOCUS:
|
WM_KILLFOCUS:
|
||||||
Begin
|
begin
|
||||||
{$ifdef DEBUG_CARET}
|
{$ifdef DEBUG_CARET}
|
||||||
DebugLn('WM_KILLFOCUS received for window ', IntToHex(Window, 8));
|
DebugLn('WM_KILLFOCUS received for window ', IntToHex(Window, 8));
|
||||||
{$endif}
|
{$endif}
|
||||||
LMessage.Msg := LM_KILLFOCUS;
|
LMessage.Msg := LM_KILLFOCUS;
|
||||||
LMessage.WParam := WParam;
|
LMessage.WParam := WParam;
|
||||||
End;
|
end;
|
||||||
//TODO:LM_KILLCHAR,LM_KILLWORD,LM_KILLLINE
|
//TODO:LM_KILLCHAR,LM_KILLWORD,LM_KILLLINE
|
||||||
WM_LBUTTONDBLCLK:
|
WM_LBUTTONDBLCLK:
|
||||||
Begin
|
begin
|
||||||
NotifyUserInput := True;
|
NotifyUserInput := True;
|
||||||
PLMsg:=@LMMouse;
|
PLMsg:=@LMMouse;
|
||||||
With LMMouse Do
|
With LMMouse Do
|
||||||
Begin
|
begin
|
||||||
Msg := LM_LBUTTONDBLCLK;
|
Msg := LM_LBUTTONDBLCLK;
|
||||||
XPos := GET_X_LPARAM(LParam);
|
XPos := GET_X_LPARAM(LParam);
|
||||||
YPos := GET_Y_LPARAM(LParam);
|
YPos := GET_Y_LPARAM(LParam);
|
||||||
Keys := WParam;
|
Keys := WParam;
|
||||||
End;
|
end;
|
||||||
|
|
||||||
// CheckListBox functionality
|
// CheckListBox functionality
|
||||||
if lWinControl is TCheckListBox then
|
if lWinControl is TCheckListBox then
|
||||||
CheckListBoxLButtonDown;
|
CheckListBoxLButtonDown;
|
||||||
End;
|
end;
|
||||||
WM_LBUTTONDOWN:
|
WM_LBUTTONDOWN:
|
||||||
Begin
|
begin
|
||||||
// if mouse-click, focus-change, mouse-click, cursor hasn't moved:
|
// if mouse-click, focus-change, mouse-click, cursor hasn't moved:
|
||||||
// simulate double click, assume focus change due to first mouse-click
|
// simulate double click, assume focus change due to first mouse-click
|
||||||
if (MouseDownFocusStatus = mfFocusChanged) and (MouseDownFocusWindow = Window)
|
if (MouseDownFocusStatus = mfFocusChanged) and (MouseDownFocusWindow = Window)
|
||||||
@ -1585,12 +1585,12 @@ begin
|
|||||||
NotifyUserInput := True;
|
NotifyUserInput := True;
|
||||||
PLMsg:=@LMMouse;
|
PLMsg:=@LMMouse;
|
||||||
With LMMouse Do
|
With LMMouse Do
|
||||||
Begin
|
begin
|
||||||
Msg := LM_LBUTTONDOWN;
|
Msg := LM_LBUTTONDOWN;
|
||||||
XPos := GET_X_LPARAM(LParam);
|
XPos := GET_X_LPARAM(LParam);
|
||||||
YPos := GET_Y_LPARAM(LParam);
|
YPos := GET_Y_LPARAM(LParam);
|
||||||
Keys := WParam;
|
Keys := WParam;
|
||||||
End;
|
end;
|
||||||
|
|
||||||
// CheckListBox functionality
|
// CheckListBox functionality
|
||||||
if lWinControl is TCheckListBox then
|
if lWinControl is TCheckListBox then
|
||||||
@ -1600,73 +1600,73 @@ begin
|
|||||||
((lWinControl = nil) or (lWinControl.CanFocus)) then
|
((lWinControl = nil) or (lWinControl.CanFocus)) then
|
||||||
Windows.SetFocus(Window);
|
Windows.SetFocus(Window);
|
||||||
|
|
||||||
End;
|
end;
|
||||||
WM_LBUTTONUP:
|
WM_LBUTTONUP:
|
||||||
Begin
|
begin
|
||||||
if (MouseDownWindow = Window) and (MouseDownFocusStatus = mfNone) then
|
if (MouseDownWindow = Window) and (MouseDownFocusStatus = mfNone) then
|
||||||
MouseDownFocusStatus := mfFocusSense;
|
MouseDownFocusStatus := mfFocusSense;
|
||||||
NotifyUserInput := True;
|
NotifyUserInput := True;
|
||||||
PLMsg:=@LMMouse;
|
PLMsg:=@LMMouse;
|
||||||
With LMMouse Do
|
With LMMouse Do
|
||||||
Begin
|
begin
|
||||||
Msg := LM_LBUTTONUP;
|
Msg := LM_LBUTTONUP;
|
||||||
XPos := GET_X_LPARAM(LParam);
|
XPos := GET_X_LPARAM(LParam);
|
||||||
YPos := GET_Y_LPARAM(LParam);
|
YPos := GET_Y_LPARAM(LParam);
|
||||||
Keys := WParam;
|
Keys := WParam;
|
||||||
End;
|
end;
|
||||||
End;
|
end;
|
||||||
WM_MBUTTONDBLCLK:
|
WM_MBUTTONDBLCLK:
|
||||||
Begin
|
begin
|
||||||
NotifyUserInput := True;
|
NotifyUserInput := True;
|
||||||
PLMsg:=@LMMouse;
|
PLMsg:=@LMMouse;
|
||||||
With LMMouse Do
|
With LMMouse Do
|
||||||
Begin
|
begin
|
||||||
Msg := LM_MBUTTONDBLCLK;
|
Msg := LM_MBUTTONDBLCLK;
|
||||||
XPos := GET_X_LPARAM(LParam);
|
XPos := GET_X_LPARAM(LParam);
|
||||||
YPos := GET_Y_LPARAM(LParam);
|
YPos := GET_Y_LPARAM(LParam);
|
||||||
Keys := WParam;
|
Keys := WParam;
|
||||||
End;
|
end;
|
||||||
End;
|
end;
|
||||||
WM_MBUTTONDOWN:
|
WM_MBUTTONDOWN:
|
||||||
Begin
|
begin
|
||||||
NotifyUserInput := True;
|
NotifyUserInput := True;
|
||||||
PLMsg:=@LMMouse;
|
PLMsg:=@LMMouse;
|
||||||
With LMMouse Do
|
With LMMouse Do
|
||||||
Begin
|
begin
|
||||||
Msg := LM_MBUTTONDOWN;
|
Msg := LM_MBUTTONDOWN;
|
||||||
XPos := GET_X_LPARAM(LParam);
|
XPos := GET_X_LPARAM(LParam);
|
||||||
YPos := GET_Y_LPARAM(LParam);
|
YPos := GET_Y_LPARAM(LParam);
|
||||||
Keys := WParam;
|
Keys := WParam;
|
||||||
End;
|
end;
|
||||||
End;
|
end;
|
||||||
WM_MBUTTONUP:
|
WM_MBUTTONUP:
|
||||||
Begin
|
begin
|
||||||
NotifyUserInput := True;
|
NotifyUserInput := True;
|
||||||
PLMsg:=@LMMouse;
|
PLMsg:=@LMMouse;
|
||||||
With LMMouse Do
|
With LMMouse Do
|
||||||
Begin
|
begin
|
||||||
Msg := LM_MBUTTONUP;
|
Msg := LM_MBUTTONUP;
|
||||||
XPos := GET_X_LPARAM(LParam);
|
XPos := GET_X_LPARAM(LParam);
|
||||||
YPos := GET_Y_LPARAM(LParam);
|
YPos := GET_Y_LPARAM(LParam);
|
||||||
Keys := WParam;
|
Keys := WParam;
|
||||||
End;
|
end;
|
||||||
End;
|
end;
|
||||||
WM_MOUSEHOVER:
|
WM_MOUSEHOVER:
|
||||||
Begin
|
begin
|
||||||
NotifyUserInput := True;
|
NotifyUserInput := True;
|
||||||
LMessage.Msg := LM_ENTER;
|
LMessage.Msg := LM_ENTER;
|
||||||
End;
|
end;
|
||||||
WM_MOUSELEAVE:
|
WM_MOUSELEAVE:
|
||||||
Begin
|
begin
|
||||||
NotifyUserInput := True;
|
NotifyUserInput := True;
|
||||||
LMessage.Msg := LM_LEAVE;
|
LMessage.Msg := LM_LEAVE;
|
||||||
End;
|
end;
|
||||||
WM_MOUSEMOVE:
|
WM_MOUSEMOVE:
|
||||||
Begin
|
begin
|
||||||
NotifyUserInput := True;
|
NotifyUserInput := True;
|
||||||
PLMsg:=@LMMouseMove;
|
PLMsg:=@LMMouseMove;
|
||||||
With LMMouseMove Do
|
With LMMouseMove Do
|
||||||
Begin
|
begin
|
||||||
Msg := LM_MOUSEMOVE;
|
Msg := LM_MOUSEMOVE;
|
||||||
XPos := GET_X_LPARAM(LParam);
|
XPos := GET_X_LPARAM(LParam);
|
||||||
YPos := GET_Y_LPARAM(LParam);
|
YPos := GET_Y_LPARAM(LParam);
|
||||||
@ -1684,14 +1684,14 @@ begin
|
|||||||
WindowInfo^.MouseX := XPos;
|
WindowInfo^.MouseX := XPos;
|
||||||
WindowInfo^.MouseY := YPos;
|
WindowInfo^.MouseY := YPos;
|
||||||
end;
|
end;
|
||||||
End;
|
end;
|
||||||
End;
|
end;
|
||||||
WM_MOUSEWHEEL:
|
WM_MOUSEWHEEL:
|
||||||
Begin
|
begin
|
||||||
NotifyUserInput := True;
|
NotifyUserInput := True;
|
||||||
PLMsg:=@LMMouseEvent;
|
PLMsg:=@LMMouseEvent;
|
||||||
With LMMouseEvent Do
|
With LMMouseEvent Do
|
||||||
Begin
|
begin
|
||||||
X := GET_X_LPARAM(LParam);
|
X := GET_X_LPARAM(LParam);
|
||||||
Y := GET_Y_LPARAM(LParam);
|
Y := GET_Y_LPARAM(LParam);
|
||||||
// check if mouse cursor within this window, otherwise send message to window the mouse is hovering over
|
// check if mouse cursor within this window, otherwise send message to window the mouse is hovering over
|
||||||
@ -1762,12 +1762,12 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
WM_NCLBUTTONDOWN:
|
WM_NCLBUTTONDOWN:
|
||||||
Begin
|
begin
|
||||||
NotifyUserInput := True;
|
NotifyUserInput := True;
|
||||||
Assert(False, 'Trace:WindowProc - Got WM_NCLBUTTONDOWN');
|
Assert(False, 'Trace:WindowProc - Got WM_NCLBUTTONDOWN');
|
||||||
End;
|
end;
|
||||||
WM_NOTIFY:
|
WM_NOTIFY:
|
||||||
Begin
|
begin
|
||||||
WindowInfo := GetWindowInfo(PNMHdr(LParam)^.hwndFrom);
|
WindowInfo := GetWindowInfo(PNMHdr(LParam)^.hwndFrom);
|
||||||
{$ifdef MSG_DEBUG}
|
{$ifdef MSG_DEBUG}
|
||||||
DebugLn([MessageStackDepth, 'Notify code: ', PNMHdr(LParam)^.code]);
|
DebugLn([MessageStackDepth, 'Notify code: ', PNMHdr(LParam)^.code]);
|
||||||
@ -1798,7 +1798,7 @@ begin
|
|||||||
lWinControl := WindowInfo^.WinControl;
|
lWinControl := WindowInfo^.WinControl;
|
||||||
PLMsg:=@LMMouse;
|
PLMsg:=@LMMouse;
|
||||||
With LMMouse Do
|
With LMMouse Do
|
||||||
Begin
|
begin
|
||||||
Msg := LM_RBUTTONUP;
|
Msg := LM_RBUTTONUP;
|
||||||
Pos := GetClientCursorPos(PNMHdr(LParam)^.hwndFrom);
|
Pos := GetClientCursorPos(PNMHdr(LParam)^.hwndFrom);
|
||||||
Keys := 0; // I don't know how to get this information
|
Keys := 0; // I don't know how to get this information
|
||||||
@ -1809,7 +1809,7 @@ begin
|
|||||||
else
|
else
|
||||||
PLMsg:=@LMNotify;
|
PLMsg:=@LMNotify;
|
||||||
With LMNotify Do
|
With LMNotify Do
|
||||||
Begin
|
begin
|
||||||
Msg := LM_NOTIFY;
|
Msg := LM_NOTIFY;
|
||||||
IDCtrl := WParam;
|
IDCtrl := WParam;
|
||||||
NMHdr := PNMHDR(LParam);
|
NMHdr := PNMHDR(LParam);
|
||||||
@ -1848,53 +1848,53 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
WM_PAINT:
|
WM_PAINT:
|
||||||
Begin
|
begin
|
||||||
SendPaintMessage(HDC(WParam));
|
SendPaintMessage(HDC(WParam));
|
||||||
// SendPaintMessage sets winprocess to false
|
// SendPaintMessage sets winprocess to false
|
||||||
End;
|
end;
|
||||||
WM_PASTE:
|
WM_PASTE:
|
||||||
Begin
|
begin
|
||||||
LMessage.Msg := LM_PASTEFROMCLIP;
|
LMessage.Msg := LM_PASTEFROMCLIP;
|
||||||
End;
|
end;
|
||||||
WM_RBUTTONDBLCLK:
|
WM_RBUTTONDBLCLK:
|
||||||
Begin
|
begin
|
||||||
NotifyUserInput := True;
|
NotifyUserInput := True;
|
||||||
PLMsg:=@LMMouse;
|
PLMsg:=@LMMouse;
|
||||||
With LMMouse Do
|
With LMMouse Do
|
||||||
Begin
|
begin
|
||||||
Msg := LM_RBUTTONDBLCLK;
|
Msg := LM_RBUTTONDBLCLK;
|
||||||
XPos := GET_X_LPARAM(LParam);
|
XPos := GET_X_LPARAM(LParam);
|
||||||
YPos := GET_Y_LPARAM(LParam);
|
YPos := GET_Y_LPARAM(LParam);
|
||||||
Keys := WParam;
|
Keys := WParam;
|
||||||
End;
|
end;
|
||||||
End;
|
end;
|
||||||
WM_RBUTTONDOWN:
|
WM_RBUTTONDOWN:
|
||||||
Begin
|
begin
|
||||||
NotifyUserInput := True;
|
NotifyUserInput := True;
|
||||||
PLMsg:=@LMMouse;
|
PLMsg:=@LMMouse;
|
||||||
With LMMouse Do
|
With LMMouse Do
|
||||||
Begin
|
begin
|
||||||
Msg := LM_RBUTTONDOWN;
|
Msg := LM_RBUTTONDOWN;
|
||||||
XPos := GET_X_LPARAM(LParam);
|
XPos := GET_X_LPARAM(LParam);
|
||||||
YPos := GET_Y_LPARAM(LParam);
|
YPos := GET_Y_LPARAM(LParam);
|
||||||
Keys := WParam;
|
Keys := WParam;
|
||||||
Result := 0;
|
Result := 0;
|
||||||
End;
|
end;
|
||||||
End;
|
end;
|
||||||
WM_RBUTTONUP:
|
WM_RBUTTONUP:
|
||||||
Begin
|
begin
|
||||||
NotifyUserInput := True;
|
NotifyUserInput := True;
|
||||||
WinProcess := false;
|
WinProcess := false;
|
||||||
PLMsg:=@LMMouse;
|
PLMsg:=@LMMouse;
|
||||||
With LMMouse Do
|
With LMMouse Do
|
||||||
Begin
|
begin
|
||||||
Msg := LM_RBUTTONUP;
|
Msg := LM_RBUTTONUP;
|
||||||
XPos := GET_X_LPARAM(LParam);
|
XPos := GET_X_LPARAM(LParam);
|
||||||
YPos := GET_Y_LPARAM(LParam);
|
YPos := GET_Y_LPARAM(LParam);
|
||||||
Keys := WParam;
|
Keys := WParam;
|
||||||
Result := 0;
|
Result := 0;
|
||||||
End;
|
end;
|
||||||
End;
|
end;
|
||||||
WM_CONTEXTMENU:
|
WM_CONTEXTMENU:
|
||||||
begin
|
begin
|
||||||
WinProcess := false;
|
WinProcess := false;
|
||||||
@ -1920,7 +1920,7 @@ begin
|
|||||||
HandleSetCursor;
|
HandleSetCursor;
|
||||||
end;
|
end;
|
||||||
WM_SETFOCUS:
|
WM_SETFOCUS:
|
||||||
Begin
|
begin
|
||||||
{$ifdef DEBUG_CARET}
|
{$ifdef DEBUG_CARET}
|
||||||
DebugLn('WM_SETFOCUS received for window ', IntToHex(Window, 8));
|
DebugLn('WM_SETFOCUS received for window ', IntToHex(Window, 8));
|
||||||
{$endif}
|
{$endif}
|
||||||
@ -1936,16 +1936,16 @@ begin
|
|||||||
// RadioButton functionality
|
// RadioButton functionality
|
||||||
if (lWinControl <> nil) and (lWinControl is TRadioButton) then
|
if (lWinControl <> nil) and (lWinControl is TRadioButton) then
|
||||||
Windows.SendMessage(Window, BM_SETCHECK, BST_CHECKED, 0);
|
Windows.SendMessage(Window, BM_SETCHECK, BST_CHECKED, 0);
|
||||||
End;
|
end;
|
||||||
WM_SHOWWINDOW:
|
WM_SHOWWINDOW:
|
||||||
Begin
|
begin
|
||||||
Assert(False, 'Trace:WindowProc - Got WM_SHOWWINDOW');
|
Assert(False, 'Trace:WindowProc - Got WM_SHOWWINDOW');
|
||||||
With TLMShowWindow(LMessage) Do
|
With TLMShowWindow(LMessage) Do
|
||||||
Begin
|
begin
|
||||||
Msg := LM_SHOWWINDOW;
|
Msg := LM_SHOWWINDOW;
|
||||||
Show := WParam <> 0;
|
Show := WParam <> 0;
|
||||||
Status := LParam;
|
Status := LParam;
|
||||||
End;
|
end;
|
||||||
//DebugLn(GetStackTrace(false));
|
//DebugLn(GetStackTrace(false));
|
||||||
if assigned(lWinControl) and ((WParam<>0) or not lWinControl.Visible)
|
if assigned(lWinControl) and ((WParam<>0) or not lWinControl.Visible)
|
||||||
and ((WParam=0) or lWinControl.Visible)
|
and ((WParam=0) or lWinControl.Visible)
|
||||||
@ -1957,72 +1957,72 @@ begin
|
|||||||
Flags := SW_SHOWNOACTIVATE;
|
Flags := SW_SHOWNOACTIVATE;
|
||||||
Windows.ShowWindow(TWin32WidgetSet(WidgetSet).FAppHandle, Flags);
|
Windows.ShowWindow(TWin32WidgetSet(WidgetSet).FAppHandle, Flags);
|
||||||
end;
|
end;
|
||||||
End;
|
end;
|
||||||
WM_SYSCHAR:
|
WM_SYSCHAR:
|
||||||
Begin
|
begin
|
||||||
PLMsg:=@LMChar;
|
PLMsg:=@LMChar;
|
||||||
With LMChar Do
|
With LMChar Do
|
||||||
Begin
|
begin
|
||||||
Msg := CN_SYSCHAR;
|
Msg := CN_SYSCHAR;
|
||||||
KeyData := LParam;
|
KeyData := LParam;
|
||||||
CharCode := Word(WParam);
|
CharCode := Word(WParam);
|
||||||
Result := 0;
|
Result := 0;
|
||||||
Assert(False,Format('WM_CHAR KeyData= %d CharCode= %d ',[KeyData,CharCode]));
|
Assert(False,Format('WM_CHAR KeyData= %d CharCode= %d ',[KeyData,CharCode]));
|
||||||
End;
|
end;
|
||||||
WinProcess := false;
|
WinProcess := false;
|
||||||
End;
|
end;
|
||||||
WM_SYSCOMMAND:
|
WM_SYSCOMMAND:
|
||||||
begin
|
begin
|
||||||
HandleSysCommand;
|
HandleSysCommand;
|
||||||
end;
|
end;
|
||||||
WM_SYSKEYDOWN:
|
WM_SYSKEYDOWN:
|
||||||
Begin
|
begin
|
||||||
NotifyUserInput := True;
|
NotifyUserInput := True;
|
||||||
PLMsg:=@LMKey;
|
PLMsg:=@LMKey;
|
||||||
With LMKey Do
|
With LMKey Do
|
||||||
Begin
|
begin
|
||||||
Msg := CN_SYSKEYDOWN;
|
Msg := CN_SYSKEYDOWN;
|
||||||
KeyData := LParam;
|
KeyData := LParam;
|
||||||
CharCode := Word(WParam);
|
CharCode := Word(WParam);
|
||||||
Result := 0;
|
Result := 0;
|
||||||
End;
|
end;
|
||||||
WinProcess := false;
|
WinProcess := false;
|
||||||
End;
|
end;
|
||||||
WM_SYSKEYUP:
|
WM_SYSKEYUP:
|
||||||
Begin
|
begin
|
||||||
NotifyUserInput := True;
|
NotifyUserInput := True;
|
||||||
PLMsg:=@LMKey;
|
PLMsg:=@LMKey;
|
||||||
With LMKey Do
|
With LMKey Do
|
||||||
Begin
|
begin
|
||||||
Msg := CN_SYSKEYUP;
|
Msg := CN_SYSKEYUP;
|
||||||
KeyData := LParam;
|
KeyData := LParam;
|
||||||
CharCode := Word(WParam);
|
CharCode := Word(WParam);
|
||||||
Result := 0;
|
Result := 0;
|
||||||
End;
|
end;
|
||||||
WinProcess := false;
|
WinProcess := false;
|
||||||
End;
|
end;
|
||||||
WM_TIMER:
|
WM_TIMER:
|
||||||
Begin
|
begin
|
||||||
LMessage.Msg := LM_TIMER;
|
LMessage.Msg := LM_TIMER;
|
||||||
LMessage.WParam := WParam;
|
LMessage.WParam := WParam;
|
||||||
LMessage.LParam := LParam;
|
LMessage.LParam := LParam;
|
||||||
End;
|
end;
|
||||||
WM_VSCROLL:
|
WM_VSCROLL:
|
||||||
HandleScrollMessage(LM_VSCROLL);
|
HandleScrollMessage(LM_VSCROLL);
|
||||||
WM_WINDOWPOSCHANGED:
|
WM_WINDOWPOSCHANGED:
|
||||||
Begin
|
begin
|
||||||
With TLMWindowPosMsg(LMessage) Do
|
With TLMWindowPosMsg(LMessage) Do
|
||||||
Begin
|
begin
|
||||||
Msg := LM_WINDOWPOSCHANGED;
|
Msg := LM_WINDOWPOSCHANGED;
|
||||||
Unused := WParam;
|
Unused := WParam;
|
||||||
WindowPos := PWindowPos(LParam);
|
WindowPos := PWindowPos(LParam);
|
||||||
End;
|
end;
|
||||||
// cross-interface compatible: complete invalidate on resize
|
// cross-interface compatible: complete invalidate on resize
|
||||||
if (PWindowPos(LParam)^.flags and SWP_NOSIZE) = 0 then
|
if (PWindowPos(LParam)^.flags and SWP_NOSIZE) = 0 then
|
||||||
Windows.InvalidateRect(Window, nil, true);
|
Windows.InvalidateRect(Window, nil, true);
|
||||||
End;
|
end;
|
||||||
WM_MEASUREITEM:
|
WM_MEASUREITEM:
|
||||||
Begin
|
begin
|
||||||
if WParam = 0 then begin
|
if WParam = 0 then begin
|
||||||
menuItem := TObject(PMeasureItemStruct(LParam)^.itemData);
|
menuItem := TObject(PMeasureItemStruct(LParam)^.itemData);
|
||||||
if menuItem is TMenuItem then
|
if menuItem is TMenuItem then
|
||||||
@ -2053,7 +2053,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
End;
|
end;
|
||||||
WM_THEMECHANGED:
|
WM_THEMECHANGED:
|
||||||
begin
|
begin
|
||||||
// winxp theme changed, recheck whether themes are enabled
|
// winxp theme changed, recheck whether themes are enabled
|
||||||
@ -2082,7 +2082,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
{$endif}
|
{$endif}
|
||||||
End;
|
end;
|
||||||
|
|
||||||
If WinProcess Then
|
If WinProcess Then
|
||||||
begin
|
begin
|
||||||
@ -2092,10 +2092,10 @@ begin
|
|||||||
|
|
||||||
Case Msg Of
|
Case Msg Of
|
||||||
WM_MOVE:
|
WM_MOVE:
|
||||||
Begin
|
begin
|
||||||
PLMsg:=@LMMove;
|
PLMsg:=@LMMove;
|
||||||
With LMMove Do
|
With LMMove Do
|
||||||
Begin
|
begin
|
||||||
Msg := LM_MOVE;
|
Msg := LM_MOVE;
|
||||||
// MoveType := WParam; WParam is not defined!
|
// MoveType := WParam; WParam is not defined!
|
||||||
MoveType := Move_SourceIsInterface;
|
MoveType := Move_SourceIsInterface;
|
||||||
@ -2126,12 +2126,12 @@ begin
|
|||||||
if (lWinControl.Left=XPos) and (lWinControl.Top=YPos) then
|
if (lWinControl.Left=XPos) and (lWinControl.Top=YPos) then
|
||||||
exit;
|
exit;
|
||||||
end;
|
end;
|
||||||
End;
|
end;
|
||||||
End;
|
end;
|
||||||
WM_SIZE:
|
WM_SIZE:
|
||||||
Begin
|
begin
|
||||||
With TLMSize(LMessage) Do
|
With TLMSize(LMessage) Do
|
||||||
Begin
|
begin
|
||||||
Msg := LM_SIZE;
|
Msg := LM_SIZE;
|
||||||
SizeType := WParam or Size_SourceIsInterface;
|
SizeType := WParam or Size_SourceIsInterface;
|
||||||
GetWindowSize(Window, NewWidth, NewHeight);
|
GetWindowSize(Window, NewWidth, NewHeight);
|
||||||
@ -2158,8 +2158,8 @@ begin
|
|||||||
OverlayWindow := GetWindowInfo(Window)^.Overlay;
|
OverlayWindow := GetWindowInfo(Window)^.Overlay;
|
||||||
if OverlayWindow <> 0 then
|
if OverlayWindow <> 0 then
|
||||||
Windows.SetWindowPos(OverlayWindow, HWND_TOP, 0, 0, NewWidth, NewHeight, SWP_NOMOVE);
|
Windows.SetWindowPos(OverlayWindow, HWND_TOP, 0, 0, NewWidth, NewHeight, SWP_NOMOVE);
|
||||||
End;
|
end;
|
||||||
End;
|
end;
|
||||||
BM_SETCHECK:
|
BM_SETCHECK:
|
||||||
begin
|
begin
|
||||||
if (WParam=BST_CHECKED) and (lWinControl is TRadioButton) then
|
if (WParam=BST_CHECKED) and (lWinControl is TRadioButton) then
|
||||||
@ -2381,7 +2381,7 @@ begin
|
|||||||
else Result := PLMsg^.Result;
|
else Result := PLMsg^.Result;
|
||||||
|
|
||||||
Assert(False, 'Trace:WindowProc - Exit');
|
Assert(False, 'Trace:WindowProc - Exit');
|
||||||
End;
|
end;
|
||||||
|
|
||||||
{$ifdef MSG_DEBUG}
|
{$ifdef MSG_DEBUG}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user