ShowMeHowItWorks.st
author Claus Gittinger <cg@exept.de>
Thu, 31 Oct 2019 13:40:45 +0100
changeset 3803 34ea88ec4dc4
parent 3801 e45e18e26a7d
child 3804 2355596aec0a
permissions -rw-r--r--
#FEATURE by exept class: ShowMeHowItWorks class definition added: #findApplication:ifMultiple: #popApplication #pushApplication: #selectComponent: comment/format in: #application: changed: #select: #showing:saying:do:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3792
7682b28c1e92 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
     1
"{ Encoding: utf8 }"
7682b28c1e92 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
     2
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     3
"{ Package: 'stx:libtool2' }"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     4
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     5
"{ NameSpace: Smalltalk }"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     6
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
     7
Object subclass:#ShowMeHowItWorks
3783
e935b92253c9 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3781
diff changeset
     8
	instanceVariableNames:'application opStream streamStack lastComponentName lastComponent
e935b92253c9 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3781
diff changeset
     9
		lastResult voice translate language verifying
3795
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
    10
		closeApplicationWhenFinished defaultComponentWaitTime ui
3803
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
    11
		theShowFile defaultElementTimeout applicationStack'
3790
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
    12
	classVariableNames:'IntroShownCount DebugMode StartLabel'
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
	poolDictionaries:''
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
	category:'Interface-Help'
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
3796
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
    17
Object subclass:#ItemInView
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
    18
	instanceVariableNames:'view item boundsInView'
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
    19
	classVariableNames:''
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
    20
	poolDictionaries:''
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
    21
	privateIn:ShowMeHowItWorks
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
    22
!
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
    23
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
!ShowMeHowItWorks class methodsFor:'documentation'!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
documentation
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
"
3713
fa10e87dbf04 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3711
diff changeset
    28
    automatic presentations.
fa10e87dbf04 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3711
diff changeset
    29
    To see how it works, open a methodFinder:
fa10e87dbf04 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3711
diff changeset
    30
        MethodFinderWindow open
fa10e87dbf04 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3711
diff changeset
    31
    and select its 'Show me how it works' item in the help menu.
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
    [author:]
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
        Claus Gittinger
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
example
3713
fa10e87dbf04 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3711
diff changeset
    39
    MethodFinderWindow open.
fa10e87dbf04 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3711
diff changeset
    40
    
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
    ShowMeHowItWorks do:#(
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
        ( showing: 'Choose the number of arguments' do:(
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
            moveTo: NumberOfArguments
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
            select: '1' 
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
        ))  
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
        (showing: 'Click into the "receiver" field' do:(
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
            moveTo: ReceiverEditor
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
            click: ReceiverEditor 
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
        ))
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
        (showing: 'Enter a value (or expression) into "receiver" field' do:(
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
            enter: '100'
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
        ))
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
        (showing: 'Click into the "first argument" field' do:(
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
            moveTo: Arg1Editor
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
            click: ReceiverEditor
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
        ))
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
        (showing: 'Enter a value (or expression) into "receiver" field' do:(
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    58
            enter: '100'
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    59
        ))
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    60
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
    )
3795
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
    62
!
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
    63
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
    64
scriptFormat
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
    65
"
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
    66
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
    67
    speaking:
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
    68
        show:           'text'
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
    69
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
    70
    mouse movement:
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
    71
        moveTo:         '<component>'       move there and circle around
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
    72
        fastMoveTo:     '<component>'       move without circling
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
    73
        (drag: '<fromComponent>' toComponent: '<toComponent>' dropAt:<pos> show:'text')
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
    74
            pos is one of #topLeft, #topCenter, #topRght, #bottomLeft, #bottomCenter, #bottomRight
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
    75
            text is spoken before the drop
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
    76
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
    77
    mouse actions:
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
    78
        click
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
    79
        click:          buttonNumber
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
    80
        select:         itemsIndexOrLabelOrPattern
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
    81
            itemsIndexOrLabelOrPattern can be an integer or text
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
    82
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
    83
    misc:
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
    84
        wait:           seconds             just pause
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
    85
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
    86
        label:          'name'              for debugging, presentation can be started at some
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
    87
                                            label, by setting the StartLabel class variable
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
    88
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
    89
        (waitFor: '<component>' timeout:seconds)
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
    90
                                            wait for a component to appear
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
    91
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
    92
        open            'nameOfAppModelClass'
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
    93
                                            open an application (class)
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
    94
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
    95
        raise           'application'
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
    96
        raise           'masterApplication'
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
    97
3795
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
    98
        intro           
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
    99
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   100
component naming:
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   101
    '<component>' can be:
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   102
        name of a component, as defined in the UI-spec's nameKey,
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   103
        helpKey
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   104
        title
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   105
        label
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   106
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   107
     a path like 'ProjectTree/ToolBar' will first find ProjectTrue, then ToolBar
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   108
     a menu item index like 'Toolbar/item[idx]'
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   109
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   110
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   111
"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   112
! !
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   113
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   114
!ShowMeHowItWorks class methodsFor:'running'!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
3775
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   116
application:anApplicationOrNilForAll do:specArray 
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   117
    "spec contains a list of action commands (show: / moveTo: etc.)"
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   118
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   119
    self new 
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   120
        application:anApplicationOrNilForAll;
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   121
        do:specArray 
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   122
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   123
    "
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   124
     ShowMeHowItWorks do:
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   125
        #(
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   126
            (language: de)
3792
7682b28c1e92 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
   127
            (show: 'üben üben üben')
3775
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   128
            (wait: 0.5)
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   129
            (moveTo: NameOfComponent)
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   130
        )    
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   131
    "
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   132
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   133
    "Created: / 19-07-2019 / 10:52:59 / Claus Gittinger"
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   134
    "Modified (comment): / 23-07-2019 / 10:26:42 / Claus Gittinger"
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   135
!
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   136
3795
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   137
application:anApplicationOrNilForAll doShowFile:aFilename 
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   138
    "spec contains a list of action commands (show: / moveTo: etc.)"
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   139
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   140
    self new 
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   141
        application:anApplicationOrNilForAll;
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   142
        doShowFile:aFilename 
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   143
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   144
    "
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   145
     ShowMeHowItWorks do:
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   146
        #(
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   147
            (language: de)
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   148
            (show: 'üben üben üben')
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   149
            (wait: 0.5)
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   150
            (moveTo: NameOfComponent)
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   151
        )    
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   152
    "
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   153
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   154
    "Created: / 19-07-2019 / 10:52:59 / Claus Gittinger"
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   155
    "Modified (comment): / 23-07-2019 / 10:26:42 / Claus Gittinger"
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   156
!
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   157
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   158
do:specArray
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   159
    "spec contains a list of action commands (show: / moveTo: etc.)"
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   160
3784
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
   161
    self do:specArray withUI:false
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   162
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   163
    "
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   164
     ShowMeHowItWorks do:
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   165
        #(
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   166
            (language: de)
3792
7682b28c1e92 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
   167
            (show: 'üben üben üben')
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   168
            (wait: 0.5)
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   169
            (moveTo: NameOfComponent)
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   170
        )    
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   171
    "
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   172
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   173
    "Created: / 19-07-2019 / 10:52:59 / Claus Gittinger"
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   174
    "Modified (comment): / 23-07-2019 / 10:26:42 / Claus Gittinger"
3784
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
   175
!
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
   176
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   177
do:specArray from:startLabelOrNil withUI:withUIBoolean
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   178
    "spec contains a list of action commands (show: / moveTo: etc.)"
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   179
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   180
    self new 
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   181
        do:specArray 
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   182
        from:startLabelOrNil
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   183
        withUI:withUIBoolean
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   184
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   185
    "
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   186
     ShowMeHowItWorks 
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   187
        do:#(
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   188
            (language: de)
3792
7682b28c1e92 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
   189
            (show: 'üben üben üben')
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   190
            (wait: 0.5)
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   191
            (moveTo: NameOfComponent)
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   192
        )
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   193
        withUI:true
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   194
    "
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   195
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   196
    "Created: / 19-07-2019 / 10:52:59 / Claus Gittinger"
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   197
    "Modified (comment): / 23-07-2019 / 10:26:42 / Claus Gittinger"
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   198
!
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   199
3784
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
   200
do:specArray withUI:withUIBoolean
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
   201
    "spec contains a list of action commands (show: / moveTo: etc.)"
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
   202
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
   203
    self new do:specArray withUI:withUIBoolean
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
   204
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
   205
    "
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
   206
     ShowMeHowItWorks 
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
   207
        do:#(
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
   208
            (language: de)
3792
7682b28c1e92 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
   209
            (show: 'üben üben üben')
3784
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
   210
            (wait: 0.5)
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
   211
            (moveTo: NameOfComponent)
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
   212
        )
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
   213
        withUI:true
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
   214
    "
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
   215
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
   216
    "Created: / 19-07-2019 / 10:52:59 / Claus Gittinger"
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
   217
    "Modified (comment): / 23-07-2019 / 10:26:42 / Claus Gittinger"
3713
fa10e87dbf04 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3711
diff changeset
   218
! !
fa10e87dbf04 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3711
diff changeset
   219
fa10e87dbf04 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3711
diff changeset
   220
!ShowMeHowItWorks methodsFor:'accessing'!
fa10e87dbf04 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3711
diff changeset
   221
3775
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   222
application:anApplication
3803
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   223
    "if set, only that application is presented (widget search is limited to that one)"
3775
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   224
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   225
    application := anApplication.
3795
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   226
!
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   227
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   228
setLanguage:lang
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   229
    voice := OperatingSystem bestVoiceForLanguage:lang.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   230
    language := lang.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   231
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   232
    "Created: / 23-07-2019 / 10:27:02 / Claus Gittinger"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   233
! !
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   234
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   235
!ShowMeHowItWorks methodsFor:'commands'!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   236
3798
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   237
freezePin:pinName ofStep:stepName with:freezeString
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   238
    <action>
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   239
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   240
    |diagramEditor pinPO|
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   241
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   242
    (diagramEditor := lastComponent) isScrollWrapper ifTrue:[
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   243
        diagramEditor := lastComponent scrolledView
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   244
    ].
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   245
    pinPO := self pinPOForPin:pinName ofStep:stepName. 
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   246
3798
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   247
    diagramEditor selection:{ pinPO }.
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   248
    diagramEditor doubleClickOn:pinPO.
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   249
    self fastMoveTo:(lastComponentName,'/','EditField').
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   250
    self click.
3800
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
   251
    self clear.
3798
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   252
    self type:freezeString.
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   253
    self key:#Return.
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   254
!
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   255
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   256
intro
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   257
    <action>
3724
e513514f6ce7 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3717
diff changeset
   258
3775
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   259
    verifying ifTrue:[^ self].
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   260
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   261
    IntroShownCount := (IntroShownCount ? 0).
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   262
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   263
    "/ only say this a few times..
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   264
    IntroShownCount > 3 ifTrue:[^ self].
3775
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   265
    IntroShownCount := IntroShownCount + 1.
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   266
3795
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   267
    language isNil ifTrue:[
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   268
        self setLanguage:(Smalltalk language). 
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   269
    ].
3724
e513514f6ce7 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3717
diff changeset
   270
    self tell:(self class classResources 
3733
1da1137b6f23 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3730
diff changeset
   271
                string:'You can stop this show, by pressing the SHIFT key').
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   272
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   273
    "Created: / 19-07-2019 / 15:49:19 / Claus Gittinger"
3733
1da1137b6f23 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3730
diff changeset
   274
    "Modified: / 23-07-2019 / 11:06:13 / Claus Gittinger"
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   275
!
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   276
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   277
label:nameOfLabel
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   278
    <action>
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   279
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   280
    "/ skipped here; see goto
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   281
!
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   282
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   283
language:lang
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   284
    <action>
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   285
3795
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   286
    self setLanguage:lang.
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   287
    translate := false.
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   288
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   289
    "Created: / 23-07-2019 / 10:27:02 / Claus Gittinger"
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   290
!
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   291
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   292
open:applicationClassName
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   293
    <action>
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   294
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   295
    |appClass|
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   296
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   297
    (appClass := Smalltalk classNamed:applicationClassName) isNil ifTrue:[
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   298
        self error:'no such application class'
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   299
    ].
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   300
    verifying ifFalse:[
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   301
        application := appClass new openAndWaitUntilVisible.
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   302
        closeApplicationWhenFinished := true.
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   303
    ].
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   304
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   305
    "Created: / 19-07-2019 / 15:09:45 / Claus Gittinger"
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   306
!
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   307
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   308
pause
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   309
    <action>
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   310
    
