Example #1
0
int d_seltext_proc(int msg, DIALOG *d, int c)
{
   int acolor = makecol(0,255,0);
   int icolor = makecol(0,100,0);
   int ret = D_O_K;

   if (msg != MSG_DRAW)
      ret = d_radio_proc(msg, d, c);

//   if (msg == MSG_GOTFOCUS)
//   {
//      ret = d_radio_proc(MSG_KEY, d, c);
//   }
   switch (msg)
   {
      case MSG_START:
           d->w = text_length(fnt_andrus_4, ((char *)d->dp));
           d->h = text_height(fnt_andrus_4);
           break;
      case MSG_DRAW:
           if (d->flags & D_SELECTED)
           {
               char *t = strdup((char *)d->dp);
               dialog_textout(ustrupr(t),d->x, d->y , acolor);
               free(t);
           }
           else
           {
               char *t = strdup((char *)d->dp);
               dialog_textout(ustrlwr(t),d->x, d->y , icolor);
               free(t);
           }
           break;
   
   }

   return ret;
}
Example #2
0
void AutoSettings()
{
    blit(ModeBox, screen, 0, 0, 100, 400, 114,55);
    while (!key[KEY_ESC])
    {
        Letteri= readkey();
        if(key[KEY_ENTER])
            if ((ustrcmp(Mode,"P")==0) || (ustrcmp(Mode,"PI")==0) || (ustrcmp(Mode,"PID")==0))
                break;
            else
            {
                uremove(Mode,-1);
                uremove(Mode,-1);
                uremove(Mode,-1);
                AutoSettings();
            }
        if(key[KEY_ESC])
            exit(0);
        if(key[KEY_BACKSPACE])
        {
            Letteri=NULL;
            uremove(Mode,-1);
        }
        Letterj= Letteri;
        strcat(Mode, &Letterj);
        ustrupr(Mode);
        textprintf_ex(screen, font, 120, 415, 0, WHITE, "%s  ", Mode);
    }

    if (ustrcmp(Mode,"P")==0)
    {
        blit(GainBox, screen, 0, 0, 300, 400, 114,55);
        while (!key[KEY_ESC])
        {
            Letteri= readkey();
            if(key[KEY_ENTER])
                break;
            if(key[KEY_ESC])
                exit(0);
            if(key[KEY_BACKSPACE])
            {
                Letteri=NULL;
                uremove(Gain,-1);
            }
            Letterj= Letteri;
            strcat(Gain, &Letterj);
            textprintf_ex(screen, font, 320, 415, 0, WHITE, "%s  ", Gain);
        }
        Proceed();
    }
    if (ustrcmp(Mode,"PI")==0)
    {
        blit(GainBox, screen, 0, 0, 300, 400, 114,55);
        while (!key[KEY_ESC])
        {
            Letteri= readkey();
            if(key[KEY_ENTER])
                break;
            if(key[KEY_ESC])
                exit(0);
            if(key[KEY_BACKSPACE])
            {
                Letteri=NULL;
                uremove(Gain,-1);
            }
            Letterj= Letteri;
            strcat(Gain, &Letterj);
            textprintf_ex(screen, font, 320, 415, 0, WHITE, "%s  ", Gain);
        }
        blit(TiBox, screen, 0, 0, 500, 400, 114,55);
        while (!key[KEY_ESC])
        {
            Letteri= readkey();
            if(key[KEY_ENTER])
                break;
            if(key[KEY_ESC])
                exit(0);
            if(key[KEY_BACKSPACE])
            {
                Letteri=NULL;
                uremove(Gain,-1);
            }
            Letterj= Letteri;
            strcat(Ti, &Letterj);
            textprintf_ex(screen, font, 520, 415, 0, WHITE, "%s  ", Ti);
        }
        Proceed();
    }
    if (ustrcmp(Mode,"PID")==0)
    {
        blit(GainBox, screen, 0, 0, 300, 400, 114,55);
        while (!key[KEY_ESC])
        {
            Letteri= readkey();
            if(key[KEY_ENTER])
                break;
            if(key[KEY_ESC])
                exit(0);
            if(key[KEY_BACKSPACE])
            {
                Letteri=NULL;
                uremove(Gain,-1);
            }
            Letterj= Letteri;
            strcat(Gain, &Letterj);
            textprintf_ex(screen, font, 320, 415, 0, WHITE, "%s  ", Gain);
        }
        blit(TiBox, screen, 0, 0, 500, 400, 114,55);
        while (!key[KEY_ESC])
        {
            Letteri= readkey();
            if(key[KEY_ENTER])
                break;
            if(key[KEY_ESC])
                exit(0);
            if(key[KEY_BACKSPACE])
            {
                Letteri=NULL;
                uremove(Ti,-1);
            }
            Letterj= Letteri;
            strcat(Ti, &Letterj);
            textprintf_ex(screen, font, 520, 415, 0, WHITE, "%s  ", Ti);
        }
        blit(TdBox, screen, 0, 0, 700, 400, 114,55);
        while (!key[KEY_ESC])
        {
            Letteri= readkey();
            if(key[KEY_ENTER])
                break;
            if(key[KEY_ESC])
                exit(0);
            if(key[KEY_BACKSPACE])
            {
                Letteri=NULL;
                uremove(Td,-1);
            }
            Letterj= Letteri;
            strcat(Td, &Letterj);
            textprintf_ex(screen, font, 720, 415, 0, WHITE, "%s  ", Td);
        }
        Proceed();
    }
    rest(1000);
    Proceed();
}