Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Synchronet
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Main
Synchronet
Commits
5e7cd249
Commit
5e7cd249
authored
20 years ago
by
deuce
Browse files
Options
Downloads
Patches
Plain Diff
Add paste support to ugetstr()
parent
84ec8f14
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/uifc/uifc32.c
+40
-3
40 additions, 3 deletions
src/uifc/uifc32.c
with
40 additions
and
3 deletions
src/uifc/uifc32.c
+
40
−
3
View file @
5e7cd249
...
@@ -117,6 +117,7 @@ void uifc_mouse_enable(void)
...
@@ -117,6 +117,7 @@ void uifc_mouse_enable(void)
ciomouse_addevent
(
CIOLIB_BUTTON_1_DRAG_MOVE
);
ciomouse_addevent
(
CIOLIB_BUTTON_1_DRAG_MOVE
);
ciomouse_addevent
(
CIOLIB_BUTTON_1_DRAG_END
);
ciomouse_addevent
(
CIOLIB_BUTTON_1_DRAG_END
);
ciomouse_addevent
(
CIOLIB_BUTTON_1_CLICK
);
ciomouse_addevent
(
CIOLIB_BUTTON_1_CLICK
);
ciomouse_addevent
(
CIOLIB_BUTTON_2_CLICK
);
ciomouse_addevent
(
CIOLIB_BUTTON_3_CLICK
);
ciomouse_addevent
(
CIOLIB_BUTTON_3_CLICK
);
showmouse
();
showmouse
();
}
}
...
@@ -1627,6 +1628,8 @@ int ugetstr(int left, int top, int width, char *outstr, int max, long mode, int
...
@@ -1627,6 +1628,8 @@ int ugetstr(int left, int top, int width, char *outstr, int max, long mode, int
BOOL
gotdecimal
=
FALSE
;
BOOL
gotdecimal
=
FALSE
;
int
soffset
=
0
;
int
soffset
=
0
;
struct
mouse_event
mevnt
;
struct
mouse_event
mevnt
;
unsigned
char
*
pastebuf
=
NULL
;
unsigned
char
*
pb
=
NULL
;
if
((
str
=
(
uchar
*
)
malloc
(
max
+
1
))
==
NULL
)
{
if
((
str
=
(
uchar
*
)
malloc
(
max
+
1
))
==
NULL
)
{
cprintf
(
"UIFC line %d: error allocating %u bytes
\r\n
"
cprintf
(
"UIFC line %d: error allocating %u bytes
\r\n
"
...
@@ -1669,6 +1672,17 @@ int ugetstr(int left, int top, int width, char *outstr, int max, long mode, int
...
@@ -1669,6 +1672,17 @@ int ugetstr(int left, int top, int width, char *outstr, int max, long mode, int
if
(
i
>
j
)
if
(
i
>
j
)
i
=
j
;
i
=
j
;
}
}
if
(
mevnt
.
startx
>=
left
&&
mevnt
.
startx
<=
left
+
width
&&
(
mevnt
.
event
==
CIOLIB_BUTTON_2_CLICK
||
mevnt
.
event
==
CIOLIB_BUTTON_3_CLICK
))
{
i
=
mevnt
.
startx
-
left
+
soffset
;
if
(
i
>
j
)
i
=
j
;
pastebuf
=
getcliptext
();
pb
=
pastebuf
;
f
=
0
;
}
}
}
}
}
...
@@ -1699,11 +1713,20 @@ int ugetstr(int left, int top, int width, char *outstr, int max, long mode, int
...
@@ -1699,11 +1713,20 @@ int ugetstr(int left, int top, int width, char *outstr, int max, long mode, int
if
(
i
>
j
)
j
=
i
;
if
(
i
>
j
)
j
=
i
;
str
[
j
]
=
0
;
str
[
j
]
=
0
;
getstrupd
(
left
,
top
,
width
,
str
,
i
,
&
soffset
);
getstrupd
(
left
,
top
,
width
,
str
,
i
,
&
soffset
);
if
(
f
||
(
ch
=
inkey
())
!=
0
)
if
(
f
||
pb
!=
NULL
||
(
ch
=
inkey
())
!=
0
)
{
{
if
(
f
)
if
(
f
)
{
ch
=
f
;
ch
=
f
;
f
=
0
;
f
=
0
;
}
else
if
(
pb
!=
NULL
)
{
ch
=*
(
pb
++
);
if
(
!*
pb
)
{
free
(
pastebuf
);
pastebuf
=
NULL
;
pb
=
NULL
;
}
}
if
(
ch
==
CIO_KEY_MOUSE
)
{
if
(
ch
==
CIO_KEY_MOUSE
)
{
if
((
ch
=
uifc_getmouse
(
&
mevnt
))
==
0
)
{
if
((
ch
=
uifc_getmouse
(
&
mevnt
))
==
0
)
{
if
(
mevnt
.
startx
>=
left
if
(
mevnt
.
startx
>=
left
...
@@ -1713,6 +1736,16 @@ int ugetstr(int left, int top, int width, char *outstr, int max, long mode, int
...
@@ -1713,6 +1736,16 @@ int ugetstr(int left, int top, int width, char *outstr, int max, long mode, int
if
(
i
>
j
)
if
(
i
>
j
)
i
=
j
;
i
=
j
;
}
}
if
(
mevnt
.
startx
>=
left
&&
mevnt
.
startx
<=
left
+
width
&&
(
mevnt
.
event
==
CIOLIB_BUTTON_2_CLICK
||
mevnt
.
event
==
CIOLIB_BUTTON_3_CLICK
))
{
i
=
mevnt
.
startx
-
left
+
soffset
;
if
(
i
>
j
)
i
=
j
;
pastebuf
=
getcliptext
();
pb
=
pastebuf
;
}
}
}
}
}
if
(
lastkey
!=
NULL
)
if
(
lastkey
!=
NULL
)
...
@@ -1791,6 +1824,8 @@ int ugetstr(int left, int top, int width, char *outstr, int max, long mode, int
...
@@ -1791,6 +1824,8 @@ int ugetstr(int left, int top, int width, char *outstr, int max, long mode, int
{
{
cursor
=
_NOCURSOR
;
cursor
=
_NOCURSOR
;
_setcursortype
(
cursor
);
_setcursortype
(
cursor
);
if
(
pastebuf
!=
NULL
)
free
(
pastebuf
);
return
(
-
1
);
return
(
-
1
);
}
}
case
CR
:
case
CR
:
...
@@ -1870,6 +1905,8 @@ int ugetstr(int left, int top, int width, char *outstr, int max, long mode, int
...
@@ -1870,6 +1905,8 @@ int ugetstr(int left, int top, int width, char *outstr, int max, long mode, int
strcpy
(
outstr
,
str
);
strcpy
(
outstr
,
str
);
cursor
=
_NOCURSOR
;
cursor
=
_NOCURSOR
;
_setcursortype
(
cursor
);
_setcursortype
(
cursor
);
if
(
pastebuf
!=
NULL
)
free
(
pastebuf
);
return
(
j
);
return
(
j
);
}
}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment