FlyByWindowInformation.st
author Claus Gittinger <cg@exept.de>
Fri, 12 Nov 2010 11:39:53 +0100
changeset 2823 cd54d69eec13
parent 2710 0ce76feb3f91
child 2824 34ec9ea82209
permissions -rw-r--r--
changed: #helpTextFor:at: #keyPress:x:y:view: return key and better flybyhelp
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2587
81f38cd168a7 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
     1
"
81f38cd168a7 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
     2
 COPYRIGHT (c) 2008 by eXept Software AG
81f38cd168a7 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
     3
              All Rights Reserved
81f38cd168a7 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
     4
81f38cd168a7 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
     5
 This software is furnished under a license and may be used
81f38cd168a7 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
     6
 only in accordance with the terms of that license and with the
81f38cd168a7 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
     7
 inclusion of the above copyright notice.   This software may not
81f38cd168a7 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
     8
 be provided or otherwise made available to, or used by, any
81f38cd168a7 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
     9
 other person.  No title to or ownership of the software is
81f38cd168a7 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
    10
 hereby transferred.
81f38cd168a7 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
    11
"
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
"{ Package: 'stx:libtool2' }"
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
FlyByHelp subclass:#FlyByWindowInformation
2699
22dd96b4e37f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
    15
	instanceVariableNames:'lastApplication lastView cleanupAction finishSemaphore finished'
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
	classVariableNames:''
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
	poolDictionaries:''
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
	category:'Interface-Help'
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    19
!
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    20
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    21
!FlyByWindowInformation class methodsFor:'documentation'!
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    22
2587
81f38cd168a7 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
    23
copyright
81f38cd168a7 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
    24
"
81f38cd168a7 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
    25
 COPYRIGHT (c) 2008 by eXept Software AG
81f38cd168a7 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
    26
              All Rights Reserved
81f38cd168a7 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
    27
81f38cd168a7 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
    28
 This software is furnished under a license and may be used
81f38cd168a7 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
    29
 only in accordance with the terms of that license and with the
81f38cd168a7 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
    30
 inclusion of the above copyright notice.   This software may not
81f38cd168a7 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
    31
 be provided or otherwise made available to, or used by, any
81f38cd168a7 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
    32
 other person.  No title to or ownership of the software is
81f38cd168a7 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
    33
 hereby transferred.
81f38cd168a7 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
    34
"
81f38cd168a7 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
    35
!
81f38cd168a7 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
    36
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
examples
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
"
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
    self shownInformationOfViewUnderMouseUntilButtonIsPressed
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
"
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
!
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
shownInformationOfViewUnderMouseUntilButtonIsPressed
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
    self start waitUntilFinished
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
    "
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
     self shownInformationOfViewUnderMouseUntilButtonIsPressed
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
    "
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
! !
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
!FlyByWindowInformation methodsFor:'accessing'!
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
2699
22dd96b4e37f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
    53
cleanupAction:something 
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
    cleanupAction := something.
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
!
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
lastApplication
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
    ^ lastApplication
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
!
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
lastView
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    62
    ^ lastView
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    63
! !
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    64
2543
7ad308542625 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2493
diff changeset
    65
!FlyByWindowInformation methodsFor:'defaults'!
7ad308542625 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2493
diff changeset
    66
7ad308542625 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2493
diff changeset
    67
flyByHelpTimeoutMillis
7ad308542625 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2493
diff changeset
    68
    ^ 1000
7ad308542625 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2493
diff changeset
    69
! !
7ad308542625 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2493
diff changeset
    70
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    71
!FlyByWindowInformation methodsFor:'event handling'!
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    72
2340
e51e52c8e849 code cleanup (arg-names)
Claus Gittinger <cg@exept.de>
parents: 2314
diff changeset
    73
buttonMotion:buttonAndModifierState x:x y:y view:aView
2702
96f1dbce3d00 changed:5 methods
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
    74
    finished == true ifTrue:[^ self].
96f1dbce3d00 changed:5 methods
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
    75
2340
e51e52c8e849 code cleanup (arg-names)
Claus Gittinger <cg@exept.de>
parents: 2314
diff changeset
    76
    super buttonMotion:buttonAndModifierState x:x y:y view:aView.
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    77
    ^ true
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    78
!
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    79
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
buttonPress:button x:x y:y view:aView
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
    self stop.
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
    ^ true
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
!
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    84
2699
22dd96b4e37f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
    85
