Changeset 183


Ignore:
Timestamp:
Sep 16, 2009, 5:47:31 PM (16 years ago)
Author:
Dmitry A. Kuminov
Message:

gui: Implemented widget scrolling (QWidget::scroll() and friends).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gui/kernel/qwidget_pm.cpp

    r182 r183  
    777777
    778778/*!
     779
     780
     781
     782
     783
     784
     785
     786
     787
     788
     789
     790
     791
     792
     793
     794
     795
     796
     797
     798
     799
     800
     801
     802
     803
     804
     805
     806
     807
     808
     809
     810
     811
     812
     813
     814
     815
     816
     817
     818
     819
     820
     821
     822
     823
     824
     825
     826
     827
     828
     829
     830
     831
     832
     833
     834
     835
     836
     837
     838
     839
     840
     841
     842
     843
     844
     845
     846
     847
     848
     849
     850
     851
     852
     853
     854
     855
     856
     857
     858
     859
     860
     861
     862
     863
     864
     865
     866
     867
     868
     869
     870
     871
     872
     873
     874
     875
     876
     877
     878
     879
     880
     881
     882
     883
     884
     885
     886
     887
     888
     889
     890
     891
     892
     893
     894
     895
     896
     897
     898
     899
    779900 * \internal
    780901 * For some unknown reason, PM sends WM_SAVEAPPLICATION to every window
     
    20842205void QWidgetPrivate::scroll_sys(int dx, int dy)
    20852206{
    2086     // @todo implement
     2207    Q_Q(QWidget);
     2208    scrollChildren(dx, dy);
     2209
     2210    if (!paintOnScreen()) {
     2211        scrollRect(q->rect(), dx, dy);
     2212    } else {
     2213        // @todo ask qt_WinScrollWindowWell() to erase background if
     2214        // WA_OpaquePaintEvent is reset?
     2215        //if (!q->testAttribute(Qt::WA_OpaquePaintEvent))
     2216        //    ;
     2217        Q_ASSERT(q->testAttribute(Qt::WA_WState_Created));
     2218        qt_WinScrollWindowWell(q->internalWinId(), dx, -dy, NULL);
     2219    }
    20872220}
    20882221
    20892222void QWidgetPrivate::scroll_sys(int dx, int dy, const QRect &r)
    20902223{
    2091     // @todo implement
     2224    Q_Q(QWidget);
     2225
     2226    if (!paintOnScreen()) {
     2227        scrollRect(r, dx, dy);
     2228    } else {
     2229        int h = data.crect.height();
     2230        // flip y coordinate (all coordinates are inclusive)
     2231        RECTL rcl = { r.left(), h - (r.bottom() + 1), r.right(), h - (r.top() + 1) };
     2232
     2233        // @todo ask qt_WinScrollWindowWell() to erase background if
     2234        // WA_OpaquePaintEvent is reset?
     2235        //if (!q->testAttribute(Qt::WA_OpaquePaintEvent))
     2236        //    ;
     2237        Q_ASSERT(q->testAttribute(Qt::WA_WState_Created));
     2238        qt_WinScrollWindowWell(q->internalWinId(), dx, -dy, &rcl);
     2239    }
    20922240}
    20932241
Note: See TracChangeset for help on using the changeset viewer.