Cursor.st
changeset 7205 9c759d20a69f
parent 6603 81fca99c892e
child 7353 6a68e2c8ba60
equal deleted inserted replaced
7203:86050e7f2580 7205:9c759d20a69f
       
     1 "{ Encoding: utf8 }"
       
     2 
     1 "
     3 "
     2  COPYRIGHT (c) 1992 by Claus Gittinger
     4  COPYRIGHT (c) 1992 by Claus Gittinger
     3 	      All Rights Reserved
     5 	      All Rights Reserved
     4 
     6 
     5  This software is furnished under a license and may be used
     7  This software is furnished under a license and may be used
     8  be provided or otherwise made available to, or used by, any
    10  be provided or otherwise made available to, or used by, any
     9  other person.  No title to or ownership of the software is
    11  other person.  No title to or ownership of the software is
    10  hereby transferred.
    12  hereby transferred.
    11 "
    13 "
    12 "{ Package: 'stx:libview' }"
    14 "{ Package: 'stx:libview' }"
       
    15 
       
    16 "{ NameSpace: Smalltalk }"
    13 
    17 
    14 Object subclass:#Cursor
    18 Object subclass:#Cursor
    15 	instanceVariableNames:'shape sourceForm maskForm hotX hotY device cursorId'
    19 	instanceVariableNames:'shape sourceForm maskForm hotX hotY device cursorId'
    16 	classVariableNames:'DefaultFgColor DefaultBgColor NormalCursor HandCursor ArrowCursor
    20 	classVariableNames:'DefaultFgColor DefaultBgColor NormalCursor HandCursor ArrowCursor
    17 		WaitCursor CrossHairCursor OriginCursor CornerCursor SquareCursor
    21 		WaitCursor CrossHairCursor OriginCursor CornerCursor SquareCursor
   364     aDevice deviceCursors do:[:aCursor |
   368     aDevice deviceCursors do:[:aCursor |
   365         aCursor setDevice:nil id:nil
   369         aCursor setDevice:nil id:nil
   366     ].
   370     ].
   367     aDevice releaseDeviceCursors
   371     aDevice releaseDeviceCursors
   368 
   372 
       
   373     "
       
   374      self flushDeviceCursorsFor:Display
       
   375     "
   369 !
   376 !
   370 
   377 
   371 initialize
   378 initialize
   372     Color initialize.
   379     Color initialize.
   373     Form initialize.
   380     Form initialize.
   401             Cursor caret
   408             Cursor caret
   402             Cursor stop
   409             Cursor stop
   403             Cursor eye
   410             Cursor eye
   404             Cursor eyeClosed"
   411             Cursor eyeClosed"
   405 
   412 
   406     |bits isWindows|
   413     |bits mask isWindows|
   407 
   414 
       
   415     "/ HandCursor := nil.
   408     HandCursor notNil ifTrue:[^ self].
   416     HandCursor notNil ifTrue:[^ self].
   409 
   417 
   410     Screen isNil ifTrue:[
   418     Screen isNil ifTrue:[
   411         isWindows := OperatingSystem isMSWINDOWSlike.
   419         isWindows := OperatingSystem isMSWINDOWSlike.
   412     ] ifFalse:[
   420     ] ifFalse:[
  2125                         2r0000000000000000
  2133                         2r0000000000000000
  2126                        )
  2134                        )
  2127                     offset: -8 @ -8).
  2135                     offset: -8 @ -8).
  2128     ClosedEyeCursor setShape:#eyeClosed.
  2136     ClosedEyeCursor setShape:#eyeClosed.
  2129 
  2137 
       
  2138     isWindows ifTrue:[
       
  2139         "/ want it white-with black boundary
       
  2140         bits := #[7 128 24 96 32 16 39 136 24 72 0 72 0 72 0 144 1 32 2 64 2 64 2 64 1 128 2 64 2 64 1 128].
       
  2141         mask := #[7 128 31 224 63 240 63 248 24 120 0 120 0 120 0 240 1 224 3 192 3 192 3 192 1 128 3 192 3 192 1 128].
       
  2142     ] ifFalse:[
       
  2143         bits := #( 
       
  2144                   2r0000000000000000
       
  2145                   2r0000000000000000
       
  2146                   2r0000001111000000
       
  2147                   2r0000111111110000
       
  2148                   2r0000110000111000
       
  2149                   2r0000000000011000
       
  2150                   2r0000000000011000
       
  2151                   2r0000000000011000
       
  2152                   2r0000000000110000
       
  2153                   2r0000000001100000
       
  2154                   2r0000000110000000
       
  2155                   2r0000000110000000
       
  2156                   2r0000000000000000
       
  2157                   2r0000000110000000
       
  2158                   2r0000000110000000
       
  2159                   2r0000000000000000).
       
  2160         mask := #(  
       
  2161                   2r0000000000000000
       
  2162                   2r0000011111000000
       
  2163                   2r0000111111100000
       
  2164                   2r0001111111111000
       
  2165                   2r0001111111111100
       
  2166                   2r0001111000111100
       
  2167                   2r0000000000111100
       
  2168                   2r0000000000111100
       
  2169                   2r0000000001111000
       
  2170                   2r0000000011110000
       
  2171                   2r0000001111000000
       
  2172                   2r0000001111000000
       
  2173                   2r0000001111000000
       
  2174                   2r0000001111000000
       
  2175                   2r0000001111000000
       
  2176                   2r0000001111000000).
       
  2177     ].
       
  2178 
  2130     QuestionMarkCursor := (Cursor
  2179     QuestionMarkCursor := (Cursor
  2131                     extent: 16@16
  2180                     extent: 16@16
  2132                     sourceArray: #(
  2181                     sourceArray:bits 
  2133                         2r0000000000000000
  2182                     maskArray:mask 
  2134                         2r0000000000000000
       
  2135                         2r0000001111000000
       
  2136                         2r0000111111110000
       
  2137                         2r0000110000111000
       
  2138                         2r0000000000011000
       
  2139                         2r0000000000011000
       
  2140                         2r0000000000011000
       
  2141                         2r0000000000110000
       
  2142                         2r0000000001100000
       
  2143                         2r0000000110000000
       
  2144                         2r0000000110000000
       
  2145                         2r0000000000000000
       
  2146                         2r0000000110000000
       
  2147                         2r0000000110000000
       
  2148                         2r0000000000000000
       
  2149                         )
       
  2150                     maskArray: #(
       
  2151                         2r0000000000000000
       
  2152                         2r0000011111000000
       
  2153                         2r0000111111100000
       
  2154                         2r0001111111111000
       
  2155                         2r0001111111111100
       
  2156                         2r0001111000111100
       
  2157                         2r0000000000111100
       
  2158                         2r0000000000111100
       
  2159                         2r0000000001111000
       
  2160                         2r0000000011110000
       
  2161                         2r0000001111000000
       
  2162                         2r0000001111000000
       
  2163                         2r0000001111000000
       
  2164                         2r0000001111000000
       
  2165                         2r0000001111000000
       
  2166                         2r0000001111000000
       
  2167                        )
       
  2168                     offset: -8 @ -8).
  2183                     offset: -8 @ -8).
  2169     QuestionMarkCursor setShape:#questionMark.
  2184     QuestionMarkCursor setShape:#questionMark.
  2170 
  2185 
  2171     "/ if possible, preallocate them on the default display
  2186     "/ if possible, preallocate them on the default display
  2172 
  2187 
  3529 ! !
  3544 ! !
  3530 
  3545 
  3531 !Cursor class methodsFor:'documentation'!
  3546 !Cursor class methodsFor:'documentation'!
  3532 
  3547 
  3533 version
  3548 version
  3534     ^ '$Header: /cvs/stx/stx/libview/Cursor.st,v 1.115 2014-11-20 15:15:44 stefan Exp $'
  3549     ^ '$Header$'
  3535 !
  3550 !
  3536 
  3551 
  3537 version_CVS
  3552 version_CVS
  3538     ^ '$Header: /cvs/stx/stx/libview/Cursor.st,v 1.115 2014-11-20 15:15:44 stefan Exp $'
  3553     ^ '$Header$'
  3539 ! !
  3554 ! !
  3540 
  3555 
  3541 
  3556 
  3542 Cursor initialize!
  3557 Cursor initialize!