ShowMeHowItWorks.st
author Claus Gittinger <cg@exept.de>
Thu, 25 Jul 2019 11:49:10 +0200
changeset 3739 9c7040099cfe
parent 3738 fcd5a6af06d4
child 3775 0e44d27ee647
permissions -rw-r--r--
#REFACTORING by cg class: ShowMeHowItWorks changed: #do:
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
     1
"{ Encoding: utf8 }"
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
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
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
     8
	instanceVariableNames:'application opStream lastComponentName lastComponent lastResult
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
     9
		voice translate'
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
    10
	classVariableNames:'IntroShownCount'
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    11
	poolDictionaries:''
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    12
	category:'Interface-Help'
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    13
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    14
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    15
!ShowMeHowItWorks class methodsFor:'documentation'!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    16
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    17
documentation
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    18
"
3713
fa10e87dbf04 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3711
diff changeset
    19
    automatic presentations.
fa10e87dbf04 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3711
diff changeset
    20
    To see how it works, open a methodFinder:
fa10e87dbf04 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3711
diff changeset
    21
        MethodFinderWindow open
fa10e87dbf04 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3711
diff changeset
    22
    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
    23
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    24
    [author:]
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    25
        Claus Gittinger
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    26
"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    27
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    28
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    29
example
3713
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
    
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    32
    ShowMeHowItWorks do:#(
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    33
        ( showing: 'Choose the number of arguments' do:(
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    34
            moveTo: NumberOfArguments
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    35
            select: '1' 
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    36
        ))  
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    37
        (showing: 'Click into the "receiver" field' do:(
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    38
            moveTo: ReceiverEditor
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    39
            click: ReceiverEditor 
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    40
        ))
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    41
        (showing: 'Enter a value (or expression) into "receiver" field' do:(
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    42
            enter: '100'
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    43
        ))
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    44
        (showing: 'Click into the "first argument" field' do:(
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    45
            moveTo: Arg1Editor
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    46
            click: ReceiverEditor
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    47
        ))
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    48
        (showing: 'Enter a value (or expression) into "receiver" field' do:(
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    49
            enter: '100'
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    50
        ))
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    51
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    52
    )
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    53
! !
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    54
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    55
!ShowMeHowItWorks class methodsFor:'running'!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    56
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    57
do:specArray
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
    58
    "spec contains a list of action commands (show: / moveTo: etc.)"
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
    59
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
    60
    self new do:specArray
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    61
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
    62
    "
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
    63
     ShowMeHowItWorks do:
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
    64
        #(
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
    65
            (language: de)
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
    66
            (show: 'üben üben üben')
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
    67
            (wait: 0.5)
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
    68
            (moveTo: NameOfComponent)
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
    69
        )    
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
    70
    "
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
    71
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
    72
    "Created: / 19-07-2019 / 10:52:59 / Claus Gittinger"
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
    73
    "Modified (comment): / 23-07-2019 / 10:26:42 / Claus Gittinger"
3713
fa10e87dbf04 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3711
diff changeset
    74
! !
fa10e87dbf04 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3711
diff changeset
    75
fa10e87dbf04 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3711
diff changeset
    76
!ShowMeHowItWorks methodsFor:'accessing'!
fa10e87dbf04 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3711
diff changeset
    77
fa10e87dbf04 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3711
diff changeset
    78
application:something
fa10e87dbf04 #DOCUMENTATION by cg
Claus Gittinger <cg@exept.de>
parents: 3711
diff changeset
    79
    application := something.
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    80
! !
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    81
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    82
!ShowMeHowItWorks methodsFor:'commands'!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
    83
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
    84
intro
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
    85
    <action>
3724
e513514f6ce7 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3717
diff changeset
    86
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
    87
    "/ only say this a few times..
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
    88
    IntroShownCount := (IntroShownCount ? 0) + 1.
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
    89
    IntroShownCount > 3 ifTrue:[^ self].
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
    90
    
3724
e513514f6ce7 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3717
diff changeset
    91
    self tell:(self class classResources 
3733
1da1137b6f23 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3730
diff changeset
    92
                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
    93
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
    94
    "Created: / 19-07-2019 / 15:49:19 / Claus Gittinger"
3733
1da1137b6f23 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3730
diff changeset
    95
    "Modified: / 23-07-2019 / 11:06:13 / Claus Gittinger"
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
    96
!
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
    97
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
    98
language:lang
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
    99
    <action>
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   100
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   101
    voice := OperatingSystem bestVoiceForLanguage:lang.
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   102
    translate := false.
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   103
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   104
    "Created: / 23-07-2019 / 10:27:02 / Claus Gittinger"
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   105
!
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   106
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   107
pause
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   108
    <action>
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   109
    
3724
e513514f6ce7 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3717
diff changeset
   110
    Dialog information:(self class classResources 
e513514f6ce7 #REFACTORING by exept
Claus Gittinger <cg@exept.de>
parents: 3717
diff changeset
   111
                            stringWithCRs:'Show Paused.\Click on "OK" to proceed')
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
    "Created: / 19-07-2019 / 15:03:17 / Claus Gittinger"
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   114
    "Modified: / 19-07-2019 / 16:13:33 / Claus Gittinger"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   115
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   116
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   117
show:message
3714
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   118
    "showing (and speak) some message."
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   119
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   120
    <action>
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   121
    
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   122
    self showing:message do:nil
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   123
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   124
    "Created: / 19-07-2019 / 15:59:18 / Claus Gittinger"
3714
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   125
    "Modified (comment): / 19-07-2019 / 18:54:36 / Claus Gittinger"
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   126
!
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   127
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   128
show:message for:seconds
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   129
    "showing (and speak) some message and wait for some time."
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   130
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   131
    <action>
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   132
    
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   133
    self show:message.
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   134
    self wait:seconds.
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   135
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   136
    "Created: / 19-07-2019 / 18:54:20 / Claus Gittinger"
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   137
!
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   138
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   139
showing:message do:operationsOrNothing
3714
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
   140
    "execute operationsOrNothing while showing (and speaking) some message."
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   141
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   142
    <action>
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   143
    
3715
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
   144
    |xLatedMessage messageView talkDone|
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   145
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   146
    xLatedMessage := (translate and:[application notNil]) 
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   147
                            ifTrue:[application resources string:message]
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   148
                            ifFalse:[message].
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   149
    
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   150
    self assert:(operationsOrNothing isNil or:[operationsOrNothing isSequenceable]).
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   151
3715
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
   152
    messageView := ActiveHelpView for:xLatedMessage.
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   153
    "/ messageView shapeStyle:#cartoon.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   154
    [
3715
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
   155
        messageView origin:(Screen current pointerPosition).
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   156
        messageView realize.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   157
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   158
        self talking ifTrue:[
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   159
            talkDone := Semaphore new.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   160
            [
3715
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
   161
                self tell:xLatedMessage.
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   162
                talkDone signal
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   163
            ] fork.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   164
            
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   165
            "/
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   166
            "/ allow speaker some headoff
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   167
            Delay waitForSeconds:(xLatedMessage size / 15)+0.5.
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   168
        ].
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   169
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   170
        operationsOrNothing notEmptyOrNil ifTrue:[
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   171
            self doStream:(operationsOrNothing readStream).
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   172
        ].
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   173
    ] ensure:[
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   174
        messageView destroy
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   175
    ].
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   176
    self talking ifTrue:[
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   177
        talkDone wait.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   178
    ].
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   179
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   180
    "Created: / 19-07-2019 / 11:19:27 / Claus Gittinger"
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   181
    "Modified: / 23-07-2019 / 10:52:30 / Claus Gittinger"
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   182
!
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   183
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   184
thankyou
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   185
    <action>
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   186
    
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   187
    self show:(self randomThankYou).
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   188
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   189
    "Created: / 23-07-2019 / 10:50:43 / Claus Gittinger"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   190
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   191
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   192
wait:seconds
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   193
    <action>
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   194
    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   195
    Delay waitForSeconds:seconds
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   196
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   197
    "Created: / 19-07-2019 / 15:09:45 / Claus Gittinger"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   198
! !
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   199
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   200
!ShowMeHowItWorks methodsFor:'commands - checking'!
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   201
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   202
isEmpty:componentName
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   203
    <action>
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   204
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   205
    |component|
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   206
    
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   207
    component := self componentNamed:componentName.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   208
    component isScrollWrapper ifTrue:[ component := component scrolledView ].
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   209
    component isTextView ifTrue:[
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   210
        ^ component contents isEmptyOrNil
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   211
    ] ifFalse:[
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   212
        self halt.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   213
    ].
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   214
    self error:'isEmpty: unhandled component type: ',component displayString.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   215
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   216
    "Created: / 19-07-2019 / 15:33:47 / Claus Gittinger"
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   217
!
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   218
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   219
unless:query do:actions
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   220
    <action>
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   221
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   222
    |result|
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   223
    
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   224
    result := self doCommand:query.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   225
    result ifFalse:[
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   226
        self doCommand:actions
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   227
    ].
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   228
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   229
    "Created: / 19-07-2019 / 15:33:32 / Claus Gittinger"
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   230
! !
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   231
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   232
!ShowMeHowItWorks methodsFor:'commands - mouse & keyboard'!
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   233
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   234
click
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   235
    "press-release"
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   236
    
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   237
    <action>
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   238
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   239
    ^ self click:1 inComponent:lastComponent
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   240
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   241
    "Created: / 19-07-2019 / 16:11:03 / Claus Gittinger"
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   242
!
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   243
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   244
click:buttonNr
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   245
    "press-release"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   246
    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   247
    <action>
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   248
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   249
    self assert:(buttonNr isInteger).
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   250
    ^ self click:buttonNr inComponent:lastComponent
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   251
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   252
    "Created: / 19-07-2019 / 13:21:20 / Claus Gittinger"
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   253
    "Modified: / 19-07-2019 / 16:10:19 / Claus Gittinger"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   254
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   255
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   256
clickIn:componentName
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   257
    "press-release"
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   258
    
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   259
    <action>
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   260
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   261
    ^ self click:1 inComponent:(self componentNamed:componentName)
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   262
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   263
    "Created: / 19-07-2019 / 16:09:58 / Claus Gittinger"
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   264
!
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   265
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   266
fastMoveTo:componentName
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   267
    "move the mouse to componentName without circling"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   268
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   269
    <action>
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   270
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   271
    |component|
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   272
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   273
    component := self componentNamed:componentName.
3717
26224649d91c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3716
diff changeset
   274
    self movePointerToComponent:component speed:(self pointerMoveSpeedFast).
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   275
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   276
    "
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   277
     ShowMeHowItWorks basicNew fastMoveTo:'Classes'
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   278
     ShowMeHowItWorks basicNew fastMoveTo:'Klassen'
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   279
    "
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   280
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   281
    "Created: / 19-07-2019 / 15:39:23 / Claus Gittinger"
3717
26224649d91c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3716
diff changeset
   282
    "Modified: / 20-07-2019 / 08:14:16 / Claus Gittinger"
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   283
    "Modified (comment): / 23-07-2019 / 09:33:31 / Claus Gittinger"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   284
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   285
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   286
moveTo:componentName
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   287
    "move the mouse to componentName,
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   288
     then circle around it a few times"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   289
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   290
    <action>
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   291
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   292
    |component|
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   293
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   294
    component := self componentNamed:componentName.
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   295
    self movePointerToComponent:component.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   296
    self circlePointerAroundComponent:component.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   297
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   298
    "Created: / 19-07-2019 / 11:20:42 / Claus Gittinger"
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   299
    "Modified: / 19-07-2019 / 15:38:11 / Claus Gittinger"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   300
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   301
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   302
select:itemsLabel
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   303
    "select an item by label,
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   304
     allowed after moving to:
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   305
        aComboBox
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   306
        aSelectionInListView
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   307
    "    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   308
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
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   311
    |idx|
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   312
    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   313
    (lastComponent isKindOf:ComboView) ifTrue:[
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   314
        "/ click on the menubutton
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   315
        self movePointerToComponent:lastComponent menuButton.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   316
        self click:1 inComponent:lastComponent menuButton.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   317
        Delay waitForSeconds:0.3.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   318
        (idx := lastComponent list indexOf:itemsLabel ifAbsent:[nil]) isNil ifTrue:[
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   319
            self error:'no such item in comboList: ',itemsLabel
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   320
        ].
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   321
        lastComponent select:idx.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   322
        Delay waitForSeconds:0.3.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   323
        lastComponent shownMenu notNil ifTrue:[
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   324
            lastComponent shownMenu hide.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   325
        ].    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   326
        ^ self
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   327
    ].    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   328
    self error:'cannot select this component'
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   329
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   330
    "Created: / 19-07-2019 / 12:34:25 / Claus Gittinger"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   331
    "Modified (format): / 19-07-2019 / 14:55:34 / Claus Gittinger"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   332
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   333
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   334
selectIndex:itemsIndex
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   335
    "select an item by index,
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   336
     allowed after moving to:
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   337
        aComboBox
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   338
        aSelectionInListView
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   339
    "    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   340
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   341
    <action>
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   342
3716
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   343
    self selectIndex:itemsIndex in:lastComponent
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   344
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   345
    "Created: / 19-07-2019 / 14:20:11 / Claus Gittinger"
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   346
    "Modified: / 19-07-2019 / 21:59:36 / Claus Gittinger"
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   347
!
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   348
3716
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   349
selectIndex:itemsIndex in:widgetArg
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   350
    "select an item by index,
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   351
     allowed after moving to:
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   352
        aComboBox
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   353
        aSelectionInListView
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   354
    "    
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   355
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   356
    <action>
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   357
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   358
    |widget y offset possibleWidgets|
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   359
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   360
    (widget := widgetArg) isScrollWrapper ifTrue:[
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   361
        widget := widget scrolledView
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   362
    ].
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
    (widget isKindOf:ComboView) ifTrue:[
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   365
        "/ click on the menubutton
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   366
        self movePointerToComponent:widget menuButton.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   367
        self click:1 inComponent:widget menuButton.
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   368
        Delay waitForSeconds:0.5.
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   369
        widget select:itemsIndex.
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   370
        Delay waitForSeconds:0.5.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   371
self halt.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   372
        ^ self
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   373
    ].    
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   374
    (widget isKindOf:SelectionInListView) ifTrue:[
3716
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   375
        (widget isLineVisible:itemsIndex) ifFalse:[
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   376
            widget scrollToLine:itemsIndex
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   377
        ].    
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   378
        "/ click on the item
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   379
        y := widget yOfLine:itemsIndex.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   380
        offset := (widget width // 2) @ y.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   381
        self movePointerToComponent:widget offset:offset.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   382
        widget simulateButtonPress:1 at:offset sendDisplayEvent:false.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   383
        Delay waitForSeconds:(self clickTime).
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   384
        widget simulateButtonRelease:1 at:offset sendDisplayEvent:false.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   385
        Delay waitForSeconds:0.5.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   386
        ^ self
3716
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   387
    ].
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   388
    (widget isKindOf:SelectionInListModelView) ifTrue:[
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   389
        (widget isLineVisible:itemsIndex) ifFalse:[
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   390
            widget scrollToLine:itemsIndex
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   391
        ].    
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   392
        y := widget yVisibleOfLine:itemsIndex.
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   393
        offset := (widget width // 2) @ y.
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   394
        self movePointerToComponent:widget offset:offset.
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   395
        widget simulateButtonPress:1 at:offset sendDisplayEvent:false.
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   396
        Delay waitForSeconds:(self clickTime).
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   397
        widget simulateButtonRelease:1 at:offset sendDisplayEvent:false.
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   398
        Delay waitForSeconds:0.5.
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   399
        ^ self
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   400
    ].
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   401
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   402
    "/ none of it - see what is in there
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   403
    possibleWidgets := OrderedCollection new.
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   404
    widget allSubViewsDo:[:each |
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   405
        ((each isKindOf:ComboView) 
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   406
          or:[(each isKindOf:SelectionInListView)
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   407
          or:[(each isKindOf:SelectionInListModelView)
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   408
        ]]) ifTrue:[
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   409
            possibleWidgets add:each
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   410
        ]
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   411
    ].
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   412
    possibleWidgets size == 1 ifTrue:[
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   413
        self selectIndex:itemsIndex in:(possibleWidgets first).
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   414
        ^ self
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   415
    ].    
3716
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   416
    
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   417
    self error:'cannot select this component'
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   418
3716
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   419
    "Created: / 19-07-2019 / 21:59:15 / Claus Gittinger"
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   420
    "Modified: / 20-07-2019 / 07:57:41 / Claus Gittinger"
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   421
!
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   422
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   423
type:aString
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   424
    "enter text into the last component"
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   425
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   426
    <action>
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   427
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   428
    lastComponent simulateTextInput:aString at:(lastComponent extent // 2) sendDisplayEvent:false
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   429
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   430
    "Created: / 19-07-2019 / 15:50:40 / Claus Gittinger"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   431
! !
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   432
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   433
!ShowMeHowItWorks methodsFor:'defaults'!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   434
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   435
circlingCount
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   436
    "circle around move-end position that many times"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   437
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   438
    ^ 3
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   439
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   440
    "Created: / 19-07-2019 / 13:03:45 / Claus Gittinger"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   441
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   442
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   443
circlingRadius 
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   444
    "radius when circling"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   445
    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   446
    ^ 30 "/ pixels
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   447
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   448
    "Created: / 19-07-2019 / 13:07:59 / Claus Gittinger"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   449
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   450
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   451
circlingSpeed 
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   452
    "time per round when circling"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   453
    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   454
    ^ 0.3 seconds.       "/ time per round
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 / 13:02:34 / Claus Gittinger"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   457
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   458
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   459
clickTime
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   460
    "when clicking"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   461
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   462
    ^ self shortClickTime
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   463
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   464
    "Created: / 19-07-2019 / 13:17:20 / Claus Gittinger"
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   465
    "Modified: / 19-07-2019 / 15:21:51 / Claus Gittinger"
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   466
!
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   467
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   468
longClickTime
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   469
    "when clicking buttons"
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   470
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   471
    ^ 500 milliseconds
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   472
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   473
    "Created: / 19-07-2019 / 15:21:42 / Claus Gittinger"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   474
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   475
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   476
pointerAnimationDelay
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   477
    ^ 50 milliseconds.   "/ 20 updates per second
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   478
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   479
    "Created: / 19-07-2019 / 13:04:45 / Claus Gittinger"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   480
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   481
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   482
pointerMoveSpeed
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   483
    ^ 400.   "/ pixels per second
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 / 13:05:40 / Claus Gittinger"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   486
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   487
3717
26224649d91c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3716
diff changeset
   488
pointerMoveSpeedFast
26224649d91c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3716
diff changeset
   489
    ^ 600.   "/ pixels per second
26224649d91c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3716
diff changeset
   490
26224649d91c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3716
diff changeset
   491
    "Created: / 20-07-2019 / 08:13:58 / Claus Gittinger"
26224649d91c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3716
diff changeset
   492
!
26224649d91c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3716
diff changeset
   493
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   494
shortClickTime
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   495
    "when clicking"
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   496
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   497
    ^ 100 milliseconds
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   498
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   499
    "Created: / 19-07-2019 / 15:21:29 / Claus Gittinger"
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   500
!
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   501
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   502
talking
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   503
    "/ ^ Expecco::ExpeccoPreferences current speechEffectsEnabled
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   504
    ^ true
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   505
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   506
    "Created: / 19-07-2019 / 14:31:14 / Claus Gittinger"
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   507
    "Modified (comment): / 23-07-2019 / 09:45:35 / Claus Gittinger"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   508
! !
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   509
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   510
!ShowMeHowItWorks methodsFor:'helper'!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   511
3715
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
   512
randomThankYou
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
   513
    ^ #(
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
   514
        'thank you, for watching'
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
   515
        'thank you for watching'
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
   516
        'thank you'
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
   517
        'have a good day'
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
   518
        'have fun'
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
   519
        'have fun with expecco'
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
   520
        '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
   521
        'happy hacking'
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
   522
        'happy hacking, I hope you liked what you saw'
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
   523
        'hope you liked it'
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
   524
        'see you again'
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
   525
        '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
   526
        'if you have any questions, please contact exept'
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
   527
        '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
   528
    ) atRandom
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
   529
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
   530
    "
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
   531
     OperatingSystem speak:'have fun with expecco'
3716
08e97653176e #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3715
diff changeset
   532
     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
   533
     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
   534
     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
   535
     OperatingSystem speak:'if you have any questions, please contact exept'
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
   536
     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
   537
    "
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
   538
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
   539
    "Created: / 19-07-2019 / 21:39:18 / Claus Gittinger"
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
   540
!
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
   541
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   542
tell:message
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   543
    self talking ifTrue:[
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   544
        OperatingSystem speak:message voiceName:voice.
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   545
    ].
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   546
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   547
    "Created: / 19-07-2019 / 14:57:50 / Claus Gittinger"
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   548
    "Modified: / 23-07-2019 / 10:28:02 / Claus Gittinger"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   549
! !
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   550
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   551
!ShowMeHowItWorks methodsFor:'helpers - broken'!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   552
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   553
click:buttonNr atPosition:position
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   554
    "press-release at position"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   555
    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   556
    |screen|
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   557
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   558
    screen := Screen current.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   559
    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   560
    screen setPointerPosition:position.    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   561
    screen flush.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   562
    self click:buttonNr
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   563
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   564
    "Created: / 19-07-2019 / 13:14:51 / Claus Gittinger"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   565
! !
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   566
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   567
!ShowMeHowItWorks methodsFor:'helpers - component search'!
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   568
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   569
componentNamed:componentName
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   570
    "retrieve a component by name or report an error if not found.
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   571
     Can return either a view or a menu item"
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   572
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   573
    |component|
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   574
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   575
    lastComponentName := componentName.
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   576
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   577
    component := self findComponent:componentName.
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   578
    component isNil ifTrue:[
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   579
        self error:'no component found for: ',componentName.
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   580
    ].
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   581
    lastComponent := component.
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   582
    ^ component
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   583
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   584
    "Created: / 19-07-2019 / 15:37:35 / Claus Gittinger"
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   585
    "Modified (comment): / 23-07-2019 / 09:31:53 / Claus Gittinger"
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   586
!
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   587
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   588
findComponent:componentName
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   589
    "find a component by name - in the active and possibly in any app.
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   590
     Can return either a view or a menu item"
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   591
    
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   592
    |component candidates|
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   593
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   594
    application notNil ifTrue:[ 
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   595
        component := self findComponent:componentName in:application.
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   596
    ].
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   597
    
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   598
    component isNil ifTrue:[
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   599
        "/ search through all current applications
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   600
        candidates := OrderedCollection new.
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   601
        WindowGroup scheduledWindowGroups do:[:eachWG |
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   602
            |eachApp|
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   603
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   604
            (eachApp := eachWG application) notNil ifTrue:[
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   605
                component := self findComponent:componentName in:eachApp.
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   606
                component notNil ifTrue:[ 
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   607
                    candidates add:component
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   608
                ].
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   609
            ].
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   610
        ].
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   611
        
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   612
        candidates size == 1 ifTrue:[
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   613
            component := candidates first
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   614
        ] ifFalse:[    
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   615
            candidates notEmpty ifTrue:[
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   616
                self error:'multiple components found by name: ',componentName.
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   617
            ]    
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   618
        ].    
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   619
    ].    
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   620
    ^ component
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   621
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   622
    "
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   623
     ShowMeHowItWorks basicNew findComponent:'Classes'
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   624
     ShowMeHowItWorks basicNew findComponent:'Klassen'
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   625
    "
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   626
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   627
    "Created: / 19-07-2019 / 12:02:30 / Claus Gittinger"
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   628
    "Modified: / 19-07-2019 / 16:44:30 / Claus Gittinger"
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   629
    "Modified (comment): / 23-07-2019 / 09:32:44 / Claus Gittinger"
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   630
!
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   631
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   632
findComponent:componentName in:anApplicationOrView
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   633
    "find a component by name inside an app.
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   634
     Uses the NameKey of the spec, and optionally the label or modelKey.
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   635
     Can return either a view or a menu item"
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   636
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   637
    |app window component componentNameSymbol foundByName foundByTitle foundByLabel item|
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   638
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   639
    (app := anApplicationOrView) isView ifTrue:[
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   640
        window := anApplicationOrView.
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   641
        app := anApplicationOrView application
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   642
    ].
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   643
    app notNil ifTrue:[
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   644
        (component := app componentAt:componentName) notNil ifTrue:[^ component].
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   645
        (componentNameSymbol := componentName asSymbolIfInterned) notNil ifTrue:[
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   646
            (component := app componentAt:componentNameSymbol) notNil ifTrue:[^ component].
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   647
        ].
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   648
        window := app window.
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   649
    ].    
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   650
    
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   651
    "/ mhmh - search through all widgets of anApplication; 
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   652
    "/ maybe it was not created via the builder/spec,
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   653
    "/ or it has changed its name.
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   654
    "/ look for: widget's name, widget's title, widget's label
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   655
    foundByName := OrderedCollection new. 
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   656
    foundByTitle := OrderedCollection new. 
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   657
    foundByLabel := OrderedCollection new.
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   658
    
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   659
    window allSubViewsDo:[:each |
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   660
        |foundIt|
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   661
        
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   662
        foundIt := false.
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   663
        [
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   664
            each name = componentName ifTrue:[ foundByName add:each. foundIt := true ].
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   665
        ] on:MessageNotUnderstood do:[:ex | ].
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   666
        foundIt ifFalse:[
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   667
            [
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   668
                each title = componentName ifTrue:[ foundByTitle add:each. foundIt := true ].
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   669
            ] on:MessageNotUnderstood do:[:ex | ].
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   670
            foundIt ifFalse:[
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   671
                [
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   672
                    each label = componentName ifTrue:[ foundByLabel add:each. foundIt := true ].
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   673
                ] on:MessageNotUnderstood do:[:ex | ].
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   674
                foundIt ifFalse:[
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   675
                    each isMenu ifTrue:[
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   676
                        (item := each detectItemForNameKey:componentName) notNil ifTrue:[
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   677
                            foundByName add:item. foundIt := true
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   678
                        ].
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   679
                        foundIt ifFalse:[
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   680
                            (item := each detectItemForKey:componentName) notNil ifTrue:[
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   681
                                foundByName add:item. foundIt := true 
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   682
                            ].    
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   683
                            foundIt ifFalse:[
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   684
                                (item := each detectItemForLabel:componentName) notNil ifTrue:[
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   685
                                    foundByLabel add:item. foundIt := true 
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   686
                                ].    
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   687
                            ].
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   688
                        ].
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   689
                    ].    
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   690
                ].
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   691
            ]    
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   692
        ].
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   693
    ].
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   694
    
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   695
    foundByName notEmpty ifTrue:[
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   696
        self assert:(foundByName size == 1) message:'multiple components found by name'.
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   697
        ^ foundByName first.
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   698
    ].
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   699
    foundByTitle notEmpty ifTrue:[
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   700
        self assert:(foundByTitle size == 1) message:'multiple components found by title'.
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   701
        ^ foundByTitle first.
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   702
    ].
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   703
    foundByLabel notEmpty ifTrue:[
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   704
        self assert:(foundByLabel size == 1) message:'multiple components found by label'.
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   705
        ^ foundByLabel first.
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   706
    ].
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   707
    ^ component
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   708
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   709
    "
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   710
     self basicNew findComponent:'Klassen' in:(Transcript topView)
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   711
    "
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   712
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   713
    "Created: / 19-07-2019 / 11:36:21 / Claus Gittinger"
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   714
    "Modified (comment): / 23-07-2019 / 09:31:34 / Claus Gittinger"
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   715
! !
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   716
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   717
!ShowMeHowItWorks methodsFor:'helpers - mouse movement'!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   718
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   719
circlePointerAroundComponent:aWidgetOrMenuItem
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   720
    "circle around it a few times"
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   721
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   722
    |position|
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   723
    
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   724
    aWidgetOrMenuItem isView ifTrue:[
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   725
        position := aWidgetOrMenuItem screenBounds center rounded
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   726
    ] ifFalse:[
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   727
        self halt.
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   728
    ].    
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   729
    self circlePointerAroundScreenPosition:position
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   730
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   731
    "Created: / 19-07-2019 / 13:12:35 / Claus Gittinger"
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   732
    "Modified: / 23-07-2019 / 09:38:12 / Claus Gittinger"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   733
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   734
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   735
circlePointerAroundScreenPosition:position
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   736
    "circle around it a few times"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   737
    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   738
    |screen stepDelayTime numCircles circlingSpeed radius|
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   739
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   740
    screen := Screen current.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   741
    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   742
    circlingSpeed := self circlingSpeed.    "/ time per round
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   743
    numCircles := self circlingCount.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   744
    stepDelayTime := self pointerAnimationDelay.   "/ update interval
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   745
    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   746
    radius := self circlingRadius.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   747
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   748
    "/ move it around a few times
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   749
    1 to:numCircles do:[:round |
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   750
        |n angle|
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   751
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   752
        n := circlingSpeed / stepDelayTime. "/ nr of steps per circle
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   753
        angle := 360 / n.                   "/ angle-delta per step
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   754
        1 to:n do:[:step |
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   755
            |a x y|
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   756
            
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   757
            a := angle * step.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   758
            "/ clockwise starting above the center
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   759
            x := position x + (radius * a degreesToRadians sin).
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   760
            y := position y + (radius * a degreesToRadians cos).
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   761
"/ Transcript showCR:(x@y).
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   762
            screen setPointerPosition:(x@y) rounded.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   763
            screen flush.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   764
            Delay waitFor:stepDelayTime.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   765
        ].    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   766
        "/ and back
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   767
        screen setPointerPosition:position rounded.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   768
        screen flush.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   769
        Delay waitFor:stepDelayTime.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   770
    ].
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   771
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   772
    "Created: / 23-07-2019 / 09:37:46 / Claus Gittinger"
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   773
!
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   774
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   775
fastMovePointerToScreenPosition:position
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   776
    self movePointerToScreenPosition:position speed:(self pointerMoveSpeedFast).
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   777
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   778
    "Created: / 23-07-2019 / 09:36:20 / Claus Gittinger"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   779
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   780
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   781
movePointerToComponent:aWidget
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   782
    "move the mouse to aWidget's center"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   783
    
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   784
    self movePointerToScreenPosition:(aWidget screenBounds center rounded).
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   785
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   786
    "Created: / 19-07-2019 / 13:11:33 / Claus Gittinger"
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   787
    "Modified: / 23-07-2019 / 09:37:01 / Claus Gittinger"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   788
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   789
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   790
movePointerToComponent:aWidget offset:offset
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   791
    "move the mouse to position inside aWidget's"
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   792
    
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   793
    self movePointerToScreenPosition:(aWidget screenBounds origin + offset) rounded.
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   794
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   795
    "Created: / 19-07-2019 / 16:18:58 / Claus Gittinger"
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   796
    "Modified: / 23-07-2019 / 09:36:57 / Claus Gittinger"
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   797
!
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   798
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   799
movePointerToComponent:aWidgetOrMenuItem speed:pixelsPerSecond
3717
26224649d91c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3716
diff changeset
   800
    "move the mouse to aWidget's center"
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   801
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   802
    |position|
3717
26224649d91c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3716
diff changeset
   803
    
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   804
    aWidgetOrMenuItem isView ifTrue:[
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   805
        position := aWidgetOrMenuItem screenBounds center rounded
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   806
    ] ifFalse:[
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   807
        self halt.
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   808
    ].    
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   809
    self movePointerToScreenPosition:position speed:pixelsPerSecond.
3717
26224649d91c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3716
diff changeset
   810
26224649d91c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3716
diff changeset
   811
    "Created: / 20-07-2019 / 08:12:49 / Claus Gittinger"
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   812
    "Modified: / 23-07-2019 / 09:37:27 / Claus Gittinger"
3717
26224649d91c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3716
diff changeset
   813
!
26224649d91c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3716
diff changeset
   814
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   815
movePointerToScreenPosition:newPosition
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   816
    "move the mouse to newPosition"
3717
26224649d91c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3716
diff changeset
   817
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   818
    self movePointerToScreenPosition:newPosition speed:(self pointerMoveSpeed)
3717
26224649d91c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3716
diff changeset
   819
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   820
    "Created: / 23-07-2019 / 09:36:39 / Claus Gittinger"
3717
26224649d91c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3716
diff changeset
   821
!
26224649d91c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3716
diff changeset
   822
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   823
movePointerToScreenPosition:newPosition speed:pixelsPerSecond
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   824
    "move the mouse to newPosition, which is a screen position"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   825
    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   826
    |screen distance start numSteps moveTime stepDelayTime delta|
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   827
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   828
    screen := Screen current.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   829
    start := screen pointerPosition.   
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   830
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   831
    distance := start dist:newPosition.
3717
26224649d91c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3716
diff changeset
   832
    moveTime := (distance / pixelsPerSecond) seconds.   "/ time to move
26224649d91c #BUGFIX by cg
Claus Gittinger <cg@exept.de>
parents: 3716
diff changeset
   833
    stepDelayTime := self pointerAnimationDelay.        "/ update every 50ms
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   834
    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   835
    numSteps := moveTime / stepDelayTime.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   836
    numSteps = 0 ifTrue:[
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   837
        "/ already there
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   838
        ^ self
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   839
    ].
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   840
    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   841
    delta := (newPosition - start) / numSteps.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   842
    1 to:numSteps do:[:step |
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   843
        |p|
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   844
        
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   845
        p := (start + (delta * step)) rounded.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   846
"/ Transcript showCR:p.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   847
        screen setPointerPosition:p.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   848
        screen flush.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   849
        Delay waitFor:stepDelayTime.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   850
    ].
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   851
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   852
    "Created: / 23-07-2019 / 09:36:45 / Claus Gittinger"
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   853
! !
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   854
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   855
!ShowMeHowItWorks methodsFor:'menu actions - mouse buttons'!
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   856
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   857
click:buttonNr inComponent:component
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   858
    "press-release in a component"
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   859
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   860
    |t|
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   861
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   862
    t := self shortClickTime.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   863
    (component isKindOf:Button) ifTrue:[
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   864
        t := self longClickTime
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   865
    ].    
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   866
    self click:buttonNr inComponent:component clickTime:t
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   867
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   868
    "Created: / 19-07-2019 / 13:18:27 / Claus Gittinger"
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   869
    "Modified: / 19-07-2019 / 15:22:47 / Claus Gittinger"
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   870
!
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   871
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   872
click:buttonNr inComponent:component clickTime:clickTime 
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   873
    "press-release in a component"
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   874
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   875
    component simulateButtonPress:buttonNr at:(component extent // 2) sendDisplayEvent:false.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   876
    Delay waitForSeconds:clickTime.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   877
    component simulateButtonRelease:buttonNr at:(component extent // 2) sendDisplayEvent:false.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   878
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   879
"/    self click:buttonNr atPosition:(component extent // 2)
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   880
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   881
    "Created: / 19-07-2019 / 15:21:05 / Claus Gittinger"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   882
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   883
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   884
press:buttonNr
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   885
    "press at the current position"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   886
    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   887
    |position screen x y|
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   888
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   889
    screen := Screen current.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   890
    position := screen pointerPosition.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   891
    x := position x.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   892
    y := position y.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   893
    
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   894
    self movePointerToScreenPosition:position.
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   895
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   896
    false "OperatingSystem isOSXlike" ifTrue:[
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   897
        |osxPos|
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   898
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   899
        osxPos := OperatingSystem getMousePosition.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   900
        x := osxPos x rounded.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   901
        y := osxPos y rounded.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   902
        OperatingSystem generateButtonEvent:buttonNr down:true x:x y:y.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   903
        ^ self.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   904
    ].
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   905
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   906
    screen sendKeyOrButtonEvent:#buttonPress x:x y:y keyOrButton:buttonNr state:0 toViewId:(screen rootWindowId).
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   907
    screen flush.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   908
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   909
    "Created: / 19-07-2019 / 13:52:38 / Claus Gittinger"
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   910
    "Modified: / 23-07-2019 / 09:38:31 / Claus Gittinger"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   911
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   912
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   913
release:buttonNr
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   914
    "press-release at the current position"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   915
    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   916
    |position screen x y|
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   917
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   918
    screen := Screen current.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   919
    position := screen pointerPosition.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   920
    x := position x.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   921
    y := position y.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   922
    
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   923
    self movePointerToScreenPosition:position.
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   924
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   925
    false "OperatingSystem isOSXlike" ifTrue:[
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   926
        |osxPos|
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   927
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   928
        osxPos := OperatingSystem getMousePosition.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   929
        x := osxPos x rounded.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   930
        y := osxPos y rounded.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   931
        OperatingSystem generateButtonEvent:buttonNr down:false x:x y:y.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   932
        ^ self.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   933
    ].
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   934
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   935
    screen sendKeyOrButtonEvent:#buttonRelease x:x y:y keyOrButton:buttonNr state:0 toViewId:(screen rootWindowId).
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   936
    screen flush.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   937
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   938
    "Created: / 19-07-2019 / 13:53:05 / Claus Gittinger"
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   939
    "Modified: / 23-07-2019 / 09:38:38 / Claus Gittinger"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   940
! !
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   941
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   942
!ShowMeHowItWorks methodsFor:'running'!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
   943
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   944
do:specArray
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   945
    "must run as a separate process;
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   946
     otherwise - if started by the app itself -
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   947
     no events will be processed while running"
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   948
3739
9c7040099cfe #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3738
diff changeset
   949
    self language:(Smalltalk language).
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   950
    translate := false.
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   951
    
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   952
    application isNil ifTrue:[
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   953
        application := WindowGroup activeMainApplication.
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   954
    ].
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   955
    
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   956
    [
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   957
        Error handle:[:ex |
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   958
            Dialog warn:(self class classResources stringWithCRs:'An error was encountered in the show:\\%1' with:ex description)
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   959
        ] do:[
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   960
            self doStream:(specArray readStream)
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   961
        ].
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   962
    ] fork.
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   963
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   964
    "
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   965
     ShowMeHowItWorks do:
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   966
        #(
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   967
            (show: 'bla bla')
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   968
            (moveTo: NameOfComponent)
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   969
        )    
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   970
    "
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   971
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   972
    "Created: / 23-07-2019 / 10:24:53 / Claus Gittinger"
3739
9c7040099cfe #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3738
diff changeset
   973
    "Modified: / 25-07-2019 / 11:48:53 / Claus Gittinger"
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   974
!
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
   975
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   976
doCommand:op
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   977
    "execute a single command"
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
   978
    
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   979
    |numArgs sel args method|
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   980
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   981
    op isArray ifTrue:[
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   982
        op first isArray ifTrue:[
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   983
            self doStream:op readStream.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   984
            ^ self.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   985
        ].
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   986
        
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   987
        "/ construct a selector from keyword parts at odd indices
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   988
        sel := ((op with:(1 to:op size) select:[:el :idx | idx odd]) asStringWith:'') asSymbol.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   989
        "/ construct arg vector from parts at even indices
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   990
        args := op with:(1 to:op size) select:[:el :idx | idx even].
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   991
    ] ifFalse:[
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   992
        sel := op.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   993
        numArgs := sel argumentCount.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   994
        args := opStream next:numArgs.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   995
    ].
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   996
    
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   997
    (self respondsTo:sel) ifFalse:[
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   998
        self error:'bad operation: ',sel
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
   999
    ].
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1000
    method := self class lookupMethodFor:sel.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1001
    (method hasAnnotation:#action) ifFalse:[self halt].
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1002
    
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1003
    lastResult := self perform:sel withArguments:args.
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1004
    ^ lastResult
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1005
    
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1006
"<<END
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1007
     ShowMeHowItWorks do:#(
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1008
        showing: 'Choose the number of arguments'
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1009
        do: (
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1010
            moveTo: NumberOfArguments
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1011
            select: '1'
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1012
        )    
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1013
        showing: 'Click into the "receiver" field'
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1014
        do: (
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1015
            moveTo: ReceiverEditor
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1016
            click: ReceiverEditor
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1017
        )
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1018
        showing: 'Enter a value (or expression) into "receiver" field'
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1019
        do: (
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1020
            enter: '100'
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1021
        )
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1022
        showing: 'Click into the "first argument" field'
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1023
        do: (
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1024
            moveTo: Arg1Editor
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1025
            click: ReceiverEditor
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1026
        )
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1027
        showing: 'Enter a value (or expression) into "receiver" field'
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1028
        do: (
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1029
            enter: '100'
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1030
        )
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1031
     )
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1032
END"
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1033
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1034
    "Created: / 19-07-2019 / 15:34:55 / Claus Gittinger"
3727
6faffd2a64a3 #REFACTORING by cg
Claus Gittinger <cg@exept.de>
parents: 3724
diff changeset
  1035
    "Modified: / 23-07-2019 / 09:14:26 / Claus Gittinger"
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1036
!
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1037
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1038
doStream:specStream
3715
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1039
    |previousStream resources|
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1040
3715
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1041
    resources := self class classResources.
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1042
    
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1043
    previousStream := opStream.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1044
    [
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1045
        opStream := specStream.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1046
        [opStream atEnd] whileFalse:[
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1047
            self nextCommand.
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1048
            Display shiftDown ifTrue:[
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
  1049
                (IntroShownCount ? 0) > 3 ifFalse:[
3738
fcd5a6af06d4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3733
diff changeset
  1050
                    self tell:(self possiblyTranslate:'You pressed the SHIFT key.').
3728
e7faeed17679 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3727
diff changeset
  1051
                ].    
3738
fcd5a6af06d4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3733
diff changeset
  1052
                self tell:(self possiblyTranslate:'Do you want to stop the show?').
3715
8e37e3d91789 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3714
diff changeset
  1053
                (Dialog confirm:(resources stringWithCRs:'Stop the demonstration?'))
3714
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  1054
                ifTrue:[
3738
fcd5a6af06d4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3733
diff changeset
  1055
                    self tell:(self possiblyTranslate:'OK,').
fcd5a6af06d4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3733
diff changeset
  1056
                    self tell:(self possiblyTranslate:(self randomThankYou)).
3714
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  1057
                    ^ AbortOperationRequest raise
d3314ff81424 #FEATURE by cg
Claus Gittinger <cg@exept.de>
parents: 3713
diff changeset
  1058
                ].    
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1059
            ].    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1060
        ].    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1061
    ] ensure:[
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1062
        opStream := previousStream
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1063
    ].
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1064
    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1065
"<<END
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1066
     ShowMeHowItWorks do:#(
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1067
        showing: 'Choose the number of arguments'
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1068
        do: (
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1069
            moveTo: NumberOfArguments
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1070
            select: '1'
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1071
        )    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1072
        showing: 'Click into the "receiver" field'
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1073
        do: (
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1074
            moveTo: ReceiverEditor
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1075
            click: ReceiverEditor
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1076
        )
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1077
        showing: 'Enter a value (or expression) into "receiver" field'
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1078
        do: (
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1079
            enter: '100'
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1080
        )
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1081
        showing: 'Click into the "first argument" field'
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1082
        do: (
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1083
            moveTo: Arg1Editor
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1084
            click: ReceiverEditor
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1085
        )
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1086
        showing: 'Enter a value (or expression) into "receiver" field'
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1087
        do: (
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1088
            enter: '100'
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1089
        )
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1090
     )
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1091
END"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1092
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1093
    "Created: / 19-07-2019 / 10:52:24 / Claus Gittinger"
3738
fcd5a6af06d4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3733
diff changeset
  1094
    "Modified: / 23-07-2019 / 11:48:45 / Claus Gittinger"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1095
!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1096
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1097
nextCommand
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1098
    self doCommand:(opStream next).
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1099
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1100
"<<END
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1101
     ShowMeHowItWorks do:#(
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1102
        showing: 'Choose the number of arguments'
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1103
        do: (
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1104
            moveTo: NumberOfArguments
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1105
            select: '1'
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1106
        )    
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1107
        showing: 'Click into the "receiver" field'
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1108
        do: (
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1109
            moveTo: ReceiverEditor
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1110
            click: ReceiverEditor
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1111
        )
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1112
        showing: 'Enter a value (or expression) into "receiver" field'
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1113
        do: (
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1114
            enter: '100'
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1115
        )
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1116
        showing: 'Click into the "first argument" field'
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1117
        do: (
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1118
            moveTo: Arg1Editor
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1119
            click: ReceiverEditor
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1120
        )
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1121
        showing: 'Enter a value (or expression) into "receiver" field'
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1122
        do: (
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1123
            enter: '100'
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1124
        )
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1125
     )
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1126
END"
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1127
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1128
    "Created: / 19-07-2019 / 10:54:04 / Claus Gittinger"
3711
a472042fd298 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3700
diff changeset
  1129
    "Modified: / 19-07-2019 / 15:35:15 / Claus Gittinger"
3738
fcd5a6af06d4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3733
diff changeset
  1130
!
fcd5a6af06d4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3733
diff changeset
  1131
fcd5a6af06d4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3733
diff changeset
  1132
possiblyTranslate:aString
fcd5a6af06d4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3733
diff changeset
  1133
    translate ifTrue:[^ self class classResources string:aString].
fcd5a6af06d4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3733
diff changeset
  1134
    ^ aString
fcd5a6af06d4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3733
diff changeset
  1135
fcd5a6af06d4 #UI_ENHANCEMENT by cg
Claus Gittinger <cg@exept.de>
parents: 3733
diff changeset
  1136
    "Created: / 23-07-2019 / 11:48:17 / Claus Gittinger"
3700
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1137
! !
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1138
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1139
!ShowMeHowItWorks class methodsFor:'documentation'!
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1140
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1141
version_CVS
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1142
    ^ '$Header$'
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1143
! !
34af8cf33242 initial checkin
Claus Gittinger <cg@exept.de>
parents:
diff changeset
  1144