143 poolDictionaries:'' |
145 poolDictionaries:'' |
144 privateIn:WindowEvent |
146 privateIn:WindowEvent |
145 ! |
147 ! |
146 |
148 |
147 WindowEvent subclass:#MessageSendEvent |
149 WindowEvent subclass:#MessageSendEvent |
148 instanceVariableNames:'' |
150 instanceVariableNames:'generatedBy' |
149 classVariableNames:'' |
151 classVariableNames:'Debug' |
150 poolDictionaries:'' |
152 poolDictionaries:'' |
151 privateIn:WindowEvent |
153 privateIn:WindowEvent |
152 ! |
154 ! |
153 |
155 |
154 WindowEvent::ButtonEvent subclass:#MouseWheelMotionEvent |
156 WindowEvent::ButtonEvent subclass:#MouseWheelMotionEvent |
155 instanceVariableNames:'' |
157 instanceVariableNames:'repeatCount' |
156 classVariableNames:'' |
158 classVariableNames:'' |
157 poolDictionaries:'' |
159 poolDictionaries:'' |
158 privateIn:WindowEvent |
160 privateIn:WindowEvent |
159 ! |
161 ! |
160 |
162 |
232 |
241 |
233 documentation |
242 documentation |
234 " |
243 " |
235 Instances of WindowEvent are created for every event coming from the graphics device. |
244 Instances of WindowEvent are created for every event coming from the graphics device. |
236 Usually, they are enqueued by the event dispatcher process into |
245 Usually, they are enqueued by the event dispatcher process into |
237 a sensors input queue, and dequeued & processed by a windowGroup process |
246 a sensor's input queue, and dequeued & processed by a windowGroup process |
238 in its event loop. |
247 in its event loop. |
239 |
248 |
240 WindowEvents hold the event type and additional information (such as key, |
249 WindowEvents hold the event type and additional information (such as key, |
241 x/y coordinates etc). Also, windowEvents know how to send themself to some |
250 x/y coordinates etc). Also, windowEvents know how to send themself to some |
242 destination. To provide a common (single) place where event dispatching is |
251 destination. To provide a common (single) place where event dispatching is |
634 |
664 |
635 for:aView type:aSymbol |
665 for:aView type:aSymbol |
636 "create and return a new windowEvent for sending |
666 "create and return a new windowEvent for sending |
637 aSymbol-message with no arguments to aView" |
667 aSymbol-message with no arguments to aView" |
638 |
668 |
|
669 self == WindowEvent ifTrue:[ |
|
670 '----------------' errorPrint. |
|
671 'WindowEvent is abstract - use/add explicit creation message' errorPrintCR. |
|
672 thisContext fullPrintAll. |
|
673 self abstractClassInstantiationError. |
|
674 ]. |
639 ^ self new for:aView type:aSymbol |
675 ^ self new for:aView type:aSymbol |
640 ! |
676 ! |
641 |
677 |
642 for:aView type:aSymbol arguments:argArray |
678 for:aView type:aSymbol arguments:argArray |
643 "create and return a new windowEvent for sending |
679 "create and return a new windowEvent for sending |
644 aSymbol-message with arguments to aView" |
680 aSymbol-message with arguments to aView" |
645 |
681 |
|
682 self == WindowEvent ifTrue:[ |
|
683 '----------------' errorPrint. |
|
684 'WindowEvent is abstract - use/add explicit creation message' errorPrintCR. |
|
685 thisContext fullPrintAll. |
|
686 self abstractClassInstantiationError. |
|
687 ]. |
646 ^ self new for:aView type:aSymbol arguments:argArray |
688 ^ self new for:aView type:aSymbol arguments:argArray |
647 ! |
689 ! |
648 |
690 |
649 new |
691 new |
650 self == WindowEvent ifTrue:[ |
692 self == WindowEvent ifTrue:[ |
765 |
807 |
766 !WindowEvent methodsFor:'printing & storing'! |
808 !WindowEvent methodsFor:'printing & storing'! |
767 |
809 |
768 displayOn:aGCOrStream |
810 displayOn:aGCOrStream |
769 "Compatibility |
811 "Compatibility |
770 append a printed desription on some stream (Dolphin, Squeak) |
812 append a printed desription on some stream (Dolphin, Squeak) |
771 OR: |
813 OR: |
772 display the receiver in a graphicsContext at 0@0 (ST80). |
814 display the receiver in a graphicsContext at 0@0 (ST80). |
773 This method allows for any object to be displayed in some view |
815 This method allows for any object to be displayed in some view |
774 (although the fallBack is to display its printString ...)" |
816 (although the fallBack is to display its printString ...)" |
775 |
817 |
776 "/ what a kludge - Dolphin and Squeak mean: printOn: a stream; |
818 "/ what a kludge - Dolphin and Squeak mean: printOn: a stream; |
777 "/ ST/X (and some old ST80's) mean: draw-yourself on a GC. |
819 "/ old ST80 means: draw-yourself on a GC. |
778 aGCOrStream isStream ifFalse:[ |
820 aGCOrStream isStream ifFalse:[ |
779 ^ super displayOn:aGCOrStream. |
821 ^ super displayOn:aGCOrStream. |
780 ]. |
822 ]. |
781 |
823 |
782 aGCOrStream |
824 aGCOrStream |
783 nextPutAll:self class name; |
825 nextPutAll:self className; |
784 nextPut:$(. |
826 nextPut:$(. |
785 |
827 |
786 selector storeOn:aGCOrStream. |
828 selector storeOn:aGCOrStream. |
787 aGCOrStream |
829 aGCOrStream |
788 nextPutAll:' view: '; |
830 nextPutAll:' view: '; |
790 nextPutAll:' args: '. |
832 nextPutAll:' args: '. |
791 |
833 |
792 args displayOn:aGCOrStream. |
834 args displayOn:aGCOrStream. |
793 aGCOrStream nextPut:$) |
835 aGCOrStream nextPut:$) |
794 |
836 |
795 "Created: 7.3.1996 / 14:55:50 / cg" |
837 "Created: / 07-03-1996 / 14:55:50 / cg" |
796 "Modified: 20.9.1997 / 11:42:11 / cg" |
838 "Modified: / 20-09-1997 / 11:42:11 / cg" |
|
839 "Modified (comment): / 22-02-2017 / 16:53:02 / cg" |
|
840 "Modified: / 28-06-2019 / 09:23:38 / Claus Gittinger" |
797 ! ! |
841 ! ! |
798 |
842 |
799 !WindowEvent methodsFor:'private-accessing'! |
843 !WindowEvent methodsFor:'private-accessing'! |
800 |
844 |
801 for:aView type:aSymbol |
845 for:aView type:aSymbol |
1485 ^ (selector == #focusOut) |
1540 ^ (selector == #focusOut) |
1486 |
1541 |
1487 "Created: / 21.5.1999 / 19:45:04 / cg" |
1542 "Created: / 21.5.1999 / 19:45:04 / cg" |
1488 ! ! |
1543 ! ! |
1489 |
1544 |
|
1545 !WindowEvent::KeyboardEvent class methodsFor:'documentation'! |
|
1546 |
|
1547 documentation |
|
1548 " |
|
1549 documentation to be added. |
|
1550 |
|
1551 class: |
|
1552 <a short class summary here, describing what instances represent> |
|
1553 |
|
1554 responsibilities: |
|
1555 <describing what my main role is> |
|
1556 |
|
1557 collaborators: |
|
1558 <describing with whom and how I talk to> |
|
1559 |
|
1560 API: |
|
1561 <public api and main messages> |
|
1562 |
|
1563 example: |
|
1564 <a one-line examples on how to use - can also be in a separate example method> |
|
1565 |
|
1566 implementation: |
|
1567 <implementation points> |
|
1568 |
|
1569 [author:] |
|
1570 exept MBP |
|
1571 |
|
1572 [instance variables:] |
|
1573 |
|
1574 [class variables:] |
|
1575 |
|
1576 [see also:] |
|
1577 |
|
1578 " |
|
1579 ! ! |
|
1580 |
1490 !WindowEvent::KeyboardEvent methodsFor:'accessing'! |
1581 !WindowEvent::KeyboardEvent methodsFor:'accessing'! |
1491 |
1582 |
|
1583 isDeadKey:aBoolean |
|
1584 "set (by the sensor) if this is an event for a deadKey. |
|
1585 Consumers may want to mark deadKeys specially |
|
1586 (eg. by highlighting it, as done in the editTextView)" |
|
1587 |
|
1588 isDeadKey := aBoolean |
|
1589 |
|
1590 "Created: 4.4.1997 / 13:47:15 / cg" |
|
1591 ! |
|
1592 |
1492 key |
1593 key |
1493 "return the key of the key-event." |
1594 "return the (translated) key of the key-event. |
|
1595 i.e. if the keyboardMap maps #Ctrlc to #Copy, |
|
1596 then key will be #Copy and untranslatedKey will be #Ctrlc |
|
1597 and rawKey will be $c." |
1494 |
1598 |
1495 ^ args at:1 |
1599 ^ args at:1 |
1496 |
1600 |
1497 "Created: 1.8.1997 / 13:55:19 / cg" |
1601 "Created: 1.8.1997 / 13:55:19 / cg" |
1498 ! |
1602 ! |
1499 |
1603 |
1500 key:aCharacterOrSymbol |
1604 key:aCharacterOrSymbol |
1501 "change the key of the key-event." |
1605 "set the (translated) key of the key-event. |
|
1606 i.e. if the keyboardMap maps #Ctrlc to #Copy, |
|
1607 then key will be #Copy and untranslatedKey will be #Ctrlc |
|
1608 and rawKey will be $c." |
1502 |
1609 |
1503 args at:1 put:aCharacterOrSymbol |
1610 args at:1 put:aCharacterOrSymbol |
1504 |
1611 |
1505 "Created: 1.8.1997 / 13:55:19 / cg" |
1612 "Created: 1.8.1997 / 13:55:19 / cg" |
1506 ! |
1613 ! |
1507 |
1614 |
1508 rawKey |
1615 rawKey |
|
1616 "return the (raw) key of the key-event. |
|
1617 i.e. if the keyboardMap maps #Ctrlc to #Copy, |
|
1618 then key will be #Copy and untranslatedKey will be #Ctrlc |
|
1619 and rawKey will be $c." |
|
1620 |
|
1621 rawKey isNil ifTrue:[^ self key]. |
1509 ^ rawKey |
1622 ^ rawKey |
1510 |
1623 |
1511 "Created: 4.4.1997 / 13:47:15 / cg" |
1624 "Created: 4.4.1997 / 13:47:15 / cg" |
1512 ! |
1625 ! |
1513 |
1626 |
1514 rawKey:aKey |
1627 rawKey:aKey |
|
1628 "set the (raw) key of the key-event. |
|
1629 i.e. if the keyboardMap maps #Ctrlc to #Copy, |
|
1630 then key will be #Copy and untranslatedKey will be #Ctrlc |
|
1631 and rawKey will be $c." |
|
1632 |
1515 rawKey := aKey |
1633 rawKey := aKey |
|
1634 |
|
1635 "Created: 4.4.1997 / 13:47:10 / cg" |
|
1636 ! |
|
1637 |
|
1638 rawKey:rKey untranslatedKey:uKey |
|
1639 "set the (raw) key of the key-event. |
|
1640 i.e. if the keyboardMap maps #Ctrlc to #Copy, |
|
1641 then key will be #Copy and untranslatedKey will be #Ctrlc |
|
1642 and rawKey will be $c." |
|
1643 |
|
1644 rawKey := rKey. |
|
1645 untranslatedKey := uKey. |
|
1646 |
|
1647 "Created: 4.4.1997 / 13:47:10 / cg" |
|
1648 ! |
|
1649 |
|
1650 untranslatedKey |
|
1651 "return the untranslated key of the key-event; |
|
1652 i.e. if the keyboardMap maps #Ctrlc to #Copy, |
|
1653 then key will be #Copy and untranslatedKey will be #Ctrlc |
|
1654 (and rawKey will be $c)." |
|
1655 |
|
1656 untranslatedKey isNil ifTrue:[^ self key]. |
|
1657 ^ untranslatedKey |
|
1658 |
|
1659 "Created: 4.4.1997 / 13:47:15 / cg" |
|
1660 ! |
|
1661 |
|
1662 untranslatedKey:aKey |
|
1663 "set the untranslated key of the key-event. |
|
1664 i.e. if the keyboardMap maps #Ctrlc to #Copy, |
|
1665 then key will be #Copy and untranslatedKey will be #Ctrlc |
|
1666 and rawKey will be $c." |
|
1667 |
|
1668 untranslatedKey := aKey |
1516 |
1669 |
1517 "Created: 4.4.1997 / 13:47:10 / cg" |
1670 "Created: 4.4.1997 / 13:47:10 / cg" |
1518 ! |
1671 ! |
1519 |
1672 |
1520 x |
1673 x |
1619 "return true, if this event is a keyboard focus event" |
1788 "return true, if this event is a keyboard focus event" |
1620 |
1789 |
1621 ^ true |
1790 ^ true |
1622 ! ! |
1791 ! ! |
1623 |
1792 |
|
1793 !WindowEvent::MessageSendEvent class methodsFor:'documentation'! |
|
1794 |
|
1795 documentation |
|
1796 " |
|
1797 documentation to be added. |
|
1798 |
|
1799 class: |
|
1800 <a short class summary here, describing what instances represent> |
|
1801 |
|
1802 responsibilities: |
|
1803 <describing what my main role is> |
|
1804 |
|
1805 collaborators: |
|
1806 <describing with whom and how I talk to> |
|
1807 |
|
1808 API: |
|
1809 <public api and main messages> |
|
1810 |
|
1811 example: |
|
1812 <a one-line examples on how to use - can also be in a separate example method> |
|
1813 |
|
1814 implementation: |
|
1815 <implementation points> |
|
1816 |
|
1817 [author:] |
|
1818 cg |
|
1819 |
|
1820 [instance variables:] |
|
1821 |
|
1822 [class variables:] |
|
1823 |
|
1824 [see also:] |
|
1825 |
|
1826 " |
|
1827 ! ! |
|
1828 |
|
1829 !WindowEvent::MessageSendEvent class methodsFor:'instance creation-basic'! |
|
1830 |
|
1831 for:aView type:aSymbol |
|
1832 "create and return a new windowEvent for sending |
|
1833 aSymbol-message with no arguments to aView" |
|
1834 |
|
1835 ^ (super for:aView type:aSymbol) rememberSender |
|
1836 ! |
|
1837 |
|
1838 for:aView type:aSymbol arguments:argArray |
|
1839 "create and return a new windowEvent for sending |
|
1840 aSymbol-message with arguments to aView" |
|
1841 |
|
1842 ^ (super for:aView type:aSymbol arguments:argArray) rememberSender |
|
1843 ! ! |
|
1844 |
|
1845 !WindowEvent::MessageSendEvent methodsFor:'accessing'! |
|
1846 |
|
1847 rememberSender |
|
1848 "possibly (i.e if Debug is true) remember the context where the message was generated. |
|
1849 Somewhat heuristicly skip uninterresting contexts." |
|
1850 |
|
1851 |con| |
|
1852 |
|
1853 (Debug ? false) ifFalse:[^ self]. |
|
1854 |
|
1855 con := thisContext sender. |
|
1856 [ |
|
1857 con notNil |
|
1858 and:[ (con receiver == self) |
|
1859 or:[(con receiver == self class) |
|
1860 or:[(con receiver == WindowEvent) |
|
1861 or:[(con receiver class == WindowSensor) |
|
1862 or:[(con receiver class == RecursionLock) |
|
1863 or:[(con receiver isBlock) |
|
1864 or:[(con selector == #enqueueMessage:for:arguments:) |
|
1865 or:[(con selector == #enqueueMessage:for:) |
|
1866 ]]]]]]] |
|
1867 ] |
|
1868 ] whileTrue:[ |
|
1869 con := con sender. |
|
1870 ]. |
|
1871 generatedBy := con. |
|
1872 ! ! |
|
1873 |
1624 !WindowEvent::MessageSendEvent methodsFor:'blocked'! |
1874 !WindowEvent::MessageSendEvent methodsFor:'blocked'! |
1625 |
1875 |
1626 view |
1876 view |
1627 ^ nil |
1877 ^ nil |
1628 ! ! |
1878 ! ! |
1636 |
1886 |
1637 |
1887 |
1638 |
1888 |
1639 ! ! |
1889 ! ! |
1640 |
1890 |
|
1891 !WindowEvent::MouseWheelMotionEvent class methodsFor:'documentation'! |
|
1892 |
|
1893 documentation |
|
1894 " |
|
1895 documentation to be added. |
|
1896 |
|
1897 class: |
|
1898 <a short class summary here, describing what instances represent> |
|
1899 |
|
1900 responsibilities: |
|
1901 <describing what my main role is> |
|
1902 |
|
1903 collaborators: |
|
1904 <describing with whom and how I talk to> |
|
1905 |
|
1906 API: |
|
1907 <public api and main messages> |
|
1908 |
|
1909 example: |
|
1910 <a one-line examples on how to use - can also be in a separate example method> |
|
1911 |
|
1912 implementation: |
|
1913 <implementation points> |
|
1914 |
|
1915 [author:] |
|
1916 exept MBP |
|
1917 |
|
1918 [instance variables:] |
|
1919 |
|
1920 [class variables:] |
|
1921 |
|
1922 [see also:] |
|
1923 |
|
1924 " |
|
1925 ! ! |
|
1926 |
1641 !WindowEvent::MouseWheelMotionEvent methodsFor:'accessing'! |
1927 !WindowEvent::MouseWheelMotionEvent methodsFor:'accessing'! |
|
1928 |
|
1929 addAmount:moreAmount |
|
1930 "used to compress multiple mouse-wheel motions into one" |
|
1931 |
|
1932 args at:4 put:(args at:4) + moreAmount |
|
1933 ! |
1642 |
1934 |
1643 amount |
1935 amount |
1644 "return the amount of the mouse wheel motion event " |
1936 "return the amount of the mouse wheel motion event " |
1645 |
1937 |
1646 ^ args at:4 |
1938 ^ args at:4 |
1722 ^ self new |
2032 ^ self new |
1723 |
2033 |
1724 "Created: / 23-01-2012 / 10:02:42 / cg" |
2034 "Created: / 23-01-2012 / 10:02:42 / cg" |
1725 ! ! |
2035 ! ! |
1726 |
2036 |
|
2037 !WindowEvent::WidgetSelectionEvent class methodsFor:'documentation'! |
|
2038 |
|
2039 copyright |
|
2040 " |
|
2041 COPYRIGHT (c) 2008 by eXept Software AG |
|
2042 All Rights Reserved |
|
2043 |
|
2044 This software is furnished under a license and may be used |
|
2045 only in accordance with the terms of that license and with the |
|
2046 inclusion of the above copyright notice. This software may not |
|
2047 be provided or otherwise made available to, or used by, any |
|
2048 other person. No title to or ownership of the software is |
|
2049 hereby transferred. |
|
2050 |
|
2051 " |
|
2052 ! ! |
|
2053 |
|
2054 !WindowEvent::WidgetSelectionEvent methodsFor:'accessing'! |
|
2055 |
|
2056 widget:aWidget |
|
2057 selector := #'widgetSelected:'. |
|
2058 args := Array with:aWidget class name. |
|
2059 receiver := aWidget. |
|
2060 timeStamp := Timestamp now. |
|
2061 ! |
|
2062 |
|
2063 widgetClassName |
|
2064 |
|
2065 ^ args at: 1 |
|
2066 ! ! |
|
2067 |
1727 !WindowEvent::WindowMapUnmapEvent methodsFor:'testing'! |
2068 !WindowEvent::WindowMapUnmapEvent methodsFor:'testing'! |
1728 |
2069 |
1729 isMapEvent |
2070 isMapEvent |
1730 "return true, if this is a map event" |
2071 "return true, if this is a map event" |
1731 |
2072 |