From 3c1c87657f9238906f630448749b5d65821cb797 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacobo=20Tarr=C3=ADo?= Date: Fri, 10 Mar 2000 20:46:26 +0000 Subject: [PATCH] Statusline got to work properly on ncurses --- docs/ncurses.txt | 21 ++++++++++++++++----- golded3/geutil.cpp | 11 ++++++----- goldlib/gall/gvidbase.cpp | 3 ++- goldlib/gall/gwinall.h | 2 ++ goldlib/gall/gwinbase.cpp | 28 ++++++++++++++++++++++++++++ 5 files changed, 54 insertions(+), 11 deletions(-) diff --git a/docs/ncurses.txt b/docs/ncurses.txt index 24bab1c..73ee59f 100644 --- a/docs/ncurses.txt +++ b/docs/ncurses.txt @@ -1,8 +1,8 @@ Random remarks about the ncurses support for GoldEd+ - by Jacobo Tarrio, 2:348/102.11@fidonet + by Jacobo Tarrio, 2:345/430.2@fidonet -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 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 "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 -:-) 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 '*'. If you find any bug not listed here, please report to Jacobo Tarrio, -2:348/102.11@fidonet ASAP to get it fixed soon, or, -better, fix it yourself and send me the patch :-) +2:345/430.2@fidonet ASAP to get it fixed soon, or, +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 Known bugs: diff --git a/golded3/geutil.cpp b/golded3/geutil.cpp index fa65d9c..0cb2911 100644 --- a/golded3/geutil.cpp +++ b/golded3/geutil.cpp @@ -56,15 +56,15 @@ void update_statuslines() { if(CFG->switches.get(statuslineclock)) { 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) *help = NUL; else if(CFG->statuslinehelp) - sprintf(help, "%s %c ", LNG->StatusLineHelp, sep); + sprintf(help, "%s ", LNG->StatusLineHelp); 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_name__, __gver_postname__, @@ -74,8 +74,7 @@ void update_statuslines() { __gver_major__, __gver_minor__, __gver_release__, - __gver_postversion__, - sep + __gver_postversion__ ); int len = MAXCOL-strlen(help)-strlen(meminfo)-strlen(clkinfo)-2; @@ -93,6 +92,8 @@ void update_statuslines() { int row, col; vposget(&row, &col); 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); #ifdef GOLD_MOUSE if(gmou.Row() == MAXROW-1) diff --git a/goldlib/gall/gvidbase.cpp b/goldlib/gall/gvidbase.cpp index afbf79e..a959bdb 100644 --- a/goldlib/gall/gvidbase.cpp +++ b/goldlib/gall/gvidbase.cpp @@ -1581,6 +1581,7 @@ void vclrscr(int atr) { #if defined(__USE_NCURSES__) + clearok(stdscr, TRUE); for(int row = 0; row < LINES; row++) mvhline(row, 0, ' ' | gvid_attrcalc(atr), COLS); move(0, 0); @@ -1930,7 +1931,7 @@ void vcurset(int sline, int eline) { if((sline == 0) and (eline == 0)) curs_set(0); - else if((eline - sline) <= 3) + else if((eline - sline) <= 4) curs_set(1); else curs_set(2); diff --git a/goldlib/gall/gwinall.h b/goldlib/gall/gwinall.h index 5a5ce6d..42dbc60 100644 --- a/goldlib/gall/gwinall.h +++ b/goldlib/gall/gwinall.h @@ -4,6 +4,7 @@ // The Goldware Library // Copyright (C) 1990-1999 Odinn Sorensen // Copyright (C) 1999-2000 Alexander S. Aganichev +// Copyright (C) 2000 Jacobo Tarrio // ------------------------------------------------------------------ // This library is free software; you can redistribute it and/or // 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 wunlink (int w); 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 wwprintstr (int whandle, int wrow, int wcol, int attr, const char* str); diff --git a/goldlib/gall/gwinbase.cpp b/goldlib/gall/gwinbase.cpp index 5a437e6..15dcf9f 100644 --- a/goldlib/gall/gwinbase.cpp +++ b/goldlib/gall/gwinbase.cpp @@ -4,6 +4,7 @@ // The Goldware Library // Copyright (C) 1990-1999 Odinn Sorensen // Copyright (C) 1999-2000 Alexander S. Aganichev +// Copyright (C) 2000 Jacobo Tarrio // ------------------------------------------------------------------ // This library is free software; you can redistribute it and/or // 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; +} // ------------------------------------------------------------------