ShowMeHowItWorks.st
author Claus Gittinger <cg@exept.de>
Thu, 31 Oct 2019 08:42:53 +0100
changeset 3801 e45e18e26a7d
parent 3800 fb1763b613bf
child 3803 34ea88ec4dc4
permissions -rw-r--r--
#FEATURE by exept class: ShowMeHowItWorks changed: #findComponent:in:
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
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
    11
		theShowFile defaultElementTimeout'
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
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   223
    "if set, only that application is presented (widget search is limtied to that one)"
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
3776
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   318
raise:what
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   319
    <action>
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   320
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   321
    verifying ifTrue:[^ self].
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   322
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   323
    what == #application ifTrue:[
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   324
        application topView raise.
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   325
        ^ self
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   326
    ].
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   327
    what == #masterApplication ifTrue:[
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   328
        application windowGroup isModal ifTrue:[
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   329
            application windowGroup mainGroup topViews first raise
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   330
        ] ifFalse:[
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   331
            (application masterApplication ? application) topViews first raise.
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   332
        ].
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   333
        ^ self
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   334
    ].
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   335
    self halt.
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   336
!
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   337
3798
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   338
selectPin:pinName ofStep:stepName
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   339
    <action>
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   340
3800
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
   341
    |diagramEditor pinPO count|
3798
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   342
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   343
    (diagramEditor := lastComponent) isScrollWrapper ifTrue:[
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   344
        diagramEditor := lastComponent scrolledView
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   345
    ].
3800
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
   346
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
   347
    count := 0.
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
   348
    [
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
   349
        Delay waitForSeconds:0.1.
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
   350
        pinPO := self pinPOForPin:pinName ofStep:stepName.
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
   351
    ] doWhile:[pinPO isNil and:[ (count := count+1) < 20]].
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
   352
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
   353
    self movePointerToComponent:diagramEditor offset:(pinPO frame center).
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   354
    diagramEditor selection:{ pinPO }. 
3798
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   355
!
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   356
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   357
show:message
3714
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   358
    "showing (and speak) some message."
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   359
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   360
    <action>
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   361
    
3776
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   362
    self showing:message saying:nil do:nil
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   363
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   364
    "Created: / 19-07-2019 / 15:59:18 / Claus Gittinger"
3714
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   365
    "Modified (comment): / 19-07-2019 / 18:54:36 / Claus Gittinger"
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   366
!
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   367
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   368
show:message for:seconds
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   369
    "showing (and speak) some message and wait for some time."
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   370
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   371
    <action>
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   372
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   373
    DebugMode == true ifTrue:[^ self].
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   374
3714
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   375
    self show:message.
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   376
    self wait:seconds.
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   377
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   378
    "Created: / 19-07-2019 / 18:54:20 / Claus Gittinger"
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   379
!
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   380
3776
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   381
show:message saying:sentenceOrNil
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   382
    "showing (and speak) some message."
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   383
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   384
    <action>
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   385
    
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   386
    self showing:message saying:sentenceOrNil do:nil
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   387
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   388
    "Created: / 19-07-2019 / 15:59:18 / Claus Gittinger"
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   389
    "Modified (comment): / 19-07-2019 / 18:54:36 / Claus Gittinger"
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   390
!
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   391
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   392
show:message saying:sentenceOrNil for:seconds
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   393
    "showing (and speak) some message and wait for some time."
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   394
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   395
    <action>
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   396
    
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   397
    DebugMode == true ifTrue:[^ self].
3776
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   398
    self show:message saying:sentenceOrNil.
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   399
    self wait:seconds.
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   400
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   401
    "Created: / 19-07-2019 / 18:54:20 / Claus Gittinger"
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   402
!
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   403
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   404
showing:message do:operationsOrNothing
3714
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   405
    "execute operationsOrNothing while showing (and speaking) some message."
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   406
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   407
    <action>
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   408
    
3776
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   409
    self showing:message saying:nil do:operationsOrNothing
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   410
!
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
showing:message saying:sentenceOrNil do:operationsOrNothing
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   413
    "execute operationsOrNothing while showing (and speaking) some message."
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   414
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   415
    <action>
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   416
    
