mirror of
https://github.com/python/cpython.git
synced 2025-07-23 19:25:40 +00:00
Use new stdwinevents.
This commit is contained in:
parent
ccfd6e105b
commit
8fd7eee6db
4 changed files with 20 additions and 26 deletions
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
import stdwin
|
import stdwin
|
||||||
import gwin
|
import gwin
|
||||||
|
from stdwinevents import *
|
||||||
|
|
||||||
def open(title, data): # Public function to open a table window
|
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)
|
return len(w.data)
|
||||||
|
|
||||||
def arrow(w, type):
|
def arrow(w, type):
|
||||||
import stdwinsupport
|
if type = WC_LEFT:
|
||||||
S = stdwinsupport
|
|
||||||
if type = S.wc_left:
|
|
||||||
incr = -1, 0
|
incr = -1, 0
|
||||||
elif type = S.wc_up:
|
elif type = WC_UP:
|
||||||
incr = 0, -1
|
incr = 0, -1
|
||||||
elif type = S.wc_right:
|
elif type = WC_RIGHT:
|
||||||
incr = 1, 0
|
incr = 1, 0
|
||||||
elif type = S.wc_down:
|
elif type = WC_DOWN:
|
||||||
incr = 0, 1
|
incr = 0, 1
|
||||||
else:
|
else:
|
||||||
return
|
return
|
||||||
|
|
|
@ -3,10 +3,8 @@
|
||||||
# Text windows, a subclass of gwin
|
# Text windows, a subclass of gwin
|
||||||
|
|
||||||
import stdwin
|
import stdwin
|
||||||
import stdwinsupport
|
|
||||||
import gwin
|
import gwin
|
||||||
|
from stdwinevents import *
|
||||||
S = stdwinsupport # Shorthand
|
|
||||||
|
|
||||||
|
|
||||||
def fixsize(w):
|
def fixsize(w):
|
||||||
|
@ -68,7 +66,7 @@ def char(w, c): # Char method
|
||||||
fixsize(w)
|
fixsize(w)
|
||||||
|
|
||||||
def backspace(w): # Backspace method
|
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)
|
fixsize(w)
|
||||||
|
|
||||||
def arrow(w, detail): # Arrow method
|
def arrow(w, detail): # Arrow method
|
||||||
|
@ -76,14 +74,14 @@ def arrow(w, detail): # Arrow method
|
||||||
fixeditmenu(w)
|
fixeditmenu(w)
|
||||||
|
|
||||||
def mdown(w, detail): # Mouse down method
|
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)
|
fixeditmenu(w)
|
||||||
|
|
||||||
def mmove(w, detail): # Mouse move method
|
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
|
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)
|
fixeditmenu(w)
|
||||||
|
|
||||||
def activate(w): # Activate method
|
def activate(w): # Activate method
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
import stdwin
|
import stdwin
|
||||||
import gwin
|
import gwin
|
||||||
|
from stdwinevents import *
|
||||||
|
|
||||||
def open(title, data): # Public function to open a table window
|
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)
|
return len(w.data)
|
||||||
|
|
||||||
def arrow(w, type):
|
def arrow(w, type):
|
||||||
import stdwinsupport
|
if type = WC_LEFT:
|
||||||
S = stdwinsupport
|
|
||||||
if type = S.wc_left:
|
|
||||||
incr = -1, 0
|
incr = -1, 0
|
||||||
elif type = S.wc_up:
|
elif type = WC_UP:
|
||||||
incr = 0, -1
|
incr = 0, -1
|
||||||
elif type = S.wc_right:
|
elif type = WC_RIGHT:
|
||||||
incr = 1, 0
|
incr = 1, 0
|
||||||
elif type = S.wc_down:
|
elif type = WC_DOWN:
|
||||||
incr = 0, 1
|
incr = 0, 1
|
||||||
else:
|
else:
|
||||||
return
|
return
|
||||||
|
|
|
@ -3,10 +3,8 @@
|
||||||
# Text windows, a subclass of gwin
|
# Text windows, a subclass of gwin
|
||||||
|
|
||||||
import stdwin
|
import stdwin
|
||||||
import stdwinsupport
|
|
||||||
import gwin
|
import gwin
|
||||||
|
from stdwinevents import *
|
||||||
S = stdwinsupport # Shorthand
|
|
||||||
|
|
||||||
|
|
||||||
def fixsize(w):
|
def fixsize(w):
|
||||||
|
@ -68,7 +66,7 @@ def char(w, c): # Char method
|
||||||
fixsize(w)
|
fixsize(w)
|
||||||
|
|
||||||
def backspace(w): # Backspace method
|
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)
|
fixsize(w)
|
||||||
|
|
||||||
def arrow(w, detail): # Arrow method
|
def arrow(w, detail): # Arrow method
|
||||||
|
@ -76,14 +74,14 @@ def arrow(w, detail): # Arrow method
|
||||||
fixeditmenu(w)
|
fixeditmenu(w)
|
||||||
|
|
||||||
def mdown(w, detail): # Mouse down method
|
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)
|
fixeditmenu(w)
|
||||||
|
|
||||||
def mmove(w, detail): # Mouse move method
|
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
|
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)
|
fixeditmenu(w)
|
||||||
|
|
||||||
def activate(w): # Activate method
|
def activate(w): # Activate method
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue