#DOCUMENTATION by exept
class: SimpleView
comment/format in:
#heightOfContentsDependsOnWidth
#originRelativeTo:
--- a/SimpleView.st Fri Feb 21 19:13:46 2020 +0100
+++ b/SimpleView.st Fri Feb 21 19:14:24 2020 +0100
@@ -2480,12 +2480,14 @@
!
heightOfContentsDependsOnWidth
- "a very special which is only used by the scrollableView,
+ "a very special query which is used by the scrollableView,
to check if it should NOT automatically hide scrollbars, when the
pointer leaves the view.
Currently, there are only a small number of views which return true here,
one being the HTML view, which rearranges its text depending on the width,
- and therefore, it is a bad idea to hide/show scrollbars dynamically"
+ and therefore, it is a bad idea to hide/show scrollbars dynamically
+ (as this might lead to annoying flicker if the hiding of the scrollbar
+ rearranges the contents)"
^ false
!
@@ -3498,30 +3500,35 @@
sumX := 0.
sumY := 0.
[currentView notNil] whileTrue:[
- (currentView == aView) ifTrue:[
- ^ (sumX @ sumY)
- ].
- bw := currentView borderWidth.
- sumX := sumX + (currentView left) + bw.
- sumY := sumY + (currentView top) + bw.
- currentView := currentView superView
+ (currentView == aView) ifTrue:[
+ ^ (sumX @ sumY)
+ ].
+ bw := currentView borderWidth.
+ sumX := sumX + (currentView left) + bw.
+ sumY := sumY + (currentView top) + bw.
+ currentView := currentView superView
].
(aView isNil or:[aView == device rootView]) ifTrue:[
- "return relative to screen ..."
- ^ (sumX @ sumY)
+ "return relative to screen ..."
+ ^ (sumX @ sumY)
].
^ nil
"
- |top sub1 sub2|
+ |top sub1 sub2 sub2ScreenOrg|
top := StandardSystemView new.
- top extent:200@200.
+ top origin:0@0 extent:200@200.
sub1 := View origin:0.2 @ 0.2 corner:0.8 @ 0.8 in:top.
sub2 := Button origin:0.3 @ 0.3 corner:0.7 @ 0.7 in:sub1.
top openAndWait.
Transcript show:'button in top:'; showCR:(sub2 originRelativeTo:top).
- Transcript show:'button on screen:'; showCR:(sub2 originRelativeTo:nil).
+ sub2ScreenOrg := sub2 originRelativeTo:nil.
+ Transcript show:'button on screen:'; showCR:sub2ScreenOrg.
+
+ Transcript show:'move to: %1' with:sub2ScreenOrg.
+ top device setPointerPosition:sub2ScreenOrg.
+ Transcript show:'pointer now at %1' with:top device pointerPosition.
"
"Modified: / 5.12.1998 / 14:30:57 / cg"