~hilaire-fernandes/drgeo/trunk

« back to all changes in this revision

Viewing changes to src/DrGeoII-Core/DrGSelectToolStateSelected.class.st

  • Committer: Hilaire Fernandes
  • Date: 2017-11-15 13:17:03 UTC
  • Revision ID: hilaire.fernandes@gmail.com-20171115131703-pz09obavthi53ebt
DrGeo code under Tonel file format

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Class {
 
2
        #name : #DrGSelectToolStateSelected,
 
3
        #superclass : #DrGSelectToolState,
 
4
        #category : #'DrGeoII-Core-Tool'
 
5
}
 
6
 
 
7
{ #category : #handling }
 
8
DrGSelectToolStateSelected >> handleMouseAt: aPoint [
 
9
        |costumes|
 
10
        costumes := self context costumesAt: aPoint.
 
11
        ^ (costumes includes: self context costume)
 
12
                ifTrue:
 
13
                        [self area 
 
14
                                tip: self mathItem descriptiveName
 
15
                                at: aPoint.
 
16
                        true]
 
17
                ifFalse: [self area hideTip.
 
18
                        false]
 
19
]
 
20
 
 
21
{ #category : #handling }
 
22
DrGSelectToolStateSelected >> handlePress: aPoint [ 
 
23
        | costumes |
 
24
        self area hideTip.
 
25
        costumes := self context costumesAt: aPoint.
 
26
        (costumes includes: self context costume) 
 
27
                ifTrue: [
 
28
                        self context updateDirtyItemsList.
 
29
                        self switchState: DrGSelectToolStateGrabbed.
 
30
                        ^true]
 
31
                ifFalse: [ 
 
32
                        self context reset.
 
33
                        ^false]
 
34
]