Changeset 26
- Timestamp:
- 02/20/08 00:27:28 (8 months ago)
- Files:
-
- trunk/win32/dfl/application.d (modified) (1 diff)
- trunk/win32/dfl/control.d (modified) (7 diffs)
- trunk/win32/dfl/form.d (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/win32/dfl/application.d
r23 r26 1821 1821 void function(Control, size_t[]) fp; 1822 1822 size_t nparams; 1823 size_t[ 0] params;1823 size_t[1] params; 1824 1824 } 1825 1825 trunk/win32/dfl/control.d
r25 r26 3486 3486 3487 3487 DflInvokeParam* p; 3488 p = cast(DflInvokeParam*)dfl.internal.clib.malloc(DflInvokeParam.sizeof + params.length * size_t.sizeof); 3488 p = cast(DflInvokeParam*)dfl.internal.clib.malloc( 3489 (DflInvokeParam.sizeof - size_t.sizeof) 3490 + params.length * size_t.sizeof); 3489 3491 if(!p) 3490 3492 throw new OomException(); … … 3753 3755 3754 3756 3755 package static void _dlgselnext(HWND hwdlg, HWND hwcursel, bool forward) 3757 private static bool _isHwndControlSel(HWND hw) 3758 { 3759 Control c = Control.fromHandle(hw); 3760 return c && c.getStyle(ControlStyles.SELECTABLE); 3761 } 3762 3763 3764 package static void _dlgselnext(HWND hwdlg, HWND hwcursel, bool forward, 3765 bool tabStopOnly = true, bool selectableOnly = false) 3756 3766 { 3757 3767 if(forward) … … 3762 3772 (HWND hw) 3763 3773 { 3774 assert(!tdone); 3764 3775 if(hw == hwcursel) 3765 3776 { … … 3768 3779 else 3769 3780 { 3770 LONG st = GetWindowLongA(hw, GWL_STYLE); 3771 if(st & WS_TABSTOP) 3781 if(!tabStopOnly || (GetWindowLongA(hw, GWL_STYLE) & WS_TABSTOP)) 3772 3782 { 3773 if( foundthis)3783 if(!selectableOnly || _isHwndControlSel(hw)) 3774 3784 { 3775 DefDlgProcA(hwdlg, WM_NEXTDLGCTL, cast(WPARAM)hw, MAKELPARAM(true, 0)); 3776 tdone = true; 3777 return false; // Break. 3778 } 3779 else 3780 { 3781 if(HWND.init == hwfirst) 3782 hwfirst = hw; 3785 if(foundthis) 3786 { 3787 DefDlgProcA(hwdlg, WM_NEXTDLGCTL, cast(WPARAM)hw, MAKELPARAM(true, 0)); 3788 tdone = true; 3789 return false; // Break. 3790 } 3791 else 3792 { 3793 if(HWND.init == hwfirst) 3794 hwfirst = hw; 3795 } 3783 3796 } 3784 3797 } … … 3800 3813 return false; // Break. 3801 3814 } 3802 LONG st = GetWindowLongA(hw, GWL_STYLE); 3803 if(st & WS_TABSTOP) 3804 hwprev = hw; 3815 if(!tabStopOnly || (GetWindowLongA(hw, GWL_STYLE) & WS_TABSTOP)) 3816 { 3817 if(!selectableOnly || _isHwndControlSel(hw)) 3818 { 3819 hwprev = hw; 3820 } 3821 } 3805 3822 return true; // Continue. 3806 3823 }); … … 3822 3839 // otherwise the previous control in the tab order is selected. 3823 3840 // Controls without style ControlStyles.SELECTABLE are skipped. 3824 /+protected+/void select(bool directed, bool forward)3841 void select(bool directed, bool forward) 3825 3842 { 3826 3843 if(!created) … … 3850 3867 else 3851 3868 { 3852 DefDlgProcA(ctrltoplevel.handle, WM_NEXTDLGCTL, cast(WPARAM)this.handle, MAKELPARAM(true, 0)); 3869 if(canSelect) 3870 DefDlgProcA(ctrltoplevel.handle, WM_NEXTDLGCTL, cast(WPARAM)this.handle, MAKELPARAM(true, 0)); 3853 3871 } 3854 3872 } trunk/win32/dfl/form.d
r25 r26 2745 2745 case Keys.UP, Keys.DOWN: 2746 2746 case Keys.RIGHT, Keys.LEFT: 2747 if(dfl.internal.utf.isDialogMessage(form.handle, &m._winMsg)) 2748 return true; // Prevent. 2747 //if(dfl.internal.utf.isDialogMessage(form.handle, &m._winMsg)) // Stopped working after removing controlparent. 2748 // return true; // Prevent. 2749 { 2750 LRESULT dlgc; 2751 dlgc = SendMessageA(m.hWnd, WM_GETDLGCODE, 0, 0); 2752 if(!(dlgc & (DLGC_WANTALLKEYS | DLGC_WANTARROWS))) 2753 { 2754 if(WM_KEYDOWN == m.msg) 2755 { 2756 switch(cast(Keys)m.wParam) 2757 { 2758 case Keys.UP, Keys.LEFT: 2759 // Backwards... 2760 Control._dlgselnext(form.handle, m.hWnd, false, false, true); 2761 break; 2762 case Keys.DOWN, Keys.RIGHT: 2763 // Forwards... 2764 Control._dlgselnext(form.handle, m.hWnd, true, false, true); 2765 break; 2766 default: 2767 assert(0); 2768 } 2769 } 2770 return true; // Prevent. 2771 } 2772 } 2749 2773 return false; // Continue. 2750 2774