handleMouseIn:aView x:x y:y
2702
96f1dbce3d00 changed:5 methods
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
    86
    finished == true ifTrue:[^ self].
2699
22dd96b4e37f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
    87
    super handleMouseIn:aView x:x y:y
22dd96b4e37f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
    88
!
22dd96b4e37f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
    89
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    90
keyPress:key x:x y:y view:aView
2823
cd54d69eec13 changed:
Claus Gittinger <cg@exept.de>
parents: 2710
diff changeset
    91
    |obj objToInspect objToBrowse lcKey|
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    92
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    93
    key == #Escape ifTrue:[
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    94
        self stop.
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    95
        ^ true
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    96
    ].
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    97
2435
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
    98
    key == $? ifTrue:[
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
    99
        [
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   100
            WindowTreeView openOn:(lastView topView) initialSelection:lastView.
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   101
        ] fork.
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   102
        self stop.
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   103
        ^ true.
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   104
    ].
2435
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   105
2823
cd54d69eec13 changed:
Claus Gittinger <cg@exept.de>
parents: 2710
diff changeset
   106
    key == #Return ifTrue:[
cd54d69eec13 changed:
Claus Gittinger <cg@exept.de>
parents: 2710
diff changeset
   107
        objToBrowse := lastApplication ? lastView
cd54d69eec13 changed:
Claus Gittinger <cg@exept.de>
parents: 2710
diff changeset
   108
    ].
cd54d69eec13 changed:
Claus Gittinger <cg@exept.de>
parents: 2710
diff changeset
   109
2435
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   110
    key isCharacter ifTrue:[
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   111
        lcKey := key asLowercase.
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   112
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   113
        lcKey == $a ifTrue:[
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   114
            obj := lastApplication
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   115
        ].
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   116
        lcKey == $o ifTrue:[
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   117
            obj := lastView model
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   118
        ].
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   119
        lcKey == $m ifTrue:[
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   120
            obj := lastApplication masterApplication
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   121
        ].
2435
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   122
        lcKey == $v ifTrue:[
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   123
            obj := lastView
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   124
        ].
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   125
        lcKey == $t ifTrue:[
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   126
            obj := lastView topView
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   127
        ].
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   128
        obj notNil ifTrue:[
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   129
            key isLowercase ifTrue:[
2823
cd54d69eec13 changed:
Claus Gittinger <cg@exept.de>
parents: 2710
diff changeset
   130
                objToInspect := obj
2435
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   131
            ] ifFalse:[
2823
cd54d69eec13 changed:
Claus Gittinger <cg@exept.de>
parents: 2710
diff changeset
   132
                objToBrowse := obj
2435
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   133
            ].
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   134
        ].
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
    ].
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
2823
cd54d69eec13 changed:
Claus Gittinger <cg@exept.de>
parents: 2710
diff changeset
   137
    objToInspect notNil ifTrue:[
cd54d69eec13 changed:
Claus Gittinger <cg@exept.de>
parents: 2710
diff changeset
   138
        [ objToInspect inspect ] forkAt:(Processor userSchedulingPriority).
cd54d69eec13 changed:
Claus Gittinger <cg@exept.de>
parents: 2710
diff changeset
   139
    ].
cd54d69eec13 changed:
Claus Gittinger <cg@exept.de>
parents: 2710
diff changeset
   140
    objToBrowse notNil ifTrue:[
cd54d69eec13 changed:
Claus Gittinger <cg@exept.de>
parents: 2710
diff changeset
   141
        [ objToBrowse browse ] forkAt:(Processor userSchedulingPriority).
cd54d69eec13 changed:
Claus Gittinger <cg@exept.de>
parents: 2710
diff changeset
   142
    ].
cd54d69eec13 changed:
Claus Gittinger <cg@exept.de>
parents: 2710
diff changeset
   143
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
    ^ true
2823
cd54d69eec13 changed:
Claus Gittinger <cg@exept.de>
parents: 2710
diff changeset
   145
cd54d69eec13 changed:
Claus Gittinger <cg@exept.de>
parents: 2710
diff changeset
   146
    "Modified: / 12-11-2010 / 11:38:23 / cg"
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   147
! !
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   148
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   149
!FlyByWindowInformation methodsFor:'help texts'!
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   150
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
helpTextFor:aView at:aPointOrNil
2699
22dd96b4e37f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   152
    "generate the text to be shown as popup-flyby info"
22dd96b4e37f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   153
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
    lastView := aView.
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   155
    lastApplication := aView application.
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
    ^ String streamContents:[:s |
2700
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   158
        |topViewToInspect applicationToInspect masterApplicationToInspect modelToInspect
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   159
         genComponentNameForApplication|
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   160
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   161
        genComponentNameForApplication := [:app :s |
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   162
                (app notNil 
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   163
                and:[ app builder notNil ]) ifTrue:[
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   164
                    |components v|
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   165
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   166
                    components := app builder namedComponents.
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   167
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   168
                    v := aView.
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   169
                    [   (components includes:v) not
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   170
                        and:[v container notNil]
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   171
                    ] whileTrue:[
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   172
                        v := v container.
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   173
                    ].
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   174
                    (components includes:v) ifTrue:[
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   175
                        |k|
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   176
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   177
                        k := components keyAtValue:v.
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   178
                        v == aView ifTrue:[
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   179
                            s nextPutLine:('   Component: ' , k).
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   180
                        ] ifFalse:[
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   181
                            s nextPutLine:('   Subview of Component: ' , k).
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   182
                        ].
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   183
                    ].
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   184
                ].
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   185
            ].
2314
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   186
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   187
        aView topView ~~ aView ifTrue:[
2314
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   188
            topViewToInspect := aView topView.
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   189
        ].
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
        lastApplication notNil ifTrue:[
2314
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   191
            applicationToInspect := lastApplication.
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   192
            masterApplicationToInspect := lastApplication masterApplication.
2700
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   193
            masterApplicationToInspect == applicationToInspect ifTrue:[
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   194
                masterApplicationToInspect := nil
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   195
            ].
2314
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   196
        ].
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   197
        aView model notNil ifTrue:[
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   198
            modelToInspect := aView model.
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   199
            ((modelToInspect == applicationToInspect)
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   200
            or:[ modelToInspect == masterApplicationToInspect ]) ifTrue:[
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   201
                modelToInspect := nil.
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   202
            ].
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   203
        ].
2314
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   204
2352
ed9a6f37f85b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
   205
        s nextPutLine:('View: ' , aView class name, ' "',aView name printString,'"').
2314
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   206
        modelToInspect notNil ifTrue:[
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   207
            s nextPutLine:('Model: ' , modelToInspect class name).
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   208
        ].
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   209
        topViewToInspect notNil ifTrue:[
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   210
            s nextPutLine:('Topview: ' , topViewToInspect class name).
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   211
        ].
2700
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   212
        masterApplicationToInspect notNil ifTrue:[
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   213
            s nextPutLine:('Masterapplication: ' , masterApplicationToInspect class name).
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   214
            genComponentNameForApplication value:masterApplicationToInspect value:s.
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   215
        ].
2314
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   216
        applicationToInspect notNil ifTrue:[
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   217
            s nextPutLine:('Application: ' , applicationToInspect class name).
2700
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   218
            genComponentNameForApplication value:applicationToInspect value:s.
2314
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   219
        ].
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   220
2699
22dd96b4e37f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   221
        "/ identity it as component
22dd96b4e37f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   222
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   223
        s cr.
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   224
        s nextPutLine:'Press:'.
2435
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   225
        s nextPutLine:'    ? to show the viewtree'.
2314
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   226
        applicationToInspect notNil ifTrue:[
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   227
            s nextPutLine:'    a to inspect application (A to browse)'.
2314
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   228
            masterApplicationToInspect notNil ifTrue:[
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   229
                s nextPutLine:'    m to inspect masterApplication (M to browse)'.
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   230
            ].
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   231
        ].
2823
cd54d69eec13 changed:
Claus Gittinger <cg@exept.de>
parents: 2710
diff changeset
   232
        s nextPutLine:'    v to inspect view (V to browse)'.
cd54d69eec13 changed:
Claus Gittinger <cg@exept.de>
parents: 2710
diff changeset
   233
        topViewToInspect notNil ifTrue:[
cd54d69eec13 changed:
Claus Gittinger <cg@exept.de>
parents: 2710
diff changeset
   234
            s nextPutLine:'    t to inspect topView (T to browse)'.
cd54d69eec13 changed:
Claus Gittinger <cg@exept.de>
parents: 2710
diff changeset
   235
        ].
cd54d69eec13 changed:
Claus Gittinger <cg@exept.de>
parents: 2710
diff changeset
   236
        modelToInspect notNil ifTrue:[
cd54d69eec13 changed:
Claus Gittinger <cg@exept.de>
parents: 2710
diff changeset
   237
            s nextPutLine:'    o to inspect model (O to browse)'.
cd54d69eec13 changed:
Claus Gittinger <cg@exept.de>
parents: 2710
diff changeset
   238
        ].
cd54d69eec13 changed:
Claus Gittinger <cg@exept.de>
parents: 2710
diff changeset
   239
        s cr.
cd54d69eec13 changed:
Claus Gittinger <cg@exept.de>
parents: 2710
diff changeset
   240
        s nextPutLine:'RETURN to browse application.'.
cd54d69eec13 changed:
Claus Gittinger <cg@exept.de>
parents: 2710
diff changeset
   241
        s nextPutAll:'ESC or click to leave flyBy-info mode.'.
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   242
    ]
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   244
    "
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   245
     self shownInformationOfViewUnderMouseUntilButtonIsPressed
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   246
    "
