Statusline got to work properly on ncurses

This commit is contained in:
Jacobo Tarrío 2000-03-10 20:46:26 +00:00
parent 69b146f956
commit 3c1c87657f
5 changed files with 54 additions and 11 deletions

View File

@ -1,8 +1,8 @@
Random remarks about the ncurses support for GoldEd+ Random remarks about the ncurses support for GoldEd+
by Jacobo Tarrio, 2:348/102.11@fidonet <jtarrio@iname.com> by Jacobo Tarrio, 2:345/430.2@fidonet <jtarrio@iname.com>
This version of GoldEd+ bears the third public release of the ncurses This version of GoldEd+ bears the fourth public release of the ncurses
implementation of its video code; it's still considered beta, so expect some implementation of its video code; it's still considered beta, so expect some
strange behaviour while it is being completed. strange behaviour while it is being completed.
@ -17,12 +17,23 @@ compiled for DOS, Win32 or OS/2, and linked with PDCurses.
This file tries to list some already known bugs along with other nasty This file tries to list some already known bugs along with other nasty
"features" of the code. Expect most of these bugs to disappear and a lot of "features" of the code. Expect most of these bugs to disappear and a lot of
fresh new ones to show up in the next public release of the ncurses support fresh new ones to show up in the next public release of the ncurses support
:-) However, I do not always succeed, so old, already existing bugs are :-) However, I do not always succeed, so, old, already existing bugs are
marked with '!', whilst new ones are marked with '*'. marked with '!', whilst new ones are marked with '*'.
If you find any bug not listed here, please report to Jacobo Tarrio, If you find any bug not listed here, please report to Jacobo Tarrio,
2:348/102.11@fidonet <jtarrio@iname.com> ASAP to get it fixed soon, or, 2:345/430.2@fidonet <jtarrio@iname.com> ASAP to get it fixed soon, or,
better, fix it yourself and send me the patch :-) even better, fix it yourself and send me the patch :-)
=== 2000-03-05: Fourth public release
Known bugs:
! Screen may become corrupted if someone other than GoldEd+ writes on the
terminal
! Messages from the program viewed before entering full-screen are not
displayed properly
! The cursor grows very big every 30 seconds when editing a message
(possible reincarnation of a similar bug in former versions)
=== 2000-02-17: Third public release === 2000-02-17: Third public release
Known bugs: Known bugs:

View File

@ -56,15 +56,15 @@ void update_statuslines() {
if(CFG->switches.get(statuslineclock)) { if(CFG->switches.get(statuslineclock)) {
time_t t = time(NULL); time_t t = time(NULL);
sprintf(clkinfo, " %c %s", sep, strftimei(help, 40, LNG->StatusLineTimeFmt, localtime(&t))); sprintf(clkinfo, " %s", strftimei(help, 40, LNG->StatusLineTimeFmt, localtime(&t)));
} }
if(CFG->statuslinehelp == -1) if(CFG->statuslinehelp == -1)
*help = NUL; *help = NUL;
else if(CFG->statuslinehelp) else if(CFG->statuslinehelp)
sprintf(help, "%s %c ", LNG->StatusLineHelp, sep); sprintf(help, "%s ", LNG->StatusLineHelp);
else else
sprintf(help, "%s%s%s%s%c%s%i.%i.%i%s %c ", sprintf(help, "%s%s%s%s%c%s%i.%i.%i%s ",
__gver_prename__, __gver_prename__,
__gver_name__, __gver_name__,
__gver_postname__, __gver_postname__,
@ -74,8 +74,7 @@ void update_statuslines() {
__gver_major__, __gver_major__,
__gver_minor__, __gver_minor__,
__gver_release__, __gver_release__,
__gver_postversion__, __gver_postversion__
sep
); );
int len = MAXCOL-strlen(help)-strlen(meminfo)-strlen(clkinfo)-2; int len = MAXCOL-strlen(help)-strlen(meminfo)-strlen(clkinfo)-2;
@ -93,6 +92,8 @@ void update_statuslines() {
int row, col; int row, col;
vposget(&row, &col); vposget(&row, &col);
wwprintstr(W_STAT, 0,0, C_STATW, buf); wwprintstr(W_STAT, 0,0, C_STATW, buf);
wwprintc(W_STAT, 0,strlen(help)-1, C_STATW, sep);
wwprintc(W_STAT, 0,MAXCOL-strlen(clkinfo), C_STATW, sep);
vposset(row, col); vposset(row, col);
#ifdef GOLD_MOUSE #ifdef GOLD_MOUSE
if(gmou.Row() == MAXROW-1) if(gmou.Row() == MAXROW-1)

View File

@ -1581,6 +1581,7 @@ void vclrscr(int atr) {
#if defined(__USE_NCURSES__) #if defined(__USE_NCURSES__)
clearok(stdscr, TRUE);
for(int row = 0; row < LINES; row++) for(int row = 0; row < LINES; row++)
mvhline(row, 0, ' ' | gvid_attrcalc(atr), COLS); mvhline(row, 0, ' ' | gvid_attrcalc(atr), COLS);
move(0, 0); move(0, 0);
@ -1930,7 +1931,7 @@ void vcurset(int sline, int eline) {
if((sline == 0) and (eline == 0)) if((sline == 0) and (eline == 0))
curs_set(0); curs_set(0);
else if((eline - sline) <= 3) else if((eline - sline) <= 4)
curs_set(1); curs_set(1);
else else
curs_set(2); curs_set(2);

View File

@ -4,6 +4,7 @@
// The Goldware Library // The Goldware Library
// Copyright (C) 1990-1999 Odinn Sorensen // Copyright (C) 1990-1999 Odinn Sorensen
// Copyright (C) 1999-2000 Alexander S. Aganichev // Copyright (C) 1999-2000 Alexander S. Aganichev
// Copyright (C) 2000 Jacobo Tarrio
// ------------------------------------------------------------------ // ------------------------------------------------------------------
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public // modify it under the terms of the GNU Library General Public
@ -395,6 +396,7 @@ int wtitle (const char* str, int tpos, int tattr);
int wunhide (int whandle); int wunhide (int whandle);
int wunlink (int w); int wunlink (int w);
int wvline (int wsrow, int wscol, int count, int btype, int attr); int wvline (int wsrow, int wscol, int count, int btype, int attr);
int wwprintc (int whandle, int wrow, int wcol, int attr, const vchar chr);
int wwprints (int whandle, int wrow, int wcol, int attr, const char* str); int wwprints (int whandle, int wrow, int wcol, int attr, const char* str);
int wwprintstr (int whandle, int wrow, int wcol, int attr, const char* str); int wwprintstr (int whandle, int wrow, int wcol, int attr, const char* str);

View File

@ -4,6 +4,7 @@
// The Goldware Library // The Goldware Library
// Copyright (C) 1990-1999 Odinn Sorensen // Copyright (C) 1990-1999 Odinn Sorensen
// Copyright (C) 1999-2000 Alexander S. Aganichev // Copyright (C) 1999-2000 Alexander S. Aganichev
// Copyright (C) 2000 Jacobo Tarrio
// ------------------------------------------------------------------ // ------------------------------------------------------------------
// This library is free software; you can redistribute it and/or // This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Library General Public // modify it under the terms of the GNU Library General Public
@ -1581,6 +1582,33 @@ static void update_buffers(vatch* pcurr, int shadow) {
} }
} }
// ------------------------------------------------------------------
int wwprintc(int whandle, int wrow, int wcol, int attr, const vchar chr) {
// check for existance of active window or hidden windows
if(!gwin.total and gwin.hidden==NULL)
return gwin.werrno=W_NOACTIVE;
// find address of window's record
_wrec_t* found = wfindrec(whandle);
if(found==NULL) {
found = gwin.hidden;
while(found) {
if(whandle==found->whandle)
break;
found = found->prev;
}
if(found==NULL)
return gwin.werrno=W_NOTFOUND;
}
// display character
vputc(found->srow+wrow+found->border, found->scol+wcol+found->border, attr, chr);
// return to caller
return gwin.werrno = W_NOERROR;
}
// ------------------------------------------------------------------ // ------------------------------------------------------------------