Some code cleaning.
This commit is contained in:
parent
ed41590d34
commit
38439b69ba
19
console.c
19
console.c
|
@ -455,8 +455,10 @@ int Console_NewLine(int pre_line_type, int pre_line_readonly)
|
|||
if (TeX_isTeX((char*)Edit_Line)) Line[Last_Line].tex_flag = 1;
|
||||
if (Line[Last_Line].type == LINE_TYPE_OUTPUT && Line[Last_Line].tex_flag) TeX_sizeComplex ((char*)Edit_Line, &(Line[Last_Line].tex_width), &(Line[Last_Line].tex_height), NULL);
|
||||
else Line[Last_Line].tex_flag = 0;
|
||||
|
||||
//½«Edit_LineµÄÄÚÈÝ¿½±´¸ø×îºóÒ»ÐС£
|
||||
//Edit_Line copy the contents to the last line.
|
||||
|
||||
#ifdef POPUP_PRETTY
|
||||
if(Line[Last_Line].tex_flag) {
|
||||
if ((Line[Last_Line].str = (unsigned char *)malloc(strlen(POPUP_PRETTY_STR) + 1)) == NULL) return CONSOLE_MEM_ERR;
|
||||
|
@ -472,6 +474,7 @@ int Console_NewLine(int pre_line_type, int pre_line_readonly)
|
|||
if ((Line[Last_Line].str = (unsigned char *)malloc(strlen((const char *)Edit_Line) + 1)) == NULL) return CONSOLE_MEM_ERR;
|
||||
strcpy((char *)Line[Last_Line].str, (const char *)Edit_Line);
|
||||
#endif
|
||||
|
||||
if ((Line[Last_Line].disp_len = Console_GetDispLen(Line[Last_Line].str)) == CONSOLE_ARG_ERR) return CONSOLE_ARG_ERR;
|
||||
Line[Last_Line].type = pre_line_type;
|
||||
Line[Last_Line].readonly = pre_line_readonly;
|
||||
|
@ -849,7 +852,6 @@ void Console_FMenu_Init()
|
|||
// Todo : check the error codes...
|
||||
if(!cfg) {
|
||||
unsigned char conf_standard[] = {"F1 alge\nabs(\ndet(\nadj(\nunit(\nF2 trig\ncosh(\narccosh(\nsinh(\narcsinh(\ntanh(\narctanh(\nF3 cplx\narg(\nconj(\nimag(\nmag(\npolar(\nreal(\nrect(\nF4 calc\nd(\neval(\nintegral(\ntaylor(\nsum(\nsimplify(\nF5 poly\ncoeff(\nquotient(\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((char*)conf_standard)+1);
|
||||
handle = memory_openfile("\\\\fls0\\FMENU.cfg", _OPENMODE_READWRITE);
|
||||
memory_writefile(handle, conf_standard, strlen((char*)conf_standard)+1);
|
||||
|
@ -935,8 +937,8 @@ int Console_Disp()
|
|||
{
|
||||
Cursor_SetFlashMode(0);
|
||||
if(Line[i+Start_Line].tex_flag) {
|
||||
locate(COL_DISP_MAX - strlen("Pretty print"),i+1);
|
||||
PrintRev((unsigned char*)"Pretty print");
|
||||
locate(COL_DISP_MAX - strlen(POPUP_PRETTY_STR) + 1,i+1);
|
||||
PrintRev((unsigned char*)POPUP_PRETTY_STR);
|
||||
}
|
||||
else {
|
||||
PrintRev(Line[i + Start_Line].str);
|
||||
|
@ -1014,8 +1016,8 @@ int Console_Disp()
|
|||
else
|
||||
{
|
||||
if(Line[i+Start_Line].tex_flag) {
|
||||
locate(COL_DISP_MAX - strlen("Pretty print"),i+1);
|
||||
Print((unsigned char*)"Pretty print");
|
||||
locate(COL_DISP_MAX - strlen(POPUP_PRETTY_STR) + 1, i + 1);
|
||||
Print((unsigned char*)POPUP_PRETTY_STR);
|
||||
}
|
||||
else {
|
||||
locate(COL_DISP_MAX - Line[i + Start_Line].disp_len + 1, i + 1);
|
||||
|
@ -1036,8 +1038,8 @@ int Console_Disp()
|
|||
}
|
||||
}
|
||||
}
|
||||
//Draw the "fkeys icons"
|
||||
|
||||
//Draw the "fkeys icons"
|
||||
for(i=0; i<6; i++) {
|
||||
ficon.bottom = 64;
|
||||
ficon.top = 64-8;
|
||||
|
@ -1047,9 +1049,7 @@ int Console_Disp()
|
|||
Bdisp_AreaClr_VRAM(&ficon);
|
||||
Bdisp_AreaReverseVRAM(ficon.left, ficon.top, ficon.right, ficon.bottom);
|
||||
memcpy(temp_fkey, FMenu_entries_name+i*FMENU_TITLE_LENGHT, FMENU_TITLE_LENGHT*sizeof(char));
|
||||
//if(FMenu_entries[i].name != NULL) {
|
||||
PrintMini(ficon.left + 2, ficon.top +2, (unsigned char*)temp_fkey, MINI_REV);
|
||||
//}
|
||||
PrintMini(ficon.left + 2, ficon.top +2, (unsigned char*)temp_fkey, MINI_REV);
|
||||
memset(temp_fkey, '\0', FMENU_TITLE_LENGHT*sizeof(char));
|
||||
}
|
||||
}
|
||||
|
@ -1084,6 +1084,7 @@ void Console_Draw_TeX_Popup(unsigned char* str, int width, int height)
|
|||
GetKey(&key);
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
ÒÔϺ¯ÊýÓÃÓÚÊäÈëÐУ¬³É¹¦ºó½«·µ»Ø¸ÃÐеÄ×Ö·û´®¡£
|
||||
*/
|
||||
|
|
Loading…
Reference in New Issue