2823
cd54d69eec13 changed:
Claus Gittinger <cg@exept.de>
parents: 2710
diff changeset
   247
cd54d69eec13 changed:
Claus Gittinger <cg@exept.de>
parents: 2710
diff changeset
   248
    "Modified: / 12-11-2010 / 11:39:34 / cg"
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   249
! !
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   250
2710
0ce76feb3f91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2702
diff changeset
   251
!FlyByWindowInformation methodsFor:'private'!
0ce76feb3f91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2702
diff changeset
   252
0ce76feb3f91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2702
diff changeset
   253
targetViewInitiatesHelpViaSensor
0ce76feb3f91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2702
diff changeset
   254
    ^ false
0ce76feb3f91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2702
diff changeset
   255
! !
0ce76feb3f91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2702
diff changeset
   256
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   257
!FlyByWindowInformation methodsFor:'queries'!
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   258
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   259
toolTipFollowsMouse
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   260
    ^ true
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   261
! !
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   262
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   263
!FlyByWindowInformation methodsFor:'start & stop'!
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   264
2699
22dd96b4e37f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   265
initiateHelpFor:aView at:aPointOrNil
2710
0ce76feb3f91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2702
diff changeset
   266
    self initiateHelpFor:aView at:aPointOrNil now:true
2699
22dd96b4e37f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   267
!
22dd96b4e37f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   268
22dd96b4e37f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   269
initiateHelpFor:aView at:aPointOrNil now:showItNow
2702
96f1dbce3d00 changed:5 methods
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
   270
    finished == true ifTrue:[^ self].
2699
22dd96b4e37f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   271
    super initiateHelpFor:aView at:aPointOrNil now:showItNow
22dd96b4e37f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   272
!
22dd96b4e37f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   273
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   274
start
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   275
    |l|
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   276
2702
96f1dbce3d00 changed:5 methods
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
   277
    finished == true ifTrue:[^ self].
96f1dbce3d00 changed:5 methods
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
   278
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   279
    l := FlyByHelp currentHelpListener.
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   280
    l notNil ifTrue:[
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   281
        FlyByHelp stop.
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   282
        cleanupAction := [ FlyByHelp start ].
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   283
    ].
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   284
    finishSemaphore := Semaphore new.
2699
22dd96b4e37f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   285
    finished := false.
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   286
    super start.
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   287
!
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   288
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   289
stop
2699
22dd96b4e37f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   290
    finished := true.
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   291
    super stop.
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   292
    cleanupAction value.
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   293
    finishSemaphore notNil ifTrue:[
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   294
        finishSemaphore signalIf.
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   295
    ].
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   296
!
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   297
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   298
waitUntilFinished
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   299
    finishSemaphore wait.
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   300
! !
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   301
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   302
!FlyByWindowInformation class methodsFor:'documentation'!
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   303
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   304
version
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   305
    ^ '$Header$'
2587
81f38cd168a7 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
   306
!
81f38cd168a7 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
   307
81f38cd168a7 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
   308
version_CVS
81f38cd168a7 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
   309
    ^ '$Header$'
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   310
! !