3724
e513514f6ce7 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3717
diff changeset
   311
    Dialog information:(self class classResources 
e513514f6ce7 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3717
diff changeset
   312
                            stringWithCRs:'Show Paused.\Click on "OK" to proceed')
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   313
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   314
    "Created: / 19-07-2019 / 15:03:17 / Claus Gittinger"
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   315
    "Modified: / 19-07-2019 / 16:13:33 / Claus Gittinger"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   316
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   317
3803
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   318
popApplication
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   319
    <action>
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   320
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   321
    "go back to the previous app"
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   322
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   323
    application := applicationStack removeLast.
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   324
!
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   325
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   326
pushApplication:newApplicationOrName
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   327
    <action>
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   328
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   329
    "goto another app, remembering where we were before"
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   330
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   331
    |newApplication|
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   332
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   333
    (newApplication := newApplicationOrName) isString ifTrue:[
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   334
        newApplication := self findApplication:newApplicationOrName ifMultiple:nil.
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   335
        self assert: newApplication notNil.
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   336
    ].
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   337
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   338
    applicationStack isNil ifTrue:[applicationStack := OrderedCollection new].
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   339
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   340
    applicationStack add:application.
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   341
    self application:newApplication.
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   342
!
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   343
3776
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   344
raise:what
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   345
    <action>
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   346
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   347
    verifying ifTrue:[^ self].
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   348
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   349
    what == #application ifTrue:[
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   350
        application topView raise.
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   351
        ^ self
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   352
    ].
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   353
    what == #masterApplication ifTrue:[
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   354
        application windowGroup isModal ifTrue:[
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   355
            application windowGroup mainGroup topViews first raise
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   356
        ] ifFalse:[
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   357
            (application masterApplication ? application) topViews first raise.
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   358
        ].
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   359
        ^ self
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   360
    ].
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   361
    self halt.
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   362
!
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   363
3798
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   364
selectPin:pinName ofStep:stepName
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   365
    <action>
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   366
3800
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
   367
    |diagramEditor pinPO count|
3798
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   368
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   369
    (diagramEditor := lastComponent) isScrollWrapper ifTrue:[
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   370
        diagramEditor := lastComponent scrolledView
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   371
    ].
3800
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
   372
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
   373
    count := 0.
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
   374
    [
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
   375
        Delay waitForSeconds:0.1.
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
   376
        pinPO := self pinPOForPin:pinName ofStep:stepName.
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
   377
    ] doWhile:[pinPO isNil and:[ (count := count+1) < 20]].
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
   378
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
   379
    self movePointerToComponent:diagramEditor offset:(pinPO frame center).
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   380
    diagramEditor selection:{ pinPO }. 
3798
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   381
!
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   382
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   383
show:message
3714
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   384
    "showing (and speak) some message."
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   385
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   386
    <action>
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   387
    
3776
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   388
    self showing:message saying:nil do:nil
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   389
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   390
    "Created: / 19-07-2019 / 15:59:18 / Claus Gittinger"
3714
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   391
    "Modified (comment): / 19-07-2019 / 18:54:36 / Claus Gittinger"
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   392
!
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   393
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   394
show:message for:seconds
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   395
    "showing (and speak) some message and wait for some time."
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   396
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   397
    <action>
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   398
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   399
    DebugMode == true ifTrue:[^ self].
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   400
3714
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   401
    self show:message.
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   402
    self wait:seconds.
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   403
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   404
    "Created: / 19-07-2019 / 18:54:20 / Claus Gittinger"
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   405
!
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   406
3776
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   407
show:message saying:sentenceOrNil
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   408
    "showing (and speak) some message."
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   409
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   410
    <action>
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   411
    
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   412
    self showing:message saying:sentenceOrNil do:nil
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   413
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   414
    "Created: / 19-07-2019 / 15:59:18 / Claus Gittinger"
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   415
    "Modified (comment): / 19-07-2019 / 18:54:36 / Claus Gittinger"
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   416
!
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   417
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   418
show:message saying:sentenceOrNil for:seconds
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   419
    "showing (and speak) some message and wait for some time."
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   420
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   421
    <action>
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   422
    
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   423
    DebugMode == true ifTrue:[^ self].
3776
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   424
    self show:message saying:sentenceOrNil.
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   425
    self wait:seconds.
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   426
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   427
    "Created: / 19-07-2019 / 18:54:20 / Claus Gittinger"
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   428
!
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   429
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   430
showing:message do:operationsOrNothing
3714
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   431
    "execute operationsOrNothing while showing (and speaking) some message."
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   432
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   433
    <action>
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   434
    
3776
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   435
    self showing:message saying:nil do:operationsOrNothing
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   436
!
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   437
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   438
showing:message saying:sentenceOrNil do:operationsOrNothing
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   439
    "execute operationsOrNothing while showing (and speaking) some message."
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   440
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   441
    <action>
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   442
    
3715
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
   443
    |xLatedMessage messageView talkDone|
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   444
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   445
    xLatedMessage := (translate and:[application notNil]) 
3803
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   446
                            ifTrue:[application resources stringWithCRs:message]
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   447
                            ifFalse:[message withCRs].
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   448
    
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   449
    self assert:(operationsOrNothing isNil or:[operationsOrNothing isSequenceable]).
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   450
3715
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
   451
    messageView := ActiveHelpView for:xLatedMessage.
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   452
    "/ messageView shapeStyle:#cartoon.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   453
    [
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   454
        messageView origin:(Screen current pointerPosition + (0 @ 20)).
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   455
        messageView makeFullyVisible.
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   456
        messageView realize.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   457
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   458
        self talking ifTrue:[
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   459
            talkDone := Semaphore new.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   460
            [
3776
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   461
                self tell:(sentenceOrNil ? xLatedMessage).
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   462
                talkDone signal
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   463
            ] fork.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   464
            
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   465
            "/
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   466
            "/ allow speaker some headoff
3775
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   467
            verifying ifFalse:[
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   468
                Delay waitForSeconds:(xLatedMessage size / 15)+0.5.
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   469
            ].
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   470
        ].
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   471
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   472
        operationsOrNothing notEmptyOrNil ifTrue:[
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   473
            self doStream:(operationsOrNothing readStream).
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   474
        ].
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   475
    ] ensure:[
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   476
        messageView destroy
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   477
    ].
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   478
    self talking ifTrue:[
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   479
        talkDone wait.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   480
    ].
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   481
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   482
    "Created: / 19-07-2019 / 11:19:27 / Claus Gittinger"
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   483
    "Modified: / 23-07-2019 / 10:52:30 / Claus Gittinger"
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   484
!
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   485
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   486
thankyou
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   487
    <action>
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   488
    
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   489
    self show:(self randomThankYou).
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   490
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   491
    "Created: / 23-07-2019 / 10:50:43 / Claus Gittinger"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   492
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   493
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   494
timeout:seconds
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   495
    <action>
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   496
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   497
    defaultElementTimeout := seconds.
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   498
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   499
    "Created: / 23-07-2019 / 10:27:02 / Claus Gittinger"
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   500
!
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   501
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   502
wait:seconds
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   503
    <action>
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   504
    
3775
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   505
    verifying ifTrue:[^ self].
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   506
    DebugMode == true ifTrue:[^ self].
3776
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   507
    Display ctrlDown ifTrue:[^ self].
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   508
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   509
    Delay waitForSeconds:seconds
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   510
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   511
    "Created: / 19-07-2019 / 15:09:45 / Claus Gittinger"
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   512
!
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   513
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   514
waitFor:componentName timeout:seconds
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   515
    <action>
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   516
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   517
    |endTime component|
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   518
3781
0040ac44a2f3 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3780
diff changeset
   519
    verifying ifTrue:[^ self].
0040ac44a2f3 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3780
diff changeset
   520
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   521
    lastComponentName := componentName.
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   522
    endTime := Timestamp now + seconds.
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   523
    [   
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   524
        (component := self findComponent:componentName inAllApplications:true ifMultiple:nil) notNil ifTrue:[
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   525
            lastComponent := component.
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   526
            ^ self
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   527
        ].
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   528
        Delay waitForSeconds:0.1.
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   529
        Timestamp now > endTime ifTrue:[
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   530
            self error:('component %1 not present after %2' bindWith:componentName with:seconds)
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   531
        ]
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   532
    ] loop
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   533
! !
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   534
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   535
!ShowMeHowItWorks methodsFor:'commands - checking'!
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   536
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   537
isEmpty:componentName
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   538
    "true if the addressed textview/field is empty.
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   539
     Leaves component in lastComponent"
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   540
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   541
    <action>
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   542
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   543
    |component|
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   544
    
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   545
    component := self componentNamed:componentName.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   546
    component isScrollWrapper ifTrue:[ component := component scrolledView ].
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   547
    component isTextView ifTrue:[
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   548
        ^ component contents isEmptyOrNil
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   549
    ].
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   550
    self error:'isEmpty: unhandled (non-text) component type: ',component displayString.
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   551
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   552
    "Created: / 19-07-2019 / 15:33:47 / Claus Gittinger"
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   553
!
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   554
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   555
unless:query do:actions
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   556
    <action>
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   557
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   558
    |result|
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   559
    
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   560
    result := self doCommand:query.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   561
    result ifFalse:[
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   562
        self doCommand:actions
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   563
    ].
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   564
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   565
    "Created: / 19-07-2019 / 15:33:32 / Claus Gittinger"
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   566
! !
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   567
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   568
!ShowMeHowItWorks methodsFor:'commands - mouse & keyboard'!
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   569
3798
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   570
clear
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   571
    "clear entry fields of last component"
3798
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   572
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   573
    <action>
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   574
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   575
    verifying ifTrue:[^ self].
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   576
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   577
    lastComponent contents:nil
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   578
!
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   579
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   580
click
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   581
    "press-release in last component"
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   582
    
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   583
    <action>
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   584
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   585
    ^ self click:1 inComponent:lastComponent
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   586
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   587
    "Created: / 19-07-2019 / 16:11:03 / Claus Gittinger"
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   588
!
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   589
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   590
click:buttonNr
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   591
    "press-release in last component"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   592
    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   593
    <action>
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   594
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   595
    self assert:(buttonNr isInteger).
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   596
    ^ self click:buttonNr inComponent:lastComponent
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   597
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   598
    "Created: / 19-07-2019 / 13:21:20 / Claus Gittinger"
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   599
    "Modified: / 19-07-2019 / 16:10:19 / Claus Gittinger"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   600
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   601
3800
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
   602
click:buttonNr clickTime:t
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
   603
    "press-release in last component"
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
   604
    
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
   605
    <action>
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
   606
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
   607
    self assert:(buttonNr isInteger).
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
   608
    ^ self click:buttonNr inComponent:lastComponent clickTime:t
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
   609
!
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
   610
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   611
clickIn:componentName
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   612
    "press-release.
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   613
     Leaves component in lastComponent"
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   614
    
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   615
    <action>
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   616
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   617
    ^ self click:1 inComponent:(self componentNamed:componentName)
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   618
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   619
    "Created: / 19-07-2019 / 16:09:58 / Claus Gittinger"
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   620
!
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   621
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   622
drag:itemsIndexOrLabelOrPattern toComponent:targetComponentName dropAt:where
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   623
    "drag an item (by index or label) from the current treeView,
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   624
     into another component.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   625
     where is one of: #top, #center or #bottom.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   626
     allowed after moving to:
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   627
        aSelectionInHierarchyView
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   628
    "    
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   629
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   630
    <action>
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   631
3790
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   632
    self drag:itemsIndexOrLabelOrPattern toComponent:targetComponentName dropAt:where show:nil
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   633
!
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   634
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   635
drag:itemsIndexOrLabelOrPattern toComponent:targetComponentName dropAt:where show:textWhenDroppingOrNil
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   636
    "drag an item (by index or label) from the current treeView,
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   637
     into another component.
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   638
     where is one of: #top, #center or #bottom.
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   639
     allowed after moving to:
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   640
        aSelectionInHierarchyView
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   641
    "    
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   642
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   643
    <action>
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   644
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   645
    |sourceComponent targetComponent idx yPos sourcePos sourcePosOnScreen
3790
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   646
     targetPos targetPosOnScreen targetPosInSource dNdMgr|
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   647
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   648
    verifying ifTrue:[^ self].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   649
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   650
    targetComponent := self findComponent:targetComponentName.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   651
    self assert:targetComponent notNil.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   652
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   653
    ((sourceComponent := lastComponent) isKindOf:ScrollableView) ifTrue:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   654
        sourceComponent := sourceComponent scrolledView.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   655
    ].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   656
3796
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
   657
    targetPos := self where:where inComponent:targetComponent. 
3790
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   658
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   659
    (sourceComponent isKindOf:HierarchicalListView) ifTrue:[
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   660
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   661
        itemsIndexOrLabelOrPattern isInteger ifTrue:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   662
            idx := itemsIndexOrLabelOrPattern
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   663
        ] ifFalse:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   664
            itemsIndexOrLabelOrPattern includesMatchCharacters ifTrue:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   665
                idx := sourceComponent indexOfElementForWhich:[:el | itemsIndexOrLabelOrPattern match:el label string].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   666
            ] ifFalse:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   667
                idx := sourceComponent indexOfElementForWhich:[:el | el label string = itemsIndexOrLabelOrPattern].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   668
            ].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   669
            idx == 0 ifTrue:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   670
                self error:'no such item in hierarchicalList: ',itemsIndexOrLabelOrPattern
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   671
            ].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   672
        ].
3796
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
   673
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   674
        yPos := sourceComponent yVisibleOfLine:idx.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   675
        self movePointerToComponent:sourceComponent rightOffset:(10 @ (yPos + 3)).
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   676
        Delay waitForSeconds:0.5.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   677
        sourcePosOnScreen := Display pointerPosition.
