Subversion Repositories SvarDOS

Rev

Rev 1439 | Rev 1441 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1439 Rev 1440
Line 217... Line 217...
217
 
217
 
218
 
218
 
219
static void ui_statusbar(const struct file *db, unsigned char slotnum) {
219
static void ui_statusbar(const struct file *db, unsigned char slotnum) {
220
  const char *s = svarlang_strid(0); /* ESC=MENU */
220
  const char *s = svarlang_strid(0); /* ESC=MENU */
221
  unsigned short helpcol = screenw - strlen(s);
221
  unsigned short helpcol = screenw - strlen(s);
222
  unsigned short maxfnlen = helpcol - 14;
222
  unsigned short col;
223
 
223
 
224
  /* slot number (guaranteed to be 0-9) */
224
  /* slot number (guaranteed to be 0-9) */
225
  {
225
  {
226
    char slot[4] = "#00";
226
    char slot[4] = "#00";
227
    if (slotnum == 9) {
227
    if (slotnum == 9) {
Line 234... Line 234...
234
  }
234
  }
235
 
235
 
236
  /* fill rest of status bar with background */
236
  /* fill rest of status bar with background */
237
  mdr_cout_char_rep(screenlastrow, 3, ' ', SCHEME_STBAR1, helpcol - 3);
237
  mdr_cout_char_rep(screenlastrow, 3, ' ', SCHEME_STBAR1, helpcol - 3);
238
 
238
 
239
  /* filename and modflag */
-
 
240
  {
-
 
241
    const char *fn;
-
 
242
    unsigned short x;
-
 
243
    if (db->fname[0] == 0) {
-
 
244
      fn = svarlang_str(0, 1); /* "UNTITLED" */
-
 
245
    } else {
-
 
246
      /* display filename up to maxfnlen chars */
-
 
247
      fn = db->fname;
-
 
248
      x = strlen(fn);
-
 
249
      if (x > maxfnlen) fn += x - maxfnlen;
-
 
250
    }
-
 
251
    x = mdr_cout_str(screenlastrow, 4, fn, SCHEME_STBAR1, maxfnlen);
-
 
252
    if (db->modflag) mdr_cout_char(screenlastrow, 5 + x, '!', SCHEME_STBAR2);
-
 
253
  }
-
 
254
 
-
 
255
  /* eol type */
239
  /* eol type */
256
  {
240
  {
257
    const char *eoltype = "CRLF";
241
    const char *eoltype = "CRLF";
258
    if (db->lfonly) eoltype += 2;
242
    if (db->lfonly) eoltype += 2;
259
    mdr_cout_str(screenlastrow, helpcol - 6, eoltype, SCHEME_STBAR1, 5);
243
    mdr_cout_str(screenlastrow, helpcol - 5, eoltype, SCHEME_STBAR1, 5);
260
  }
244
  }
261
 
245
 
262
  /* line numbers */
246
  /* line numbers */
263
  {
247
  {
264
    unsigned short x;
248
    unsigned short x;
265
    unsigned char count = 0;
249
    unsigned char count = 0;
266
    unsigned short col = helpcol - 9;
250
    col = helpcol - 7;
267
 
251
 
268
    x = db->totlines;
252
    x = db->totlines;
269
    AGAIN:
253
    AGAIN:
270
    do {
254
    do {
271
      mdr_cout_char(screenlastrow, col--, '0' + (x % 10), SCHEME_STBAR1);
255
      mdr_cout_char(screenlastrow, col--, '0' + (x % 10), SCHEME_STBAR1);
Line 276... Line 260...
276
      count = 1;
260
      count = 1;
277
      mdr_cout_char(screenlastrow, col--, '/', SCHEME_STBAR1);
261
      mdr_cout_char(screenlastrow, col--, '/', SCHEME_STBAR1);
278
      x = 1 + db->curline;
262
      x = 1 + db->curline;
279
      goto AGAIN;
263
      goto AGAIN;
280
    }
264
    }
-
 
265
  }
281
 
266
 
-
 
267
  /* filename and modflag */
-
 
268
  {
-
 
269
    const char *fn;
-
 
270
    unsigned short x;
-
 
271
    unsigned short maxfnlen = col - 6;
-
 
272
    if (db->fname[0] == 0) {
-
 
273
      fn = svarlang_str(0, 1); /* "UNTITLED" */
-
 
274
    } else {
-
 
275
      /* display filename up to maxfnlen chars */
-
 
276
      fn = db->fname;
-
 
277
      x = strlen(fn);
-
 
278
      if (x > maxfnlen) fn += x - maxfnlen;
-
 
279
    }
-
 
280
    x = mdr_cout_str(screenlastrow, 4, fn, SCHEME_STBAR1, maxfnlen);
-
 
281
    if (db->modflag) mdr_cout_char(screenlastrow, 5 + x, '!', SCHEME_STBAR2);
282
  }
282
  }
283
 
283
 
284
  mdr_cout_str(screenlastrow, helpcol, s, SCHEME_STBAR2, 40);
284
  mdr_cout_str(screenlastrow, helpcol, s, SCHEME_STBAR2, 40);
285
}
285
}
286
 
286