Changeset 30
- Timestamp:
- 02/20/08 19:36:12 (8 months ago)
- Files:
-
- trunk/win32/dfl/application.d (modified) (1 diff)
- trunk/win32/dfl/control.d (modified) (2 diffs)
- trunk/win32/dfl/form.d (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/win32/dfl/application.d
r27 r30 140 140 // When a Form is in showDialog, changing the dialogResult from NONE doesn't close the form. 141 141 FORM_DIALOGRESULT_096 = 0x8, 142 143 // Call onLoad/load and focus a control at old time. 144 FORM_LOAD_096 = 0x10, 142 145 } 143 146 trunk/win32/dfl/control.d
r29 r30 5633 5633 case WM_DESTROY: 5634 5634 cbits &= ~CBits.CREATED; 5635 if(!recreatingHandle) 5636 cbits &= ~CBits.FORMLOADED; 5635 5637 _destroying(); 5636 5638 //if(!killing) … … 6829 6831 HAS_LAYOUT = 0x200000, 6830 6832 VSTYLE = 0x400000, // If not forced off. 6833 FORMLOADED = 0x800000, // If not forced off. 6831 6834 } 6832 6835 trunk/win32/dfl/form.d
r29 r30 488 488 } 489 489 490 // Load before shown. 491 // Not calling if recreating handle! 492 onLoad(EventArgs.empty); 490 if(Application._compat & DflCompat.FORM_LOAD_096) 491 { 492 // Load before shown. 493 // Not calling if recreating handle! 494 onLoad(EventArgs.empty); 495 } 493 496 } 494 497 … … 1801 1804 } 1802 1805 1806 if(!(Application._compat & DflCompat.FORM_LOAD_096)) 1807 { 1808 if(visible) 1809 { 1810 if(!(cbits & CBits.FORMLOADED)) 1811 { 1812 cbits |= CBits.FORMLOADED; 1813 onLoad(EventArgs.empty); 1814 } 1815 } 1816 } 1817 1803 1818 super.onVisibleChanged(ea); 1804 1819 } … … 2138 2153 { 2139 2154 load(this, ea); 2155 2156 if(!(Application._compat & DflCompat.FORM_LOAD_096)) 2157 { 2158 _selonecontrol(); 2159 } 2140 2160 } 2141 2161 … … 2491 2511 2492 2512 2513 private void _selonecontrol() 2514 { 2515 HWND hwfocus = GetFocus(); 2516 if(!hwfocus || hwfocus == hwnd) 2517 { 2518 _selectNextControl(this, null, true, true, true, false); 2519 if(!GetFocus()) 2520 select(); 2521 } 2522 } 2523 2524 2493 2525 package alias dfl.internal.utf.defDlgProc _defFormProc; 2494 2526 … … 2531 2563 } 2532 2564 +/ 2533 _selectNextControl(this, null, true, true, true, false); 2534 if(!GetFocus()) 2535 focus(); 2565 _selonecontrol(); 2536 2566 // Prevent DefDlgProc from getting this message because it'll focus controls it shouldn't. 2537 2567 return; … … 2542 2572 if(GetActiveWindow() == msg.hWnd) 2543 2573 { 2544 if(!GetFocus()) 2545 SetFocus(msg.hWnd); 2574 _selonecontrol(); 2546 2575 } 2547 2576 }