3796
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
   678
        sourcePos := Display translatePoint:sourcePosOnScreen fromView:nil toView:sourceComponent.
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
   679
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
   680
        targetPosOnScreen := Display translatePoint:targetPos fromView:targetComponent toView:nil.
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
   681
        targetPosInSource := Display translatePoint:targetPosOnScreen fromView:nil toView:sourceComponent.
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   682
3796
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
   683
        sourceComponent simulateButtonPress:1 at:sourcePos sendDisplayEvent:false.
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
   684
        sourceComponent simulateButtonPress:1 at:sourcePos sendDisplayEvent:true.
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
   685
        Delay waitForSeconds:0.2.
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   686
3790
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   687
        dNdMgr := sourceComponent startDragAt:sourcePos.
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   688
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   689
        textWhenDroppingOrNil notNil ifTrue:[
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   690
            self show:textWhenDroppingOrNil.
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   691
        ].
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   692
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   693
        Delay waitForSeconds:1.
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   694
        self movePointerToComponent:targetComponent offset:targetPos.
3790
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   695
        Delay waitForSeconds:1.
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   696
        dNdMgr buttonMotion:1 x:targetPos x y:targetPos y view:targetComponent.
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   697
3790
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   698
        dNdMgr buttonRelease:1 x:targetPos x y:targetPos y view:targetComponent.
3796
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
   699
        sourceComponent simulateButtonRelease:1 at:targetPos sendDisplayEvent:false.
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   700
        ^ self
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   701
    ].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   702
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   703
    self error:'cannot expand in this component'
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   704
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   705
    "Created: / 19-07-2019 / 12:34:25 / Claus Gittinger"
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   706
    "Modified (format): / 19-07-2019 / 14:55:34 / Claus Gittinger"
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   707
!
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   708
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   709
expand:itemsIndexOrLabelOrPattern
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   710
    "expand an item in a treeView by label,
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   711
     allowed after moving to:
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   712
        aSelectionInHierarchyView
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   713
    "    
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   714
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   715
    <action>
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   716
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   717
    |component|
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   718
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   719
    verifying ifTrue:[^ self].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   720
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   721
    ((component := lastComponent) isKindOf:ScrollableView) ifTrue:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   722
        component := component scrolledView.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   723
    ].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   724
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   725
    (component isKindOf:HierarchicalListView) ifTrue:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   726
        |idx yPos|
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   727
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   728
        itemsIndexOrLabelOrPattern isInteger ifTrue:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   729
            idx := itemsIndexOrLabelOrPattern
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   730
        ] ifFalse:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   731
            itemsIndexOrLabelOrPattern includesMatchCharacters ifTrue:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   732
                idx := component indexOfElementForWhich:[:el | itemsIndexOrLabelOrPattern match:el label string].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   733
            ] ifFalse:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   734
                idx := component indexOfElementForWhich:[:el | el label string = itemsIndexOrLabelOrPattern].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   735
            ].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   736
            idx == 0 ifTrue:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   737
                self error:'no such item in hierarchicalList: ',itemsIndexOrLabelOrPattern
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   738
            ].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   739
        ].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   740
        yPos := component yVisibleOfLine:idx.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   741
        self movePointerToComponent:component offset:(0 @ (yPos + 3)).
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   742
        Delay waitForSeconds:0.5.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   743
        (component listAt:idx) expand.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   744
        ^ self
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   745
    ].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   746
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   747
    self error:'cannot expand in this component'
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   748
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   749
    "Created: / 19-07-2019 / 12:34:25 / Claus Gittinger"
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   750
    "Modified (format): / 19-07-2019 / 14:55:34 / Claus Gittinger"
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   751
!
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   752
3798
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   753
fastMoveRelativeX:dX y:dY
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   754
    "move the mouse to a new relative position"
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   755
    
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   756
    <action>
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   757
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   758
    |screen newPos currentPos|
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   759
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   760
    verifying ifTrue:[^ self].
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   761
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   762
    screen := Screen current.
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   763
    currentPos := screen pointerPosition.   
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   764
    newPos := currentPos + (dX @ dY).
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   765
    self fastMovePointerToScreenPosition:newPos
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   766
!
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   767
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   768
fastMoveTo:componentName
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   769
    "move the mouse to componentName without circling.
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   770
     Leaves component in lastComponent"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   771
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   772
    <action>
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   773
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   774
    |component|
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   775
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   776
    component := self componentNamed:componentName.
3717
26224649d91c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3716
diff changeset
   777
    self movePointerToComponent:component speed:(self pointerMoveSpeedFast).
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   778
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   779
    "
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   780
     ShowMeHowItWorks basicNew fastMoveTo:'Classes'
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   781
     ShowMeHowItWorks basicNew fastMoveTo:'Klassen'
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   782
    "
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   783
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   784
    "Created: / 19-07-2019 / 15:39:23 / Claus Gittinger"
3717
26224649d91c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3716
diff changeset
   785
    "Modified: / 20-07-2019 / 08:14:16 / Claus Gittinger"
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   786
    "Modified (comment): / 23-07-2019 / 09:33:31 / Claus Gittinger"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   787
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   788
3798
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   789
key:aKeySymbol
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   790
    "press/release a key in last component"
3798
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   791
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   792
    <action>
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   793
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   794
    |t|
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   795
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   796
    verifying ifTrue:[^ self].
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   797
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   798
    t := Display ctrlDown ifTrue:[0.05] ifFalse:[0.1].
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   799
    lastComponent 
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   800
        simulateKey:aKeySymbol at:(lastComponent extent // 2) sendDisplayEvent:false keyPressTime:t
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   801
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   802
    "Created: / 19-07-2019 / 15:50:40 / Claus Gittinger"
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   803
!
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   804
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   805
moveTo:componentName
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   806
    "move the mouse to componentName,
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   807
     then circle around it a few times.
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   808
     Leaves component in lastComponent"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   809
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   810
    <action>
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   811
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   812
    |component|
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   813
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   814
    component := self componentNamed:componentName.
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   815
    self movePointerToComponent:component.
3776
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   816
    Display ctrlDown ifTrue:[^ self].
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   817
    self circlePointerAroundComponent:component.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   818
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   819
    "Created: / 19-07-2019 / 11:20:42 / Claus Gittinger"
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   820
    "Modified: / 19-07-2019 / 15:38:11 / Claus Gittinger"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   821
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   822
3795
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   823
press:buttonNr
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   824
    <action>
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   825
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   826
    "press at the current position in last component"
3795
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   827
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   828
    self assert:(buttonNr isInteger).
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   829
    ^ self press:buttonNr inComponent:lastComponent.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   830
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   831
"/    "press at the current position"
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   832
"/
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   833
"/    |position screen x y|
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   834
"/
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   835
"/    verifying ifTrue:[^ self].
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   836
"/
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   837
"/    screen := Screen current.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   838
"/    position := screen pointerPosition.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   839
"/    x := position x.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   840
"/    y := position y.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   841
"/
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   842
"/    "/ self movePointerToScreenPosition:position.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   843
"/
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   844
"/    false "OperatingSystem isOSXlike" ifTrue:[
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   845
"/        |osxPos|
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   846
"/
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   847
"/        osxPos := OperatingSystem getMousePosition.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   848
"/        x := osxPos x rounded.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   849
"/        y := osxPos y rounded.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   850
"/        OperatingSystem generateButtonEvent:buttonNr down:true x:x y:y.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   851
"/        ^ self.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   852
"/    ].
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   853
"/
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   854
"/    screen sendKeyOrButtonEvent:#buttonPress x:x y:y keyOrButton:buttonNr state:0 toViewId:(screen rootWindowId).
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   855
"/    screen flush.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   856
"/
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   857
"/    "Created: / 19-07-2019 / 13:52:38 / Claus Gittinger"
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   858
"/    "Modified: / 23-07-2019 / 09:38:31 / Claus Gittinger"
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   859
!
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   860
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   861
release:buttonNr
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   862
    <action>
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   863
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   864
    "release at the current position in last component"
3795
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   865
    
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   866
    <action>
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   867
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   868
    self assert:(buttonNr isInteger).
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   869
    ^ self press:buttonNr inComponent:lastComponent.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   870
"/    |position screen x y|
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   871
"/
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   872
"/    verifying ifTrue:[^ self].
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   873
"/
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   874
"/    screen := Screen current.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   875
"/    position := screen pointerPosition.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   876
"/    x := position x.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   877
"/    y := position y.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   878
"/    
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   879
"/    self movePointerToScreenPosition:position.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   880
"/
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   881
"/    false "OperatingSystem isOSXlike" ifTrue:[
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   882
"/        |osxPos|
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   883
"/
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   884
"/        osxPos := OperatingSystem getMousePosition.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   885
"/        x := osxPos x rounded.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   886
"/        y := osxPos y rounded.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   887
"/        OperatingSystem generateButtonEvent:buttonNr down:false x:x y:y.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   888
"/        ^ self.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   889
"/    ].
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   890
"/
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   891
"/    screen sendKeyOrButtonEvent:#buttonRelease x:x y:y keyOrButton:buttonNr state:0 toViewId:(screen rootWindowId).
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   892
"/    screen flush.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   893
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   894
    "Created: / 19-07-2019 / 13:53:05 / Claus Gittinger"
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   895
    "Modified: / 23-07-2019 / 09:38:38 / Claus Gittinger"
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   896
!
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   897
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   898
select:itemsIndexOrLabelOrPattern
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   899
    "select an item by label,
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   900
     allowed after moving to:
3803
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   901
        a ComboBox
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   902
        a SelectionInListView
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   903
        a NoteBook
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   904
        a DSVColumnView
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   905
    "    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   906
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   907
    <action>
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   908
3803
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   909
    |idx component yPos tab|
3775
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   910
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   911
    verifying ifTrue:[^ self].
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   912
3783
e935b92253c9 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3781
diff changeset
   913
    ((component := lastComponent) isKindOf:ScrollableView) ifTrue:[
e935b92253c9 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3781
diff changeset
   914
        component := component scrolledView.
e935b92253c9 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3781
diff changeset
   915
    ].
e935b92253c9 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3781
diff changeset
   916
e935b92253c9 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3781
diff changeset
   917
    (component isKindOf:ComboView) ifTrue:[
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   918
        "/ click on the menubutton
3783
e935b92253c9 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3781
diff changeset
   919
        self movePointerToComponent:component menuButton.
e935b92253c9 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3781
diff changeset
   920
        self click:1 inComponent:component menuButton.
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   921
        Delay waitForSeconds:0.3.
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   922
        itemsIndexOrLabelOrPattern isInteger ifTrue:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   923
            idx := itemsIndexOrLabelOrPattern
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   924
        ] ifFalse:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   925
            itemsIndexOrLabelOrPattern includesMatchCharacters ifTrue:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   926
                idx := component list findFirst:[:lbl | itemsIndexOrLabelOrPattern match:lbl]
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   927
            ] ifFalse:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   928
                idx := component list indexOf:itemsIndexOrLabelOrPattern.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   929
            ].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   930
            idx == 0 ifTrue:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   931
                self error:'no such item in comboList: ',itemsIndexOrLabelOrPattern
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   932
            ].
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   933
        ].
3783
e935b92253c9 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3781
diff changeset
   934
        component select:idx.
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   935
        Delay waitForSeconds:0.3.
3783
e935b92253c9 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3781
diff changeset
   936
        component shownMenu notNil ifTrue:[
e935b92253c9 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3781
diff changeset
   937
            component shownMenu hide.
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   938
        ].    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   939
        ^ self
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   940
    ].    
3783
e935b92253c9 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3781
diff changeset
   941
    (component isKindOf:HierarchicalListView) ifTrue:[
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   942
        itemsIndexOrLabelOrPattern isInteger ifTrue:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   943
            idx := itemsIndexOrLabelOrPattern
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   944
        ] ifFalse:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   945
            itemsIndexOrLabelOrPattern includesMatchCharacters ifTrue:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   946
                idx := component indexOfElementForWhich:[:el | itemsIndexOrLabelOrPattern match:el label string].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   947
            ] ifFalse:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   948
                idx := component indexOfElementForWhich:[:el | el label string = itemsIndexOrLabelOrPattern].
3783
e935b92253c9 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3781
diff changeset
   949
            ].
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   950
            idx == 0 ifTrue:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   951
                self error:'no such item in hierarchicalList: ',itemsIndexOrLabelOrPattern
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   952
            ].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   953
        ].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   954
        yPos := component yVisibleOfLine:idx.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   955
        self movePointerToComponent:component offset:(0 @ (yPos + 3)).
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   956
        component simulateButtonPress:1 at:(0 @ (yPos + 3)) sendDisplayEvent:false.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   957
        Delay waitForSeconds:0.1.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   958
        component simulateButtonRelease:1 at:(0 @ (yPos + 3)) sendDisplayEvent:false.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   959
        "/ component selection:idx.
3783
e935b92253c9 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3781
diff changeset
   960
        ^ self
e935b92253c9 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3781
diff changeset
   961
    ].
