Changeset 640 for cpp/frams/model


Ignore:
Timestamp:
12/05/16 02:31:34 (7 years ago)
Author:
Maciej Komosinski
Message:

Introduced a separate function to provide a human-friendly description of a given param-item type

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpp/frams/model/modelparts.cpp

    r637 r640  
    159159                {
    160160                if (i) t+="\n";
    161                 t+="   "; t+=p.name(i); t+=" ("; t+=p.id(i); t+=")";
    162                 switch(*p.type(i))
    163                         {
    164                         case 'd': t+=" integer";
    165                         {paInt a,b,c; int n=p.getMinMax(i,a,b,c); if (n>=2) t+=SString::sprintf(" %d..%d",a,b); if (n>=3) t+=SString::sprintf(" (default %d)",c);}
    166                                 break;
    167                         case 'f': t+=" float";
    168                         {double a,b,c; int n=p.getMinMax(i,a,b,c); if (n>=2) t+=SString::sprintf(" %g..%g",a,b); if (n>=3) t+=SString::sprintf(" (default %g)",c);}
    169                                 break;
    170                         case 's': t+=" string";
    171                         {int a,b; SString c; int n=p.getMinMax(i,a,b,c); if ((n>=2)&&(b>0)) t+=SString::sprintf(", max %d chars",b); if (n>=3) t+=SString::sprintf(" (default \"%s\")",c.c_str());}
    172                                 break;
    173                         case 'x': t+=" anything"; break;
    174                         }
     161                t+="   "; t+=p.name(i); t+=" ("; t+=p.id(i); t+=") ";
     162                t+=p.describeType(i);
    175163                if (h=p.help(i)) if (*h) {t+=" - "; t+=h;}
    176164                }
Note: See TracChangeset for help on using the changeset viewer.