Subversion Repositories SvarDOS

Rev

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

Rev 1324 Rev 1325
Line 179... Line 179...
179
 
179
 
180
 
180
 
181
static void ui_help(unsigned char screenw) {
181
static void ui_help(unsigned char screenw) {
182
#define MAXLINLEN 35
182
#define MAXLINLEN 35
183
  unsigned short i, offset;
183
  unsigned short i, offset;
184
  offset = (screenw - MAXLINLEN + 1) >> 1;
184
  offset = (screenw - MAXLINLEN + 2) >> 1;
185
  mdr_cout_cursor_hide();
185
  mdr_cout_cursor_hide();
186
  for (i = 2; i <= 12; i++) {
186
  for (i = 2; i <= 15; i++) {
187
    mdr_cout_char_rep(i, offset - 2, ' ', scheme[COL_STATUSBAR1], MAXLINLEN);
187
    mdr_cout_char_rep(i, offset - 2, ' ', scheme[COL_STATUSBAR1], MAXLINLEN + 2);
188
  }
188
  }
189
 
189
 
190
  mdr_cout_str(3, offset, svarlang_str(0, 0), scheme[COL_STATUSBAR1], MAXLINLEN);
190
  mdr_cout_str(3, offset, svarlang_str(0, 0), scheme[COL_STATUSBAR1], MAXLINLEN);
191
  for (i = 0; i <= 2; i++) {
191
  for (i = 0; i <= 4; i++) {
192
    mdr_cout_str(5 + i, offset, svarlang_str(8, i), scheme[COL_STATUSBAR1], MAXLINLEN);
192
    mdr_cout_str(5 + i, offset, svarlang_str(8, i), scheme[COL_STATUSBAR1], MAXLINLEN);
193
  }
193
  }
194
  mdr_cout_str(9, offset, svarlang_str(8, 10), scheme[COL_STATUSBAR1], MAXLINLEN);
194
  mdr_cout_str(5 + 1 + i, offset, svarlang_str(8, 10), scheme[COL_STATUSBAR1], MAXLINLEN);
-
 
195
 
-
 
196
  /* Press any key */
195
  mdr_cout_str(11, offset, svarlang_str(8, 11), scheme[COL_STATUSBAR1], MAXLINLEN);
197
  mdr_cout_str(14, offset, svarlang_str(8, 11), scheme[COL_STATUSBAR1], MAXLINLEN);
196
 
198
 
197
  keyb_getkey();
199
  keyb_getkey();
198
  mdr_cout_cursor_show();
200
  mdr_cout_cursor_show();
199
#undef MAXLINLEN
201
#undef MAXLINLEN
200
}
202
}
Line 694... Line 696...
694
 
696
 
695
    } else if (k == 0x144) { /* F10 */
697
    } else if (k == 0x144) { /* F10 */
696
      db->lfonly ^= 1;
698
      db->lfonly ^= 1;
697
      ui_basic(screenw, screenh, db);
699
      ui_basic(screenw, screenh, db);
698
 
700
 
-
 
701
    } else if (k == 0x174) { /* CTRL+ArrRight - jump to next word */
-
 
702
      /* if currently cursor is on a non-space, then fast-forward to nearest space or EOL */
-
 
703
      for (;;) {
-
 
704
        if (db->xoffset + db->cursorposx == db->cursor->len) break;
-
 
705
        if (db->cursor->payload[db->xoffset + db->cursorposx] == ' ') break;
-
 
706
        cursor_right(db, screenw, screenh, &uidirtyfrom, &uidirtyto);
-
 
707
      }
-
 
708
      /* now skip to next non-space or end of file */
-
 
709
      for (;;) {
-
 
710
        cursor_right(db, screenw, screenh, &uidirtyfrom, &uidirtyto);
-
 
711
        if (db->cursor->payload[db->xoffset + db->cursorposx] != ' ') break;
-
 
712
        if ((db->cursor->next == NULL) && (db->cursorposx + db->xoffset == db->cursor->len)) break;
-
 
713
      }
-
 
714
 
-
 
715
    } else if (k == 0x173) { /* CTRL+ArrLeft - jump to prev word */
-
 
716
      cursor_left(db, screenw, &uidirtyfrom, &uidirtyto);
-
 
717
      /* if currently cursor is on a space, then fast-forward to nearest non-space or start of line */
-
 
718
      for (;;) {
-
 
719
        if ((db->xoffset == 0) && (db->cursorposx == 0)) break;
-
 
720
        if (db->cursor->payload[db->xoffset + db->cursorposx] != ' ') break;
-
 
721
        cursor_left(db, screenw, &uidirtyfrom, &uidirtyto);
-
 
722
      }
-
 
723
      /* now skip to next space or start of file */
-
 
724
      for (;;) {
-
 
725
        cursor_left(db, screenw, &uidirtyfrom, &uidirtyto);
-
 
726
        if (db->cursor->payload[db->xoffset + db->cursorposx] == ' ') {
-
 
727
          cursor_right(db, screenw, screenh, &uidirtyfrom, &uidirtyto);
-
 
728
          break;
-
 
729
        }
-
 
730
        if ((db->cursorposx == 0) && (db->xoffset == 0)) break;
-
 
731
      }
-
 
732
 
699
    } else { /* UNHANDLED KEY - TODO IGNORE THIS IN PRODUCTION RELEASE */
733
    } else { /* UNHANDLED KEY - TODO IGNORE THIS IN PRODUCTION RELEASE */
700
      char buff[4];
734
      char buff[4];
701
      const char *HEX = "0123456789ABCDEF";
735
      const char *HEX = "0123456789ABCDEF";
702
      buff[0] = HEX[(k >> 8) & 15];
736
      buff[0] = HEX[(k >> 8) & 15];
703
      buff[1] = HEX[(k >> 4) & 15];
737
      buff[1] = HEX[(k >> 4) & 15];