Changes between Version 1 and Version 2 of Ticket #76, comment 5
- Timestamp:
- Dec 24, 2017, 11:42:51 AM (7 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #76, comment 5
v1 v2 1 After some research and more PM message tracing I think I am pretty clear on how all of this works ; I'll be documenting it here to start working later. First some clarifications just in case. Terminology for parameters, etc. adopted from IBM's PM reference:1 After some research and more PM message tracing I think I am pretty clear on how all of this works now, although I have been baffled at times--turns out *different*, *standard* (IBM) applications behave differently when using seemingly identical controls. I'm documenting my findings here to start working on this bug later. 2 2 3 1) 'MB3 drag scrolling' (MB3DS) is a feature present in newer Mozilla and other applications, such as the XWorkPlace WPS extension, or the older !HotScroll. The description in XWP reference is quoted above. Scroll on PM windows with scroll bars starts when MB3 goes down while the mouse pointer is on the window interior, and the mouse is dragged. Content then scrolls following the mouse movement just like the regular scroll bars were used. This has the advantage of not having to reach for them. 3 Some clarifications first just in case. Terminology for parameters, etc. adopted from IBM's PM reference: 4 4 5 2) With XWP installed, no MB3-specific code is necessary within PM applications to enable this scrolling method, as XWP sends all the necessary PM messages when this feature is activated. This actually works with E, the old system editor that predates XWP, and should work 'in theory' with all PM applications (but doesn't with current eFTE2-PM).5 1) 'MB3 drag scrolling' (MB3DS) is a feature present in newer Mozilla and other applications, such as the XWorkPlace WPS extension, or the older !HotScroll. The description in XWP reference is quoted above. Scroll on PM windows with scroll bars starts when MB3 goes down while the mouse pointer is over the window contents, and the mouse is dragged. Contents then scroll following the mouse movement just like the regular scroll bars were used. This has the advantage of not having to reach for them. 6 6 7 3.1a When MB3DS is in 'line-wise (fixed)' mode: 7 2) With XWP installed, no MB3-specific code is necessary within PM applications to enable this scrolling method, as XWP sends all the necessary PM messages when this feature is activated. This I have confirmed tracing PM messages, and should work 'theoretically' with all PM applications (but doesn't with current eFTE2-PM). It actually works with E, the old system editor that predates XWP, and many other applications -- we can be fairly sure what doesn't work in eFTE2-PM is a bug in it. 8 8 9 Every single time the mouse is dragged south a certain distance, TWO (2) WM_VSCROLL messages are sent sequentially. First, uscmd = SB_LINEDOWN, then uscmd = SB_ENDSCROLL with sslide value 1 both times. That second ENDSCROLL message is in consonance with MB3 being released not triggering a new message (it would be unnecessary).9 3) MB3DS can be set to work either of two ways: 'line-wise (fixed)' or 'amplified'. 10 10 11 OTOH Clicking the regular scrollbar bottom arrow will keep sending WM_VSCROLL messages where uscmd = SB_LINEDOWN as long as MB1 is held; releasing the arrow will send another WM_VSCROLL message with uscmd = SB_ENDSCROLL; sslider value is 0 at all times. 11 3.1a) When MB3DS is in 'line-wise (fixed)' mode: 12 12 13 Thus the difference between MB3DS and regular PM scrolling with arrows seems to lie in the sslide value. Apparently SB_LINE* messages are ignored by eFTE code when sslider = 0, and this MB3DS style does not work on it.13 Every single time the mouse is dragged south a certain distance, TWO (2) WM_VSCROLL messages are sent sequentially. First, uscmd = SB_LINEDOWN, then uscmd = SB_ENDSCROLL with sslider value 1 both times. That second ENDSCROLL message is in consonance with MB3 being released not triggering a new message (it would be unnecessary). 14 14 15 3.1b Scrolling upwards behaves exactly the same, replacing SB_LINEDOWN with SB_LINEUP.15 OTOH Clicking the regular scrollbar bottom arrow will keep sending WM_VSCROLL messages where uscmd = SB_LINEDOWN as long as MB1 is held; releasing the arrow will send another WM_VSCROLL message with uscmd = SB_ENDSCROLL; sslider value is 0 at all times. 16 16 17 3.1c All of the above is paralleled too for WM_HSCROLL messages. 17 The only difference I have been able to spot between MB3DS and regular PM scrolling with the bar arrows seems to lie in the sslider value. Apparently SB_LINE* messages are ignored down when sslider = 1, God knows why, and this MB3DS style does not work on it. 18 19 3.1b) Scrolling upwards behaves exactly the same, replacing SB_LINEDOWN with SB_LINEUP. 20 21 3.1c) All of the above is paralleled too for WM_HSCROLL messages. 18 22 19 23 3.2) When MB3DS is in 'amplified' mode: 20 24 21 Dragging the mouse sends WM_ VSCROLL messages where uscmd = SB_SLIDERTRACK, and sslider varies as the mouse is dragged up and down while MB3 is down.25 Dragging the mouse sends WM_xSCROLL messages where uscmd = SB_SLIDERTRACK, and sslider varies as the mouse is dragged up and down while MB3 is down. 22 26 23 27 When MB3 is released, scrolling is terminated, and a WM_VSCROLL is sent with uscmd = SB_SLIDERPOSITION and the last slider position in sslider. 24 28 25 As for bar-based scrolling, when clicking on the slider and dragging the mouse, WM_VSCROLL generated messages have usmd = SB_SLIDERTRACK, and sslider reflects the slider position within the bar (1 = top). When the mouse button is released, the scrolling stops and a WM_VSCROLL message is sent with ucmd = SB_SLIDERPOSITION, and the last slider position in sslider.29 As for regular, bar-based scrolling, when clicking on the slider and dragging the mouse, WM_xSCROLL generated messages have uscmd = SB_SLIDERTRACK, and sslider reflects the slider position within the bar (1 = top). When the mouse button is released, the scrolling stops and a WM_xSCROLL message is sent with uscmd = SB_SLIDERPOSITION, and the last slider position in sslider. 26 30 27 31 These are exactly the same messages that MB3DS 'amplified' mode sends, and, as one might expect, both scrolling methods work exactly the same in eFTEPM. 28 ---- 29 So, in principle, "all that's left to do" :) is accommodate these not-so-special PM messages in the WM_VSCROLL handling block of g_pm.cpp, starting ca. line 1410 and make eFTE2 react to them with the corresponding evCommand / cmVScrollMove, etc. Specific MB3 code (it seems there is currently some, commented out) can be left for the future, if any specific use for it is found. 32 33 Now, assuming (because this is harder to test) equal controls in different applications produce the same messages, not all applications react the same way to them. For example, while dragging the scroll bar sliders in IBM's view, windows contents are updated as the slider is dragged, whereas in IBM's system editor E, window contents are not updated until the slider is released. This gives the idea that some leeway is given for application developers when implementing scroll. 34 35 MB3DS/amplified updates window contents while dragging currently, and I am happy with that so I won't touch it. TTBOMK there is also only one way for 3MBDS/line-wise to work, so I am open to anything I may have overlooked -- but I expect no surprises in that front.