3715
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
   417
    |xLatedMessage messageView talkDone|
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   418
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   419
    xLatedMessage := (translate and:[application notNil]) 
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   420
                            ifTrue:[application resources string:message]
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   421
                            ifFalse:[message].
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   422
    
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   423
    self assert:(operationsOrNothing isNil or:[operationsOrNothing isSequenceable]).
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   424
3715
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
   425
    messageView := ActiveHelpView for:xLatedMessage.
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   426
    "/ messageView shapeStyle:#cartoon.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   427
    [
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   428
        messageView origin:(Screen current pointerPosition + (0 @ 20)).
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   429
        messageView makeFullyVisible.
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   430
        messageView realize.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   431
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   432
        self talking ifTrue:[
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   433
            talkDone := Semaphore new.
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 tell:(sentenceOrNil ? xLatedMessage).
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   436
                talkDone signal
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   437
            ] fork.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   438
            
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   439
            "/
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   440
            "/ allow speaker some headoff
3775
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   441
            verifying ifFalse:[
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   442
                Delay waitForSeconds:(xLatedMessage size / 15)+0.5.
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   443
            ].
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   444
        ].
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   445
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   446
        operationsOrNothing notEmptyOrNil ifTrue:[
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   447
            self doStream:(operationsOrNothing readStream).
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   448
        ].
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   449
    ] ensure:[
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   450
        messageView destroy
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   451
    ].
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   452
    self talking ifTrue:[
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   453
        talkDone wait.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   454
    ].
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   455
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   456
    "Created: / 19-07-2019 / 11:19:27 / Claus Gittinger"
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   457
    "Modified: / 23-07-2019 / 10:52:30 / Claus Gittinger"
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   458
!
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   459
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   460
thankyou
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   461
    <action>
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   462
    
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   463
    self show:(self randomThankYou).
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   464
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   465
    "Created: / 23-07-2019 / 10:50:43 / Claus Gittinger"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   466
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   467
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   468
timeout:seconds
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   469
    <action>
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   470
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   471
    defaultElementTimeout := seconds.
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   472
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   473
    "Created: / 23-07-2019 / 10:27:02 / Claus Gittinger"
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   474
!
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   475
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   476
wait:seconds
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   477
    <action>
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   478
    
3775
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   479
    verifying ifTrue:[^ self].
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   480
    DebugMode == true ifTrue:[^ self].
3776
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   481
    Display ctrlDown ifTrue:[^ self].
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   482
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   483
    Delay waitForSeconds:seconds
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   484
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   485
    "Created: / 19-07-2019 / 15:09:45 / Claus Gittinger"
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   486
!
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   487
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   488
waitFor:componentName timeout:seconds
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   489
    <action>
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   490
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   491
    |endTime component|
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   492
3781
0040ac44a2f3 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3780
diff changeset
   493
    verifying ifTrue:[^ self].
0040ac44a2f3 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3780
diff changeset
   494
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   495
    lastComponentName := componentName.
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   496
    endTime := Timestamp now + seconds.
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   497
    [   
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   498
        (component := self findComponent:componentName inAllApplications:true ifMultiple:nil) notNil ifTrue:[
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   499
            lastComponent := component.
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   500
            ^ self
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   501
        ].
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   502
        Delay waitForSeconds:0.1.
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   503
        Timestamp now > endTime ifTrue:[
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   504
            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
   505
        ]
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
   506
    ] loop
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   507
! !
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   508
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   509
!ShowMeHowItWorks methodsFor:'commands - checking'!
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   510
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   511
isEmpty:componentName
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   512
    "true if the addressed textview/field is empty.
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   513
     Leaves component in lastComponent"
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   514
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   515
    <action>
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   516
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   517
    |component|
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   518
    
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   519
    component := self componentNamed:componentName.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   520
    component isScrollWrapper ifTrue:[ component := component scrolledView ].
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   521
    component isTextView ifTrue:[
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   522
        ^ component contents isEmptyOrNil
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   523
    ].
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   524
    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
   525
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   526
    "Created: / 19-07-2019 / 15:33:47 / Claus Gittinger"
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   527
!
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   528
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   529
unless:query do:actions
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   530
    <action>
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   531
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   532
    |result|
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   533
    
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   534
    result := self doCommand:query.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   535
    result ifFalse:[
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   536
        self doCommand:actions
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   537
    ].
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   538
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   539
    "Created: / 19-07-2019 / 15:33:32 / Claus Gittinger"
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   540
! !
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   541
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   542
!ShowMeHowItWorks methodsFor:'commands - mouse & keyboard'!
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   543
3798
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   544
clear
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   545
    "clear entry fields of last component"
3798
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   546
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   547
    <action>
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   548
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   549
    verifying ifTrue:[^ self].
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   550
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   551
    lastComponent contents:nil
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   552
!
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   553
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   554
click
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   555
    "press-release in last component"
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   556
    
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   557
    <action>
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   558
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   559
    ^ self click:1 inComponent:lastComponent
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   560
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   561
    "Created: / 19-07-2019 / 16:11:03 / Claus Gittinger"
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   562
!
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   563
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   564
click:buttonNr
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   565
    "press-release in last component"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   566
    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   567
    <action>
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   568
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   569
    self assert:(buttonNr isInteger).
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   570
    ^ self click:buttonNr inComponent:lastComponent
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   571
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   572
    "Created: / 19-07-2019 / 13:21:20 / Claus Gittinger"
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   573
    "Modified: / 19-07-2019 / 16:10:19 / Claus Gittinger"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   574
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   575
3800
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
   576