3798
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   962
    (component isKindOf:SelectionInListModelView) ifTrue:[
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   963
        itemsIndexOrLabelOrPattern isInteger ifTrue:[
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   964
            idx := itemsIndexOrLabelOrPattern
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   965
        ] ifFalse:[
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   966
            itemsIndexOrLabelOrPattern includesMatchCharacters ifTrue:[
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   967
                idx := component indexOfElementForWhich:[:el | el notNil and:[itemsIndexOrLabelOrPattern match:el string]]. 
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   968
            ] ifFalse:[
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   969
                idx := component indexOfElementForWhich:[:el | el notNil and:[el string = itemsIndexOrLabelOrPattern]].
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   970
            ].
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   971
            idx == 0 ifTrue:[
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   972
                self error:'no such item in hierarchicalList: ',itemsIndexOrLabelOrPattern
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   973
            ].
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   974
        ].
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   975
        yPos := component yVisibleOfLine:idx.
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   976
        self movePointerToComponent:component offset:(0 @ (yPos + 3)).
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   977
        component simulateButtonPress:1 at:(0 @ (yPos + 3)) sendDisplayEvent:false.
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   978
        Delay waitForSeconds:0.1.
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   979
        component simulateButtonRelease:1 at:(0 @ (yPos + 3)) sendDisplayEvent:false.
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   980
        "/ component selection:idx.
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   981
        ^ self
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   982
    ].
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   983
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   984
    (component isKindOf:ItemInView) ifTrue:[
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   985
        component isMenuItem ifTrue:[
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   986
            self movePointerToComponent:component.
3803
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   987
            self click.
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   988
            ^ self
3798
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   989
        ].
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   990
    ].
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   991
3803
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   992
    (component isKindOf:NoteBookView) ifTrue:[
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   993
        (idx := itemsIndexOrLabelOrPattern) isInteger ifFalse:[
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   994
            idx := component indexOfTabNamed:itemsIndexOrLabelOrPattern
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   995
        ].
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   996
        tab := component tabAtIndex:idx.
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   997
        self movePointerToComponent:component offset:(tab layout center).
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   998
        component selection:idx.
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
   999
        ^ self
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1000
    ].
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1001
    (component isKindOf:DSVColumnView) ifTrue:[
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1002
        (idx := itemsIndexOrLabelOrPattern) isInteger ifFalse:[
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1003
            self halt.
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1004
        ].
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1005
        yPos := ((component yVisibleOfRowNr:idx) + (component yVisibleOfRowNr:idx+1)) // 2.
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1006
        self movePointerToComponent:component offset:(1 @ yPos).
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1007
        component selectRow:idx.
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1008
        ^ self
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1009
    ].
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1010
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1011
    self error:('cannot select "%1" this component: %2' bindWith:itemsIndexOrLabelOrPattern with:component className)
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1012
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1013
    "Created: / 19-07-2019 / 12:34:25 / Claus Gittinger"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1014
    "Modified (format): / 19-07-2019 / 14:55:34 / Claus Gittinger"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1015
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1016
3803
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1017
selectComponent:componentName
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1018
    "Leaves component in lastComponent without moving"
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1019
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1020
    <action>
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1021
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1022
    |component|
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1023
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1024
    component := self componentNamed:componentName.
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1025
!
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1026
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1027
selectIndex:itemsIndex
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1028
    "select an item by index,
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1029
     allowed after moving to:
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1030
        aComboBox
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1031
        aSelectionInListView
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1032
    "    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1033
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1034
    <action>
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1035
3716
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1036
    self selectIndex:itemsIndex in:lastComponent
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1037
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1038
    "Created: / 19-07-2019 / 14:20:11 / Claus Gittinger"
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1039
    "Modified: / 19-07-2019 / 21:59:36 / Claus Gittinger"
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1040
!
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1041
3716
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1042
selectIndex:itemsIndex in:widgetArg
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1043
    "select an item by index,
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1044
     allowed after moving to:
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1045
        aComboBox
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1046
        aSelectionInListView
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1047
    "    
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1048
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1049
    <action>
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1050
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1051
    |widget y offset possibleWidgets|
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1052
3775
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
  1053
    verifying ifTrue:[^ self].
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
  1054
3716
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1055
    (widget := widgetArg) isScrollWrapper ifTrue:[
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1056
        widget := widget scrolledView
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1057
    ].
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1058
    
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1059
    (widget isKindOf:ComboView) ifTrue:[
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1060
        "/ click on the menubutton
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1061
        self movePointerToComponent:widget menuButton.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1062
        self click:1 inComponent:widget menuButton.
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1063
        Delay waitForSeconds:0.5.
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1064
        widget select:itemsIndex.
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1065
        Delay waitForSeconds:0.5.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1066
        ^ self
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1067
    ].    
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1068
    (widget isKindOf:SelectionInListView) ifTrue:[
3716
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1069
        (widget isLineVisible:itemsIndex) ifFalse:[
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1070
            widget scrollToLine:itemsIndex
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1071
        ].    
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1072
        "/ click on the item
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1073
        y := widget yOfLine:itemsIndex.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1074
        offset := (widget width // 2) @ y.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1075
        self movePointerToComponent:widget offset:offset.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1076
        widget simulateButtonPress:1 at:offset sendDisplayEvent:false.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1077
        Delay waitForSeconds:(self clickTime).
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1078
        widget simulateButtonRelease:1 at:offset sendDisplayEvent:false.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1079
        Delay waitForSeconds:0.5.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1080
        ^ self
3716
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1081
    ].
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1082
    (widget isKindOf:SelectionInListModelView) ifTrue:[
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1083
        (widget isLineVisible:itemsIndex) ifFalse:[
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1084
            widget scrollToLine:itemsIndex
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1085
        ].    
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1086
        y := widget yVisibleOfLine:itemsIndex.
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1087
        offset := (widget width // 2) @ y.
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1088
        self movePointerToComponent:widget offset:offset.
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1089
        widget simulateButtonPress:1 at:offset sendDisplayEvent:false.
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1090
        Delay waitForSeconds:(self clickTime).
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1091
        widget simulateButtonRelease:1 at:offset sendDisplayEvent:false.
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1092
        Delay waitForSeconds:0.5.
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1093
        ^ self
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1094
    ].
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1095
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1096
    "/ none of it - see what is in there
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1097
    possibleWidgets := OrderedCollection new.
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1098
    widget allSubViewsDo:[:each |
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1099
        ((each isKindOf:ComboView) 
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1100
          or:[(each isKindOf:SelectionInListView)
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1101
          or:[(each isKindOf:SelectionInListModelView)
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1102
        ]]) ifTrue:[
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1103
            possibleWidgets add:each
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1104
        ]
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1105
    ].
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1106
    possibleWidgets size == 1 ifTrue:[
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1107
        self selectIndex:itemsIndex in:(possibleWidgets first).
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1108
        ^ self
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1109
    ].    
3716
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1110
    
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1111
    self error:'cannot select this component'
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1112
3716
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1113
    "Created: / 19-07-2019 / 21:59:15 / Claus Gittinger"
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1114
    "Modified: / 20-07-2019 / 07:57:41 / Claus Gittinger"
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1115
!
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1116
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1117
type:aString
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1118
    "enter text into the last component"
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1119
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1120
    <action>
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1121
3776
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
  1122
    |t|
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
  1123
3775
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
  1124
    verifying ifTrue:[^ self].
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
  1125
3776
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
  1126
    t := Display ctrlDown ifTrue:[0.05] ifFalse:[0.1].
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
  1127
    lastComponent 
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
  1128
        simulateTextInput:aString at:(lastComponent extent // 2) 
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
  1129
        sendDisplayEvent:false keyPressTime:t
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1130
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1131
    "Created: / 19-07-2019 / 15:50:40 / Claus Gittinger"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1132
! !
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1133
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1134
!ShowMeHowItWorks methodsFor:'defaults'!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1135
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1136
circlingCount
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1137
    "circle around move-end position that many times"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1138
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1139
    ^ 3
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1140
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1141
    "Created: / 19-07-2019 / 13:03:45 / Claus Gittinger"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1142
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1143
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1144
circlingRadius 
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1145
    "radius when circling"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1146
    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1147
    ^ 30 "/ pixels
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1148
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1149
    "Created: / 19-07-2019 / 13:07:59 / Claus Gittinger"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1150
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1151
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1152
circlingSpeed 
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1153
    "time per round when circling"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1154
    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1155
    ^ 0.3 seconds.       "/ time per round
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1156
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1157
    "Created: / 19-07-2019 / 13:02:34 / Claus Gittinger"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1158
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1159
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1160
clickTime
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1161
    "when clicking"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1162
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1163
    ^ self shortClickTime
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1164
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1165
    "Created: / 19-07-2019 / 13:17:20 / Claus Gittinger"
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1166
    "Modified: / 19-07-2019 / 15:21:51 / Claus Gittinger"
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1167
!
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1168
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1169
longClickTime
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1170
    "when clicking buttons"
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1171
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1172
    ^ 500 milliseconds
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1173
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1174
    "Created: / 19-07-2019 / 15:21:42 / Claus Gittinger"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1175
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1176
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1177
pointerAnimationDelay
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1178
    ^ 50 milliseconds.   "/ 20 updates per second
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1179
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1180
    "Created: / 19-07-2019 / 13:04:45 / Claus Gittinger"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1181
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1182
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1183
pointerMoveSpeed
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1184
    ^ 400.   "/ pixels per second
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1185
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1186
    "Created: / 19-07-2019 / 13:05:40 / Claus Gittinger"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1187
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1188
3717
26224649d91c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3716
diff changeset
  1189
pointerMoveSpeedFast
26224649d91c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3716
diff changeset
  1190
    ^ 600.   "/ pixels per second
26224649d91c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3716
diff changeset
  1191
26224649d91c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3716
diff changeset
  1192
    "Created: / 20-07-2019 / 08:13:58 / Claus Gittinger"
26224649d91c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3716
diff changeset
  1193
!
26224649d91c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3716
diff changeset
  1194
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1195
shortClickTime
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1196
    "when clicking"
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1197
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1198
    ^ 100 milliseconds
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1199
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1200
    "Created: / 19-07-2019 / 15:21:29 / Claus Gittinger"
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1201
!
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1202
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1203
talking
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1204
    "/ DebugMode := true
3775
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
  1205
    verifying ifTrue:[^ false].
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1206
    DebugMode == true ifTrue:[^ false].
3775
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
  1207
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1208
    "/ ^ Expecco::ExpeccoPreferences current speechEffectsEnabled
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1209
    ^ true
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1210
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1211
    "Created: / 19-07-2019 / 14:31:14 / Claus Gittinger"
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1212
    "Modified (comment): / 23-07-2019 / 09:45:35 / Claus Gittinger"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1213
! !
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1214
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1215
!ShowMeHowItWorks methodsFor:'helper'!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1216
3715
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1217
randomThankYou
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1218
    ^ #(
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1219
        'thank you, for watching'
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1220
        'thank you for watching'
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1221
        'thank you'
3775
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
  1222
        'thanks'
3715
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1223
        'have a good day'
3775
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
  1224
        'have a nice day'
3715
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1225
        'have fun'
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1226
        'have fun with expecco'
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1227
        'have fun with expecco, by the way: expecco comes from the latin word: peccare, which means: "to sin"'
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1228
        'happy hacking'
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1229
        'happy hacking, I hope you liked what you saw'
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1230
        'hope you liked it'
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1231
        'see you again'
3775
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
  1232
        'be the source with you'
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
  1233
        'be the force with you'
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
  1234
        'may the force be with you'
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
  1235
        'may the source be with you'
3715
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1236
        'please give feedback, and let us know, if you liked it'
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1237
        'if you have any questions, please contact exept'
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1238
        'if you need more information, please take a look at the wiki'
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1239
    ) atRandom
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1240
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1241
    "
3775
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
  1242
     OperatingSystem speak:'may the source be with you'
3715
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1243
     OperatingSystem speak:'have fun with expecco'
3716
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1244
     OperatingSystem speak:'have fun with expecco, by the way: expecco comes from the latin word: peccare, which means: to sin'
3715
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1245
     OperatingSystem speak:'happy hacking, I hope you liked what you saw'
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1246
     OperatingSystem speak:'please give feedback, and let us know, if you liked it'
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1247
     OperatingSystem speak:'if you have any questions, please contact exept'
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1248
     OperatingSystem speak:'if you need more information, please take a look at the wiki'
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1249
    "
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1250
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1251
    "Created: / 19-07-2019 / 21:39:18 / Claus Gittinger"
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1252
!
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1253
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1254
tell:message
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1255
    self talking ifTrue:[
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
  1256
        OperatingSystem speak:message voiceName:voice.
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1257
    ].
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1258
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1259
    "Created: / 19-07-2019 / 14:57:50 / Claus Gittinger"
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
  1260
    "Modified: / 23-07-2019 / 10:28:02 / Claus Gittinger"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1261
! !
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1262
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1263
!ShowMeHowItWorks methodsFor:'helpers - broken'!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1264
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1265
click:buttonNr atPosition:position
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1266
    "press-release at position"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1267
    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1268
    |screen|
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1269
3775
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
  1270
    verifying ifTrue:[^ self].
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
  1271
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1272
    screen := Screen current.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1273
    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1274
    screen setPointerPosition:position.    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1275
    screen flush.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1276
    self click:buttonNr
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1277
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1278
    "Created: / 19-07-2019 / 13:14:51 / Claus Gittinger"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1279
! !
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1280
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1281
!ShowMeHowItWorks methodsFor:'helpers - component search'!
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1282
3800
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1283
chooseBestComponentFrom:foundItems
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1284
    |reallyShown inMyApp|
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1285
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1286
    foundItems size == 1 ifTrue:[^ foundItems first].
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1287
    foundItems size == 0 ifTrue:[^ nil].
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1288
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1289
    reallyShown := foundItems select:[:item | item isReallyShown]. 
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1290
    reallyShown size == 1 ifTrue:[^ reallyShown first].
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1291
    reallyShown size == 0 ifTrue:[^ nil].
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1292
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1293
    "/ is there one in my application
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1294
    application notNil ifTrue:[
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1295
        inMyApp := reallyShown select:[:item | item topView application == application].
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1296
        inMyApp size == 1 ifTrue:[^ inMyApp first].
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1297
    ].
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1298
    "/ there seems to be a mapped view, but underneath
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1299
    "/ select the last one found
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1300
    ^ foundItems last.
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1301
!
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1302
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1303
componentNamed:componentName
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1304
    "retrieve a component by name or report an error if not found.
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1305
     Can return either a view or a menu item"
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1306
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1307
    |component|
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1308
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
  1309
    verifying ifFalse:[
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
  1310
        self waitFor:componentName timeout:(defaultElementTimeout ? 1).
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
  1311
        ^ lastComponent.
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
  1312
    ].
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
  1313
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1314
    lastComponentName := componentName.
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1315
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1316
    component := self findComponent:componentName.
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1317
    component isNil ifTrue:[
3784
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  1318
        self error:'no component found for: ',componentName mayProceed:verifying.
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  1319
        ^ nil
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1320
    ].
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1321
    lastComponent := component.
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1322
    ^ component
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1323
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1324
    "Created: / 19-07-2019 / 15:37:35 / Claus Gittinger"
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1325
    "Modified (comment): / 23-07-2019 / 09:31:53 / Claus Gittinger"
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1326
!
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1327
3803
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1328
findApplication:classNameOrWindowTitle ifMultiple:exceptionalValue
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1329
    "find an application by name"
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1330
    
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1331
    |candidates|
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1332
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1333
    candidates := IdentitySet new.
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1334
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1335
    "/ search through all current applications
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1336
    WindowGroup scheduledWindowGroups do:[:eachWG |
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1337
        |eachApp|
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1338
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1339
        (eachApp := eachWG application) notNil ifTrue:[
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1340
            ((classNameOrWindowTitle match:eachApp className) 
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1341
            or:[(classNameOrWindowTitle match:eachApp class nameWithoutPrefix)
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1342
            or:[(classNameOrWindowTitle match:eachApp mainWindow label)]]) ifTrue:[
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1343
                candidates add:eachApp
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1344
            ].
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1345
        ].
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1346
    ].
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1347
    candidates size == 1 ifTrue:[
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1348
        ^ candidates first
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1349
    ].
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1350
    candidates notEmpty ifTrue:[
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1351
        "/ multiple elements (probably there are multiple topviews open...
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1352
        "/ check the current windowGroup
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1353
        ^ exceptionalValue value
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1354
    ].
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1355
    ^ nil
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1356
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1357
    "
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1358
     ShowMeHowItWorks basicNew findApplication:'Inspector*' ifMultiple:nil.
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1359
    "
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1360
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1361
    "Created: / 19-07-2019 / 12:02:30 / Claus Gittinger"
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1362
    "Modified: / 19-07-2019 / 16:44:30 / Claus Gittinger"
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1363
    "Modified (comment): / 23-07-2019 / 09:32:44 / Claus Gittinger"
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1364
!
34ea88ec4dc4 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3801
diff changeset
  1365
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1366
findComponent:componentName
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1367
    "find a component by name - in the active and possibly in any app.
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1368
     Can return either a view or a menu item"
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1369
    
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1370
    ^ self 
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1371
        findComponent:componentName
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1372
        inAllApplications:true
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1373
        ifMultiple:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1374
            self proceedableError:('multiple components found by name: ',componentName).
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1375
            nil
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1376
        ].
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1377
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1378
    "
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1379
     ShowMeHowItWorks basicNew findComponent:'Classes'
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1380
     ShowMeHowItWorks basicNew findComponent:'Klassen'
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1381
    "
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1382
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1383
    "Created: / 19-07-2019 / 12:02:30 / Claus Gittinger"
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1384
    "Modified: / 19-07-2019 / 16:44:30 / Claus Gittinger"
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1385
    "Modified (comment): / 23-07-2019 / 09:32:44 / Claus Gittinger"
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1386
!
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1387
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1388
findComponent:componentName ifMultiple:exceptionalValue
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1389
    "find a component by name - in the active and possibly in any app.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1390
     Can return either a view or a menu item"
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1391
    
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1392
    ^ self
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1393
        findComponent:componentName
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1394
        inAllApplications:true
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1395
        ifMultiple:exceptionalValue
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1396
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1397
    "
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1398
     ShowMeHowItWorks basicNew findComponent:'Classes'
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1399
     ShowMeHowItWorks basicNew findComponent:'Klassen'
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1400
    "
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1401
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1402
    "Created: / 19-07-2019 / 12:02:30 / Claus Gittinger"
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1403
    "Modified: / 19-07-2019 / 16:44:30 / Claus Gittinger"
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1404
    "Modified (comment): / 23-07-2019 / 09:32:44 / Claus Gittinger"
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1405
!
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1406
3781
0040ac44a2f3 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3780
diff changeset
  1407
findComponent:componentNameOrPath in:anApplicationOrViewOrMenuItem
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1408
    "find a component by name inside an app or inside a view.
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1409
     Uses the NameKey of the spec, and optionally the label or modelKey.
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1410
     Can return either a view or a menu item"
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1411
3798
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1412
    |quoted idxString idx app window component componentNameSymbol 
3793
4759769ba7a3 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3792
diff changeset
  1413
     foundByName foundByHelpKey foundByTitle foundByLabel item
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1414
     checkIfAllMenuItemsDoTheSame|
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1415
3798
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1416
    "/ split at "/";
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1417
    "/ but not if inside quotes
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1418
    quoted := false.
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1419
    componentNameOrPath doWithIndex:[:ch :idx |
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1420
        ch == $" ifTrue:[
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1421
            quoted := quoted not.
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1422
        ] ifFalse:[
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1423
            ((ch == $/) and:[quoted not]) ifTrue:[
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1424
                |containerName restPath container|
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1425
3798
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1426
                containerName := componentNameOrPath copyTo:idx-1.
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1427
                restPath := componentNameOrPath copyFrom:idx+1.
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1428
                container := self findComponent:containerName in:anApplicationOrViewOrMenuItem.
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1429
                container isNil ifTrue:[ ^ nil ].
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1430
                ^ self findComponent:restPath in:container
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1431
            ]
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1432
        ]
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1433
    ].
