Changeset 36
- Timestamp:
- 02/26/08 05:33:56 (6 months ago)
- Files:
-
- trunk/win32/dfl/button.d (modified) (1 diff)
- trunk/win32/dfl/control.d (modified) (2 diffs)
- trunk/win32/dfl/form.d (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/win32/dfl/button.d
r34 r36 348 348 { 349 349 // Fixing the thick border of a default button when enabling and disabling it. 350 351 // To-do: check if correct implementation. 350 352 351 353 DWORD bst; trunk/win32/dfl/control.d
r34 r36 979 979 } 980 980 +/ 981 assert(getStyle(ControlStyles.CONTAINER_CONTROL), "Control added to non-container parent"); 981 982 982 983 onControlAdded(cea); … … 6208 6209 wstyle = style; 6209 6210 6210 //if( (ctrlStyle & ControlStyles.CONTAINER_CONTROL) && (style & WS_CHILD))6211 if( style & WS_CHILD)6211 //if(style & WS_CHILD) // Breaks context-help. 6212 if((ctrlStyle & ControlStyles.CONTAINER_CONTROL) && (style & WS_CHILD)) 6212 6213 { 6213 6214 exStyle |= WS_EX_CONTROLPARENT; trunk/win32/dfl/form.d
r35 r36 2520 2520 2521 2521 2522 package HWND _lastSel; // Last selected, excluding accept button! 2522 package HWND _lastSelBtn; // Last selected button (not necessarily focused), excluding accept button! 2523 package HWND _lastSel; // Last senected and focused control. 2523 2524 package HWND _hadfocus; // Before being deactivated. 2524 2525 … … 2528 2529 { 2529 2530 bool wasselbtn = false; 2530 if(_lastSel )2531 if(_lastSelBtn) 2531 2532 { 2532 2533 wasselbtn = true; 2533 if(IsChild(this.hwnd, _lastSel ))2534 { 2535 auto lastctrl = Control.fromHandle(_lastSel );2534 if(IsChild(this.hwnd, _lastSelBtn)) 2535 { 2536 auto lastctrl = Control.fromHandle(_lastSelBtn); 2536 2537 if(lastctrl) 2537 2538 { … … 2545 2546 } 2546 2547 2548 package final void _selafter(Control ctrl, bool wasselbtn) 2549 { 2550 _lastSelBtn = _lastSelBtn.init; 2551 auto ibc = cast(IButtonControl)ctrl; 2552 if(ibc) 2553 { 2554 if(acceptButton) 2555 { 2556 if(ibc !is acceptButton) 2557 { 2558 acceptButton.notifyDefault(false); 2559 _lastSelBtn = ctrl.hwnd; 2560 } 2561 //else don't set _lastSelBtn to accept button. 2562 } 2563 else 2564 { 2565 _lastSelBtn = ctrl.hwnd; 2566 } 2567 2568 ibc.notifyDefault(true); 2569 } 2570 else 2571 { 2572 if(wasselbtn) // Only do it if there was a different button; don't keep doing this. 2573 { 2574 if(acceptButton) 2575 acceptButton.notifyDefault(true); 2576 } 2577 } 2578 } 2579 2547 2580 package final void _seldeactivate() 2548 2581 { … … 2552 2585 acceptButton.notifyDefault(false); 2553 2586 } 2554 _lastSel = GetFocus(); 2555 } 2556 2557 package final void _selafter(Control ctrl, bool wasselbtn) 2558 { 2559 _lastSel = _lastSel.init; 2560 auto ibc = cast(IButtonControl)ctrl; 2561 if(ibc) 2562 { 2563 if(acceptButton) 2564 { 2565 if(ibc !is acceptButton) 2566 { 2567 acceptButton.notifyDefault(false); 2568 _lastSel = ctrl.hwnd; 2569 } 2570 //else don't set _lastSel to accept button. 2571 } 2572 else 2573 { 2574 _lastSel = ctrl.hwnd; 2575 } 2576 2577 ibc.notifyDefault(true); 2578 } 2579 else 2580 { 2581 if(wasselbtn) // Only do it if there was a different button; don't keep doing this. 2582 { 2583 if(acceptButton) 2584 acceptButton.notifyDefault(true); 2585 } 2586 } 2587 //_lastSel = GetFocus(); // Not reliable, especially when minimizing. 2587 2588 } 2588 2589 … … 2625 2626 2626 2627 _selafter(ctrl, wasselbtn); 2628 2629 _lastSel = ctrl.hwnd; 2627 2630 } 2628 2631 }