click:buttonNr clickTime:t
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
   577
    "press-release in last component"
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
   578
    
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
   579
    <action>
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
   580
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
   581
    self assert:(buttonNr isInteger).
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
   582
    ^ self click:buttonNr inComponent:lastComponent clickTime:t
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
   583
!
fb1763b613bf #QUALITY by exept
Claus Gittinger <cg@exept.de>
parents: 3799
diff changeset
   584
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   585
clickIn:componentName
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   586
    "press-release.
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   587
     Leaves component in lastComponent"
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   588
    
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   589
    <action>
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   590
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   591
    ^ self click:1 inComponent:(self componentNamed:componentName)
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   592
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   593
    "Created: / 19-07-2019 / 16:09:58 / Claus Gittinger"
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   594
!
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   595
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   596
drag:itemsIndexOrLabelOrPattern toComponent:targetComponentName dropAt:where
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   597
    "drag an item (by index or label) from the current treeView,
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   598
     into another component.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   599
     where is one of: #top, #center or #bottom.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   600
     allowed after moving to:
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   601
        aSelectionInHierarchyView
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   602
    "    
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   603
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   604
    <action>
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   605
3790
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   606
    self drag:itemsIndexOrLabelOrPattern toComponent:targetComponentName dropAt:where show:nil
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   607
!
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   608
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   609
drag:itemsIndexOrLabelOrPattern toComponent:targetComponentName dropAt:where show:textWhenDroppingOrNil
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   610
    "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
   611
     into another component.
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   612
     where is one of: #top, #center or #bottom.
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   613
     allowed after moving to:
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   614
        aSelectionInHierarchyView
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   615
    "    
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   616
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   617
    <action>
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   618
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   619
    |sourceComponent targetComponent idx yPos sourcePos sourcePosOnScreen
3790
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   620
     targetPos targetPosOnScreen targetPosInSource dNdMgr|
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   621
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   622
    verifying ifTrue:[^ self].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   623
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   624
    targetComponent := self findComponent:targetComponentName.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   625
    self assert:targetComponent notNil.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   626
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   627
    ((sourceComponent := lastComponent) isKindOf:ScrollableView) ifTrue:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   628
        sourceComponent := sourceComponent scrolledView.
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
3796
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
   631
    targetPos := self where:where inComponent:targetComponent. 
3790
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   632
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   633
    (sourceComponent isKindOf:HierarchicalListView) ifTrue:[
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   634
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   635
        itemsIndexOrLabelOrPattern isInteger ifTrue:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   636
            idx := itemsIndexOrLabelOrPattern
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   637
        ] ifFalse:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   638
            itemsIndexOrLabelOrPattern includesMatchCharacters ifTrue:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   639
                idx := sourceComponent indexOfElementForWhich:[:el | itemsIndexOrLabelOrPattern match:el label string].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   640
            ] ifFalse:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   641
                idx := sourceComponent indexOfElementForWhich:[:el | el label string = itemsIndexOrLabelOrPattern].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   642
            ].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   643
            idx == 0 ifTrue:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   644
                self error:'no such item in hierarchicalList: ',itemsIndexOrLabelOrPattern
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   645
            ].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   646
        ].
3796
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
   647
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   648
        yPos := sourceComponent yVisibleOfLine:idx.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   649
        self movePointerToComponent:sourceComponent rightOffset:(10 @ (yPos + 3)).
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   650
        Delay waitForSeconds:0.5.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   651
        sourcePosOnScreen := Display pointerPosition.
3796
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
   652
        sourcePos := Display translatePoint:sourcePosOnScreen fromView:nil toView:sourceComponent.
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
   653
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
   654
        targetPosOnScreen := Display translatePoint:targetPos fromView:targetComponent toView:nil.
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
   655
        targetPosInSource := Display translatePoint:targetPosOnScreen fromView:nil toView:sourceComponent.
3787
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
        sourceComponent simulateButtonPress:1 at:sourcePos sendDisplayEvent:false.
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
   658
        sourceComponent simulateButtonPress:1 at:sourcePos sendDisplayEvent:true.
4ed3796c2d60 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3795
diff changeset
   659
        Delay waitForSeconds:0.2.
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   660
3790
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   661
        dNdMgr := sourceComponent startDragAt:sourcePos.
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   662
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   663
        textWhenDroppingOrNil notNil ifTrue:[
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   664
            self show:textWhenDroppingOrNil.
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   665
        ].
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   666
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   667
        Delay waitForSeconds:1.
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   668
        self movePointerToComponent:targetComponent offset:targetPos.
