mirror of
https://github.com/yourtion/30dayMakeOS.git
synced 2026-02-05 11:03:22 +08:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9299bf0a55 |
@@ -4,6 +4,7 @@
|
||||
#include <stdio.h>
|
||||
|
||||
void make_window8(unsigned char *buf, int xsize, int ysize, char *title, char act);
|
||||
void make_wtitle8(unsigned char *buf, int xsize, char *title, char act);
|
||||
void putfonts8_asc_sht(struct SHEET *sht, int x, int y, int c, int b, char *s, int l);
|
||||
void make_textbox8(struct SHEET *sht, int x0, int y0, int sx, int sy, int c);
|
||||
void console_task(struct SHEET *sheet);
|
||||
@@ -31,6 +32,7 @@ void HariMain(void)
|
||||
struct SHEET *sht_back, *sht_mouse, *sht_win, *sht_cons;
|
||||
struct TASK *task_a, *task_cons;
|
||||
struct TIMER *timer;
|
||||
int key_to = 0;
|
||||
|
||||
init_gdtidt();
|
||||
init_pic();
|
||||
@@ -134,7 +136,20 @@ void HariMain(void)
|
||||
putfonts8_asc_sht(sht_win, cursor_x, 28, COL8_000000, COL8_FFFFFF, " ", 1);
|
||||
cursor_x -= 8;
|
||||
}
|
||||
/* 光标再显示 */
|
||||
if (i == 256 + 0x0f) { /* Tab键*/
|
||||
if (key_to == 0) {
|
||||
key_to = 1;
|
||||
make_wtitle8(buf_win, sht_win->bxsize, "task_a", 0);
|
||||
make_wtitle8(buf_cons, sht_cons->bxsize, "console", 1);
|
||||
} else {
|
||||
key_to = 0;
|
||||
make_wtitle8(buf_win, sht_win->bxsize, "task_a", 1);
|
||||
make_wtitle8(buf_cons, sht_cons->bxsize, "console", 0);
|
||||
}
|
||||
sheet_refresh(sht_win, 0, 0, sht_win->bxsize, 21);
|
||||
sheet_refresh(sht_cons, 0, 0, sht_cons->bxsize, 21);
|
||||
}
|
||||
/*重新显示光标*/
|
||||
boxfill8(sht_win->buf, sht_win->bxsize, cursor_c, cursor_x, 28, cursor_x + 7, 43);
|
||||
sheet_refresh(sht_win, cursor_x, 28, cursor_x + 8, 44);
|
||||
} else if (512 <= i && i <= 767) { /* 鼠标数据*/
|
||||
@@ -190,6 +205,21 @@ void HariMain(void)
|
||||
}
|
||||
|
||||
void make_window8(unsigned char *buf, int xsize, int ysize, char *title, char act)
|
||||
{
|
||||
boxfill8(buf, xsize, COL8_C6C6C6, 0, 0, xsize - 1, 0 );
|
||||
boxfill8(buf, xsize, COL8_FFFFFF, 1, 1, xsize - 2, 1 );
|
||||
boxfill8(buf, xsize, COL8_C6C6C6, 0, 0, 0, ysize - 1);
|
||||
boxfill8(buf, xsize, COL8_FFFFFF, 1, 1, 1, ysize - 2);
|
||||
boxfill8(buf, xsize, COL8_848484, xsize - 2, 1, xsize - 2, ysize - 2);
|
||||
boxfill8(buf, xsize, COL8_000000, xsize - 1, 0, xsize - 1, ysize - 1);
|
||||
boxfill8(buf, xsize, COL8_C6C6C6, 2, 2, xsize - 3, ysize - 3);
|
||||
boxfill8(buf, xsize, COL8_848484, 1, ysize - 2, xsize - 2, ysize - 2);
|
||||
boxfill8(buf, xsize, COL8_000000, 0, ysize - 1, xsize - 1, ysize - 1);
|
||||
make_wtitle8(buf, xsize, title, act);
|
||||
return;
|
||||
}
|
||||
|
||||
void make_wtitle8(unsigned char *buf, int xsize, char *title, char act)
|
||||
{
|
||||
static char closebtn[14][16] = {
|
||||
"OOOOOOOOOOOOOOO@",
|
||||
@@ -216,16 +246,7 @@ void make_window8(unsigned char *buf, int xsize, int ysize, char *title, char ac
|
||||
tc = COL8_C6C6C6;
|
||||
tbc = COL8_848484;
|
||||
}
|
||||
boxfill8(buf, xsize, COL8_C6C6C6, 0, 0, xsize - 1, 0 );
|
||||
boxfill8(buf, xsize, COL8_FFFFFF, 1, 1, xsize - 2, 1 );
|
||||
boxfill8(buf, xsize, COL8_C6C6C6, 0, 0, 0, ysize - 1);
|
||||
boxfill8(buf, xsize, COL8_FFFFFF, 1, 1, 1, ysize - 2);
|
||||
boxfill8(buf, xsize, COL8_848484, xsize - 2, 1, xsize - 2, ysize - 2);
|
||||
boxfill8(buf, xsize, COL8_000000, xsize - 1, 0, xsize - 1, ysize - 1);
|
||||
boxfill8(buf, xsize, COL8_C6C6C6, 2, 2, xsize - 3, ysize - 3);
|
||||
boxfill8(buf, xsize, tbc, 3, 3, xsize - 4, 20 );
|
||||
boxfill8(buf, xsize, COL8_848484, 1, ysize - 2, xsize - 2, ysize - 2);
|
||||
boxfill8(buf, xsize, COL8_000000, 0, ysize - 1, xsize - 1, ysize - 1);
|
||||
boxfill8(buf, xsize, tbc, 3, 3, xsize - 4, 20);
|
||||
putfonts8_asc(buf, xsize, 24, 4, tc, title);
|
||||
for (y = 0; y < 14; y++) {
|
||||
for (x = 0; x < 16; x++) {
|
||||
|
||||
Reference in New Issue
Block a user