3798
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1434
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1435
    (anApplicationOrViewOrMenuItem isKindOf:ItemInView) ifTrue:[
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1436
        anApplicationOrViewOrMenuItem isMenuItem ifTrue:[
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1437
            ^ self findComponent:componentNameOrPath in:anApplicationOrViewOrMenuItem item submenu
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1438
        ].
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1439
    ].
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1440
3797
5ab4b911e388 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3796
diff changeset
  1441
    (componentNameOrPath startsWith:'item[') ifTrue:[
3794
49da17b54a22 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3793
diff changeset
  1442
        anApplicationOrViewOrMenuItem isMenu ifFalse:[
49da17b54a22 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3793
diff changeset
  1443
            self assert:false message:'container is not a menu'.
49da17b54a22 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3793
diff changeset
  1444
        ].
3797
5ab4b911e388 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3796
diff changeset
  1445
        idxString := (componentNameOrPath withoutPrefix:'item[') withoutSuffix:']'.
5ab4b911e388 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3796
diff changeset
  1446
        (idxString conform:#isDigit) ifTrue:[
5ab4b911e388 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3796
diff changeset
  1447
            idx := Integer readFrom:idxString.
5ab4b911e388 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3796
diff changeset
  1448
            item := anApplicationOrViewOrMenuItem itemAtIndex:idx.
5ab4b911e388 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3796
diff changeset
  1449
        ] ifFalse:[
3798
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1450
            idxString := idxString withoutQuotes.
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1451
            idxString includesMatchCharacters ifTrue:[
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1452
                item := 
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1453
                    anApplicationOrViewOrMenuItem itemForWhich:[:item |
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
  1454
                        (idxString match:(item nameKey ? '') )
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
  1455
                        or:[ (idxString match:(item textLabel ? '')) 
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
  1456
                        or:[ (item value isSymbol and:[idxString match:(item value)])]]
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
  1457
                    ]  
3798
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1458
            ] ifFalse:[
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1459
                item := 
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1460
                    anApplicationOrViewOrMenuItem itemForWhich:[:item |
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1461
                        item nameKey = idxString
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1462
                        or:[ item textLabel = idxString 
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1463
                        or:[ (item value isSymbol and:[ item value = idxString ])]]
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1464
                    ]
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1465
            ].
3797
5ab4b911e388 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3796
diff changeset
  1466
        ].
3798
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1467
        self assert:item notNil message:('no menu item named "%1"' bindWith:idxString).
3796
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  1468
        ^ ItemInView new view:anApplicationOrViewOrMenuItem item:item boundsInView:(item layout)
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  1469
    ].
3797
5ab4b911e388 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3796
diff changeset
  1470
    (componentNameOrPath startsWith:'tab[') ifTrue:[
3796
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  1471
        (anApplicationOrViewOrMenuItem isKindOf:NoteBookView) ifFalse:[
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  1472
            self assert:false message:'container is not a notebook'.
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  1473
        ].
3797
5ab4b911e388 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3796
diff changeset
  1474
        idxString := (componentNameOrPath withoutPrefix:'tab[') withoutSuffix:']'.
5ab4b911e388 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3796
diff changeset
  1475
        (idxString conform:#isDigit) ifTrue:[
5ab4b911e388 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3796
diff changeset
  1476
            idx := Integer readFrom:idxString.
5ab4b911e388 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3796
diff changeset
  1477
            item := anApplicationOrViewOrMenuItem tabAtIndex:idx.
5ab4b911e388 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3796
diff changeset
  1478
        ] ifFalse:[
3798
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1479
            idxString := idxString withoutQuotes.
3797
5ab4b911e388 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3796
diff changeset
  1480
            item := anApplicationOrViewOrMenuItem tabForWhich:[:tab | tab tabItem rawLabel = idxString].
5ab4b911e388 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3796
diff changeset
  1481
            item isNil ifTrue:[
5ab4b911e388 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3796
diff changeset
  1482
                item := anApplicationOrViewOrMenuItem tabForWhich:[:tab | tab printableLabel = idxString].
5ab4b911e388 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3796
diff changeset
  1483
                item isNil ifTrue:[
5ab4b911e388 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3796
diff changeset
  1484
                    item := anApplicationOrViewOrMenuItem tabForWhich:[:tab | tab activeHelpKey = idxString].
5ab4b911e388 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3796
diff changeset
  1485
                ].
5ab4b911e388 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3796
diff changeset
  1486
            ].
5ab4b911e388 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3796
diff changeset
  1487
        ].
5ab4b911e388 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3796
diff changeset
  1488
        self assert:item notNil.
3796
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  1489
        ^ ItemInView new view:anApplicationOrViewOrMenuItem item:item boundsInView:(item layout)
3794
49da17b54a22 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3793
diff changeset
  1490
    ].
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1491
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1492
    componentNameSymbol := componentNameOrPath asSymbolIfInterned ? componentNameOrPath.
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1493
3781
0040ac44a2f3 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3780
diff changeset
  1494
    (app := anApplicationOrViewOrMenuItem) isView ifTrue:[
0040ac44a2f3 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3780
diff changeset
  1495
        window := anApplicationOrViewOrMenuItem.
0040ac44a2f3 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3780
diff changeset
  1496
        app := anApplicationOrViewOrMenuItem application
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1497
    ].
3781
0040ac44a2f3 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3780
diff changeset
  1498
    app isApplicationModel ifTrue:[
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1499
        (component := app componentAt:componentNameSymbol) notNil ifTrue:[^ component].
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1500
        window := window ? app window.
3781
0040ac44a2f3 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3780
diff changeset
  1501
    ] ifFalse:[
3796
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  1502
        (app askFor:#isMenuItem) ifTrue:[
3781
0040ac44a2f3 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3780
diff changeset
  1503
            window := app submenu.
0040ac44a2f3 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3780
diff changeset
  1504
        ]
0040ac44a2f3 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3780
diff changeset
  1505
    ].
3792
7682b28c1e92 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  1506
    window notNil ifTrue:[
7682b28c1e92 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  1507
        window shown ifFalse:[^ nil].
7682b28c1e92 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  1508
    ].
7682b28c1e92 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  1509
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1510
    "/ mhmh - search through all widgets of anApplication; 
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1511
    "/ maybe it was not created via the builder/spec,
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1512
    "/ or it has changed its name.
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1513
    "/ look for: widget's name, widget's title, widget's label
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1514
    foundByName := OrderedCollection new. 
3793
4759769ba7a3 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3792
diff changeset
  1515
    foundByHelpKey := OrderedCollection new. 
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1516
    foundByTitle := OrderedCollection new. 
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1517
    foundByLabel := OrderedCollection new.