3790
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   669
        Delay waitForSeconds:1.
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   670
        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
   671
3790
a28f8340a3eb #UI_ENHANCEMENT by exept
Claus Gittinger <cg@exept.de>
parents: 3787
diff changeset
   672
        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
   673
        sourceComponent simulateButtonRelease:1 at:targetPos sendDisplayEvent:false.
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   674
        ^ self
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   675
    ].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   676
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   677
    self error:'cannot expand in this component'
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   678
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   679
    "Created: / 19-07-2019 / 12:34:25 / Claus Gittinger"
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   680
    "Modified (format): / 19-07-2019 / 14:55:34 / Claus Gittinger"
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   681
!
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   682
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   683
expand:itemsIndexOrLabelOrPattern
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   684
    "expand an item in a treeView by label,
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   685
     allowed after moving to:
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   686
        aSelectionInHierarchyView
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   687
    "    
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   688
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   689
    <action>
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   690
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   691
    |component|
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   692
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   693
    verifying ifTrue:[^ self].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   694
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   695
    ((component := lastComponent) isKindOf:ScrollableView) ifTrue:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   696
        component := component scrolledView.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   697
    ].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   698
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   699
    (component isKindOf:HierarchicalListView) ifTrue:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   700
        |idx yPos|
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
        itemsIndexOrLabelOrPattern isInteger ifTrue:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   703
            idx := itemsIndexOrLabelOrPattern
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   704
        ] ifFalse:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   705
            itemsIndexOrLabelOrPattern includesMatchCharacters ifTrue:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   706
                idx := component indexOfElementForWhich:[:el | itemsIndexOrLabelOrPattern match:el label string].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   707
            ] ifFalse:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   708
                idx := component indexOfElementForWhich:[:el | el label string = itemsIndexOrLabelOrPattern].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   709
            ].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   710
            idx == 0 ifTrue:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   711
                self error:'no such item in hierarchicalList: ',itemsIndexOrLabelOrPattern
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   712
            ].
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
        yPos := component yVisibleOfLine:idx.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   715
        self movePointerToComponent:component offset:(0 @ (yPos + 3)).
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   716
        Delay waitForSeconds:0.5.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   717
        (component listAt:idx) expand.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   718
        ^ self
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   719
    ].
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
    self error:'cannot expand in this component'
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   722
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   723
    "Created: / 19-07-2019 / 12:34:25 / Claus Gittinger"
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   724
    "Modified (format): / 19-07-2019 / 14:55:34 / Claus Gittinger"
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   725
!
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   726
3798
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   727
fastMoveRelativeX:dX y:dY
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   728
    "move the mouse to a new relative position"
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   729
    
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   730
    <action>
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   731
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   732
    |screen newPos currentPos|
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   733
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   734
    verifying ifTrue:[^ self].
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   735
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   736
    screen := Screen current.
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   737
    currentPos := screen pointerPosition.   
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   738
    newPos := currentPos + (dX @ dY).
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   739
    self fastMovePointerToScreenPosition:newPos
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   740
!
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   741
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   742
fastMoveTo:componentName
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   743
    "move the mouse to componentName without circling.
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   744
     Leaves component in lastComponent"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   745
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   746
    <action>
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   747
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   748
    |component|
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   749
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   750
    component := self componentNamed:componentName.
3717
26224649d91c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3716
diff changeset
   751
    self movePointerToComponent:component speed:(self pointerMoveSpeedFast).
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   752
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   753
    "
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   754
     ShowMeHowItWorks basicNew fastMoveTo:'Classes'
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   755
     ShowMeHowItWorks basicNew fastMoveTo:'Klassen'
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   756
    "
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   757
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   758
    "Created: / 19-07-2019 / 15:39:23 / Claus Gittinger"
3717
26224649d91c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3716
diff changeset
   759
    "Modified: / 20-07-2019 / 08:14:16 / Claus Gittinger"
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   760
    "Modified (comment): / 23-07-2019 / 09:33:31 / Claus Gittinger"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   761
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   762
3798
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   763
key:aKeySymbol
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   764
    "press/release a key in last component"
3798
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   765
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   766
    <action>
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   767
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   768
    |t|
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   769
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   770
    verifying ifTrue:[^ self].
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   771
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   772
    t := Display ctrlDown ifTrue:[0.05] ifFalse:[0.1].
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   773
    lastComponent 
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   774
        simulateKey:aKeySymbol at:(lastComponent extent // 2) sendDisplayEvent:false keyPressTime:t
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   775
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   776
    "Created: / 19-07-2019 / 15:50:40 / Claus Gittinger"
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   777
!
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   778
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   779
moveTo:componentName
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   780
    "move the mouse to componentName,
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   781
     then circle around it a few times.
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   782
     Leaves component in lastComponent"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   783
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   784
    <action>
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   785
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   786
    |component|
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   787
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   788
    component := self componentNamed:componentName.
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   789
    self movePointerToComponent:component.
3776
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
   790
    Display ctrlDown ifTrue:[^ self].
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   791
    self circlePointerAroundComponent:component.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   792
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   793
    "Created: / 19-07-2019 / 11:20:42 / Claus Gittinger"
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   794
    "Modified: / 19-07-2019 / 15:38:11 / Claus Gittinger"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   795
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   796
3795
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   797
press:buttonNr
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   798
    <action>
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   799
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   800
    "press at the current position in last component"
3795
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   801
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   802
    self assert:(buttonNr isInteger).
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   803
    ^ self press:buttonNr inComponent:lastComponent.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   804
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   805
"/    "press at the current position"
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   806
"/
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   807
"/    |position screen x y|
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   808
"/
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   809
"/    verifying ifTrue:[^ self].
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   810
"/
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   811
"/    screen := Screen current.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   812
"/    position := screen pointerPosition.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   813
"/    x := position x.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   814
"/    y := position y.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   815
"/
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   816
"/    "/ self movePointerToScreenPosition:position.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   817
"/
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   818
"/    false "OperatingSystem isOSXlike" ifTrue:[
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   819
"/        |osxPos|
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   820
"/
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   821
"/        osxPos := OperatingSystem getMousePosition.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   822
"/        x := osxPos x rounded.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   823
"/        y := osxPos y rounded.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   824
"/        OperatingSystem generateButtonEvent:buttonNr down:true x:x y:y.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   825
"/        ^ self.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   826
"/    ].
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
"/    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
   829
"/    screen flush.
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
"/    "Created: / 19-07-2019 / 13:52:38 / Claus Gittinger"
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   832
"/    "Modified: / 23-07-2019 / 09:38:31 / Claus Gittinger"
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   833
!
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
release:buttonNr
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   836
    <action>
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   837
3799
bbb4c1dbce25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3798
diff changeset
   838
    "release at the current position in last component"
3795
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   839
    
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   840
    <action>
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 assert:(buttonNr isInteger).
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   843
    ^ self press:buttonNr inComponent:lastComponent.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   844
"/    |position screen x y|
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   845
"/
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   846
"/    verifying ifTrue:[^ self].
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   847
"/
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   848
"/    screen := Screen current.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   849
"/    position := screen pointerPosition.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   850
"/    x := position x.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   851
"/    y := position y.
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
"/    self movePointerToScreenPosition:position.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   854
"/
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   855
"/    false "OperatingSystem isOSXlike" ifTrue:[
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   856
"/        |osxPos|
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   857
"/
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   858
"/        osxPos := OperatingSystem getMousePosition.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   859
"/        x := osxPos x rounded.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   860
"/        y := osxPos y rounded.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   861
"/        OperatingSystem generateButtonEvent:buttonNr down:false x:x y:y.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   862
"/        ^ self.
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   863
"/    ].
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   864
"/
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   865
"/    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
   866
"/    screen flush.
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
    "Created: / 19-07-2019 / 13:53:05 / Claus Gittinger"
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   869
    "Modified: / 23-07-2019 / 09:38:38 / Claus Gittinger"
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   870
!
0b36f57fd1c9 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3794
diff changeset
   871
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   872
select:itemsIndexOrLabelOrPattern
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   873
    "select an item by label,
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   874
     allowed after moving to:
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   875
        aComboBox
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   876
        aSelectionInListView
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   877
    "    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   878
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   879
    <action>
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   880
3783
e935b92253c9 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3781
diff changeset
   881
    |idx component|
3775
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   882
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   883
    verifying ifTrue:[^ self].
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   884
3783
e935b92253c9 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3781
diff changeset
   885
    ((component := lastComponent) isKindOf:ScrollableView) ifTrue:[
e935b92253c9 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3781
diff changeset
   886
        component := component scrolledView.
e935b92253c9 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3781
diff changeset
   887
    ].
e935b92253c9 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3781
diff changeset
   888
e935b92253c9 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3781
diff changeset
   889
    (component isKindOf:ComboView) ifTrue:[
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   890
        "/ click on the menubutton
3783
e935b92253c9 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3781
diff changeset
   891
        self movePointerToComponent:component menuButton.
e935b92253c9 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3781
diff changeset
   892
        self click:1 inComponent:component menuButton.
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   893
        Delay waitForSeconds:0.3.
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   894
        itemsIndexOrLabelOrPattern isInteger ifTrue:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   895
            idx := itemsIndexOrLabelOrPattern
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   896
        ] ifFalse:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   897
            itemsIndexOrLabelOrPattern includesMatchCharacters ifTrue:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   898
                idx := component list findFirst:[:lbl | itemsIndexOrLabelOrPattern match:lbl]
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   899
            ] ifFalse:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   900
                idx := component list indexOf:itemsIndexOrLabelOrPattern.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   901
            ].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   902
            idx == 0 ifTrue:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   903
                self error:'no such item in comboList: ',itemsIndexOrLabelOrPattern
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   904
            ].
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   905
        ].
