795 "return the signal used for device I/O error reporting. |
795 "return the signal used for device I/O error reporting. |
796 The default here is the global DeviceIOErrorSignal (which is the |
796 The default here is the global DeviceIOErrorSignal (which is the |
797 parent of the per-instance signals)." |
797 parent of the per-instance signals)." |
798 |
798 |
799 ^ self class deviceIOErrorSignal |
799 ^ self class deviceIOErrorSignal |
|
800 ! ! |
|
801 |
|
802 !DeviceWorkstation methodsFor:'Squeak compatibility'! |
|
803 |
|
804 border:aRectangle width:bw |
|
805 "draw a rectangular border on the display with black. |
|
806 Added to allow for some squeak examples to be evaluated ..." |
|
807 |
|
808 |r| |
|
809 |
|
810 rootView clippedByChildren:false. |
|
811 rootView paint:Color black. |
|
812 r := aRectangle. |
|
813 0 to:bw-1 do:[:i | |
|
814 rootView displayRectangle:r. |
|
815 r := r insetBy:1. |
|
816 ]. |
|
817 rootView clippedByChildren:true. |
|
818 |
|
819 " |
|
820 Display restoreAfter:[ |
|
821 Display border:(10@10 corner:100@100) width:2. |
|
822 ] |
|
823 " |
|
824 |
|
825 "Modified: 15.10.1997 / 19:23:28 / cg" |
|
826 ! |
|
827 |
|
828 displayOpaqueString:s x:x y:y |
|
829 "draw a string on the display with black. |
|
830 Added to allow for some squeak examples to be evaluated ..." |
|
831 |
|
832 rootView clippedByChildren:false. |
|
833 rootView paint:Color black. |
|
834 rootView displayOpaqueString:s x:x y:y. |
|
835 rootView clippedByChildren:true. |
|
836 |
|
837 " |
|
838 Display restoreAfter:[ |
|
839 Display displayOpaqueString:'hello' x:10 y:10. |
|
840 ] |
|
841 " |
|
842 |
|
843 "Created: 15.10.1997 / 19:25:09 / cg" |
|
844 "Modified: 15.10.1997 / 19:29:05 / cg" |
|
845 ! |
|
846 |
|
847 displayString:s x:x y:y |
|
848 "draw a string on the display with black. |
|
849 Added to allow for some squeak examples to be evaluated ..." |
|
850 |
|
851 rootView clippedByChildren:false. |
|
852 rootView paint:Color black. |
|
853 rootView displayString:s x:x y:y. |
|
854 rootView clippedByChildren:true. |
|
855 |
|
856 " |
|
857 Display restoreAfter:[ |
|
858 Display displayString:'hello' x:10 y:10. |
|
859 ] |
|
860 " |
|
861 |
|
862 "Modified: 15.10.1997 / 19:29:10 / cg" |
|
863 ! |
|
864 |
|
865 fillWhite:aRectangle |
|
866 "fill a rectangular area on the display with white. |
|
867 Added to allow for some squeak examples to be evaluated ..." |
|
868 |
|
869 |oldPaint| |
|
870 |
|
871 oldPaint := rootView paint. |
|
872 rootView clippedByChildren:false. |
|
873 rootView paint:Color white. |
|
874 rootView fillRectangle:aRectangle. |
|
875 rootView clippedByChildren:true. |
|
876 rootView paint:oldPaint. |
|
877 |
|
878 " |
|
879 Display restoreAfter:[ |
|
880 Display fillWhite:(10@10 corner:100@100) |
|
881 ] |
|
882 " |
|
883 |
|
884 "Modified: 15.10.1997 / 19:28:17 / cg" |
|
885 ! |
|
886 |
|
887 restoreAfter:aBlock |
|
888 "evaluate aBlock, wait for a buttonPress, then restore the display. |
|
889 Added to allow for some squeak examples to be evaluated ..." |
|
890 |
|
891 aBlock value. |
|
892 [self anyButtonPressed] whileFalse:[]. |
|
893 self restoreWindows. |
|
894 |
|
895 " |
|
896 Display restoreAfter:[Display fillWhite:(10@10 corner:100@100)] |
|
897 " |
|
898 |
|
899 "Modified: 15.10.1997 / 19:43:08 / cg" |
800 ! ! |
900 ! ! |
801 |
901 |
802 !DeviceWorkstation methodsFor:'accessing & queries'! |
902 !DeviceWorkstation methodsFor:'accessing & queries'! |
803 |
903 |
804 activeView |
904 activeView |
4808 |
4926 |
4809 ^ self |
4927 ^ self |
4810 ! ! |
4928 ! ! |
4811 |
4929 |
4812 !DeviceWorkstation methodsFor:'pointer stuff'! |
4930 !DeviceWorkstation methodsFor:'pointer stuff'! |
|
4931 |
|
4932 anyButtonPressed |
|
4933 "return true, if the any button is currently pressed" |
|
4934 |
|
4935 ^ (self buttonStates bitAnd:self anyButtonStateMask) ~~ 0 |
|
4936 |
|
4937 "Created: 15.10.1997 / 19:16:32 / cg" |
|
4938 ! |
|
4939 |
|
4940 anyButtonStateMask |
|
4941 "return an integer for masking out any button from a |
|
4942 buttonStates value. This is very device specific and to |
|
4943 be redefined by concrete subclasses." |
|
4944 |
|
4945 ^ self subclassResponsibility |
|
4946 |
|
4947 "Created: 15.10.1997 / 19:17:00 / cg" |
|
4948 ! |
4813 |
4949 |
4814 buttonStates |
4950 buttonStates |
4815 "return an integer representing the state of the pointer buttons; |
4951 "return an integer representing the state of the pointer buttons; |
4816 a one-bit represents a pressed button. The bit positions are device specific |
4952 a one-bit represents a pressed button. The bit positions are device specific |
4817 and to be returned by the *ButtonStateMask methods. |
4953 and to be returned by the *ButtonStateMask methods. |