3792
7682b28c1e92 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  1518
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1519
    window withAllSubViewsDo:[:each |
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1520
        |foundIt|
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1521
        
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1522
        foundIt := false.
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1523
        each shown ifTrue:[
3793
4759769ba7a3 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3792
diff changeset
  1524
            {
4759769ba7a3 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3792
diff changeset
  1525
                #name . foundByName .
4759769ba7a3 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3792
diff changeset
  1526
                #helpKey . foundByHelpKey .
4759769ba7a3 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3792
diff changeset
  1527
                #title . foundByTitle .
4759769ba7a3 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3792
diff changeset
  1528
                #label . foundByLabel .
4759769ba7a3 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3792
diff changeset
  1529
            } pairWiseDo:[:attr :coll |
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1530
                foundIt ifFalse:[
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1531
                    [
3793
4759769ba7a3 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3792
diff changeset
  1532
                        (each perform:attr) = componentNameSymbol ifTrue:[ 
4759769ba7a3 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3792
diff changeset
  1533
                            coll add:each. foundIt := true
4759769ba7a3 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3792
diff changeset
  1534
                        ]
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1535
                    ] on:MessageNotUnderstood do:[:ex | ].
3793
4759769ba7a3 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3792
diff changeset
  1536
                ]
4759769ba7a3 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3792
diff changeset
  1537
            ].
4759769ba7a3 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3792
diff changeset
  1538
            foundIt ifFalse:[
4759769ba7a3 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3792
diff changeset
  1539
                each isMenu ifTrue:[
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
  1540
                    |comp|
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
  1541
3793
4759769ba7a3 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3792
diff changeset
  1542
                    (item := each detectItemForNameKey:componentNameSymbol) notNil ifTrue:[
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
  1543
                        comp := ItemInView new view:each item:item boundsInView:(item layout).
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
  1544
                        foundByName add:comp. foundIt := true
3793
4759769ba7a3 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3792
diff changeset
  1545
                    ].
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1546
                    foundIt ifFalse:[
3793
4759769ba7a3 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3792
diff changeset
  1547
                        (item := each detectItemForKey:componentNameSymbol) notNil ifTrue:[
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
  1548
                            comp := ItemInView new view:each item:item boundsInView:(item layout).
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
  1549
                            foundByName add:comp. foundIt := true 
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1550
                        ].    
3793
4759769ba7a3 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3792
diff changeset
  1551
                        foundIt ifFalse:[
4759769ba7a3 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3792
diff changeset
  1552
                            (item := each detectItemForLabel:componentNameSymbol) notNil ifTrue:[
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
  1553
                                comp := ItemInView new view:each item:item boundsInView:(item layout).
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
  1554
                                foundByLabel add:comp. foundIt := true 
3793
4759769ba7a3 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3792
diff changeset
  1555
                            ].    
4759769ba7a3 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3792
diff changeset
  1556
                        ].
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1557
                    ].
3793
4759769ba7a3 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3792
diff changeset
  1558
                ].    
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1559
            ].
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1560
        ].
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1561
    ].
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1562
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1563
    "/ a check, if multiple menu items have the same action, then choose the first found
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1564
    checkIfAllMenuItemsDoTheSame := 
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1565
        [:itemsFound |
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1566
            |visibleItems|
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1567
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1568
            (itemsFound conform:[:each | each askFor:#isMenuItem]) ifTrue:[
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1569
                (itemsFound collect:[:item | item itemValue]) asSet size == 1 ifTrue:[
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1570
                    "/ choose one which is visible, if possible
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
  1571
                    visibleItems := itemsFound select:[:item | item view shown].
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1572
                    visibleItems notEmpty ifTrue:[
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1573
                        ^ visibleItems first
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1574
                    ].
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1575
                    ^ itemsFound first.
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1576
                ].
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1577
            ].
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1578
        ].
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1579
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1580
    foundByName notEmpty ifTrue:[
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1581
        checkIfAllMenuItemsDoTheSame value:foundByName.
3800
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1582
        foundByName size > 1 ifTrue:[
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1583
            |item|
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1584
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1585
            (item := self chooseBestComponentFrom:foundByName) notNil ifTrue:[
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1586
                ^ item
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1587
            ].
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1588
        ].
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1589
        self assert:(foundByName size == 1) message:('multiple components found by name: %1' bindWith:componentNameOrPath).
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1590
        ^ foundByName first.
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1591
    ].
3793
4759769ba7a3 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3792
diff changeset
  1592
    foundByHelpKey notEmpty ifTrue:[
4759769ba7a3 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3792
diff changeset
  1593
        checkIfAllMenuItemsDoTheSame value:foundByHelpKey.
4759769ba7a3 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3792
diff changeset
  1594
        self assert:(foundByHelpKey size == 1) message:'multiple components found by helpKey'.
4759769ba7a3 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3792
diff changeset
  1595
        ^ foundByHelpKey first.
4759769ba7a3 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3792
diff changeset
  1596
    ].
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1597
    foundByTitle notEmpty ifTrue:[
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1598
        checkIfAllMenuItemsDoTheSame value:foundByTitle.
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1599
        self assert:(foundByTitle size == 1) message:'multiple components found by title'.
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1600
        ^ foundByTitle first.
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1601
    ].
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1602
    foundByLabel notEmpty ifTrue:[
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1603
        checkIfAllMenuItemsDoTheSame value:foundByLabel.
3801
e45e18e26a7d #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3800
diff changeset
  1604
        self assert:(foundByLabel size == 1) message:('multiple components found by label: %1' bindWith:componentNameOrPath).
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1605
        ^ foundByLabel first.
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1606
    ].
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1607
    ^ component
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1608
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1609
    "
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1610
     self basicNew findComponent:'Klassen' in:(Transcript topView)
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1611
    "
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1612
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1613
    "Created: / 19-07-2019 / 11:36:21 / Claus Gittinger"
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1614
    "Modified (comment): / 23-07-2019 / 09:31:34 / Claus Gittinger"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1615
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1616
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1617
findComponent:componentName inAllApplications:inAllApplicationsBool ifMultiple:exceptionalValue
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1618
    "find a component by name - in the active and possibly in any app.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1619
     Can return either a view or a menu item"
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1620
    
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1621
    |component candidates modalGroup|
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1622
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1623
    application notNil ifTrue:[ 
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1624
        (component := self findComponent:componentName in:application) notNil ifTrue:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1625
            ^ component.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1626
        ].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1627
    ].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1628
    candidates := OrderedCollection new.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1629
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1630
    "/ is there a modal dialog open for the app?
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1631
    (modalGroup := application windowGroup modalGroup) notNil ifTrue:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1632
        modalGroup topViews do:[:eachModalTopView |
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1633
            component := self findComponent:componentName in:eachModalTopView.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1634
            component notNil ifTrue:[ 
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1635
                candidates add:component
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1636
            ].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1637
        ].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1638
        candidates size == 1 ifTrue:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1639
            ^ candidates first
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1640
        ].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1641
    ].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1642
    inAllApplicationsBool ifTrue:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1643
        "/ search through all current applications
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1644
        WindowGroup scheduledWindowGroups do:[:eachWG |
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1645
            |eachApp|
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1646
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1647
            (eachApp := eachWG application) notNil ifTrue:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1648
                component := self findComponent:componentName in:eachApp.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1649
                component notNil ifTrue:[ 
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1650
                    candidates add:component
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1651
                ].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1652
            ].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1653
        ].
3792
7682b28c1e92 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  1654
        candidates isEmpty ifTrue:[
7682b28c1e92 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  1655
            Display allTopViews do:[:eachTopView |
7682b28c1e92 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  1656
                component := self findComponent:componentName in:eachTopView.
7682b28c1e92 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  1657
                component notNil ifTrue:[ 
7682b28c1e92 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  1658
                    candidates add:component
7682b28c1e92 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  1659
                ].
7682b28c1e92 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  1660
            ]
7682b28c1e92 #BUGFIX by exept
Claus Gittinger <cg@exept.de>
parents: 3791
diff changeset
  1661
        ].
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1662
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1663
        candidates size == 1 ifTrue:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1664
            ^ candidates first
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1665
        ].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1666
        candidates notEmpty ifTrue:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1667
            "/ multiple elements (probably there are multiple topviews open...
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1668
            "/ check the current windowGroup
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1669
            ^ exceptionalValue value
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1670
        ].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1671
    ].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1672
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1673
    ^ nil
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1674
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1675
    "
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1676
     ShowMeHowItWorks basicNew findComponent:'Classes'
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1677
     ShowMeHowItWorks basicNew findComponent:'Klassen'
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1678
    "
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1679
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1680
    "Created: / 19-07-2019 / 12:02:30 / Claus Gittinger"
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1681
    "Modified: / 19-07-2019 / 16:44:30 / Claus Gittinger"
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1682
    "Modified (comment): / 23-07-2019 / 09:32:44 / Claus Gittinger"
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1683
!
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1684
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
  1685
pinPOForPin:pinName ofStep:stepName
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
  1686
    |diagramEditor pinPO|
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
  1687
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
  1688
    (diagramEditor := lastComponent) isScrollWrapper ifTrue:[
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
  1689
        diagramEditor := lastComponent scrolledView
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
  1690
    ].
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
  1691
    pinPO := diagramEditor 
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
  1692
            detectPOForWhich:[:po |
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
  1693
                po isPin 
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
  1694
                and:[ po name = pinName
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
  1695
                and:[ po owningStepPO name = stepName ]]
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
  1696
            ].
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
  1697
    ^ pinPO
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
  1698
!
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
  1699
3796
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  1700
screenBoundsOfComponent:aWidgetOrMenuItemOrTab
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  1701
    |itemLayout|
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  1702
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  1703
    aWidgetOrMenuItemOrTab isView ifTrue:[
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  1704
        ^ aWidgetOrMenuItemOrTab screenBounds
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1705
    ].
3796
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  1706
    (aWidgetOrMenuItemOrTab askFor:#isMenuItem) ifTrue:[
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1707
        |menuPanel menuBounds|
3717
26224649d91c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3716
diff changeset
  1708
3796
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  1709
        aWidgetOrMenuItemOrTab isVisible ifTrue:[
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  1710
            (itemLayout := aWidgetOrMenuItemOrTab layout) notNil ifTrue:[
3798
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1711
                menuPanel := aWidgetOrMenuItemOrTab view.
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1712
                menuPanel shown ifTrue:[
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1713
                    menuBounds := menuPanel screenBounds.
3796
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  1714
                    ^ itemLayout + menuBounds origin 
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1715
                ].
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1716
            ].
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1717
        ].
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1718
    ].
3796
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  1719
    (aWidgetOrMenuItemOrTab askFor:#isNoteBookTab) ifTrue:[
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  1720
        (itemLayout := aWidgetOrMenuItemOrTab layout) notNil ifTrue:[
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  1721
            |notebook notebookBounds|
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  1722
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  1723
            notebook := aWidgetOrMenuItemOrTab view.
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  1724
            notebook shown ifTrue:[
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  1725
                notebookBounds := notebook screenBounds.
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  1726
                ^ itemLayout + notebookBounds origin 
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  1727
            ].
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  1728
        ]. 
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  1729
        self halt.
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  1730
    ].
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1731
    ^ nil.
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1732
! !
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1733
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1734
!ShowMeHowItWorks methodsFor:'helpers - mouse buttons'!
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1735
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1736
click:buttonNr inComponent:component
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1737
    "press-release in a component"
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1738
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1739
    |t|
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1740
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1741
    t := self shortClickTime.