3783
e935b92253c9 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3781
diff changeset
   906
        component select:idx.
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   907
        Delay waitForSeconds:0.3.
3783
e935b92253c9 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3781
diff changeset
   908
        component shownMenu notNil ifTrue:[
e935b92253c9 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3781
diff changeset
   909
            component shownMenu hide.
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   910
        ].    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   911
        ^ self
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   912
    ].    
3783
e935b92253c9 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3781
diff changeset
   913
    (component isKindOf:HierarchicalListView) ifTrue:[
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   914
        |idx yPos|
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   915
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   916
        itemsIndexOrLabelOrPattern isInteger ifTrue:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   917
            idx := itemsIndexOrLabelOrPattern
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   918
        ] ifFalse:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   919
            itemsIndexOrLabelOrPattern includesMatchCharacters ifTrue:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   920
                idx := component indexOfElementForWhich:[:el | itemsIndexOrLabelOrPattern match:el label string].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   921
            ] ifFalse:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   922
                idx := component indexOfElementForWhich:[:el | el label string = itemsIndexOrLabelOrPattern].
3783
e935b92253c9 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3781
diff changeset
   923
            ].
3787
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   924
            idx == 0 ifTrue:[
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   925
                self error:'no such item in hierarchicalList: ',itemsIndexOrLabelOrPattern
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   926
            ].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   927
        ].
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   928
        yPos := component yVisibleOfLine:idx.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   929
        self movePointerToComponent:component offset:(0 @ (yPos + 3)).
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   930
        component simulateButtonPress:1 at:(0 @ (yPos + 3)) sendDisplayEvent:false.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   931
        Delay waitForSeconds:0.1.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   932
        component simulateButtonRelease:1 at:(0 @ (yPos + 3)) sendDisplayEvent:false.
7b01435dcf25 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3784
diff changeset
   933
        "/ component selection:idx.
3783
e935b92253c9 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3781
diff changeset
   934
        ^ self
e935b92253c9 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3781
diff changeset
   935
    ].
3798
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   936
    (component isKindOf:SelectionInListModelView) ifTrue:[
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   937
        |idx yPos|
3783
e935b92253c9 #DOCUMENTATION by exept
Claus Gittinger <cg@exept.de>
parents: 3781
diff changeset
   938
3798
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   939
        itemsIndexOrLabelOrPattern isInteger ifTrue:[
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   940
            idx := itemsIndexOrLabelOrPattern
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   941
        ] ifFalse:[
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   942
            itemsIndexOrLabelOrPattern includesMatchCharacters ifTrue:[
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   943
                idx := component indexOfElementForWhich:[:el | el notNil and:[itemsIndexOrLabelOrPattern match:el string]]. 
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   944
            ] ifFalse:[
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   945
                idx := component indexOfElementForWhich:[:el | el notNil and:[el string = itemsIndexOrLabelOrPattern]].
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   946
            ].
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   947
            idx == 0 ifTrue:[
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   948
                self error:'no such item in hierarchicalList: ',itemsIndexOrLabelOrPattern
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   949
            ].
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   950
        ].
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   951
        yPos := component yVisibleOfLine:idx.
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   952
        self movePointerToComponent:component offset:(0 @ (yPos + 3)).
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   953
        component simulateButtonPress:1 at:(0 @ (yPos + 3)) sendDisplayEvent:false.
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   954
        Delay waitForSeconds:0.1.
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   955
        component simulateButtonRelease:1 at:(0 @ (yPos + 3)) sendDisplayEvent:false.
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   956
        "/ component selection:idx.
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   957
        ^ self
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   958
    ].
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   959
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   960
    (component isKindOf:ItemInView) ifTrue:[
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   961
        component isMenuItem ifTrue:[
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   962
            self movePointerToComponent:component.
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   963
            self halt.
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   964
        ].
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   965
    ].
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   966
eafc4c1bb53e #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3797
diff changeset
   967
    self error:('cannot select this component: %1' bindWith:component className)
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   968
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   969
    "Created: / 19-07-2019 / 12:34:25 / Claus Gittinger"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   970
    "Modified (format): / 19-07-2019 / 14:55:34 / Claus Gittinger"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   971
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   972
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   973
selectIndex:itemsIndex
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   974
    "select an item by index,
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   975
     allowed after moving to:
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   976
        aComboBox
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   977
        aSelectionInListView
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   978
    "    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   979
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   980
    <action>
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   981
3716
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   982
    self selectIndex:itemsIndex in:lastComponent
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   983
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   984
    "Created: / 19-07-2019 / 14:20:11 / Claus Gittinger"
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   985
    "Modified: / 19-07-2019 / 21:59:36 / Claus Gittinger"
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   986
!
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   987
3716
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   988
selectIndex:itemsIndex in:widgetArg
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   989
    "select an item by index,
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   990
     allowed after moving to:
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   991
        aComboBox
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   992
        aSelectionInListView
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   993
    "    
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   994
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   995
    <action>
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   996
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   997
    |widget y offset possibleWidgets|
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   998
3775
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
   999
    verifying ifTrue:[^ self].
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
  1000
3716
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1001
    (widget := widgetArg) isScrollWrapper ifTrue:[
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1002
        widget := widget scrolledView
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1003
    ].
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1004
    
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1005
    (widget isKindOf:ComboView) ifTrue:[
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1006
        "/ click on the menubutton
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1007
        self movePointerToComponent:widget menuButton.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1008
        self click:1 inComponent:widget menuButton.
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1009
        Delay waitForSeconds:0.5.
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1010
        widget select:itemsIndex.
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1011
        Delay waitForSeconds:0.5.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1012
        ^ self
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1013
    ].    
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1014
    (widget isKindOf:SelectionInListView) ifTrue:[
3716
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1015
        (widget isLineVisible:itemsIndex) ifFalse:[
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1016
            widget scrollToLine:itemsIndex
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1017
        ].    
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1018
        "/ click on the item
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1019
        y := widget yOfLine:itemsIndex.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1020
        offset := (widget width // 2) @ y.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1021
        self movePointerToComponent:widget offset:offset.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1022
        widget simulateButtonPress:1 at:offset sendDisplayEvent:false.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1023
        Delay waitForSeconds:(self clickTime).
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1024
        widget simulateButtonRelease:1 at:offset sendDisplayEvent:false.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1025
        Delay waitForSeconds:0.5.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1026
        ^ self
3716
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1027
    ].
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1028
    (widget isKindOf:SelectionInListModelView) ifTrue:[
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1029
        (widget isLineVisible:itemsIndex) ifFalse:[
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1030
            widget scrollToLine:itemsIndex
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1031
        ].    
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1032
        y := widget yVisibleOfLine:itemsIndex.
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1033
        offset := (widget width // 2) @ y.
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1034
        self movePointerToComponent:widget offset:offset.
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1035
        widget simulateButtonPress:1 at:offset sendDisplayEvent:false.
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1036
        Delay waitForSeconds:(self clickTime).
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1037
        widget simulateButtonRelease:1 at:offset sendDisplayEvent:false.
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1038
        Delay waitForSeconds:0.5.
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1039
        ^ self
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1040
    ].
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1041
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1042
    "/ none of it - see what is in there
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1043
    possibleWidgets := OrderedCollection new.
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1044
    widget allSubViewsDo:[:each |
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1045
        ((each isKindOf:ComboView) 
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1046
          or:[(each isKindOf:SelectionInListView)
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1047
          or:[(each isKindOf:SelectionInListModelView)
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1048
        ]]) ifTrue:[
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1049
            possibleWidgets add:each
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
    ].
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1052
    possibleWidgets size == 1 ifTrue:[
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1053
        self selectIndex:itemsIndex in:(possibleWidgets first).
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1054
        ^ self
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1055
    ].    
3716
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1056
    
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1057
    self error:'cannot select this component'
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1058
3716
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1059
    "Created: / 19-07-2019 / 21:59:15 / Claus Gittinger"
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1060
    "Modified: / 20-07-2019 / 07:57:41 / Claus Gittinger"
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1061
!
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1062
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1063
type:aString
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1064
    "enter text into the last component"
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1065
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1066
    <action>
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1067
3776
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
  1068
    |t|
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
  1069
3775
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
  1070
    verifying ifTrue:[^ self].
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
  1071
3776
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
  1072
    t := Display ctrlDown ifTrue:[0.05] ifFalse:[0.1].
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
  1073
    lastComponent 
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
  1074
        simulateTextInput:aString at:(lastComponent extent // 2) 
371ad059085a #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3775
diff changeset
  1075
        sendDisplayEvent:false keyPressTime:t
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1076
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1077
    "Created: / 19-07-2019 / 15:50:40 / Claus Gittinger"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1078
! !
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1079
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1080
!ShowMeHowItWorks methodsFor:'defaults'!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1081
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1082
circlingCount
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1083
    "circle around move-end position that many times"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1084
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1085
    ^ 3
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1086
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1087
    "Created: / 19-07-2019 / 13:03:45 / Claus Gittinger"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1088
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1089
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1090
circlingRadius 
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1091
    "radius when circling"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1092
    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1093
    ^ 30 "/ pixels
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1094
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1095
    "Created: / 19-07-2019 / 13:07:59 / Claus Gittinger"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1096
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1097
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1098
circlingSpeed 
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1099
    "time per round when circling"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1100
    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1101
    ^ 0.3 seconds.       "/ time per round
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1102
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1103
    "Created: / 19-07-2019 / 13:02:34 / Claus Gittinger"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1104
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1105
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1106
clickTime
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1107
    "when clicking"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1108
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1109
    ^ self shortClickTime
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1110
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1111
    "Created: / 19-07-2019 / 13:17:20 / Claus Gittinger"
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1112
    "Modified: / 19-07-2019 / 15:21:51 / Claus Gittinger"
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1113
!
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1114
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1115
longClickTime
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1116
    "when clicking buttons"
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1117
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1118
    ^ 500 milliseconds
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
    "Created: / 19-07-2019 / 15:21:42 / Claus Gittinger"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1121
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1122
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1123
pointerAnimationDelay
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1124
    ^ 50 milliseconds.   "/ 20 updates per second
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1125
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1126
    "Created: / 19-07-2019 / 13:04:45 / Claus Gittinger"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1127
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1128
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1129
pointerMoveSpeed
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1130
    ^ 400.   "/ pixels per second
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1131
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1132
    "Created: / 19-07-2019 / 13:05:40 / Claus Gittinger"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1133
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1134
3717
26224649d91c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3716
diff changeset
  1135
pointerMoveSpeedFast
26224649d91c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3716
diff changeset
  1136
    ^ 600.   "/ pixels per second
26224649d91c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3716
diff changeset
  1137
26224649d91c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3716
diff changeset
  1138
    "Created: / 20-07-2019 / 08:13:58 / Claus Gittinger"
26224649d91c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3716
diff changeset
  1139
!
26224649d91c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3716
diff changeset
  1140
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1141
shortClickTime
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1142
    "when clicking"
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1143
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1144
    ^ 100 milliseconds
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1145
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1146
    "Created: / 19-07-2019 / 15:21:29 / Claus Gittinger"
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1147
!
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1148
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1149
talking
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1150
    "/ DebugMode := true
3775
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
  1151
    verifying ifTrue:[^ false].
3780
604d8ffc8903 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3776
diff changeset
  1152
    DebugMode == true ifTrue:[^ false].
3775
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
  1153
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1154
    "/ ^ Expecco::ExpeccoPreferences current speechEffectsEnabled
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1155
    ^ true
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 / 14:31:14 / Claus Gittinger"
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1158
    "Modified (comment): / 23-07-2019 / 09:45:35 / Claus Gittinger"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1159
! !
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1160
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1161
!ShowMeHowItWorks methodsFor:'helper'!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1162
3715
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1163
randomThankYou
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1164
    ^ #(
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1165
        'thank you, for watching'
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1166
        'thank you for watching'
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1167
        'thank you'
3775
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
  1168
        'thanks'
3715
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1169
        'have a good day'
3775
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
  1170
        'have a nice day'
3715
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1171
        'have fun'
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1172
        'have fun with expecco'
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1173
        '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
  1174
        'happy hacking'
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1175
        'happy hacking, I hope you liked what you saw'
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1176
        'hope you liked it'
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1177
        'see you again'
3775
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
  1178
        'be the source with you'
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
  1179
        'be the force with you'
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
  1180
        'may the force be with you'
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
  1181
        'may the source be with you'
3715
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1182
        '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
  1183
        'if you have any questions, please contact exept'
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1184
        '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
  1185
    ) atRandom
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1186
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1187
    "
3775
0e44d27ee647 #FEATURE by exept
Claus Gittinger <cg@exept.de>
parents: 3739
diff changeset
  1188
     OperatingSystem speak:'may the source be with you'
3715
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1189
     OperatingSystem speak:'have fun with expecco'
3716
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
  1190
     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
  1191
     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
  1192
     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
  1193
     OperatingSystem speak:'if you have any questions, please contact exept'
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1194
     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
  1195
    "
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1196
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1197
    "Created: / 19-07-2019 / 21:39:18 / Claus Gittinger"
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1198
!
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1199
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1200
tell:message
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1201
    self talking ifTrue:[
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
  1202
        OperatingSystem speak:message voiceName:voice.
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1203
    ].
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1204
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1205
    "Created: / 19-07-2019 / 14:57:50 / Claus Gittinger"
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
  1206
    "Modified: / 23-07-2019 / 10:28:02 / Claus Gittinger"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1207
! !
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1208
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1209
!ShowMeHowItWorks methodsFor:'helpers - broken'!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1210
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1211
click:buttonNr atPosition:position
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1212
    "press-release at position"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1213
    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset