Add mvderwin function.

This commit is contained in:
blymn 2001-10-08 10:45:13 +00:00
parent 62274f02ea
commit 6a6d2c60ec
4 changed files with 42 additions and 4 deletions

View File

@ -786,6 +786,18 @@ and
should be used to move the cursor position,
so that the routines know what's going on.
.Ds
.Fn mvderwin "WINDOW *win" "int y" "int x"
.De
Moves the subwindow
.Vn win
to the location
.Vn y\*,x ) (
where the location is relative to the top left hand corner of the
parent window. This call will return ERR if
.Vn win
is not a subwindow or if the relocated window would lie outside the
parent window.
.Ds
.Fn mvhline "int y" "int x" "chtype ch" "int count"
.De
Moves the cursor to the position

View File

@ -1,4 +1,4 @@
.\" $NetBSD: curses.3,v 1.32 2001/09/20 11:11:54 blymn Exp $
.\" $NetBSD: curses.3,v 1.33 2001/10/08 10:45:13 blymn Exp $
.\"
.\" Copyright (c) 1985, 1991, 1993
.\" The Regents of the University of California. All rights reserved.
@ -207,6 +207,7 @@ is always ignored.
.It move(y,x) move to (y,x) on
.Em stdscr
.It mvcur(lasty,lastx,newy,newx) actually move cursor
.It mvderwin(win, y, x) move window to (y,x) within parent window.
.It mvgetnstr(str, len) move to
.Em y ,
.Em x

View File

@ -1,4 +1,4 @@
/* $NetBSD: curses.h,v 1.59 2001/09/20 11:11:54 blymn Exp $ */
/* $NetBSD: curses.h,v 1.60 2001/10/08 10:45:13 blymn Exp $ */
/*
* Copyright (c) 1981, 1993, 1994
@ -661,6 +661,7 @@ int leaveok(WINDOW *, bool);
char *longname(void);
int meta(WINDOW *, bool);
int mvcur(int, int, int, int);
int mvderwin(WINDOW *, int, int);
int mvhline(int, int, chtype, int);
int mvprintw(int, int, const char *, ...)
__attribute__((__format__(__printf__, 3, 4)));

View File

@ -1,4 +1,4 @@
/* $NetBSD: mvwin.c,v 1.11 2000/04/15 13:17:04 blymn Exp $ */
/* $NetBSD: mvwin.c,v 1.12 2001/10/08 10:45:13 blymn Exp $ */
/*
* Copyright (c) 1981, 1993, 1994
@ -38,13 +38,37 @@
#if 0
static char sccsid[] = "@(#)mvwin.c 8.2 (Berkeley) 5/4/94";
#else
__RCSID("$NetBSD: mvwin.c,v 1.11 2000/04/15 13:17:04 blymn Exp $");
__RCSID("$NetBSD: mvwin.c,v 1.12 2001/10/08 10:45:13 blymn Exp $");
#endif
#endif /* not lint */
#include "curses.h"
#include "curses_private.h"
/*
* mvderwin --
* Move a derived window.
*
*/
int
mvderwin(WINDOW *win, int dy, int dx)
{
WINDOW *parent;
int x, y;
if (win == NULL)
return ERR;
parent = win->orig;
if (parent == NULL)
return ERR;
x = parent->begx + dx;
y = parent->begy + dy;
return mvwin(win, y, x);
}
/*
* mvwin --
* Relocate the starting position of a window.