Cursor.st
changeset 1494 4faf11deec70
parent 1414 492ba3d77d92
child 1495 d1934d676421
equal deleted inserted replaced
1493:b162273f59f9 1494:4faf11deec70
  1861 
  1861 
  1862 on:aDevice
  1862 on:aDevice
  1863     "create a new Cursor representing the same cursor as
  1863     "create a new Cursor representing the same cursor as
  1864      myself on aDevice; if one already exists, return the one"
  1864      myself on aDevice; if one already exists, return the one"
  1865 
  1865 
       
  1866     self obsoleteMethodWarning:'use #onDevice:'.
       
  1867     ^ self onDevice:aDevice
       
  1868 
       
  1869     "Modified: 28.3.1997 / 13:47:02 / cg"
       
  1870 !
       
  1871 
       
  1872 onDevice:aDevice
       
  1873     "create a new Cursor representing the same cursor as
       
  1874      myself on aDevice; if one already exists, return the one"
       
  1875 
  1866     aDevice isNil ifTrue:[
  1876     aDevice isNil ifTrue:[
  1867 	"this may not happen"
  1877         "this may not happen"
  1868 	self error:'nil device'
  1878         self error:'nil device'
  1869     ].
  1879     ].
  1870 
  1880 
  1871     "if I am already assigned to that device ..."
  1881     "if I am already assigned to that device ..."
  1872     (device == aDevice) ifTrue:[^ self].
  1882     (device == aDevice) ifTrue:[^ self].
  1873 
  1883 
  1874     "first look if not already there"
  1884     "first look if not already there"
  1875     Lobby do:[:aCursor |
  1885     Lobby do:[:aCursor |
  1876 	(aCursor graphicsDevice == aDevice) ifTrue:[
  1886         (aCursor graphicsDevice == aDevice) ifTrue:[
  1877 	    shape notNil ifTrue:[
  1887             shape notNil ifTrue:[
  1878 		(aCursor shape == shape) ifTrue:[
  1888                 (aCursor shape == shape) ifTrue:[
  1879 		    ^ aCursor
  1889                     ^ aCursor
  1880 		]
  1890                 ]
  1881 	    ] ifFalse:[
  1891             ] ifFalse:[
  1882 		(aCursor sourceForm == sourceForm) ifTrue:[
  1892                 (aCursor sourceForm == sourceForm) ifTrue:[
  1883 		    (aCursor maskForm == maskForm) ifTrue:[
  1893                     (aCursor maskForm == maskForm) ifTrue:[
  1884 			(aCursor hotX == hotX) ifTrue:[
  1894                         (aCursor hotX == hotX) ifTrue:[
  1885 			    (aCursor hotY == hotY) ifTrue:[
  1895                             (aCursor hotY == hotY) ifTrue:[
  1886 				^ aCursor
  1896                                 ^ aCursor
  1887 			    ]
  1897                             ]
  1888 			]
  1898                         ]
  1889 		    ]
  1899                     ]
  1890 		]
  1900                 ]
  1891 	    ]
  1901             ]
  1892 	]
  1902         ]
  1893     ].
  1903     ].
  1894     ^ self newOn:aDevice
  1904     ^ self newOn:aDevice
  1895 
  1905 
  1896     "Modified: 5.7.1996 / 17:58:00 / cg"
  1906     "Modified: 5.7.1996 / 17:58:00 / cg"
       
  1907     "Created: 28.3.1997 / 13:46:38 / cg"
  1897 ! !
  1908 ! !
  1898 
  1909 
  1899 !Cursor methodsFor:'instance release'!
  1910 !Cursor methodsFor:'instance release'!
  1900 
  1911 
  1901 disposed
  1912 disposed
  2044 ! !
  2055 ! !
  2045 
  2056 
  2046 !Cursor class methodsFor:'documentation'!
  2057 !Cursor class methodsFor:'documentation'!
  2047 
  2058 
  2048 version
  2059 version
  2049     ^ '$Header: /cvs/stx/stx/libview/Cursor.st,v 1.46 1997-03-04 13:24:02 cg Exp $'
  2060     ^ '$Header: /cvs/stx/stx/libview/Cursor.st,v 1.47 1997-03-28 12:51:20 cg Exp $'
  2050 ! !
  2061 ! !
  2051 Cursor initialize!
  2062 Cursor initialize!