From: Andreas H. <ah...@us...> - 2004-02-23 23:41:47
|
Update of /cvsroot/jvcl/dev/JVCL3/run In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19873/run Modified Files: JvExControls.pas Log Message: Fixed non-changeable WParam, LParam bug Index: JvExControls.pas =================================================================== RCS file: /cvsroot/jvcl/dev/JVCL3/run/JvExControls.pas,v retrieving revision 1.30 retrieving revision 1.31 diff -C2 -d -r1.30 -r1.31 *** JvExControls.pas 16 Feb 2004 19:45:09 -0000 1.30 --- JvExControls.pas 23 Feb 2004 23:27:47 -0000 1.31 *************** *** 146,150 **** {$ENDIF VisualCLX} - type TJvExControl = class(TControl, IJvControlEvents) --- 146,149 ---- *************** *** 568,572 **** - {$IFDEF VCL} function ShiftStateToKeyData(Shift: TShiftState): Longint; --- 567,570 ---- *************** *** 574,577 **** --- 572,576 ---- function InheritMsg(Instance: TControl; Msg: Integer; WParam, LParam: Integer): Integer; overload; function InheritMsg(Instance: TControl; Msg: Integer): Integer; overload; + procedure InheritMsg(Instance: TControl; var Msg: TMessage); overload; procedure DispatchMsg(Instance: TControl; var Msg); *************** *** 663,672 **** - type - TDisptachMethod = procedure(Self: TObject; var Msg: TMessage); - function InheritMsg(Instance: TControl; Msg: Integer; WParam, LParam: Integer): Integer; var - Proc: TDisptachMethod; Mesg: TMessage; begin --- 662,667 ---- *************** *** 675,680 **** Mesg.LParam := LParam; Mesg.Result := 0; ! Proc := @TObject.Dispatch; ! Proc(Instance, Mesg); Result := Mesg.Result; end; --- 670,674 ---- Mesg.LParam := LParam; Mesg.Result := 0; ! InheritMsg(Instance, Mesg); Result := Mesg.Result; end; *************** *** 685,688 **** --- 679,692 ---- end; + procedure InheritMsg(Instance: TControl; var Msg: TMessage); + type + TDispatchMethod = procedure(Self: TObject; var Msg: TMessage); + var + Proc: TDispatchMethod; + begin + Proc := @TObject.Dispatch; + Proc(Instance, Msg); + end; + procedure DispatchMsg(Instance: TControl; var Msg); var *************** *** 781,785 **** Helper := TFreeNotificationHelper.Create(Instance, @IntfWinControl); try ! PMsg^.Result := InheritMsg(Instance, PMsg^.Msg, PMsg^.WParam, PMsg^.LParam); DlgCodes := [dcNative]; --- 785,789 ---- Helper := TFreeNotificationHelper.Create(Instance, @IntfWinControl); try ! InheritMsg(Instance, PMsg^); DlgCodes := [dcNative]; *************** *** 822,827 **** Helper := TFreeNotificationHelper.Create(Instance, @IntfWinControl); try ! with PMsg^ do ! Result := InheritMsg(Instance, Msg, WParam, LParam); if Helper.IsValid then DoSetFocus(HWND(PMsg^.WParam)); --- 826,830 ---- Helper := TFreeNotificationHelper.Create(Instance, @IntfWinControl); try ! InheritMsg(Instance, PMsg^); if Helper.IsValid then DoSetFocus(HWND(PMsg^.WParam)); *************** *** 834,839 **** Helper := TFreeNotificationHelper.Create(Instance, @IntfWinControl); try ! with PMsg^ do ! Result := InheritMsg(Instance, Msg, WParam, LParam); if Helper.IsValid then DoKillFocus(HWND(PMsg^.WParam)); --- 837,841 ---- Helper := TFreeNotificationHelper.Create(Instance, @IntfWinControl); try ! InheritMsg(Instance, PMsg^); if Helper.IsValid then DoKillFocus(HWND(PMsg^.WParam)); *************** *** 846,851 **** DoBoundsChanged; IntfWinControl := nil; ! with PMsg^ do ! Result := InheritMsg(Instance, Msg, WParam, LParam); end; WM_ERASEBKGND: --- 848,852 ---- DoBoundsChanged; IntfWinControl := nil; ! InheritMsg(Instance, PMsg^); end; WM_ERASEBKGND: *************** *** 862,868 **** end; end; ! else ! CallInherited := True; ! end; finally IntfWinControl := nil; --- 863,869 ---- end; end; ! else ! CallInherited := True; ! end; finally IntfWinControl := nil; *************** *** 899,904 **** if CallInherited then ! with PMsg^ do ! Result := InheritMsg(Instance, Msg, WParam, LParam); end; --- 900,904 ---- if CallInherited then ! InheritMsg(Instance, PMsg^); end; |