3795
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  1742
    ((component isKindOf:Button) 
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  1743
      or:[(component askFor:#isMenuItem)]
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  1744
    )ifTrue:[
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1745
        t := self longClickTime
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1746
    ].    
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1747
    self click:buttonNr inComponent:component clickTime:t
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1748
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1749
    "Created: / 19-07-2019 / 13:18:27 / Claus Gittinger"
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1750
    "Modified: / 19-07-2019 / 15:22:47 / Claus Gittinger"
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1751
!
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1752
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1753
click:buttonNr inComponent:viewOrMenuItem clickTime:clickTime 
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1754
    "press-release in a component"
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1755
3795
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  1756
    self withViewAndPositionFor:viewOrMenuItem do:[:viewToClick :clickPos |
3798
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1757
        Display activePointerGrab == Display rootView ifTrue:[
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1758
            |pos|
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1759
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1760
            pos := Display translatePoint:clickPos fromView:viewToClick toView:nil.
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1761
            OperatingSystem isOSXlike ifTrue:[
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1762
                OperatingSystem 
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1763
                    generateMouseMoveEventX:pos x y:pos y;
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1764
                    generateButtonEvent:buttonNr down:true x:pos x y:pos y;
3800
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1765
                    yourself.
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1766
                Delay waitForSeconds:clickTime.
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1767
                OperatingSystem 
3798
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1768
                    generateButtonEvent:buttonNr down:false x:pos x y:pos y;
3800
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1769
                    "/ generateButtonEvent:buttonNr down:true x:pos x y:pos y;
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1770
                    "/ generateButtonEvent:buttonNr down:false x:pos x y:pos y;
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
  1771
                    yourself.
3798
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1772
                ^ self.
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1773
            ].
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1774
            Display rootView simulateButtonPress:buttonNr at:pos sendDisplayEvent:true.
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1775
            Delay waitForSeconds:clickTime.
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1776
            Display rootView simulateButtonRelease:buttonNr at:pos sendDisplayEvent:true.
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1777
        ] ifFalse:[
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1778
            viewToClick simulateButtonPress:buttonNr at:clickPos sendDisplayEvent:false.
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1779
            Delay waitForSeconds:clickTime.
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1780
            viewToClick simulateButtonRelease:buttonNr at:clickPos sendDisplayEvent:false.
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1781
        ].
3795
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  1782
    ].
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  1783
!
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  1784
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  1785
press:buttonNr inComponent:viewOrMenuItem 
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  1786
    "press in a component"
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  1787
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  1788
    self withViewAndPositionFor:viewOrMenuItem do:[:viewToClick :clickPos |
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  1789
        viewToClick simulateButtonPress:buttonNr at:clickPos sendDisplayEvent:false.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  1790
    ]
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  1791
!
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  1792
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  1793
release:buttonNr inComponent:viewOrMenuItem 
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  1794
    "release in a component"
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  1795
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  1796
    self withViewAndPositionFor:viewOrMenuItem do:[:viewToClick :clickPos |
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  1797
        viewToClick simulateButtonRelease:buttonNr at:clickPos sendDisplayEvent:false.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  1798
    ]
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  1799
!
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  1800
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  1801
withViewAndPositionFor:viewOrMenuItem do:aBlock
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  1802
    "helper for click, press and release"
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  1803
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1804
    |viewToClick clickPos|
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1805
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1806
    self assert:viewOrMenuItem notNil.
3775
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
  1807
    verifying ifTrue:[^ self].
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
  1808
3798
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1809
    (viewOrMenuItem isKindOf:ItemInView) ifTrue:[
3797
5ab4b911e388 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3796
diff changeset
  1810
        viewToClick := viewOrMenuItem view.
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1811
        clickPos := viewOrMenuItem layout center.
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1812
        self assert:(clickPos notNil).
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1813
    ] ifFalse:[
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1814
        viewToClick := viewOrMenuItem.
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1815
        clickPos := viewToClick extent // 2.
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1816
    ].
3795
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  1817
    aBlock value:viewToClick value:clickPos.
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1818
! !
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1819
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1820
!ShowMeHowItWorks methodsFor:'helpers - mouse movement'!
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1821
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1822
circlePointerAroundComponent:aWidgetOrMenuItem
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1823
    "circle around it a few times"
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1824
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1825
    |bounds position|
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1826
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1827
    bounds := self screenBoundsOfComponent:aWidgetOrMenuItem.
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1828
    bounds isNil ifTrue:[
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1829
        self error:'no bounds found for: ',aWidgetOrMenuItem printString.
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1830
    ].
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1831
    position := bounds center rounded.
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1832
    self circlePointerAroundScreenPosition:position
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1833
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1834
    "Created: / 19-07-2019 / 13:12:35 / Claus Gittinger"
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1835
    "Modified: / 23-07-2019 / 09:38:12 / Claus Gittinger"
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1836
!
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1837
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1838
circlePointerAroundScreenPosition:position
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1839
    "circle around it a few times"
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1840
    
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1841
    |screen stepDelayTime numCircles circlingSpeed radius|
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1842
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1843
    verifying ifTrue:[^ self].
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1844
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1845
    screen := Screen current.
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1846
    
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1847
    circlingSpeed := self circlingSpeed.    "/ time per round
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1848
    numCircles := self circlingCount.
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1849
    stepDelayTime := self pointerAnimationDelay.   "/ update interval
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1850
    
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1851
    radius := self circlingRadius.
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1852
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1853
    "/ move it around a few times
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1854
    1 to:numCircles do:[:round |
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1855
        |n angle|
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1856
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1857
        n := circlingSpeed / stepDelayTime. "/ nr of steps per circle
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1858
        angle := 360 / n.                   "/ angle-delta per step
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1859
        1 to:n do:[:step |
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1860
            |a x y|
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1861
            
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1862
            a := angle * step.
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1863
            "/ clockwise starting above the center
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1864
            x := position x + (radius * a degreesToRadians sin).
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1865
            y := position y + (radius * a degreesToRadians cos).
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1866
"/ Transcript showCR:(x@y).
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1867
            screen setPointerPosition:(x@y) rounded.
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1868
            screen flush.
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1869
            Delay waitFor:stepDelayTime.
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1870
        ].    
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1871
        "/ and back
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1872
        screen setPointerPosition:position rounded.
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1873
        screen flush.
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1874
        Delay waitFor:stepDelayTime.
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1875
    ].
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1876
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1877
    "Created: / 23-07-2019 / 09:37:46 / Claus Gittinger"
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1878
!
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1879
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1880
fastMovePointerToScreenPosition:position
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1881
    self movePointerToScreenPosition:position speed:(self pointerMoveSpeedFast).
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1882
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1883
    "Created: / 23-07-2019 / 09:36:20 / Claus Gittinger"
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1884
!
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1885
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1886
movePointerToComponent:aWidgetOrMenuItem
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1887
    "move the mouse to aWidget's center"
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1888
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1889
    |bounds|
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1890
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1891
    bounds := self screenBoundsOfComponent:aWidgetOrMenuItem.
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1892
    self movePointerToScreenPosition:(bounds center rounded).
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1893
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1894
    "Created: / 19-07-2019 / 13:11:33 / Claus Gittinger"
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1895
    "Modified: / 23-07-2019 / 09:37:01 / Claus Gittinger"
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1896
!
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1897
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1898
movePointerToComponent:aWidgetOrMenuItem offset:offset
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1899
    "move the mouse to position inside aWidget's"
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1900
    
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1901
    |bounds|
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1902
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1903
    bounds := self screenBoundsOfComponent:aWidgetOrMenuItem.
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1904
    self movePointerToScreenPosition:(bounds origin + offset) rounded.
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1905
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1906
    "Created: / 19-07-2019 / 16:18:58 / Claus Gittinger"
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1907
    "Modified: / 23-07-2019 / 09:36:57 / Claus Gittinger"
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1908
!
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1909
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1910
movePointerToComponent:aWidgetOrMenuItem rightBottomOffset:offset
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1911
    "move the mouse to position inside aWidget's.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1912
     Offset is from the rightBottom"
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1913
    
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1914
    |bounds|
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1915
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1916
    bounds := self screenBoundsOfComponent:aWidgetOrMenuItem.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1917
    self movePointerToScreenPosition:(bounds corner - offset) rounded.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1918
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1919
    "Created: / 19-07-2019 / 16:18:58 / Claus Gittinger"
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1920
    "Modified: / 23-07-2019 / 09:36:57 / Claus Gittinger"
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1921
!
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1922
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1923
movePointerToComponent:aWidgetOrMenuItem rightOffset:offset
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1924
    "move the mouse to position inside aWidget's.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1925
     Offset is from the rightTop (i.e. x is subtracted, y is added)"
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1926
    
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1927
    |bounds pos|
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1928
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1929
    bounds := self screenBoundsOfComponent:aWidgetOrMenuItem.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1930
    pos := (bounds right - offset x) @ (bounds top + offset y).
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1931
    self movePointerToScreenPosition:pos rounded.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1932
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1933
    "Created: / 19-07-2019 / 16:18:58 / Claus Gittinger"
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1934
    "Modified: / 23-07-2019 / 09:36:57 / Claus Gittinger"
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1935
!
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  1936
3796
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  1937
movePointerToComponent:aWidgetOrMenuItemOrTab speed:pixelsPerSecond
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1938
    "move the mouse to aWidget's center"
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1939
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1940
    |bounds position|
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1941
    
3796
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  1942
    bounds := self screenBoundsOfComponent:aWidgetOrMenuItemOrTab.
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1943
    bounds isNil ifTrue:[
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
  1944
        self error:('no bounds found for: %1 (%2)' bindWith:lastComponentName with:aWidgetOrMenuItemOrTab printString).
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1945
    ].
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1946
    position := bounds center rounded.
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1947
    self movePointerToScreenPosition:position speed:pixelsPerSecond.
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1948
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1949
    "Created: / 20-07-2019 / 08:12:49 / Claus Gittinger"
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1950
    "Modified: / 23-07-2019 / 09:37:27 / Claus Gittinger"
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1951
!
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1952
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1953
movePointerToScreenPosition:newPosition
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1954
    "move the mouse to newPosition"
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1955
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1956
    self movePointerToScreenPosition:newPosition speed:(self pointerMoveSpeed)
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1957
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1958
    "Created: / 23-07-2019 / 09:36:39 / Claus Gittinger"
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1959
!
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1960
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1961
movePointerToScreenPosition:newPosition speed:pixelsPerSecond
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1962
    "move the mouse to newPosition, which is a screen position"
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1963
    
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1964
    |screen distance start numSteps moveTime stepDelayTime delta|
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1965
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1966
    verifying ifTrue:[^ self].
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1967
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1968
    screen := Screen current.
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1969
    start := screen pointerPosition.   
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1970
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1971
    distance := start dist:newPosition.
3798
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1972
    distance = 0 ifTrue:[
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1973
        "/ already there
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1974
        screen setPointerPosition:newPosition. "/ do it anyway, in case of rounding errors
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1975
        ^ self
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1976
    ].
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1977
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1978
    moveTime := (distance / pixelsPerSecond) seconds.   "/ time to move
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1979
    stepDelayTime := self pointerAnimationDelay.        "/ update every 50ms
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1980
    
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1981
    numSteps := moveTime / stepDelayTime.
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1982
    numSteps = 0 ifTrue:[
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1983
        "/ already there
3798
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  1984
        screen setPointerPosition:newPosition. "/ do it anyway, in case of rounding errors
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1985
        ^ self
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1986
    ].
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1987
    
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1988
    delta := (newPosition - start) / numSteps.
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1989
    1 to:numSteps do:[:step |
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1990
        |p|
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1991
        
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1992
        p := (start + (delta * step)) rounded.
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1993
"/ Transcript showCR:p.
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1994
        screen setPointerPosition:p.
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1995
        screen flush.
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1996
        Delay waitFor:stepDelayTime.
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1997
    ].
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1998
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1999
    "Created: / 23-07-2019 / 09:36:45 / Claus Gittinger"
3796
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2000
!
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2001
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2002
where:where inComponent:aComponent
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2003
    where == #center ifTrue:[
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2004
        ^ aComponent center
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2005
    ].
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2006
    where == #leftCenter ifTrue:[
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2007
        ^ aComponent leftCenter + (5@0). 
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2008
    ].
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2009
    where == #rightCenter ifTrue:[
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2010
        ^ aComponent rightCenter - (5@0). 
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2011
    ].
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2012
    where == #topLeft ifTrue:[
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2013
        ^ aComponent topLeft + (5@5). 
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2014
    ].
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2015
    where == #topCenter ifTrue:[
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2016
        ^ aComponent topCenter + (0@5). 
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2017
    ].
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2018
    where == #topRight ifTrue:[
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2019
        ^ aComponent topRight - (5@5). 
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2020
    ].
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2021
    where == #bottomCenter ifTrue:[
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2022
        ^ aComponent bottomCenter - (0 @ 5)
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2023
    ].
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2024
    where == #bottomLeft ifTrue:[
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2025
        ^ aComponent bottomLeft + (5 @ -5)
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2026
    ].
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2027
    where == #bottomRight ifTrue:[
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2028
        ^ aComponent bottomLeft - (5 @ 5)
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2029
    ].
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2030
    self error:'where is this'
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  2031
! !
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  2032
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2033
!ShowMeHowItWorks methodsFor:'running'!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2034
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
  2035
do:specArray
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
  2036
    "must run as a separate process;
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
  2037
     otherwise - if started by the app itself -
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
  2038
     no events will be processed while running"
3784
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2039
3790
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
  2040
    "/ StartLabel := nil.
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
  2041
    "/ StartLabel := 'start'.
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
  2042
    self do:specArray from:StartLabel
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2043
3784
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2044
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2045
    "
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2046
     ShowMeHowItWorks do:
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2047
        #(
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2048
            (show: 'blah blah')
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2049
            (moveTo: NameOfComponent)
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2050
        )    
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2051
    "
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2052
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2053
    "Created: / 23-07-2019 / 10:24:53 / Claus Gittinger"
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2054
    "Modified: / 25-07-2019 / 11:48:53 / Claus Gittinger"
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2055
!
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2056
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2057
do:specArray from:startLabelOrNil withUI:withUIBoolean
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2058
    "must run as a separate process;
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2059
     otherwise - if started by the app itself -
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2060
     no events will be processed while running"
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2061
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2062
    withUIBoolean ifTrue:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2063
        ui := ShowMeHowItWorksRunner openOn:self.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2064
    ].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2065
    self do:specArray from:startLabelOrNil
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2066
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2067
    "
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2068
     ShowMeHowItWorks 
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2069
        do:#(
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2070
            (show: 'blah blah')
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2071
            (moveTo: NameOfComponent)
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2072
        )
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2073
        withUI:true
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2074
    "
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2075
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2076
    "Created: / 23-07-2019 / 10:24:53 / Claus Gittinger"
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2077
    "Modified: / 25-07-2019 / 11:48:53 / Claus Gittinger"
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2078
!
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2079
3784
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2080
do:specArray withUI:withUIBoolean
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2081
    "must run as a separate process;
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2082
     otherwise - if started by the app itself -
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2083
     no events will be processed while running"
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2084
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2085
    withUIBoolean ifTrue:[
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2086
        ui := ShowMeHowItWorksRunner openOn:self.
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2087
    ].
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2088
    self do:specArray from:nil
3784
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2089
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2090
    "
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2091
     ShowMeHowItWorks 
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2092
        do:#(
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2093
            (show: 'blah blah')
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2094
            (moveTo: NameOfComponent)
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2095
        )
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2096
        withUI:true
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2097
    "
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2098
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2099
    "Created: / 23-07-2019 / 10:24:53 / Claus Gittinger"
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2100
    "Modified: / 25-07-2019 / 11:48:53 / Claus Gittinger"
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2101
!
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2102
3795
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  2103
doShowFile:aFilename
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  2104
    "the file from which the show was loaded"
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  2105
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  2106
    |spec|
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  2107
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  2108
    theShowFile := aFilename.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  2109
    aFilename readingFileWithEncoding:#utf8 do:[:s |
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  2110
        spec := Array readFrom:s.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  2111
    ].
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  2112
    self do:spec.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  2113
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  2114
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  2115
!
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  2116
3784
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2117
prepare
3775
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
  2118
    language isNil ifTrue:[
3795
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
  2119
        self setLanguage:(Smalltalk language).
3775
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
  2120
    ].
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
  2121
    translate := false.
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
  2122
    
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
  2123
    application isNil ifTrue:[
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
  2124
        application := WindowGroup activeMainApplication.
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
  2125
    ].
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  2126
    closeApplicationWhenFinished := false.
3783
e935b92253c9 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3781
diff changeset
  2127
    defaultComponentWaitTime isNil ifTrue:[ defaultComponentWaitTime := 1 ].
3775
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
  2128
3784
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2129
    "Created: / 23-07-2019 / 10:24:53 / Claus Gittinger"
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2130
    "Modified: / 25-07-2019 / 11:48:53 / Claus Gittinger"
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2131
!
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2132
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2133
verify:specArray
3775
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
  2134
    "/ run in verifying mode
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
  2135
    verifying := true.
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
  2136
    [
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
  2137
        Error handle:[:ex |
3784
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2138
            Transcript showCR:('Possible error (encountered while verifying):\.... %1' withCRs)
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2139
                         with:ex description withCRs.
3776
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
  2140
            Display ctrlDown ifTrue:[ex reject].
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
  2141
        ] do:[
3784
f6654cc10071 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3783
diff changeset
  2142
            self show:' '. "/ to avoid an audible disturbance on OSX
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
  2143
            self doStream:(specArray readStream)
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
  2144
        ].
3775
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
  2145
    ] ensure:[
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
  2146
        verifying := false.
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
  2147
    ].
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
  2148
! !
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
  2149
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
  2150
!ShowMeHowItWorks methodsFor:'running - private'!
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
  2151
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2152
do:specArray from:startLabelOrNil
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2153
    "must run as a separate process;
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2154
     otherwise - if started by the app itself -
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2155
     no events will be processed while running"
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2156
3790
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
  2157
    |wasFlyByActive|
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2158
3790
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
  2159
    (wasFlyByActive := FlyByHelp isSuspended) ifFalse:[
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
  2160
        FlyByHelp suspend.
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2161
    ].
3790
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
  2162
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2163
    self prepare.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2164
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2165
    "/ run once in verifying mode
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2166
    [
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2167
        self verify:specArray.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2168
    ] ensure:[
3790
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
  2169
        wasFlyByActive ifTrue:[FlyByHelp resume].
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2170
    ].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2171
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2172
    [
3790
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
  2173
        FlyByHelp suspend.
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
  2174
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2175
        [
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2176
            Error handle:[:ex |
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2177
                Dialog warn:(self class classResources 
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2178
                                    stringWithCRs:'An error was encountered in the show:\\%1' 
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2179
                                    with:ex description withCRs)
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2180
            ] do:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2181
                self doStream:(specArray readStream) from:startLabelOrNil
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2182
            ].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2183
        ] ensure:[
3790
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
  2184
            wasFlyByActive ifTrue:[FlyByHelp resume].
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2185
        ].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2186
    ] fork.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2187
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2188
    "
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2189
     ShowMeHowItWorks do:
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2190
        #(
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2191
            (show: 'blah blah')
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2192
            (moveTo: NameOfComponent)
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2193
        )    
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2194
    "
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2195
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2196
    "Created: / 23-07-2019 / 10:24:53 / Claus Gittinger"
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2197
    "Modified: / 25-07-2019 / 11:48:53 / Claus Gittinger"
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2198
!
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2199
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2200
doCommand:op
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  2201
    "execute a single command"
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  2202
    
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2203
    |numArgs sel args method|
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2204
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2205
    op isArray ifTrue:[
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2206
        op first isArray ifTrue:[
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2207
            self doStream:op readStream.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2208
            ^ self.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2209
        ].
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2210
        
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2211
        "/ construct a selector from keyword parts at odd indices
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2212
        sel := ((op with:(1 to:op size) select:[:el :idx | idx odd]) asStringWith:'') asSymbol.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2213
        "/ construct arg vector from parts at even indices
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2214
        args := op with:(1 to:op size) select:[:el :idx | idx even].
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2215
    ] ifFalse:[
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2216
        sel := op.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2217
        numArgs := sel argumentCount.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2218
        args := opStream next:numArgs.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2219
    ].
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2220
    
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2221
    (self respondsTo:sel) ifFalse:[
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2222
        self error:'bad operation: ',sel
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2223
    ].
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2224
    method := self class lookupMethodFor:sel.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2225
    (method hasAnnotation:#action) ifFalse:[self halt].
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2226
    
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2227
    lastResult := self perform:sel withArguments:args.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2228
    ^ lastResult
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2229
    
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2230
"<<END
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2231
     ShowMeHowItWorks do:#(
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2232
        showing: 'Choose the number of arguments'
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2233
        do: (
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2234
            moveTo: NumberOfArguments
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2235
            select: '1'
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2236
        )    
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2237
        showing: 'Click into the "receiver" field'
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2238
        do: (
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2239
            moveTo: ReceiverEditor
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2240
            click: ReceiverEditor
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2241
        )
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2242
        showing: 'Enter a value (or expression) into "receiver" field'
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2243
        do: (
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2244
            enter: '100'
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2245
        )
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2246
        showing: 'Click into the "first argument" field'
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2247
        do: (
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2248
            moveTo: Arg1Editor
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2249
            click: ReceiverEditor
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2250
        )
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2251
        showing: 'Enter a value (or expression) into "receiver" field'
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2252
        do: (
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2253
            enter: '100'
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2254
        )
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2255
     )
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2256
END"
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2257
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2258
    "Created: / 19-07-2019 / 15:34:55 / Claus Gittinger"
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  2259
    "Modified: / 23-07-2019 / 09:14:26 / Claus Gittinger"
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2260
!
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  2261
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2262
doStream:specStream
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2263
    self doStream:specStream from:nil
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2264
    
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2265
"<<END
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2266
     ShowMeHowItWorks do:#(
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2267
        showing: 'Choose the number of arguments'
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2268
        do: (
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2269
            moveTo: NumberOfArguments
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2270
            select: '1'
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2271
        )    
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2272
        showing: 'Click into the "receiver" field'
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2273
        do: (
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2274
            moveTo: ReceiverEditor
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2275
            click: ReceiverEditor
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2276
        )
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2277
        showing: 'Enter a value (or expression) into "receiver" field'
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2278
        do: (
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2279
            enter: '100'
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2280
        )
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2281
        showing: 'Click into the "first argument" field'
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2282
        do: (
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2283
            moveTo: Arg1Editor
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2284
            click: ReceiverEditor
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2285
        )
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2286
        showing: 'Enter a value (or expression) into "receiver" field'
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2287
        do: (
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2288
            enter: '100'
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2289
        )
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2290
     )
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2291
END"
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2292
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2293
    "Created: / 19-07-2019 / 10:52:24 / Claus Gittinger"
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2294
    "Modified: / 23-07-2019 / 11:48:45 / Claus Gittinger"
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2295
!
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2296
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2297
doStream:specStream from:startLabelOrNil
3715
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2298
    |previousStream resources|
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2299
3715
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2300
    resources := self class classResources.
3783
e935b92253c9 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3781
diff changeset
  2301
e935b92253c9 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3781
diff changeset
  2302
    streamStack isNil ifTrue:[ streamStack := OrderedCollection new ].
e935b92253c9 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3781
diff changeset
  2303
    streamStack add:opStream.
e935b92253c9 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3781
diff changeset
  2304
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2305
    previousStream := opStream.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2306
    [
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2307
        |nextCommand|
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2308
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2309
        opStream := specStream.
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2310
        startLabelOrNil notNil ifTrue:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2311
            |found|
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2312
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2313
            "/ skip for that label
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2314
            found := false.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2315
            [ found ] whileFalse:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2316
                |cmd|
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2317
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2318
                cmd := opStream nextOrNil.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2319
                cmd isNil ifTrue:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2320
                    self proceedableError:'label not found: ',startLabelOrNil.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2321
                    ^ self.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2322
                ].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2323
                (cmd = 'label:') ifTrue:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2324
                    found := (opStream next = startLabelOrNil)
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2325
                ].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2326
            ].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2327
        ].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2328
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2329
        [opStream atEnd] whileFalse:[
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2330
            nextCommand := opStream next.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2331
            self doCommand:nextCommand.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
  2332
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2333
            Display shiftDown ifTrue:[
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
  2334
                (IntroShownCount ? 0) > 3 ifFalse:[
3738
fcd5a6af06d4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3733
diff changeset
  2335
                    self tell:(self possiblyTranslate:'You pressed the SHIFT key.').
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
  2336
                ].    
3738
fcd5a6af06d4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3733
diff changeset
  2337
                self tell:(self possiblyTranslate:'Do you want to stop the show?').
3715
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  2338
                (Dialog confirm:(resources stringWithCRs:'Stop the demonstration?'))
3714
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  2339
                ifTrue:[
3738
fcd5a6af06d4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3733
diff changeset
  2340
                    self tell:(self possiblyTranslate:'OK,').
fcd5a6af06d4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3733
diff changeset
  2341
                    self tell:(self possiblyTranslate:(self randomThankYou)).
3714
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  2342
                    ^ AbortOperationRequest raise
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  2343
                ].    
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2344
            ].    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2345
        ].    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2346
    ] ensure:[
3783
e935b92253c9 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3781
diff changeset
  2347
        streamStack removeLast.
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2348
        opStream := previousStream
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2349
    ].
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2350
    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2351
"<<END
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2352
     ShowMeHowItWorks do:#(
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2353
        showing: 'Choose the number of arguments'
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2354
        do: (
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2355
            moveTo: NumberOfArguments
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2356
            select: '1'
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2357
        )    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2358
        showing: 'Click into the "receiver" field'
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2359
        do: (
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2360
            moveTo: ReceiverEditor
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2361
            click: ReceiverEditor
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2362
        )
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2363
        showing: 'Enter a value (or expression) into "receiver" field'
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2364
        do: (
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2365
            enter: '100'
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2366
        )
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2367
        showing: 'Click into the "first argument" field'
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2368
        do: (
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2369
            moveTo: Arg1Editor
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2370
            click: ReceiverEditor
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2371
        )
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2372
        showing: 'Enter a value (or expression) into "receiver" field'
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2373
        do: (
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2374
            enter: '100'
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2375
        )
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2376
     )
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2377
END"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2378
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2379
    "Created: / 19-07-2019 / 10:52:24 / Claus Gittinger"
3738
fcd5a6af06d4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3733
diff changeset
  2380
    "Modified: / 23-07-2019 / 11:48:45 / Claus Gittinger"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2381
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2382
3738
fcd5a6af06d4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3733
diff changeset
  2383
possiblyTranslate:aString
fcd5a6af06d4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3733
diff changeset
  2384
    translate ifTrue:[^ self class classResources string:aString].
fcd5a6af06d4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3733
diff changeset
  2385
    ^ aString
fcd5a6af06d4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3733
diff changeset
  2386
fcd5a6af06d4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3733
diff changeset
  2387
    "Created: / 23-07-2019 / 11:48:17 / Claus Gittinger"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2388
! !
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2389
3796
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2390
!ShowMeHowItWorks::ItemInView class methodsFor:'documentation'!
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2391
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2392
documentation
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2393
"
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2394
    documentation to be added.
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2395
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2396
    class:
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2397
        <a short class summary here, describing what instances represent>
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2398
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2399
    responsibilities:    
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2400
        <describing what my main role is>
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2401
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2402
    collaborators:    
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2403
        <describing with whom and how I talk to>
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2404
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2405
    API:
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2406
        <public api and main messages>
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2407
        
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2408
    example:
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2409
        <a one-line examples on how to use - can also be in a separate example method>
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2410
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2411
    implementation:
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2412
        <implementation points>
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2413
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2414
    [author:]
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2415
        exept MBP
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2416
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2417
    [instance variables:]
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2418
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2419
    [class variables:]
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2420
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2421
    [see also:]
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2422
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2423
"
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2424
! !
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2425
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2426
!ShowMeHowItWorks::ItemInView methodsFor:'accessing'!
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2427
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2428
boundsInView
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2429
    ^ boundsInView
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2430
!
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2431
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2432
item
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2433
    ^ item
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2434
!
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2435
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
  2436
itemValue
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
  2437
    ^ item itemValue
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
  2438
!
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
  2439
3796
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2440
layout
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2441
    ^ item layout
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2442
!
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2443
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2444
view
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2445
    ^ view
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2446
!
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2447
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2448
view:viewArg item:itemArg boundsInView:boundsInViewArg 
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2449
    view := viewArg.
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2450
    item := itemArg.
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2451
    boundsInView := boundsInViewArg.
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2452
! !
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2453
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2454
!ShowMeHowItWorks::ItemInView methodsFor:'testing'!
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2455
3798
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  2456
isItemInView
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  2457
    ^ true
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  2458
!
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  2459
3796
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2460
isMenuItem
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2461
    ^ item askFor:#isMenuItem
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2462
!
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2463
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2464
isNoteBookTab
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2465
    ^ item isKindOf:NoteBookView::Tab
3798
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  2466
!
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  2467
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  2468
isVisible
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  2469
    ^ view shown
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
  2470
    and:[item isVisible]
3796
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2471
! !
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
  2472
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2473
!ShowMeHowItWorks class methodsFor:'documentation'!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2474
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2475
version_CVS
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2476
    ^ '$Header$'
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2477
! !
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  2478