Subversion Repositories tpanel

Rev

Rev 153 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 153 Rev 165
Line 479... Line 479...
479
 
479
 
480
    MSG_DEBUG("Found " << map.size() << " buttons.");
480
    MSG_DEBUG("Found " << map.size() << " buttons.");
481
    return map;
481
    return map;
482
}
482
}
483
 
483
 
-
 
484
string TAmxCommands::findImage(int bt, int page, int instance)
-
 
485
{
-
 
486
    DECL_TRACER("TAmxCommands::findImage(int bt, int page, int instance)");
-
 
487
 
-
 
488
    vector<MAP_BM_T> mapBm = mMap.map_bm;
-
 
489
    vector<MAP_BM_T>::iterator iter;
-
 
490
 
-
 
491
    if (mapBm.empty())
-
 
492
        return string();
-
 
493
 
-
 
494
    for (iter = mapBm.begin(); iter != mapBm.end(); ++iter)
-
 
495
    {
-
 
496
        if (iter->bt == bt && iter->pg == page && !iter->i.empty())
-
 
497
        {
-
 
498
            if (instance >= 0 && iter->st == (instance + 1))
-
 
499
                return iter->i;
-
 
500
            else if (instance < 0)
-
 
501
                return iter->i;
-
 
502
        }
-
 
503
    }
-
 
504
 
-
 
505
    return string();
-
 
506
}
-
 
507
 
-
 
508
string TAmxCommands::findImage(const string& name)
-
 
509
{
-
 
510
    DECL_TRACER("TAmxCommands::findImage(const string& name)");
-
 
511
 
-
 
512
    vector<MAP_BM_T> mapBm = mMap.map_bm;
-
 
513
    vector<MAP_BM_T>::iterator iter;
-
 
514
 
-
 
515
    if (mapBm.empty() || name.empty())
-
 
516
        return string();
-
 
517
 
-
 
518
    size_t cnt = 0;
-
 
519
 
-
 
520
    for (iter = mapBm.begin(); iter != mapBm.end(); ++iter)
-
 
521
    {
-
 
522
        if (!iter->i.empty() && iter->i.find(name) != string::npos)
-
 
523
        {
-
 
524
            size_t pos = iter->i.find_last_of(".");
-
 
525
 
-
 
526
            if (pos != string::npos)
-
 
527
            {
-
 
528
                string left = iter->i.substr(0, pos);
-
 
529
MSG_DEBUG("Found candidate: " << iter->i << " (" << left << ")");
-
 
530
                if (left == name)
-
 
531
                    return iter->i;
-
 
532
            }
-
 
533
        }
-
 
534
 
-
 
535
        cnt++;
-
 
536
    }
-
 
537
 
-
 
538
    MSG_WARNING("No image with name " << name << " in table found!");
-
 
539
    MSG_DEBUG("Searched " << cnt << " entries for image " << name);
-
 
540
    return string();
-
 
541
}
-
 
542
 
484
vector<MAP_T> TAmxCommands::findButtonByName(const string& name)
543
vector<MAP_T> TAmxCommands::findButtonByName(const string& name)
485
{
544
{
486
    DECL_TRACER("TAmxCommands::findButtonByName(const string& name)");
545
    DECL_TRACER("TAmxCommands::findButtonByName(const string& name)");
487
 
546
 
488
    vector<MAP_T> map;
547
    vector<MAP_T> map;