Changeset 109 for trunk/src/gui/kernel
- Timestamp:
- Aug 13, 2009, 8:20:25 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/gui/kernel/qapplication_pm.cpp
r108 r109 104 104 extern QCursor *qt_grab_cursor(); 105 105 106 107 106 108 MRESULT EXPENTRY QtWndProc(HWND, ULONG, MPARAM, MPARAM); 107 109 … … 125 127 #endif 126 128 bool translatePaintEvent(const QMSG &qmsg); 127 // bool translateConfigEvent(const MSG &msg);128 // bool translateCloseEvent(const MSG &msg);129 // bool translateConfigEvent(const MSG &msg); 130 msg); 129 131 // void repolishStyle(QStyle &style); 130 132 // inline void showChildren(bool spontaneous) { d_func()->showChildren(spontaneous); } … … 333 335 void QApplication::setCursorFlashTime(int msecs) 334 336 { 335 // @todo implement336 } 337 337 338 QApplicationPrivate::cursor_flash_time = msecs; 339 } 338 340 339 341 int QApplication::cursorFlashTime() 340 342 { 341 // @todo implement 343 int blink = (int)WinQuerySysValue(HWND_DESKTOP, SV_CURSORRATE); 344 if (!blink) 345 return QApplicationPrivate::cursor_flash_time; 346 if (blink > 0) 347 return 2 * blink; 342 348 return 0; 343 349 } … … 345 351 void QApplication::setDoubleClickInterval(int ms) 346 352 { 347 // @todo implement 353 WinSetSysValue(HWND_DESKTOP, SV_DBLCLKTIME, ms); 354 QApplicationPrivate::mouse_double_click_time = ms; 348 355 } 349 356 350 357 int QApplication::doubleClickInterval() 351 358 { 352 // @todo implement 353 return 0; 354 } 355 359 int ms = (int) WinQuerySysValue(HWND_DESKTOP, SV_DBLCLKTIME); 360 if (ms != 0) 361 return ms; 362 return QApplicationPrivate::mouse_double_click_time; 363 } 356 364 357 365 void QApplication::setKeyboardInputInterval(int ms) 358 366 { 359 // @todo implement367 360 368 } 361 369 362 370 int QApplication::keyboardInputInterval() 363 371 { 364 // @todo implement365 return 0;372 // 373 return ; 366 374 } 367 375 … … 369 377 void QApplication::setWheelScrollLines(int n) 370 378 { 371 // @todo implement379 372 380 } 373 381 374 382 int QApplication::wheelScrollLines() 375 383 { 376 // @todo implement 377 return 0; 384 return QApplicationPrivate::wheel_scroll_lines; 378 385 } 379 386 #endif //QT_NO_WHEELEVENT … … 392 399 void QApplication::beep() 393 400 { 394 // @todo implement401 395 402 } 396 403 … … 431 438 Main event loop 432 439 *****************************************************************************/ 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 433 455 434 456 // QtWndProc() receives all messages from the main event loop … … 537 559 case WM_SHOW: { 538 560 // @todo there is some more processing in Qt4, see 539 // WM_SHOWWINDOW in Win32 sources561 // WM_SHOWWINDOW in 540 562 if (!SHORT1FROMMP(mp1) && autoCaptureWnd == widget->internalWinId()) 541 563 releaseAutoCapture(); 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 542 583 break; 543 584 } … … 564 605 #endif 565 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 566 650 default: 567 651 break; … … 620 704 bool QApplicationPrivate::modalState() 621 705 { 622 // @todo implement 623 return false; 706 return app_do_modal; 624 707 } 625 708 626 709 void QApplicationPrivate::enterModal_sys(QWidget *widget) 627 710 { 628 // @todo implement 711 if (!qt_modal_stack) 712 qt_modal_stack = new QWidgetList; 713 714 releaseAutoCapture(); 715 QWidget *leave = qt_last_mouse_receiver; 716 if (!leave) 717 leave = QWidget::find(curWin); 718 QApplicationPrivate::dispatchEnterLeave(0, leave); 719 qt_modal_stack->insert(0, widget); 720 app_do_modal = true; 721 curWin = 0; 722 qt_last_mouse_receiver = 0; 723 ignoreNextMouseReleaseEvent = false; 629 724 } 630 725 631 726 void QApplicationPrivate::leaveModal_sys(QWidget *widget) 632 727 { 633 // @todo implement 634 } 635 636 bool qt_try_modal(QWidget *widget, QMSG *qmsg, MRESULT& rc) 637 { 638 // @todo implement 639 return false; 728 if (qt_modal_stack && qt_modal_stack->removeAll(widget)) { 729 if (qt_modal_stack->isEmpty()) { 730 delete qt_modal_stack; 731 qt_modal_stack = 0; 732 QPoint p(QCursor::pos()); 733 app_do_modal = false; // necessary, we may get recursively into qt_try_modal below 734 QWidget* w = QApplication::widgetAt(p.x(), p.y()); 735 QWidget *leave = qt_last_mouse_receiver; 736 if (!leave) 737 leave = QWidget::find(curWin); 738 if (QWidget *grabber = QWidget::mouseGrabber()) { 739 w = grabber; 740 if (leave == w) 741 leave = 0; 742 } 743 QApplicationPrivate::dispatchEnterLeave(w, leave); // send synthetic enter event 744 curWin = w ? w->effectiveWinId() : 0; 745 qt_last_mouse_receiver = w; 746 } 747 ignoreNextMouseReleaseEvent = true; 748 } 749 app_do_modal = qt_modal_stack != 0; 750 } 751 752 bool qt_try_modal(QWidget *widget, QMSG *qmsg, MRESULT &rc) 753 { 754 QWidget *top = 0; 755 756 if (QApplicationPrivate::tryModalHelper(widget, &top)) 757 return true; 758 759 int type = qmsg->msg; 760 761 bool block_event = false; 762 if ((type >= WM_MOUSEFIRST && type <= WM_MOUSELAST) || 763 (type >= WM_EXTMOUSEFIRST && type <= WM_EXTMOUSELAST) || 764 type == WM_VSCROLL || type == WM_HSCROLL || 765 type == WM_U_MOUSELEAVE || 766 type == WM_CHAR) { 767 if (type == WM_MOUSEMOVE) { 768 #ifndef QT_NO_CURSOR 769 QCursor *c = qt_grab_cursor(); 770 if (!c) 771 c = QApplication::overrideCursor(); 772 if (c) // application cursor defined 773 WinSetPointer(HWND_DESKTOP, c->handle()); 774 else 775 WinSetPointer(HWND_DESKTOP, QCursor(Qt::ArrowCursor).handle()); 776 #endif // QT_NO_CURSOR 777 } else if (type == WM_BUTTON1DOWN || type == type == WM_BUTTON2DOWN || 778 type == WM_BUTTON3DOWN) { 779 if (!top->isActiveWindow()) { 780 top->activateWindow(); 781 } else { 782 QApplication::beep(); 783 } 784 } 785 block_event = true; 786 } else if (type == WM_CLOSE) { 787 block_event = true; 788 } else if (type == WM_SYSCOMMAND) { 789 if (!(SHORT1FROMMP(qmsg->mp1) == SC_RESTORE && widget->isMinimized())) 790 block_event = true; 791 } 792 793 return !block_event; 640 794 } 641 795 … … 1245 1399 #endif 1246 1400 1401 1402 1403 1404 1405 1406 1407 1408 1409 1410 1411 1412 1247 1413 QT_END_NAMESPACE
Note:
See TracChangeset
for help on using the changeset viewer.