First attempt of doing a pre-embarqued usuable menu

This commit is contained in:
Nemh 2015-02-10 00:46:38 +01:00
parent 42bb534499
commit 94deef878a
2 changed files with 14 additions and 9 deletions

View File

@ -9,15 +9,15 @@ Height=7095
Width=9090
State=0
Flags=00000020
Setting=32:1:console.c
Setting=16:45:console.c
OptionA=0
[_2]
Type=1
Order=3
Order=2
Top=0
Left=13035
Height=4785
Height=4800
Width=5490
State=0
Flags=00000001
@ -26,7 +26,7 @@ OptionB=15
[_3]
Type=6
Order=2
Order=3
Top=4770
Left=13035
Height=6345
@ -153,7 +153,7 @@ Top=7515
Left=3045
Height=9570
Width=24855
State=1
State=0
Flags=00000020
OptionA=0

View File

@ -465,8 +465,8 @@ int Console_GetKey()
if (key == KEY_CHAR_DIV) return Console_Input((const unsigned char *)"/");
if (key == KEY_CHAR_RBRACE) return Console_Input((const unsigned char *)"}");
if (key == KEY_CHAR_FRAC) return Console_Input((const unsigned char *)"/");
if (key == KEY_CTRL_MIXEDFRAC) return Console_Input((const unsigned char *)"float(");
if (key == KEY_CTRL_FD) return Console_Input((const unsigned char *)"simplify(");
if (key == KEY_CTRL_MIXEDFRAC) return Console_Input((const unsigned char *)"simplify(");
if (key == KEY_CTRL_FD) return Console_Input((const unsigned char *)"float");
if (key == KEY_CTRL_FRACCNVRT) return Console_Input((const unsigned char *)"factor(");
if (key == KEY_CHAR_LPAR) return Console_Input((const unsigned char *)"(");
if (key == KEY_CHAR_RPAR) return Console_Input((const unsigned char *)")");
@ -516,6 +516,8 @@ int Console_GetKey()
return CONSOLE_SUCCEEDED;
}
//if (key == KEY_CTRL_INS) return Console_Init();
if (key == KEY_CTRL_EXE)
{
if (Current_Line == Last_Line)
@ -548,7 +550,9 @@ int Console_GetKey()
int Console_FMenu(int key)
{
return Console_Draw_FMenu(key, &FMenu_entries[key-KEY_CTRL_F1]);
if(FMenu_entries[key-KEY_CTRL_F1].count > 0)
return Console_Draw_FMenu(key, &FMenu_entries[key-KEY_CTRL_F1]);
else return 0;
}
unsigned char *Console_Make_Entry(const unsigned char* str)
@ -671,7 +675,8 @@ void Console_FMenu_Init()
// Does the file exists ?
// Todo : check the error codes...
if(!cfg) {
unsigned char conf_standard[] = {"F2 trig\ncos(\nsin(\ntan(\nF1\ntest(\ntest(\nF4\nje(\nsuis(\nvivant(\nF5\nabdibol(\ngeorges(\ngali(\npom(\npom(\nde(\natol(\nF6\nreturn(\nsolve(\nF3\nsolve(\nfactor(\nsimplify(\nmatrix(\nd("};
unsigned char conf_standard[] = {"F3 cplx\narg(\nconj(\nimag(\nmag(\npolar(\nreal(\nrect(\nF4 calc\nd(\neval(\nintegral(\ntaylor(\nF5 poly\ncoeff(\ndeg(\nexpand(\nfactor(\nroots\nnroots\nF6 misc\nf(\ny\nsimplify("};
//unsigned char conf_standard[] = {"F2 trig\ncos(\nsin(\ntan(\nF1\ntest(\ntest(\nF4\nje(\nsuis(\nvivant(\nF5\nabdibol(\ngeorges(\ngali(\npom(\npom(\nde(\natol(\nF6\nreturn(\nsolve(\nF3\nsolve(\nfactor(\nsimplify(\nmatrix(\nd("};
memory_createfile("\\\\fls0\\FMENU.cfg", strlen(conf_standard)+1);
handle = memory_openfile("\\\\fls0\\FMENU.cfg", _OPENMODE_READWRITE);
memory_writefile(handle, conf_standard, strlen(conf_standard)+1);