Changeset 109:0a02d6d3466b
- Timestamp:
- 02/10/08 20:45:33
(1 year ago)
- Author:
- Frank Benoit <benoit@tionex.de>
- Parents:
108:6f75fdfa1bcd 107:a378481be65f
- branch:
- default
- Message:
merge
-
Files:
-
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
| r107 |
r109 |
|
| 3715 | 3715 | |
|---|
| 3716 | 3716 | int windowProc (HWND hwnd, int msg, int wParam, int lParam) { |
|---|
| 3717 | | LRESULT result = LRESULT.NULL; |
|---|
| | 3717 | LRESULT result = null; |
|---|
| 3718 | 3718 | switch (msg) { |
|---|
| 3719 | 3719 | case OS.WM_ACTIVATE: result = WM_ACTIVATE (wParam, lParam); break; |
|---|
| … | … | |
| 3807 | 3807 | default: |
|---|
| 3808 | 3808 | } |
|---|
| 3809 | | if (result !is LRESULT.NULL) return result; |
|---|
| | 3809 | if (result !is null) return result.value; |
|---|
| 3810 | 3810 | return callWindowProc (hwnd, msg, wParam, lParam); |
|---|
| 3811 | 3811 | } |
|---|
| 3812 | 3812 | |
|---|
| 3813 | 3813 | LRESULT WM_ACTIVATE (int wParam, int lParam) { |
|---|
| 3814 | | return LRESULT.NULL; |
|---|
| | 3814 | return null; |
|---|
| 3815 | 3815 | } |
|---|
| 3816 | 3816 | |
|---|
| … | … | |
| 3824 | 3824 | |
|---|
| 3825 | 3825 | LRESULT WM_CLEAR (int wParam, int lParam) { |
|---|
| 3826 | | return LRESULT.NULL; |
|---|
| | 3826 | return null; |
|---|
| 3827 | 3827 | } |
|---|
| 3828 | 3828 | |
|---|
| 3829 | 3829 | LRESULT WM_CLOSE (int wParam, int lParam) { |
|---|
| 3830 | | return LRESULT.NULL; |
|---|
| | 3830 | return null; |
|---|
| 3831 | 3831 | } |
|---|
| 3832 | 3832 | |
|---|
| … | … | |
| 3845 | 3845 | } |
|---|
| 3846 | 3846 | } |
|---|
| 3847 | | return LRESULT.NULL; |
|---|
| | 3847 | return null; |
|---|
| 3848 | 3848 | } |
|---|
| 3849 | 3849 | Control control = display.getControl (cast(HANDLE)lParam); |
|---|
| 3850 | | if (control is null) return LRESULT.NULL; |
|---|
| | 3850 | if (control is null) return null; |
|---|
| 3851 | 3851 | return control.wmCommandChild (wParam, lParam); |
|---|
| 3852 | 3852 | } |
|---|
| … | … | |
| 3863 | 3863 | } |
|---|
| 3864 | 3864 | Control control = display.getControl (cast(HANDLE)lParam); |
|---|
| 3865 | | if (control is null) return LRESULT.NULL; |
|---|
| | 3865 | if (control is null) return null; |
|---|
| 3866 | 3866 | return control.wmColorChild (wParam, lParam); |
|---|
| 3867 | 3867 | } |
|---|
| 3868 | 3868 | |
|---|
| 3869 | 3869 | LRESULT WM_CUT (int wParam, int lParam) { |
|---|
| 3870 | | return LRESULT.NULL; |
|---|
| | 3870 | return null; |
|---|
| 3871 | 3871 | } |
|---|
| 3872 | 3872 | |
|---|
| 3873 | 3873 | LRESULT WM_DESTROY (int wParam, int lParam) { |
|---|
| 3874 | | return LRESULT.NULL; |
|---|
| | 3874 | return null; |
|---|
| 3875 | 3875 | } |
|---|
| 3876 | 3876 | |
|---|
| … | … | |
| 3879 | 3879 | if (struct_.CtlType is OS.ODT_MENU) { |
|---|
| 3880 | 3880 | MenuItem item = display.getMenuItem (struct_.itemID); |
|---|
| 3881 | | if (item is null) return LRESULT.NULL; |
|---|
| | 3881 | if (item is null) return null; |
|---|
| 3882 | 3882 | return item.wmDrawChild (wParam, lParam); |
|---|
| 3883 | 3883 | } |
|---|
| 3884 | 3884 | Control control = display.getControl (struct_.hwndItem); |
|---|
| 3885 | | if (control is null) return LRESULT.NULL; |
|---|
| | 3885 | if (control is null) return null; |
|---|
| 3886 | 3886 | return control.wmDrawChild (wParam, lParam); |
|---|
| 3887 | 3887 | } |
|---|
| 3888 | 3888 | |
|---|
| 3889 | 3889 | LRESULT WM_ENDSESSION (int wParam, int lParam) { |
|---|
| 3890 | | return LRESULT.NULL; |
|---|
| | 3890 | return null; |
|---|
| 3891 | 3891 | } |
|---|
| 3892 | 3892 | |
|---|
| 3893 | 3893 | LRESULT WM_ENTERIDLE (int wParam, int lParam) { |
|---|
| 3894 | | return LRESULT.NULL; |
|---|
| | 3894 | return null; |
|---|
| 3895 | 3895 | } |
|---|
| 3896 | 3896 | |
|---|
| … | … | |
| 3904 | 3904 | } |
|---|
| 3905 | 3905 | } |
|---|
| 3906 | | return LRESULT.NULL; |
|---|
| | 3906 | return null; |
|---|
| 3907 | 3907 | } |
|---|
| 3908 | 3908 | |
|---|
| 3909 | 3909 | LRESULT WM_GETDLGCODE (int wParam, int lParam) { |
|---|
| 3910 | | return LRESULT.NULL; |
|---|
| | 3910 | return null; |
|---|
| 3911 | 3911 | } |
|---|
| 3912 | 3912 | |
|---|
| 3913 | 3913 | LRESULT WM_GETFONT (int wParam, int lParam) { |
|---|
| 3914 | | return LRESULT.NULL; |
|---|
| | 3914 | return null; |
|---|
| 3915 | 3915 | } |
|---|
| 3916 | 3916 | |
|---|
| 3917 | 3917 | LRESULT WM_GETOBJECT (int wParam, int lParam) { |
|---|
| 3918 | 3918 | if (accessible !is null) { |
|---|
| 3919 | | LRESULT result = cast(LRESULT) accessible.internal_WM_GETOBJECT (wParam, lParam); |
|---|
| 3920 | | if (result !is 0) return result; |
|---|
| 3921 | | } |
|---|
| 3922 | | return LRESULT.NULL; |
|---|
| | 3919 | int result = accessible.internal_WM_GETOBJECT (wParam, lParam); |
|---|
| | 3920 | if (result !is 0) return new LRESULT (result); |
|---|
| | 3921 | } |
|---|
| | 3922 | return null; |
|---|
| 3923 | 3923 | } |
|---|
| 3924 | 3924 | |
|---|
| 3925 | 3925 | LRESULT WM_GETMINMAXINFO (int wParam, int lParam) { |
|---|
| 3926 | | return LRESULT.NULL; |
|---|
| | 3926 | return null; |
|---|
| 3927 | 3927 | } |
|---|
| 3928 | 3928 | |
|---|
| 3929 | 3929 | LRESULT WM_HOTKEY (int wParam, int lParam) { |
|---|
| 3930 | | return LRESULT.NULL; |
|---|
| | 3930 | return null; |
|---|
| 3931 | 3931 | } |
|---|
| 3932 | 3932 | |
|---|
| 3933 | 3933 | LRESULT WM_HELP (int wParam, int lParam) { |
|---|
| 3934 | | static if (OS.IsWinCE) return LRESULT.NULL; |
|---|
| | 3934 | static if (OS.IsWinCE) return null; |
|---|
| 3935 | 3935 | HELPINFO* lphi = cast(HELPINFO*)lParam; |
|---|
| 3936 | 3936 | Decorations shell = menuShell (); |
|---|
| 3937 | | if (!shell.isEnabled ()) return LRESULT.NULL; |
|---|
| | 3937 | if (!shell.isEnabled ()) return null; |
|---|
| 3938 | 3938 | if (lphi.iContextType is OS.HELPINFO_MENUITEM) { |
|---|
| 3939 | 3939 | MenuItem item = display.getMenuItem (lphi.iCtrlId); |
|---|
| … | … | |
| 3953 | 3953 | } |
|---|
| 3954 | 3954 | } |
|---|
| 3955 | | return LRESULT.NULL; |
|---|
| | 3955 | return null; |
|---|
| 3956 | 3956 | } |
|---|
| 3957 | 3957 | if (hooks (DWT.Help)) { |
|---|
| … | … | |
| 3959 | 3959 | return LRESULT.ONE; |
|---|
| 3960 | 3960 | } |
|---|
| 3961 | | return LRESULT.NULL; |
|---|
| | 3961 | return null; |
|---|
| 3962 | 3962 | } |
|---|
| 3963 | 3963 | |
|---|
| 3964 | 3964 | LRESULT WM_HSCROLL (int wParam, int lParam) { |
|---|
| 3965 | 3965 | Control control = display.getControl (cast(HANDLE)lParam); |
|---|
| 3966 | | if (control is null) return LRESULT.NULL; |
|---|
| | 3966 | if (control is null) return null; |
|---|
| 3967 | 3967 | return control.wmScrollChild (wParam, lParam); |
|---|
| 3968 | 3968 | } |
|---|
| … | … | |
| 3973 | 3973 | |
|---|
| 3974 | 3974 | LRESULT WM_IME_COMPOSITION (int wParam, int lParam) { |
|---|
| 3975 | | return LRESULT.NULL; |
|---|
| | 3975 | return null; |
|---|
| 3976 | 3976 | } |
|---|
| 3977 | 3977 | |
|---|
| … | … | |
| 3979 | 3979 | |
|---|
| 3980 | 3980 | /* Ignore WM_INITMENUPOPUP for an accelerator */ |
|---|
| 3981 | | if (display.accelKeyHit) return LRESULT.NULL; |
|---|
| | 3981 | if (display.accelKeyHit) return null; |
|---|
| 3982 | 3982 | |
|---|
| 3983 | 3983 | /* |
|---|
| … | … | |
| 4030 | 4030 | // widget could be disposed at this point |
|---|
| 4031 | 4031 | } |
|---|
| 4032 | | return LRESULT.NULL; |
|---|
| | 4032 | return null; |
|---|
| 4033 | 4033 | } |
|---|
| 4034 | 4034 | |
|---|
| 4035 | 4035 | LRESULT WM_INPUTLANGCHANGE (int wParam, int lParam) { |
|---|
| 4036 | | return LRESULT.NULL; |
|---|
| | 4036 | return null; |
|---|
| 4037 | 4037 | } |
|---|
| 4038 | 4038 | |
|---|
| … | … | |
| 4077 | 4077 | if (struct_.CtlType is OS.ODT_MENU) { |
|---|
| 4078 | 4078 | MenuItem item = display.getMenuItem (struct_.itemID); |
|---|
| 4079 | | if (item is null) return LRESULT.NULL; |
|---|
| | 4079 | if (item is null) return null; |
|---|
| 4080 | 4080 | return item.wmMeasureChild (wParam, lParam); |
|---|
| 4081 | 4081 | } |
|---|
| 4082 | 4082 | auto hwnd = OS.GetDlgItem (handle, struct_.CtlID); |
|---|
| 4083 | 4083 | Control control = display.getControl (hwnd); |
|---|
| 4084 | | if (control is null) return LRESULT.NULL; |
|---|
| | 4084 | if (control is null) return null; |
|---|
| 4085 | 4085 | return control.wmMeasureChild (wParam, lParam); |
|---|
| 4086 | 4086 | } |
|---|
| … | … | |
| 4098 | 4098 | if (type is 0 || type is OS.MF_SYSMENU) { |
|---|
| 4099 | 4099 | display.mnemonicKeyHit = false; |
|---|
| 4100 | | return cast( LRESULT )(OS.MNC_CLOSE << 16); |
|---|
| 4101 | | } |
|---|
| 4102 | | return LRESULT.NULL; |
|---|
| | 4100 | return new LRESULT (OS.MNC_CLOSE << 16); |
|---|
| | 4101 | } |
|---|
| | 4102 | return null; |
|---|
| 4103 | 4103 | } |
|---|
| 4104 | 4104 | |
|---|
| … | … | |
| 4136 | 4136 | */ |
|---|
| 4137 | 4137 | shell.activeMenu = null; |
|---|
| 4138 | | return LRESULT.NULL; |
|---|
| 4139 | | } |
|---|
| 4140 | | if ((code & OS.MF_SYSMENU) !is 0) return LRESULT.NULL; |
|---|
| | 4138 | return null; |
|---|
| | 4139 | } |
|---|
| | 4140 | if ((code & OS.MF_SYSMENU) !is 0) return null; |
|---|
| 4141 | 4141 | if ((code & OS.MF_HILITE) !is 0) { |
|---|
| 4142 | 4142 | MenuItem item = null; |
|---|
| … | … | |
| 4195 | 4195 | if (item !is null) item.sendEvent (DWT.Arm); |
|---|
| 4196 | 4196 | } |
|---|
| 4197 | | return LRESULT.NULL; |
|---|
| | 4197 | return null; |
|---|
| 4198 | 4198 | } |
|---|
| 4199 | 4199 | |
|---|
| 4200 | 4200 | LRESULT WM_MOUSEACTIVATE (int wParam, int lParam) { |
|---|
| 4201 | | return LRESULT.NULL; |
|---|
| | 4201 | return null; |
|---|
| 4202 | 4202 | } |
|---|
| 4203 | 4203 | |
|---|
| … | … | |
| 4233 | 4233 | sendEvent (DWT.Move); |
|---|
| 4234 | 4234 | // widget could be disposed at this point |
|---|
| 4235 | | return LRESULT.NULL; |
|---|
| | 4235 | return null; |
|---|
| 4236 | 4236 | } |
|---|
| 4237 | 4237 | |
|---|
| 4238 | 4238 | LRESULT WM_NCACTIVATE (int wParam, int lParam) { |
|---|
| 4239 | | return LRESULT.NULL; |
|---|
| | 4239 | return null; |
|---|
| 4240 | 4240 | } |
|---|
| 4241 | 4241 | |
|---|
| 4242 | 4242 | LRESULT WM_NCCALCSIZE (int wParam, int lParam) { |
|---|
| 4243 | | return LRESULT.NULL; |
|---|
| | 4243 | return null; |
|---|
| 4244 | 4244 | } |
|---|
| 4245 | 4245 | |
|---|
| 4246 | 4246 | LRESULT WM_NCHITTEST (int wParam, int lParam) { |
|---|
| 4247 | | if (!OS.IsWindowEnabled (handle)) return LRESULT.NULL; |
|---|
| 4248 | | if (!isActive ()) return cast( LRESULT )(OS.HTTRANSPARENT); |
|---|
| 4249 | | return LRESULT.NULL; |
|---|
| | 4247 | if (!OS.IsWindowEnabled (handle)) return null; |
|---|
| | 4248 | if (!isActive ()) return new LRESULT (OS.HTTRANSPARENT); |
|---|
| | 4249 | return null; |
|---|
| 4250 | 4250 | } |
|---|
| 4251 | 4251 | |
|---|
| 4252 | 4252 | LRESULT WM_NCLBUTTONDOWN (int wParam, int lParam) { |
|---|
| 4253 | | return LRESULT.NULL; |
|---|
| | 4253 | return null; |
|---|
| 4254 | 4254 | } |
|---|
| 4255 | 4255 | |
|---|
| 4256 | 4256 | LRESULT WM_NCPAINT (int wParam, int lParam) { |
|---|
| 4257 | | return LRESULT.NULL; |
|---|
| | 4257 | return null; |
|---|
| 4258 | 4258 | } |
|---|
| 4259 | 4259 | |
|---|
| … | … | |
| 4268 | 4268 | |
|---|
| 4269 | 4269 | LRESULT WM_PALETTECHANGED (int wParam, int lParam) { |
|---|
| 4270 | | return LRESULT.NULL; |
|---|
| | 4270 | return null; |
|---|
| 4271 | 4271 | } |
|---|
| 4272 | 4272 | |
|---|
| 4273 | 4273 | LRESULT WM_PARENTNOTIFY (int wParam, int lParam) { |
|---|
| 4274 | | return LRESULT.NULL; |
|---|
| | 4274 | return null; |
|---|
| 4275 | 4275 | } |
|---|
| 4276 | 4276 | |
|---|
| 4277 | 4277 | LRESULT WM_PASTE (int wParam, int lParam) { |
|---|
| 4278 | | return LRESULT.NULL; |
|---|
| | 4278 | return null; |
|---|
| 4279 | 4279 | } |
|---|
| 4280 | 4280 | |
|---|
| … | … | |
| 4284 | 4284 | |
|---|
| 4285 | 4285 | LRESULT WM_PRINTCLIENT (int wParam, int lParam) { |
|---|
| 4286 | | return LRESULT.NULL; |
|---|
| | 4286 | return null; |
|---|
| 4287 | 4287 | } |
|---|
| 4288 | 4288 | |
|---|
| 4289 | 4289 | LRESULT WM_QUERYENDSESSION (int wParam, int lParam) { |
|---|
| 4290 | | return LRESULT.NULL; |
|---|
| | 4290 | return null; |
|---|
| 4291 | 4291 | } |
|---|
| 4292 | 4292 | |
|---|
| 4293 | 4293 | LRESULT WM_QUERYNEWPALETTE (int wParam, int lParam) { |
|---|
| 4294 | | return LRESULT.NULL; |
|---|
| | 4294 | return null; |
|---|
| 4295 | 4295 | } |
|---|
| 4296 | 4296 | |
|---|
| 4297 | 4297 | LRESULT WM_QUERYOPEN (int wParam, int lParam) { |
|---|
| 4298 | | return LRESULT.NULL; |
|---|
| | 4298 | return null; |
|---|
| 4299 | 4299 | } |
|---|
| 4300 | 4300 | |
|---|
| … | … | |
| 4315 | 4315 | if (hitTest is OS.HTCLIENT) { |
|---|
| 4316 | 4316 | Control control = display.getControl (cast(HANDLE)wParam); |
|---|
| 4317 | | if (control is null) return LRESULT.NULL; |
|---|
| | 4317 | if (control is null) return null; |
|---|
| 4318 | 4318 | Cursor cursor = control.findCursor (); |
|---|
| 4319 | 4319 | if (cursor !is null) { |
|---|
| … | … | |
| 4322 | 4322 | } |
|---|
| 4323 | 4323 | } |
|---|
| 4324 | | return LRESULT.NULL; |
|---|
| | 4324 | return null; |
|---|
| 4325 | 4325 | } |
|---|
| 4326 | 4326 | |
|---|
| … | … | |
| 4330 | 4330 | |
|---|
| 4331 | 4331 | LRESULT WM_SETTINGCHANGE (int wParam, int lParam) { |
|---|
| 4332 | | return LRESULT.NULL; |
|---|
| | 4332 | return null; |
|---|
| 4333 | 4333 | } |
|---|
| 4334 | 4334 | |
|---|
| 4335 | 4335 | LRESULT WM_SETFONT (int wParam, int lParam) { |
|---|
| 4336 | | return LRESULT.NULL; |
|---|
| | 4336 | return null; |
|---|
| 4337 | 4337 | } |
|---|
| 4338 | 4338 | |
|---|
| 4339 | 4339 | LRESULT WM_SETREDRAW (int wParam, int lParam) { |
|---|
| 4340 | | return LRESULT.NULL; |
|---|
| | 4340 | return null; |
|---|
| 4341 | 4341 | } |
|---|
| 4342 | 4342 | |
|---|
| 4343 | 4343 | LRESULT WM_SHOWWINDOW (int wParam, int lParam) { |
|---|
| 4344 | | return LRESULT.NULL; |
|---|
| | 4344 | return null; |
|---|
| 4345 | 4345 | } |
|---|
| 4346 | 4346 | |
|---|
| … | … | |
| 4348 | 4348 | sendEvent (DWT.Resize); |
|---|
| 4349 | 4349 | // widget could be disposed at this point |
|---|
| 4350 | | return LRESULT.NULL; |
|---|
| | 4350 | return null; |
|---|
| 4351 | 4351 | } |
|---|
| 4352 | 4352 | |
|---|
| … | … | |
| 4356 | 4356 | |
|---|
| 4357 | 4357 | LRESULT WM_SYSCOLORCHANGE (int wParam, int lParam) { |
|---|
| 4358 | | return LRESULT.NULL; |
|---|
| | 4358 | return null; |
|---|
| 4359 | 4359 | } |
|---|
| 4360 | 4360 | |
|---|
| … | … | |
| 4470 | 4470 | default: |
|---|
| 4471 | 4471 | } |
|---|
| 4472 | | return LRESULT.NULL; |
|---|
| | 4472 | return null; |
|---|
| 4473 | 4473 | } |
|---|
| 4474 | 4474 | |
|---|
| … | … | |
| 4482 | 4482 | |
|---|
| 4483 | 4483 | LRESULT WM_TIMER (int wParam, int lParam) { |
|---|
| 4484 | | return LRESULT.NULL; |
|---|
| | 4484 | return null; |
|---|
| 4485 | 4485 | } |
|---|
| 4486 | 4486 | |
|---|
| 4487 | 4487 | LRESULT WM_UNDO (int wParam, int lParam) { |
|---|
| 4488 | | return LRESULT.NULL; |
|---|
| | 4488 | return null; |
|---|
| 4489 | 4489 | } |
|---|
| 4490 | 4490 | |
|---|
| 4491 | 4491 | LRESULT WM_UPDATEUISTATE (int wParam, int lParam) { |
|---|
| 4492 | | return LRESULT.NULL; |
|---|
| | 4492 | return null; |
|---|
| 4493 | 4493 | } |
|---|
| 4494 | 4494 | |
|---|
| 4495 | 4495 | LRESULT WM_VSCROLL (int wParam, int lParam) { |
|---|
| 4496 | 4496 | Control control = display.getControl (cast(HANDLE)lParam); |
|---|
| 4497 | | if (control is null) return LRESULT.NULL; |
|---|
| | 4497 | if (control is null) return null; |
|---|
| 4498 | 4498 | return control.wmScrollChild (wParam, lParam); |
|---|
| 4499 | 4499 | } |
|---|
| 4500 | 4500 | |
|---|
| 4501 | 4501 | LRESULT WM_WINDOWPOSCHANGED (int wParam, int lParam) { |
|---|
| 4502 | | return LRESULT.NULL; |
|---|
| | 4502 | return null; |
|---|
| 4503 | 4503 | } |
|---|
| 4504 | 4504 | |
|---|
| … | … | |
| 4523 | 4523 | } |
|---|
| 4524 | 4524 | } |
|---|
| 4525 | | return LRESULT.NULL; |
|---|
| | 4525 | return null; |
|---|
| 4526 | 4526 | } |
|---|
| 4527 | 4527 | |
|---|
| … | … | |
| 4551 | 4551 | fillThemeBackground (cast(HANDLE)wParam, control, &rect); |
|---|
| 4552 | 4552 | OS.SetBkMode (cast(HANDLE)wParam, OS.TRANSPARENT); |
|---|
| 4553 | | return cast( LRESULT )(OS.GetStockObject (OS.NULL_BRUSH)); |
|---|
| | 4553 | return new LRESULT ( cast(int) OS.GetStockObject (OS.NULL_BRUSH)); |
|---|
| 4554 | 4554 | } |
|---|
| 4555 | 4555 | } |
|---|
| 4556 | 4556 | } |
|---|
| 4557 | | if (foreground is -1) return LRESULT.NULL; |
|---|
| | 4557 | if (foreground is -1) return null; |
|---|
| 4558 | 4558 | } |
|---|
| 4559 | 4559 | if (control is null) control = this; |
|---|
| … | … | |
| 4579 | 4579 | } |
|---|
| 4580 | 4580 | OS.SetBkMode (cast(HANDLE)wParam, OS.TRANSPARENT); |
|---|
| 4581 | | return cast( LRESULT )(hBrush); |
|---|
| | 4581 | return new LRESULT ( cast(int) hBrush); |
|---|
| 4582 | 4582 | } |
|---|
| 4583 | 4583 | auto hBrush = findBrush (backPixel, OS.BS_SOLID); |
|---|
| … | … | |
| 4589 | 4589 | OS.SelectObject (cast(HANDLE)wParam, hOldBrush); |
|---|
| 4590 | 4590 | } |
|---|
| 4591 | | return cast( LRESULT )(hBrush); |
|---|
| | 4591 | return new LRESULT ( cast(int) hBrush); |
|---|
| 4592 | 4592 | } |
|---|
| 4593 | 4593 | |
|---|
| 4594 | 4594 | LRESULT wmCommandChild (int wParam, int lParam) { |
|---|
| 4595 | | return LRESULT.NULL; |
|---|
| | 4595 | return null; |
|---|
| 4596 | 4596 | } |
|---|
| 4597 | 4597 | |
|---|
| 4598 | 4598 | LRESULT wmDrawChild (int wParam, int lParam) { |
|---|
| 4599 | | return LRESULT.NULL; |
|---|
| | 4599 | return null; |
|---|
| 4600 | 4600 | } |
|---|
| 4601 | 4601 | |
|---|
| 4602 | 4602 | LRESULT wmMeasureChild (int wParam, int lParam) { |
|---|
| 4603 | | return LRESULT.NULL; |
|---|
| | 4603 | return null; |
|---|
| 4604 | 4604 | } |
|---|
| 4605 | 4605 | |
|---|
| 4606 | 4606 | LRESULT wmNotify (NMHDR* hdr, int wParam, int lParam) { |
|---|
| 4607 | 4607 | Control control = display.getControl (hdr.hwndFrom); |
|---|
| 4608 | | if (control is null) return LRESULT.NULL; |
|---|
| | 4608 | if (control is null) return null; |
|---|
| 4609 | 4609 | return control.wmNotifyChild (hdr, wParam, lParam); |
|---|
| 4610 | 4610 | } |
|---|
| 4611 | 4611 | |
|---|
| 4612 | 4612 | LRESULT wmNotifyChild (NMHDR* hdr, int wParam, int lParam) { |
|---|
| 4613 | | return LRESULT.NULL; |
|---|
| | 4613 | return null; |
|---|
| 4614 | 4614 | } |
|---|
| 4615 | 4615 | |
|---|
| 4616 | 4616 | LRESULT wmScrollChild (int wParam, int lParam) { |
|---|
| 4617 | | return LRESULT.NULL; |
|---|
| 4618 | | } |
|---|
| 4619 | | |
|---|
| 4620 | | } |
|---|
| | 4617 | return null; |
|---|
| | 4618 | } |
|---|
| | 4619 | |
|---|
| | 4620 | } |
|---|
| r108 |
r109 |
|
| 1963 | 1963 | // checkWidget (); |
|---|
| 1964 | 1964 | if (!OS.IsWindowVisible (handle)) return; |
|---|
| 1965 | | if (OS.IsWinCE) { |
|---|
| | 1965 | static if (OS.IsWinCE) { |
|---|
| 1966 | 1966 | OS.InvalidateRect (handle, null, true); |
|---|
| 1967 | 1967 | } else { |
|---|
| … | … | |
| 2007 | 2007 | RECT rect; |
|---|
| 2008 | 2008 | OS.SetRect (&rect, x, y, x + width, y + height); |
|---|
| 2009 | | if (OS.IsWinCE) { |
|---|
| | 2009 | static if (OS.IsWinCE) { |
|---|
| 2010 | 2010 | OS.InvalidateRect (handle, &rect, true); |
|---|
| 2011 | 2011 | } else { |
|---|
| … | … | |
| 2502 | 2502 | |
|---|
| 2503 | 2503 | void setBackgroundImage (HBITMAP hBitmap) { |
|---|
| 2504 | | if (OS.IsWinCE) { |
|---|
| | 2504 | static if (OS.IsWinCE) { |
|---|
| 2505 | 2505 | OS.InvalidateRect (handle, null, true); |
|---|
| 2506 | 2506 | } else { |
|---|
| … | … | |
| 2511 | 2511 | |
|---|
| 2512 | 2512 | void setBackgroundPixel (int pixel) { |
|---|
| 2513 | | if (OS.IsWinCE) { |
|---|
| | 2513 | static if (OS.IsWinCE) { |
|---|
| 2514 | 2514 | OS.InvalidateRect (handle, null, true); |
|---|
| 2515 | 2515 | } else { |
|---|
| … | … | |
| 2874 | 2874 | * not running on WinCE. |
|---|
| 2875 | 2875 | */ |
|---|
| 2876 | | if (!OS.IsWinCE) flags |= OS.SWP_DRAWFRAME; |
|---|
| | 2876 | static if (!OS.IsWinCE) flags |= OS.SWP_DRAWFRAME; |
|---|
| 2877 | 2877 | setBounds (x, y, 0, 0, flags); |
|---|
| 2878 | 2878 | } |
|---|
| … | … | |
| 2993 | 2993 | if (handle !is topHandle_) OS.ShowWindow (handle, OS.SW_HIDE); |
|---|
| 2994 | 2994 | } else { |
|---|
| 2995 | | if (OS.IsWinCE) { |
|---|
| | 2995 | static if (OS.IsWinCE) { |
|---|
| 2996 | 2996 | OS.InvalidateRect (topHandle_, null, true); |
|---|
| 2997 | 2997 | if (handle !is topHandle_) OS.InvalidateRect (handle, null, true); |
|---|
| … | … | |
| 3579 | 3579 | void update (bool all) { |
|---|
| 3580 | 3580 | // checkWidget (); |
|---|
| 3581 | | if (OS.IsWinCE) { |
|---|
| | 3581 | static if (OS.IsWinCE) { |
|---|
| 3582 | 3582 | OS.UpdateWindow (handle); |
|---|
| 3583 | 3583 | } else { |
|---|
| … | … | |
| 3932 | 3932 | |
|---|
| 3933 | 3933 | LRESULT WM_HELP (int wParam, int lParam) { |
|---|
| 3934 | | if (OS.IsWinCE) return null; |
|---|
| | 3934 | static if (OS.IsWinCE) return null; |
|---|
| 3935 | 3935 | HELPINFO* lphi = cast(HELPINFO*)lParam; |
|---|
| 3936 | 3936 | Decorations shell = menuShell (); |
|---|
| r107 |
r109 |
|
| 36 | 36 | |
|---|
| 37 | 37 | import dwt.dwthelper.utils; |
|---|
| | 38 | import tango.util.log.Trace; |
|---|
| | 39 | void trc( long line ){ |
|---|
| | 40 | //Trace.formatln( "ExpandBar {}", line ); |
|---|
| | 41 | } |
|---|
| 38 | 42 | |
|---|
| 39 | 43 | /** |
|---|
| … | … | |
| 132 | 136 | } |
|---|
| 133 | 137 | |
|---|
| 134 | | override LRESULT callWindowProc (HWND hwnd, int msg, int wParam, int lParam) { |
|---|
| 135 | | if (handle is null) return LRESULT.ZERO; |
|---|
| | 138 | override int callWindowProc (HWND hwnd, int msg, int wParam, int lParam) { |
|---|
| | 139 | if (handle is null) return 0; |
|---|
| 136 | 140 | return cast(LRESULT) OS.DefWindowProc (hwnd, msg, wParam, lParam); |
|---|
| 137 | 141 | } |
|---|
| … | … | |
| 588 | 592 | |
|---|
| 589 | 593 | override LRESULT WM_KEYDOWN (int wParam, int lParam) { |
|---|
| | 594 | trc(__LINE__); |
|---|
| 590 | 595 | LRESULT result = super.WM_KEYDOWN (wParam, lParam); |
|---|
| 591 | | if (result !is LRESULT.NULL) return result; |
|---|
| | 596 | if (result !is null) return result; |
|---|
| 592 | 597 | if (focusItem is null) return result; |
|---|
| 593 | 598 | switch (wParam) { |
|---|
| … | … | |
| 626 | 631 | |
|---|
| 627 | 632 | override LRESULT WM_KILLFOCUS (int wParam, int lParam) { |
|---|
| | 633 | trc(__LINE__); |
|---|
| 628 | 634 | LRESULT result = super.WM_KILLFOCUS (wParam, lParam); |
|---|
| 629 | 635 | if (focusItem !is null) focusItem.redraw (true); |
|---|
| … | … | |
| 632 | 638 | |
|---|
| 633 | 639 | override LRESULT WM_LBUTTONDOWN (int wParam, int lParam) { |
|---|
| | 640 | //trc(__LINE__); |
|---|
| 634 | 641 | LRESULT result = super.WM_LBUTTONDOWN (wParam, lParam); |
|---|
| 635 | 642 | if (result is LRESULT.ZERO) return result; |
|---|
| … | … | |
| 668 | 675 | |
|---|
| 669 | 676 | override LRESULT WM_MOUSELEAVE (int wParam, int lParam) { |
|---|
| | 677 | trc(__LINE__); |
|---|
| 670 | 678 | LRESULT result = super.WM_MOUSELEAVE (wParam, lParam); |
|---|
| 671 | | if (result !is LRESULT.NULL) return result; |
|---|
| | 679 | if (result !is null) return result; |
|---|
| 672 | 680 | for (int i = 0; i < itemCount; i++) { |
|---|
| 673 | 681 | ExpandItem item = items [i]; |
|---|
| … | … | |
| 682 | 690 | |
|---|
| 683 | 691 | override LRESULT WM_MOUSEMOVE (int wParam, int lParam) { |
|---|
| | 692 | trc(__LINE__); |
|---|
| 684 | 693 | LRESULT result = super.WM_MOUSEMOVE (wParam, lParam); |
|---|
| 685 | 694 | if (result is LRESULT.ZERO) return result; |
|---|
| … | … | |
| 698 | 707 | |
|---|
| 699 | 708 | override LRESULT WM_PAINT (int wParam, int lParam) { |
|---|
| | 709 | trc(__LINE__); |
|---|
| 700 | 710 | PAINTSTRUCT ps; |
|---|
| 701 | 711 | GCData data = new GCData (); |
|---|
| … | … | |
| 727 | 737 | |
|---|
| 728 | 738 | override LRESULT WM_PRINTCLIENT (int wParam, int lParam) { |
|---|
| | 739 | trc(__LINE__); |
|---|
| 729 | 740 | LRESULT result = super.WM_PRINTCLIENT (wParam, lParam); |
|---|
| 730 | 741 | RECT rect; |
|---|
| … | … | |
| 740 | 751 | |
|---|
| 741 | 752 | override LRESULT WM_SETCURSOR (int wParam, int lParam) { |
|---|
| | 753 | trc(__LINE__); |
|---|
| 742 | 754 | LRESULT result = super.WM_SETCURSOR (wParam, lParam); |
|---|
| 743 | | if (result !is LRESULT.NULL) return result; |
|---|
| | 755 | if (result !is null) return result; |
|---|
| 744 | 756 | int hitTest = lParam & 0xFFFF; |
|---|
| 745 | 757 | if (hitTest is OS.HTCLIENT) { |
|---|
| … | … | |
| 757 | 769 | |
|---|
| 758 | 770 | override LRESULT WM_SETFOCUS (int wParam, int lParam) { |
|---|
| | 771 | trc(__LINE__); |
|---|
| 759 | 772 | LRESULT result = super.WM_SETFOCUS (wParam, lParam); |
|---|
| 760 | 773 | if (focusItem !is null) focusItem.redraw (true); |
|---|
| … | … | |
| 763 | 776 | |
|---|
| 764 | 777 | override LRESULT WM_SIZE (int wParam, int lParam) { |
|---|
| | 778 | trc(__LINE__); |
|---|
| 765 | 779 | LRESULT result = super.WM_SIZE (wParam, lParam); |
|---|
| 766 | 780 | RECT rect; |
|---|
| … | … | |
| 777 | 791 | |
|---|
| 778 | 792 | override LRESULT wmScroll (ScrollBar bar, bool update, HWND hwnd, int msg, int wParam, int lParam) { |
|---|
| | 793 | trc(__LINE__); |
|---|
| 779 | 794 | LRESULT result = super.wmScroll (bar, true, hwnd, msg, wParam, lParam); |
|---|
| 780 | 795 | SCROLLINFO info; |
|---|
| r108 |
r109 |
|
| 165 | 165 | hCurrentFont = hFont; |
|---|
| 166 | 166 | } else { |
|---|
| 167 | | if (!OS.IsWinCE) { |
|---|
| | 167 | static if (!OS.IsWinCE) { |
|---|
| 168 | 168 | NONCLIENTMETRICS info; |
|---|
| 169 | 169 | info.cbSize = NONCLIENTMETRICS.sizeof; |
|---|
| … | … | |
| 288 | 288 | HFONT hCaptionFont, oldFont; |
|---|
| 289 | 289 | if (hTheme is null) { |
|---|
| 290 | | if (!OS.IsWinCE && hFont is null) { |
|---|
| 291 | | NONCLIENTMETRICS info; |
|---|
| 292 | | info.cbSize = NONCLIENTMETRICS.sizeof; |
|---|
| 293 | | if (OS.SystemParametersInfo (OS.SPI_GETNONCLIENTMETRICS, 0, &info, 0)) { |
|---|
| 294 | | LOGFONT* logFont = &info.lfCaptionFont; |
|---|
| 295 | | hCaptionFont = OS.CreateFontIndirect (logFont); |
|---|
| 296 | | oldFont = OS.SelectObject (gc.handle, hCaptionFont); |
|---|
| | 290 | static if (!OS.IsWinCE ) { |
|---|
| | 291 | if (hFont is null) { |
|---|
| | 292 | NONCLIENTMETRICS info; |
|---|
| | 293 | info.cbSize = NONCLIENTMETRICS.sizeof; |
|---|
| | 294 | if (OS.SystemParametersInfo (OS.SPI_GETNONCLIENTMETRICS, 0, &info, 0)) { |
|---|
| | 295 | LOGFONT* logFont = &info.lfCaptionFont; |
|---|
| | 296 | hCaptionFont = OS.CreateFontIndirect (logFont); |
|---|
| | 297 | oldFont = OS.SelectObject (gc.handle, hCaptionFont); |
|---|
| | 298 | } |
|---|
| 297 | 299 | } |
|---|
| 298 | 300 | } |
|---|
| … | … | |
| 498 | 500 | override void setBackgroundPixel (int pixel) { |
|---|
| 499 | 501 | super.setBackgroundPixel (pixel); |
|---|
| 500 | | if (!OS.IsWinCE) { |
|---|
| | 502 | static if (!OS.IsWinCE) { |
|---|
| 501 | 503 | int flags = OS.RDW_ERASE | OS.RDW_FRAME | OS.RDW_INVALIDATE | OS.RDW_ALLCHILDREN; |
|---|
| 502 | 504 | OS.RedrawWindow (handle, null, null, flags); |
|---|
| … | … | |
| 512 | 514 | override void setForegroundPixel (int pixel) { |
|---|
| 513 | 515 | super.setForegroundPixel (pixel); |
|---|
| 514 | | if (!OS.IsWinCE) { |
|---|
| | 516 | static if (!OS.IsWinCE) { |
|---|
| 515 | 517 | int flags = OS.RDW_ERASE | OS.RDW_FRAME | OS.RDW_INVALIDATE | OS.RDW_ALLCHILDREN; |
|---|
| 516 | 518 | OS.RedrawWindow (handle, null, null, flags); |
|---|
| r107 |
r109 |
|
| 33 | 33 | import tango.util.log.Trace; |
|---|
| 34 | 34 | void trc( long line ){ |
|---|
| 35 | | //Trace.formatln( "Widget {}", line ); |
|---|
| | 35 | // Trace.formatln( "Widget {}", line ); |
|---|
| 36 | 36 | } |
|---|
| 37 | 37 | |
|---|
| … | … | |
| 65 | 65 | public abstract class Widget { |
|---|
| 66 | 66 | |
|---|
| 67 | | public enum LRESULT { |
|---|
| 68 | | NULL = -1, |
|---|
| 69 | | ZERO = 0, |
|---|
| 70 | | ONE = 1, |
|---|
| 71 | | } |
|---|
| 72 | | |
|---|
| 73 | | |
|---|
| 74 | 67 | int style, state; |
|---|
| 75 | 68 | Display display; |
|---|
| 76 | 69 | EventTable eventTable; |
|---|
| 77 | 70 | Object data; |
|---|
| | 71 | |
|---|
| | 72 | public alias dwt.internal.win32.OS.LDWTRESULT LRESULT; |
|---|
| 78 | 73 | |
|---|
| 79 | 74 | /* Global state flags */ |
|---|
| … | … | |
| 238 | 233 | } |
|---|
| 239 | 234 | |
|---|
| 240 | | LRESULT callWindowProc (HWND hwnd, int msg, int wParam, int lParam) { |
|---|
| 241 | | return LRESULT.ZERO; |
|---|
| | 235 | int callWindowProc (HWND hwnd, int msg, int wParam, int lParam) { |
|---|
| | 236 | return 0; |
|---|
| 242 | 237 | } |
|---|
| 243 | 238 | |
|---|
| … | … | |
| 1313 | 1308 | LRESULT wmCaptureChanged (HWND hwnd, int wParam, int lParam) { |
|---|
| 1314 | 1309 | display.captureChanged = true; |
|---|
| 1315 | | return LRESULT.NULL; |
|---|
| | 1310 | return null; |
|---|
| 1316 | 1311 | } |
|---|
| 1317 | 1312 | |
|---|
| … | … | |
| 1322 | 1317 | if (!OS.IsUnicode && OS.IsDBLocale) { |
|---|
| 1323 | 1318 | byte lead = cast(byte) (wParam & 0xFF); |
|---|
| 1324 | | if (OS.IsDBCSLeadByte (lead)) return LRESULT.NULL; |
|---|
| | 1319 | if (OS.IsDBCSLeadByte (lead)) return null; |
|---|
| 1325 | 1320 | } |
|---|
| 1326 | 1321 | display.lastAscii = wParam; |
|---|
| … | … | |
| 1330 | 1325 | } |
|---|
| 1331 | 1326 | // widget could be disposed at this point |
|---|
| 1332 | | return LRESULT.NULL; |
|---|
| | 1327 | return null; |
|---|
| 1333 | 1328 | } |
|---|
| 1334 | 1329 | |
|---|
| 1335 | 1330 | LRESULT wmContextMenu (HWND hwnd, int wParam, int lParam) { |
|---|
| 1336 | | if (wParam !is cast(int)hwnd) return LRESULT.NULL; |
|---|
| | 1331 | if (wParam !is cast(int)hwnd) return null; |
|---|
| 1337 | 1332 | |
|---|
| 1338 | 1333 | /* |
|---|
| … | … | |
| 1347 | 1342 | * not support WM_CONTEXTMENU. |
|---|
| 1348 | 1343 | */ |
|---|
| 1349 | | static if (OS.IsWinCE) return LRESULT.NULL; |
|---|
| | 1344 | static if (OS.IsWinCE) return null; |
|---|
| 1350 | 1345 | |
|---|
| 1351 | 1346 | /* |
|---|
| … | … | |
| 1368 | 1363 | RECT rect; |
|---|
| 1369 | 1364 | OS.GetClientRect (hwnd, &rect); |
|---|
| 1370 | | if (!OS.PtInRect (&rect, pt)) return LRESULT.NULL; |
|---|
| | 1365 | if (!OS.PtInRect (&rect, pt)) return null; |
|---|
| 1371 | 1366 | } else { |
|---|
| 1372 | 1367 | int pos = OS.GetMessagePos (); |
|---|
| … | … | |
| 1376 | 1371 | |
|---|
| 1377 | 1372 | /* Show the menu */ |
|---|
| 1378 | | return showMenu (x, y) ? LRESULT.ZERO : LRESULT.NULL; |
|---|
| | 1373 | return showMenu (x, y) ? LRESULT.ZERO : null; |
|---|
| 1379 | 1374 | } |
|---|
| 1380 | 1375 | |
|---|
| … | … | |
| 1403 | 1398 | case OS.VK_NUMLOCK: |
|---|
| 1404 | 1399 | case OS.VK_SCROLL: |
|---|
| 1405 | | if ((lParam & 0x40000000) !is 0) return LRESULT.NULL; |
|---|
| | 1400 | if ((lParam & 0x40000000) !is 0) return null; |
|---|
| 1406 | 1401 | default: |
|---|
| 1407 | 1402 | } |
|---|
| … | … | |
| 1416 | 1411 | if (!OS.IsUnicode && OS.IsDBLocale) { |
|---|
| 1417 | 1412 | byte lead = cast(byte) (wParam & 0xFF); |
|---|
| 1418 | | if (OS.IsDBCSLeadByte (lead)) return LRESULT.NULL; |
|---|
| | 1413 | if (OS.IsDBCSLeadByte (lead)) return null; |
|---|
| 1419 | 1414 | } |
|---|
| 1420 | 1415 | |
|---|
| … | … | |
| 1461 | 1456 | */ |
|---|
| 1462 | 1457 | if (OS.IsWinNT) { |
|---|
| 1463 | | if ((mapKey & 0x80000000) !is 0) return LRESULT.NULL; |
|---|
| 1464 | | } else { |
|---|
| 1465 | | if ((mapKey & 0x8000) !is 0) return LRESULT.NULL; |
|---|
| | 1458 | if ((mapKey & 0x80000000) !is 0) return null; |
|---|
| | 1459 | } else { |
|---|
| | 1460 | if ((mapKey & 0x8000) !is 0) return null; |
|---|
| 1466 | 1461 | } |
|---|
| 1467 | 1462 | MSG msg; |
|---|
| … | … | |
| 1471 | 1466 | display.lastVirtual = mapKey is 0; |
|---|
| 1472 | 1467 | display.lastKey = display.lastVirtual ? wParam : mapKey; |
|---|
| 1473 | | return LRESULT.NULL; |
|---|
| | 1468 | return null; |
|---|
| 1474 | 1469 | } |
|---|
| 1475 | 1470 | |
|---|
| … | … | |
| 1537 | 1532 | * ALT+0231 should gives 'c' with a cedilla when NumLock is down). |
|---|
| 1538 | 1533 | */ |
|---|
| 1539 | | if (display.asciiKey (display.lastKey) !is 0) return LRESULT.NULL; |
|---|
| | 1534 | if (display.asciiKey (display.lastKey) !is 0) return null; |
|---|
| 1540 | 1535 | display.lastAscii = display.numpadKey (display.lastKey); |
|---|
| 1541 | 1536 | } |
|---|
| … | … | |
| 1575 | 1570 | * issue the event from WM_CHAR. |
|---|
| 1576 | 1571 | */ |
|---|
| 1577 | | if (asciiKey is ' ') return LRESULT.NULL; |
|---|
| 1578 | | if (asciiKey !is wParam) return LRESULT.NULL; |
|---|
| | 1572 | if (asciiKey is ' ') return null; |
|---|
| | 1573 | if (asciiKey !is wParam) return null; |
|---|
| 1579 | 1574 | /* |
|---|
| 1580 | 1575 | * Feature in Windows. The virtual key VK_CANCEL is treated |
|---|
| … | … | |
| 1584 | 1579 | * VK_CANCEL and issue the event from WM_CHAR. |
|---|
| 1585 | 1580 | */ |
|---|
| 1586 | | if (wParam is OS.VK_CANCEL) return LRESULT.NULL; |
|---|
| | 1581 | if (wParam is OS.VK_CANCEL) return null; |
|---|
| 1587 | 1582 | } |
|---|
| 1588 | 1583 | |
|---|
| … | … | |
| 1593 | 1588 | * key event from WM_CHAR. |
|---|
| 1594 | 1589 | */ |
|---|
| 1595 | | if (OS.GetKeyState (OS.VK_CONTROL) >= 0) return LRESULT.NULL; |
|---|
| | 1590 | if (OS.GetKeyState (OS.VK_CONTROL) >= 0) return null; |
|---|
| 1596 | 1591 | |
|---|
| 1597 | 1592 | /* |
|---|
| … | … | |
| 1610 | 1605 | |
|---|
| 1611 | 1606 | /* Note that Ctrl+'@' is ASCII NUL and is delivered in WM_CHAR */ |
|---|
| 1612 | | if (display.lastAscii is '@') return LRESULT.NULL; |
|---|
| | 1607 | if (display.lastAscii is '@') return null; |
|---|
| 1613 | 1608 | display.lastAscii = display.controlKey (display.lastAscii); |
|---|
| 1614 | 1609 | } |
|---|
| … | … | |
| 1617 | 1612 | } |
|---|
| 1618 | 1613 | // widget could be disposed at this point |
|---|
| 1619 | | return LRESULT.NULL; |
|---|
| | 1614 | return null; |
|---|
| 1620 | 1615 | } |
|---|
| 1621 | 1616 | |
|---|
| … | … | |
| 1634 | 1629 | if (setInputState (event, type)) sendEvent (type, event); |
|---|
| 1635 | 1630 | // widget could be disposed at this point |
|---|
| 1636 | | return LRESULT.NULL; |
|---|
| | 1631 | return null; |
|---|
| 1637 | 1632 | } |
|---|
| 1638 | 1633 | } |
|---|
| … | … | |
| 1645 | 1640 | display.lastKey = display.lastAscii = 0; |
|---|
| 1646 | 1641 | display.lastVirtual = display.lastNull = display.lastDead = false; |
|---|
| 1647 | | return LRESULT.NULL; |
|---|
| | 1642 | return null; |
|---|
| 1648 | 1643 | } |
|---|
| 1649 | 1644 | |
|---|
| … | … | |
| 1683 | 1678 | */ |
|---|
| 1684 | 1679 | if (OS.IsWinNT) { |
|---|
| 1685 | | if ((mapKey & 0x80000000) !is 0) return LRESULT.NULL; |
|---|
| 1686 | | } else { |
|---|
| 1687 | | if ((mapKey & 0x8000) !is 0) return LRESULT.NULL; |
|---|
| 1688 | | } |
|---|
| 1689 | | if (display.lastDead) return LRESULT.NULL; |
|---|
| | 1680 | if ((mapKey & 0x80000000) !is 0) return null; |
|---|
| | 1681 | } else { |
|---|
| | 1682 | if ((mapKey & 0x8000) !is 0) return null; |
|---|
| | 1683 | } |
|---|
| | 1684 | if (display.lastDead) return null; |
|---|
| 1690 | 1685 | |
|---|
| 1691 | 1686 | /* |
|---|
| … | … | |
| 1710 | 1705 | display.lastAscii = 0; |
|---|
| 1711 | 1706 | display.lastNull = display.lastDead = false; |
|---|
| 1712 | | return LRESULT.NULL; |
|---|
| 1713 | | } |
|---|
| 1714 | | } |
|---|
| 1715 | | LRESULT result = LRESULT.NULL; |
|---|
| | 1707 | return null; |
|---|
| | 1708 | } |
|---|
| | 1709 | } |
|---|
| | 1710 | LRESULT result = null; |
|---|
| 1716 | 1711 | if (!sendKeyEvent (DWT.KeyUp, OS.WM_KEYUP, wParam, lParam)) { |
|---|
| 1717 | 1712 | result = LRESULT.ONE; |
|---|
| … | … | |
| 1724 | 1719 | |
|---|
| 1725 | 1720 | LRESULT wmKillFocus (HWND hwnd, int wParam, int lParam) { |
|---|
| 1726 | | LRESULT code = callWindowProc (hwnd, OS.WM_KILLFOCUS, wParam, lParam); |
|---|
| 1727 | | assert( code !is LRESULT.NULL ); |
|---|
| | 1721 | int code = callWindowProc (hwnd, OS.WM_KILLFOCUS, wParam, lParam); |
|---|
| 1728 | 1722 | sendFocusEvent (DWT.FocusOut); |
|---|
| 1729 | 1723 | // widget could be disposed at this point |
|---|
| … | … | |
| 1738 | 1732 | if (isDisposed ()) return LRESULT.ZERO; |
|---|
| 1739 | 1733 | if (code is 0) return LRESULT.ZERO; |
|---|
| 1740 | | return cast(LRESULT) code; |
|---|
| | 1734 | return new LRESULT(code); |
|---|
| 1741 | 1735 | } |
|---|
| 1742 | 1736 | |
|---|
| … | … | |
| 1755 | 1749 | * fix is to send a mouse down event. |
|---|
| 1756 | 1750 | */ |
|---|
| 1757 | | LRESULT result = LRESULT.NULL; |
|---|
| | 1751 | LRESULT result = null; |
|---|
| 1758 | 1752 | Display display = this.display; |
|---|
| 1759 | 1753 | display.captureChanged = false; |
|---|
| 1760 | 1754 | sendMouseEvent (DWT.MouseDown, 1, hwnd, OS.WM_LBUTTONDOWN, wParam, lParam); |
|---|
| 1761 | 1755 | if (sendMouseEvent (DWT.MouseDoubleClick, 1, hwnd, OS.WM_LBUTTONDBLCLK, wParam, lParam)) { |
|---|
| 1762 | | result = callWindowProc (hwnd, OS.WM_LBUTTONDBLCLK, wParam, lParam); |
|---|
| 1763 | | assert( result !is LRESULT.NULL ); |
|---|
| | 1756 | result = new LRESULT( callWindowProc (hwnd, OS.WM_LBUTTONDBLCLK, wParam, lParam)); |
|---|
| 1764 | 1757 | } else { |
|---|
| 1765 | 1758 | result = LRESULT.ZERO; |
|---|
| … | … | |
| 1773 | 1766 | LRESULT wmLButtonDown (HWND hwnd, int wParam, int lParam) { |
|---|
| 1774 | 1767 | Display display = this.display; |
|---|
| 1775 | | LRESULT result = LRESULT.NULL; |
|---|
| | 1768 | LRESULT result = null; |
|---|
| 1776 | 1769 | int x = cast(short) (lParam & 0xFFFF); |
|---|
| 1777 | 1770 | int y = cast(short) (lParam >> 16); |
|---|
| … | … | |
| 1799 | 1792 | bool dispatch = sendMouseEvent (DWT.MouseDown, 1, count, 0, false, hwnd, OS.WM_LBUTTONDOWN, wParam, lParam); |
|---|
| 1800 | 1793 | if (dispatch && (consume is null || !consume [0])) { |
|---|
| 1801 | | result = callWindowProc (hwnd, OS.WM_LBUTTONDOWN, wParam, lParam); |
|---|
| 1802 | | assert( result !is LRESULT.NULL ); |
|---|
| | 1794 | result = new LRESULT( callWindowProc (hwnd, OS.WM_LBUTTONDOWN, wParam, lParam)); |
|---|
| 1803 | 1795 | } else { |
|---|
| 1804 | 1796 | result = LRESULT.ZERO; |
|---|
| … | … | |
| 1864 | 1856 | LRESULT wmLButtonUp (HWND hwnd, int wParam, int lParam) { |
|---|
| 1865 | 1857 | Display display = this.display; |
|---|
| 1866 | | LRESULT result = LRESULT.NULL; |
|---|
| | 1858 | LRESULT result = null; |
|---|
| | 1859 | trc(__LINE__); |
|---|
| 1867 | 1860 | if (sendMouseEvent (DWT.MouseUp, 1, hwnd, OS.WM_LBUTTONUP, wParam, lParam)) { |
|---|
| 1868 | | result = callWindowProc (hwnd, OS.WM_LBUTTONUP, wParam, lParam); |
|---|
| 1869 | | assert( result !is LRESULT.NULL ); |
|---|
| | 1861 | trc(__LINE__); |
|---|
| | 1862 | result = new LRESULT( callWindowProc (hwnd, OS.WM_LBUTTONUP, wParam, lParam)); |
|---|
| 1870 | 1863 | } else { |
|---|
| 1871 | 1864 | result = LRESULT.ZERO; |
|---|
| … | … | |
| 1882 | 1875 | if (OS.GetCapture () is hwnd) OS.ReleaseCapture (); |
|---|
| 1883 | 1876 | } |
|---|
| | 1877 | Trace.formatln( "result={}", result ); |
|---|
| 1884 | 1878 | return result; |
|---|
| 1885 | 1879 | } |
|---|
| … | … | |
| 1899 | 1893 | * fix is to send a mouse down event. |
|---|
| 1900 | 1894 | */ |
|---|
| 1901 | | LRESULT result = LRESULT.NULL; |
|---|
| | 1895 | LRESULT result = null; |
|---|
| 1902 | 1896 | Display display = this.display; |
|---|
| 1903 | 1897 | display.captureChanged = false; |
|---|
| 1904 | 1898 | sendMouseEvent (DWT.MouseDown, 2, hwnd, OS.WM_MBUTTONDOWN, wParam, lParam); |
|---|
| 1905 | 1899 | if (sendMouseEvent (DWT.MouseDoubleClick, 2, hwnd, OS.WM_MBUTTONDBLCLK, wParam, lParam)) { |
|---|
| 1906 | | result = callWindowProc (hwnd, OS.WM_MBUTTONDBLCLK, wParam, lParam); |
|---|
| 1907 | | assert( result !is LRESULT.NULL ); |
|---|
| | 1900 | result = new LRESULT( callWindowProc (hwnd, OS.WM_MBUTTONDBLCLK, wParam, lParam)); |
|---|
| 1908 | 1901 | } else { |
|---|
| 1909 | 1902 | result = LRESULT.ZERO; |
|---|
| … | … | |
| 1916 | 1909 | |
|---|
| 1917 | 1910 | LRESULT wmMButtonDown (HWND hwnd, int wParam, int lParam) { |
|---|
| 1918 | | LRESULT result = LRESULT.NULL; |
|---|
| | 1911 | LRESULT result = null; |
|---|
| 1919 | 1912 | Display display = this.display; |
|---|
| 1920 | 1913 | display.captureChanged = false; |
|---|
| 1921 | 1914 | if (sendMouseEvent (DWT.MouseDown, 2, hwnd, OS.WM_MBUTTONDOWN, wParam, lParam)) { |
|---|
| 1922 | | result = callWindowProc (hwnd, OS.WM_MBUTTONDOWN, wParam, lParam); |
|---|
| 1923 | | assert( result !is LRESULT.NULL ); |
|---|
| | 1915 | result = new LRESULT( callWindowProc (hwnd, OS.WM_MBUTTONDOWN, wParam, lParam)); |
|---|
| 1924 | 1916 | } else { |
|---|
| 1925 | 1917 | result = LRESULT.ZERO; |
|---|
| … | … | |
| 1933 | 1925 | LRESULT wmMButtonUp (HWND hwnd, int wParam, int lParam) { |
|---|
| 1934 | 1926 | Display display = this.display; |
|---|
| 1935 | | LRESULT result = LRESULT.NULL; |
|---|
| | 1927 | LRESULT result = null; |
|---|
| 1936 | 1928 | if (sendMouseEvent (DWT.MouseUp, 2, hwnd, OS.WM_MBUTTONUP, wParam, lParam)) { |
|---|
| 1937 | | result = callWindowProc (hwnd, OS.WM_MBUTTONUP, wParam, lParam); |
|---|
| 1938 | | assert( result !is LRESULT.NULL ); |
|---|
| | 1929 | result = new LRESULT( callWindowProc (hwnd, OS.WM_MBUTTONUP, wParam, lParam)); |
|---|
| 1939 | 1930 | } else { |
|---|
| 1940 | 1931 | result = LRESULT.ZERO; |
|---|
| … | … | |
| 1958 | 1949 | return LRESULT.ZERO; |
|---|
| 1959 | 1950 | } |
|---|
| 1960 | | return LRESULT.NULL; |
|---|
| | 1951 | return null; |
|---|
| 1961 | 1952 | } |
|---|
| 1962 | 1953 | |
|---|
| 1963 | 1954 | LRESULT wmMouseLeave (HWND hwnd, int wParam, int lParam) { |
|---|
| 1964 | | if (!hooks (DWT.MouseExit) && !filters (DWT.MouseExit)) return LRESULT.NULL; |
|---|
| | 1955 | if (!hooks (DWT.MouseExit) && !filters (DWT.MouseExit)) return null; |
|---|
| 1965 | 1956 | int pos = OS.GetMessagePos (); |
|---|
| 1966 | 1957 | POINT pt; |
|---|
| … | … | |
| 1972 | 1963 | return LRESULT.ZERO; |
|---|
| 1973 | 1964 | } |
|---|
| 1974 | | return LRESULT.NULL; |
|---|
| | 1965 | return null; |
|---|
| 1975 | 1966 | } |
|---|
| 1976 | 1967 | |
|---|
| 1977 | 1968 | LRESULT wmMouseMove (HWND hwnd, int wParam, int lParam) { |
|---|
| 1978 | | LRESULT result = LRESULT.NULL; |
|---|
| | 1969 | LRESULT result = null; |
|---|