est il possible de creer une fonction en C avec un paramètre prédefini à la fin:
void CenterStrX(short y, const char *str, short Attr, int underline=NULL)
{
switch(underline)
{
case 1:
DrawLine((160-DrawStrWidth(str, FontGetSys()))/2, FontGetSys()*2+6+y, (160-DrawStrWidth(str, FontGetSys()))/2+DrawStrWidth(str, FontGetSys()), FontGetSys()*2+6+y, A_NORMAL);
break;
case 2:
DrawLine((160-DrawStrWidth(str, FontGetSys()))/2-1, FontGetSys()*2+6+y, (160-DrawStrWidth(str, FontGetSys()))/2+DrawStrWidth(str, FontGetSys())+1, FontGetSys()*2+6+y, A_NORMAL);
DrawLine((160-DrawStrWidth(str, FontGetSys()))/2-1, FontGetSys()*2+7+y, (160-DrawStrWidth(str, FontGetSys()))/2+DrawStrWidth(str, FontGetSys())+1, FontGetSys()*2+7+y, A_REVERSE);
DrawLine((160-DrawStrWidth(str, FontGetSys()))/2, FontGetSys()*2+5+y, (160-DrawStrWidth(str, FontGetSys()))/2+DrawStrWidth(str, FontGetSys()), FontGetSys()*2+5+y, A_REVERSE);
DrawLine((160-DrawStrWidth(str, FontGetSys()))/2, y-1, (160-DrawStrWidth(str, FontGetSys()))/2+DrawStrWidth(str, FontGetSys()), y-1, A_REVERSE);
DrawLine((160-DrawStrWidth(str, FontGetSys()))/2-1, y-2, (160-DrawStrWidth(str, FontGetSys()))/2+DrawStrWidth(str, FontGetSys())+1, y-2, A_NORMAL);
DrawLine((160-DrawStrWidth(str, FontGetSys()))/2-1, y-2, (160-DrawStrWidth(str, FontGetSys()))/2-1, FontGetSys()*2+6+y, A_NORMAL);
DrawLine((160-DrawStrWidth(str, FontGetSys()))/2+DrawStrWidth(str, FontGetSys())+1, y-2, (160-DrawStrWidth(str, FontGetSys()))/2+DrawStrWidth(str, FontGetSys())+1, FontGetSys()*2+6+y, A_NORMAL);
break;
default:
break;
}
DrawStrXY((160-DrawStrWidth(str, FontGetSys()))/2, y, str, Attr);
}
C'est une fonction qui centre le texte en X, et qui si Underline est active souligne ou crée un cadre autour(pas encore terminée)