Exemple #1
0
void CAht::UpdateModelProperty( int id )
{
    //		プロパティの参照データを更新する
    //
    int i;
    int target;
    int a;
    AHTMODEL *model;
    AHTMODEL *m;
    AHTPROP *p;
    AHTPROP *p2;
    char *res;
    CStrNote note;
    char *list;
    char tmp[256];
    
    model = GetModel( id );
    if ( model == NULL ) return;
    target = id;
    
    for(i=0;i<model->GetPropCount();i++) {
        p = model->GetProperty( i );
        switch( p->ahttype ) {
            case AHTTYPE_PARTS_INT:
                res = p->newval;
                if ( res == NULL ) {
                    list = SearchModelByClassName( p->defval2 );
                    note.Select( list );
                    note.GetLine( tmp, 0, 255 );
                    p->SetNewVal( tmp );
                }
                target = p->GetValueInt();
                break;
            case AHTTYPE_PARTS_PROP_STRING:
                a = target;if ( *p->defval3 == 'm' ) a = id;				// 自分を参照するオプション
                m = GetModel( a );
                if ( m != NULL ) {
                    p2 = m->GetProperty( p->defval2 );
                    //Alertf( "%d:%d:%s:%s:%x",i,a,p->defval, p->defval2,p2 );
                    if ( p2 != NULL ) {
                        res = p2->GetValue();
                        p->SetNewVal( res );
                    }
                }
                break;
            case AHTTYPE_PARTS_OPT_STRING:
                a = target;if ( *p->defval3 == 'm' ) a = id;				// 自分を参照するオプション
                m = GetModel( a );
                if ( m != NULL ) {
                    res = m->GetAHTOption( p->defval2 );
                    if ( res != NULL ) {
                        p->SetNewVal( res );
                    }
                }
                break;
            default:
                break;
        }
    }
}
Exemple #2
0
static char *note_update( void )
{
	char *p;
	if ( ctx->note_pval == NULL ) throw HSPERR_ILLEGAL_FUNCTION;
	p = (char *)HspVarCorePtrAPTR( ctx->note_pval, ctx->note_aptr );
	note.Select( p );
	return p;
}
Exemple #3
0
int CAht::BuildPartsSub( int id, char *fname )
{
    //		簡易ahtパース
    //
    int i,res,maxline;
    CStrNote note;
    CMemBuf tmp;
    AHTPARTS *p;
    char s1[256];
    
    p = GetParts( id );
    if ( p == NULL ) return -2;
    
    p->classname[0] = 0;
    p->name[0] = 0;
    p->icon = 0;
    
    res = tmp.PutFile( fname );
    if ( res < 0 ) {
        return -1;
    }
    note.Select( tmp.GetBuffer() );
    maxline = note.GetMaxLine();
    getpath( fname, p->name, 1+8+16 );			// 仮にファイル名を入れておく
    
    for(i=0;i<maxline;i++) {
        pickptr = 0;
        note.GetLine( linebuf, i, 255 );
        PickLineBuffer( s1 );
        if ( tstrcmp( s1,"#aht" ) ) {
            PickLineBuffer( s1 );
            if ( tstrcmp( s1,"iconid" ) ) {
                PickLineBuffer( s1 );
                p->icon = atoi( s1 );
            }
            if ( tstrcmp( s1,"name" ) ) {
                PickLineBuffer( s1 );
                strcpy( p->name, s1 );
            }
            if ( tstrcmp( s1,"class" ) ) {
                PickLineBuffer( s1 );
                strcpy( p->classname, s1 );
            }
        }
    }
    
    return 0;
}
Exemple #4
0
int CAht::BuildParts( char *list, char *path )
{
    int i;
    char fullpath[256];
    char fname[256];
    CStrNote note;
    
    note.Select( list );
    maxparts = note.GetMaxLine();
    DisposeParts();
    mem_parts = (AHTPARTS *)mem_ini( sizeof(AHTPARTS) * maxparts );
    for(i=0;i<maxparts;i++) {
        note.GetLine( fname, i, 255 );
        strcpy( fullpath, path );
        strcat( fullpath, fname );
        //Alertf( "#%d [%s]",i, fullpath );
        BuildPartsSub( i, fullpath );
    }
    return maxparts;
}