]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Use new stdwinevents.
authorGuido van Rossum <guido@python.org>
Thu, 26 Dec 1991 13:06:52 +0000 (13:06 +0000)
committerGuido van Rossum <guido@python.org>
Thu, 26 Dec 1991 13:06:52 +0000 (13:06 +0000)
Lib/lib-stdwin/tablewin.py
Lib/lib-stdwin/textwin.py
Lib/stdwin/tablewin.py
Lib/stdwin/textwin.py

index 05a954e5b86f48a4ee8cf8d330715a06b0935204..f9ab90761ff036976816475a73fcf47565b7896e 100644 (file)
@@ -16,6 +16,7 @@
 
 import stdwin
 import gwin
+from stdwinevents import *
 
 def open(title, data): # Public function to open a table window
        #
@@ -163,15 +164,13 @@ def whichcol(w, h): # Return column number (may be >= len(w.data))
        return len(w.data)
 
 def arrow(w, type):
-       import stdwinsupport
-       S = stdwinsupport
-       if type = S.wc_left:
+       if type = WC_LEFT:
                incr = -1, 0
-       elif type = S.wc_up:
+       elif type = WC_UP:
                incr = 0, -1
-       elif type = S.wc_right:
+       elif type = WC_RIGHT:
                incr = 1, 0
-       elif type = S.wc_down:
+       elif type = WC_DOWN:
                incr = 0, 1
        else:
                return
index a003a9a0d97d2f821bc372e47bfe41dea8c063c3..778717fe14f07f9bcbbee2e367056b7e5b34b9cc 100644 (file)
@@ -3,10 +3,8 @@
 # Text windows, a subclass of gwin
 
 import stdwin
-import stdwinsupport
 import gwin
-
-S = stdwinsupport                      # Shorthand
+from stdwinevents import *
 
 
 def fixsize(w):
@@ -68,7 +66,7 @@ def char(w, c):                               # Char method
        fixsize(w)
 
 def backspace(w):                      # Backspace method
-       void = w.text.event(S.we_command, w, S.wc_backspace)
+       void = w.text.event(WE_COMMAND, w, WC_BACKSPACE)
        fixsize(w)
 
 def arrow(w, detail):                  # Arrow method
@@ -76,14 +74,14 @@ def arrow(w, detail):                       # Arrow method
        fixeditmenu(w)
 
 def mdown(w, detail):                  # Mouse down method
-       void = w.text.event(S.we_mouse_down, w, detail)
+       void = w.text.event(WE_MOUSE_DOWN, w, detail)
        fixeditmenu(w)
 
 def mmove(w, detail):                  # Mouse move method
-       void = w.text.event(S.we_mouse_move, w, detail)
+       void = w.text.event(WE_MOUSE_MOVE, w, detail)
 
 def mup(w, detail):                    # Mouse up method
-       void = w.text.event(S.we_mouse_up, w, detail)
+       void = w.text.event(WE_MOUSE_UP, w, detail)
        fixeditmenu(w)
 
 def activate(w):                       # Activate method
index 05a954e5b86f48a4ee8cf8d330715a06b0935204..f9ab90761ff036976816475a73fcf47565b7896e 100755 (executable)
@@ -16,6 +16,7 @@
 
 import stdwin
 import gwin
+from stdwinevents import *
 
 def open(title, data): # Public function to open a table window
        #
@@ -163,15 +164,13 @@ def whichcol(w, h): # Return column number (may be >= len(w.data))
        return len(w.data)
 
 def arrow(w, type):
-       import stdwinsupport
-       S = stdwinsupport
-       if type = S.wc_left:
+       if type = WC_LEFT:
                incr = -1, 0
-       elif type = S.wc_up:
+       elif type = WC_UP:
                incr = 0, -1
-       elif type = S.wc_right:
+       elif type = WC_RIGHT:
                incr = 1, 0
-       elif type = S.wc_down:
+       elif type = WC_DOWN:
                incr = 0, 1
        else:
                return
index a003a9a0d97d2f821bc372e47bfe41dea8c063c3..778717fe14f07f9bcbbee2e367056b7e5b34b9cc 100755 (executable)
@@ -3,10 +3,8 @@
 # Text windows, a subclass of gwin
 
 import stdwin
-import stdwinsupport
 import gwin
-
-S = stdwinsupport                      # Shorthand
+from stdwinevents import *
 
 
 def fixsize(w):
@@ -68,7 +66,7 @@ def char(w, c):                               # Char method
        fixsize(w)
 
 def backspace(w):                      # Backspace method
-       void = w.text.event(S.we_command, w, S.wc_backspace)
+       void = w.text.event(WE_COMMAND, w, WC_BACKSPACE)
        fixsize(w)
 
 def arrow(w, detail):                  # Arrow method
@@ -76,14 +74,14 @@ def arrow(w, detail):                       # Arrow method
        fixeditmenu(w)
 
 def mdown(w, detail):                  # Mouse down method
-       void = w.text.event(S.we_mouse_down, w, detail)
+       void = w.text.event(WE_MOUSE_DOWN, w, detail)
        fixeditmenu(w)
 
 def mmove(w, detail):                  # Mouse move method
-       void = w.text.event(S.we_mouse_move, w, detail)
+       void = w.text.event(WE_MOUSE_MOVE, w, detail)
 
 def mup(w, detail):                    # Mouse up method
-       void = w.text.event(S.we_mouse_up, w, detail)
+       void = w.text.event(WE_MOUSE_UP, w, detail)
        fixeditmenu(w)
 
 def activate(w):                       # Activate method