Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
33f1770e
Commit
33f1770e
authored
Feb 13, 1991
by
Guido van Rossum
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add getdefwinpos, getdefwinsize;
and improve mouse clipping for textedit blocks.
parent
253919f3
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
35 additions
and
3 deletions
+35
-3
Modules/stdwinmodule.c
Modules/stdwinmodule.c
+35
-3
No files found.
Modules/stdwinmodule.c
View file @
33f1770e
...
...
@@ -584,11 +584,17 @@ text_event(self, args)
if
(
!
geteventarg
(
args
,
&
e
))
return
NULL
;
if
(
e
.
type
==
WE_MOUSE_DOWN
)
{
/* Cheat at the left margin */
/* Cheat at the margins */
int
width
,
height
;
wgetdocsize
(
e
.
window
,
&
width
,
&
height
);
if
(
e
.
u
.
where
.
h
<
0
&&
tegetleft
(
tp
)
==
0
)
e
.
u
.
where
.
h
=
0
;
/* XXX should also check right margin and bottom,
but we have no wgetdocsize() yet */
else
if
(
e
.
u
.
where
.
h
>
width
&&
tegetright
(
tp
)
==
width
)
e
.
u
.
where
.
h
=
width
;
if
(
e
.
u
.
where
.
v
<
0
&&
tegettop
(
tp
)
==
0
)
e
.
u
.
where
.
v
=
0
;
else
if
(
e
.
u
.
where
.
v
>
height
&&
tegetright
(
tp
)
==
height
)
e
.
u
.
where
.
v
=
height
;
}
return
newintobject
((
long
)
teevent
(
tp
,
&
e
));
}
...
...
@@ -1432,6 +1438,30 @@ stdwin_setdefwinsize(sw, args)
return
None
;
}
static
object
*
stdwin_getdefwinpos
(
wp
,
args
)
windowobject
*
wp
;
object
*
args
;
{
int
h
,
v
;
if
(
!
getnoarg
(
args
))
return
NULL
;
wgetdefwinpos
(
&
h
,
&
v
);
return
makepoint
(
h
,
v
);
}
static
object
*
stdwin_getdefwinsize
(
wp
,
args
)
windowobject
*
wp
;
object
*
args
;
{
int
width
,
height
;
if
(
!
getnoarg
(
args
))
return
NULL
;
wgetdefwinsize
(
&
width
,
&
height
);
return
makepoint
(
width
,
height
);
}
static
object
*
stdwin_menucreate
(
self
,
args
)
object
*
self
;
...
...
@@ -1609,6 +1639,8 @@ static struct methodlist stdwin_methods[] = {
{
"fleep"
,
stdwin_fleep
},
{
"getselection"
,
stdwin_getselection
},
{
"getcutbuffer"
,
stdwin_getcutbuffer
},
{
"getdefwinpos"
,
stdwin_getdefwinpos
},
{
"getdefwinsize"
,
stdwin_getdefwinsize
},
{
"getevent"
,
stdwin_getevent
},
{
"menucreate"
,
stdwin_menucreate
},
{
"message"
,
stdwin_message
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment