FlyByWindowInformation.st
author Claus Gittinger <cg@exept.de>
Tue, 09 Mar 2010 13:10:54 +0100
changeset 2769 a63d3048fc9c
parent 2710 0ce76feb3f91
child 2823 cd54d69eec13
permissions -rw-r--r--
code deobfuscated: expr not ifTrue: -> expr ifFalse:
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
2435
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
    91
    |obj action 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
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   106
    key isCharacter ifTrue:[
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   107
        lcKey := key asLowercase.
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   108
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   109
        lcKey == $a ifTrue:[
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   110
            obj := lastApplication
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   111
        ].
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   112
        lcKey == $o ifTrue:[
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   113
            obj := lastView model
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   114
        ].
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   115
        lcKey == $m ifTrue:[
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   116
            obj := lastApplication masterApplication
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   117
        ].
2435
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   118
        lcKey == $v ifTrue:[
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   119
            obj := lastView
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   120
        ].
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   121
        lcKey == $t ifTrue:[
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   122
            obj := lastView topView
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   123
        ].
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   124
        obj notNil ifTrue:[
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   125
            key isLowercase ifTrue:[
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   126
                action := [ obj inspect ].
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   127
            ] ifFalse:[
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   128
                action := [ obj browse ].
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   129
            ].
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   130
            action forkAt:8.
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   131
        ].
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   132
    ].
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   133
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   134
    ^ true
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   135
! !
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   136
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   137
!FlyByWindowInformation methodsFor:'help texts'!
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   138
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   139
helpTextFor:aView at:aPointOrNil
2699
22dd96b4e37f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   140
    "generate the text to be shown as popup-flyby info"
22dd96b4e37f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   141
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
    lastView := aView.
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
    lastApplication := aView application.
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   144
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
    ^ String streamContents:[:s |
2700
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   146
        |topViewToInspect applicationToInspect masterApplicationToInspect modelToInspect
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   147
         genComponentNameForApplication|
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   148
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   149
        genComponentNameForApplication := [:app :s |
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   150
                (app notNil 
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   151
                and:[ app builder notNil ]) ifTrue:[
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   152
                    |components v|
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   153
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   154
                    components := app builder namedComponents.
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   155
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   156
                    v := aView.
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   157
                    [   (components includes:v) not
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   158
                        and:[v container notNil]
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   159
                    ] whileTrue:[
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   160
                        v := v container.
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   161
                    ].
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   162
                    (components includes:v) ifTrue:[
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   163
                        |k|
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   164
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   165
                        k := components keyAtValue:v.
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   166
                        v == aView ifTrue:[
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   167
                            s nextPutLine:('   Component: ' , k).
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   168
                        ] ifFalse:[
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   169
                            s nextPutLine:('   Subview of Component: ' , k).
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   170
                        ].
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   171
                    ].
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   172
                ].
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   173
            ].
2314
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   174
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
        aView topView ~~ aView ifTrue:[
2314
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   176
            topViewToInspect := aView topView.
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   177
        ].
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
        lastApplication notNil ifTrue:[
2314
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   179
            applicationToInspect := lastApplication.
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   180
            masterApplicationToInspect := lastApplication masterApplication.
2700
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   181
            masterApplicationToInspect == applicationToInspect ifTrue:[
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   182
                masterApplicationToInspect := nil
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   183
            ].
2314
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   184
        ].
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   185
        aView model notNil ifTrue:[
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   186
            modelToInspect := aView model.
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   187
            ((modelToInspect == applicationToInspect)
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   188
            or:[ modelToInspect == masterApplicationToInspect ]) ifTrue:[
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   189
                modelToInspect := nil.
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
            ].
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
        ].
2314
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   192
2352
ed9a6f37f85b *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2340
diff changeset
   193
        s nextPutLine:('View: ' , aView class name, ' "',aView name printString,'"').
2314
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   194
        modelToInspect notNil ifTrue:[
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   195
            s nextPutLine:('Model: ' , modelToInspect class name).
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
        topViewToInspect notNil ifTrue:[
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   198
            s nextPutLine:('Topview: ' , topViewToInspect class name).
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   199
        ].
2700
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   200
        masterApplicationToInspect notNil ifTrue:[
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   201
            s nextPutLine:('Masterapplication: ' , masterApplicationToInspect class name).
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   202
            genComponentNameForApplication value:masterApplicationToInspect value:s.
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   203
        ].
2314
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   204
        applicationToInspect notNil ifTrue:[
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   205
            s nextPutLine:('Application: ' , applicationToInspect class name).
2700
bad11f9b735f #helpTextFor:at: - also show component's name
Claus Gittinger <cg@exept.de>
parents: 2699
diff changeset
   206
            genComponentNameForApplication value:applicationToInspect value:s.
2314
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   207
        ].
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   208
2699
22dd96b4e37f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   209
        "/ identity it as component
22dd96b4e37f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   210
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   211
        s cr.
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   212
        s nextPutLine:'Press:'.
2435
f803a14907b4 ? - command added
Claus Gittinger <cg@exept.de>
parents: 2352
diff changeset
   213
        s nextPutLine:'    ? to show the viewtree'.
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   214
        s nextPutLine:'    v to inspect view (V to browse)'.
2314
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   215
        modelToInspect notNil ifTrue:[
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   216
            s nextPutLine:'    o to inspect model (O to browse)'.
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   217
        ].
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   218
        topViewToInspect notNil ifTrue:[
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   219
            s nextPutLine:'    t to inspect topView (T to browse)'.
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   220
        ].
2314
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   221
        applicationToInspect notNil ifTrue:[
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   222
            s nextPutLine:'    a to inspect application (A to browse)'.
2314
e65082256c46 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2300
diff changeset
   223
            masterApplicationToInspect notNil ifTrue:[
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   224
                s nextPutLine:'    m to inspect masterApplication (M to browse)'.
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   225
            ].
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   226
        ].
2493
b19544e382b7 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2435
diff changeset
   227
        s nextPutAll:'ESC or button to leave flyBy-info mode.'.
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   228
    ]
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   229
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   230
    "
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   231
     self shownInformationOfViewUnderMouseUntilButtonIsPressed
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   232
    "
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   233
! !
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   234
2710
0ce76feb3f91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2702
diff changeset
   235
!FlyByWindowInformation methodsFor:'private'!
0ce76feb3f91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2702
diff changeset
   236
0ce76feb3f91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2702
diff changeset
   237
targetViewInitiatesHelpViaSensor
0ce76feb3f91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2702
diff changeset
   238
    ^ false
0ce76feb3f91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2702
diff changeset
   239
! !
0ce76feb3f91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2702
diff changeset
   240
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   241
!FlyByWindowInformation methodsFor:'queries'!
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   242
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
toolTipFollowsMouse
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   244
    ^ true
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   245
! !
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   246
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   247
!FlyByWindowInformation methodsFor:'start & stop'!
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   248
2699
22dd96b4e37f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   249
initiateHelpFor:aView at:aPointOrNil
2710
0ce76feb3f91 *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2702
diff changeset
   250
    self initiateHelpFor:aView at:aPointOrNil now:true
2699
22dd96b4e37f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   251
!
22dd96b4e37f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   252
22dd96b4e37f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   253
initiateHelpFor:aView at:aPointOrNil now:showItNow
2702
96f1dbce3d00 changed:5 methods
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
   254
    finished == true ifTrue:[^ self].
2699
22dd96b4e37f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   255
    super initiateHelpFor:aView at:aPointOrNil now:showItNow
22dd96b4e37f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   256
!
22dd96b4e37f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   257
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   258
start
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   259
    |l|
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   260
2702
96f1dbce3d00 changed:5 methods
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
   261
    finished == true ifTrue:[^ self].
96f1dbce3d00 changed:5 methods
Claus Gittinger <cg@exept.de>
parents: 2700
diff changeset
   262
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   263
    l := FlyByHelp currentHelpListener.
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   264
    l notNil ifTrue:[
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   265
        FlyByHelp stop.
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   266
        cleanupAction := [ FlyByHelp start ].
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   267
    ].
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   268
    finishSemaphore := Semaphore new.
2699
22dd96b4e37f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   269
    finished := false.
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   270
    super start.
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   271
!
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   272
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   273
stop
2699
22dd96b4e37f *** empty log message ***
Claus Gittinger <cg@exept.de>
parents: 2587
diff changeset
   274
    finished := true.
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   275
    super stop.
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   276
    cleanupAction value.
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   277
    finishSemaphore notNil ifTrue:[
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   278
        finishSemaphore signalIf.
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   279
    ].
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   280
!
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   281
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   282
waitUntilFinished
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   283
    finishSemaphore wait.
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   284
! !
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   285
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   286
!FlyByWindowInformation class methodsFor:'documentation'!
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   287
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   288
version
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   289
    ^ '$Header$'
2587
81f38cd168a7 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
   290
!
81f38cd168a7 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
   291
81f38cd168a7 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
   292
version_CVS
81f38cd168a7 added: #copyright
Claus Gittinger <cg@exept.de>
parents: 2543
diff changeset
   293
    ^ '$Header$'
2300
afddc24415dc initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   294
! !