]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/base/lib_slkrefr.c
ncurses 5.0
[ncurses.git] / ncurses / base / lib_slkrefr.c
similarity index 90%
rename from ncurses/lib_slkrefr.c
rename to ncurses/base/lib_slkrefr.c
index dcdef99a2e1b4d1d045b17df2d5e97ab90438398..ee3c91dbee6710d6faeeee0bbdedbe88e46d35d4 100644 (file)
@@ -38,7 +38,7 @@
 #include <curses.priv.h>
 #include <term.h>        /* num_labels, label_*, plab_norm */
 
-MODULE_ID("$Id: lib_slkrefr.c,v 1.4 1998/02/11 12:13:56 tom Exp $")
+MODULE_ID("$Id: lib_slkrefr.c,v 1.8 1999/03/14 00:10:27 Alexander.V.Lukyanov Exp $")
 
 /*
  * Write the soft labels to the soft-key window.
@@ -47,24 +47,25 @@ static void
 slk_intern_refresh(SLK *slk)
 {
 int i;
+int fmt = SP->slk_format;
+
        for (i = 0; i < slk->labcnt; i++) {
                if (slk->dirty || slk->ent[i].dirty) {
                        if (slk->ent[i].visible) {
-#ifdef num_labels
-                               if (num_labels > 0 && SLK_STDFMT)
+                               if (num_labels > 0 && SLK_STDFMT(fmt))
                                {
                                  if (i < num_labels) {
                                    TPUTS_TRACE("plab_norm");
-                                   putp(tparm(plab_norm, i, slk->win,slk->ent[i].form_text));
+                                   putp(tparm(plab_norm, i+1, slk->ent[i].form_text));
                                  }
                                }
                                else
-#endif /* num_labels */
                                {
-                                       wmove(slk->win,SLK_LINES-1,slk->ent[i].x);
+                                       wmove(slk->win,SLK_LINES(fmt)-1,slk->ent[i].x);
                                        if (SP && SP->_slk)
                                          wattrset(slk->win,SP->_slk->attr);
-                                       waddnstr(slk->win,slk->ent[i].form_text, MAX_SKEY_LEN);
+                                       waddnstr(slk->win,slk->ent[i].form_text,
+                                                MAX_SKEY_LEN(fmt));
                                        /* if we simulate SLK's, it's looking much more
                                           natural to use the current ATTRIBUTE also
                                           for the label window */
@@ -76,8 +77,7 @@ int i;
        }
        slk->dirty = FALSE;
 
-#ifdef num_labels
-       if (num_labels > 0)
+       if (num_labels > 0) {
            if (slk->hidden)
            {
                TPUTS_TRACE("label_off");
@@ -88,7 +88,7 @@ int i;
                TPUTS_TRACE("label_on");
                putp(label_on);
            }
-#endif /* num_labels */
+       }
 }
 
 /*