Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 8fd7eee

Browse files
committed
Use new stdwinevents.
1 parent ccfd6e1 commit 8fd7eee

4 files changed

Lines changed: 20 additions & 26 deletions

File tree

Lib/lib-stdwin/tablewin.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
import stdwin
1818
import gwin
19+
from stdwinevents import *
1920

2021
def open(title, data): # Public function to open a table window
2122
#
@@ -163,15 +164,13 @@ def whichcol(w, h): # Return column number (may be >= len(w.data))
163164
return len(w.data)
164165

165166
def arrow(w, type):
166-
import stdwinsupport
167-
S = stdwinsupport
168-
if type = S.wc_left:
167+
if type = WC_LEFT:
169168
incr = -1, 0
170-
elif type = S.wc_up:
169+
elif type = WC_UP:
171170
incr = 0, -1
172-
elif type = S.wc_right:
171+
elif type = WC_RIGHT:
173172
incr = 1, 0
174-
elif type = S.wc_down:
173+
elif type = WC_DOWN:
175174
incr = 0, 1
176175
else:
177176
return

Lib/lib-stdwin/textwin.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
# Text windows, a subclass of gwin
44

55
import stdwin
6-
import stdwinsupport
76
import gwin
8-
9-
S = stdwinsupport # Shorthand
7+
from stdwinevents import *
108

119

1210
def fixsize(w):
@@ -68,22 +66,22 @@ def char(w, c): # Char method
6866
fixsize(w)
6967

7068
def backspace(w): # Backspace method
71-
void = w.text.event(S.we_command, w, S.wc_backspace)
69+
void = w.text.event(WE_COMMAND, w, WC_BACKSPACE)
7270
fixsize(w)
7371

7472
def arrow(w, detail): # Arrow method
7573
w.text.arrow(detail)
7674
fixeditmenu(w)
7775

7876
def mdown(w, detail): # Mouse down method
79-
void = w.text.event(S.we_mouse_down, w, detail)
77+
void = w.text.event(WE_MOUSE_DOWN, w, detail)
8078
fixeditmenu(w)
8179

8280
def mmove(w, detail): # Mouse move method
83-
void = w.text.event(S.we_mouse_move, w, detail)
81+
void = w.text.event(WE_MOUSE_MOVE, w, detail)
8482

8583
def mup(w, detail): # Mouse up method
86-
void = w.text.event(S.we_mouse_up, w, detail)
84+
void = w.text.event(WE_MOUSE_UP, w, detail)
8785
fixeditmenu(w)
8886

8987
def activate(w): # Activate method

Lib/stdwin/tablewin.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
import stdwin
1818
import gwin
19+
from stdwinevents import *
1920

2021
def open(title, data): # Public function to open a table window
2122
#
@@ -163,15 +164,13 @@ def whichcol(w, h): # Return column number (may be >= len(w.data))
163164
return len(w.data)
164165

165166
def arrow(w, type):
166-
import stdwinsupport
167-
S = stdwinsupport
168-
if type = S.wc_left:
167+
if type = WC_LEFT:
169168
incr = -1, 0
170-
elif type = S.wc_up:
169+
elif type = WC_UP:
171170
incr = 0, -1
172-
elif type = S.wc_right:
171+
elif type = WC_RIGHT:
173172
incr = 1, 0
174-
elif type = S.wc_down:
173+
elif type = WC_DOWN:
175174
incr = 0, 1
176175
else:
177176
return

Lib/stdwin/textwin.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,8 @@
33
# Text windows, a subclass of gwin
44

55
import stdwin
6-
import stdwinsupport
76
import gwin
8-
9-
S = stdwinsupport # Shorthand
7+
from stdwinevents import *
108

119

1210
def fixsize(w):
@@ -68,22 +66,22 @@ def char(w, c): # Char method
6866
fixsize(w)
6967

7068
def backspace(w): # Backspace method
71-
void = w.text.event(S.we_command, w, S.wc_backspace)
69+
void = w.text.event(WE_COMMAND, w, WC_BACKSPACE)
7270
fixsize(w)
7371

7472
def arrow(w, detail): # Arrow method
7573
w.text.arrow(detail)
7674
fixeditmenu(w)
7775

7876
def mdown(w, detail): # Mouse down method
79-
void = w.text.event(S.we_mouse_down, w, detail)
77+
void = w.text.event(WE_MOUSE_DOWN, w, detail)
8078
fixeditmenu(w)
8179

8280
def mmove(w, detail): # Mouse move method
83-
void = w.text.event(S.we_mouse_move, w, detail)
81+
void = w.text.event(WE_MOUSE_MOVE, w, detail)
8482

8583
def mup(w, detail): # Mouse up method
86-
void = w.text.event(S.we_mouse_up, w, detail)
84+
void = w.text.event(WE_MOUSE_UP, w, detail)
8785
fixeditmenu(w)
8886

8987
def activate(w): # Activate method

0 commit comments

Comments
 (0)