Esempio n. 1
0
//------------------------------------------------------------------------------
// select() -- select one of our components, using String or Number
//------------------------------------------------------------------------------
bool Component::select(const String* const name)
{
    bool ok {true};
    selected = nullptr;
    setSelectionName(nullptr);
    if (name != nullptr) {
        setSelectionName(name);
        Pair* p = findByName(*name);
        if (p != nullptr) selected = static_cast<Component*>(p->object());
        else {
            std::cerr << "Component::select: name not found!"  << std::endl;
            ok = false;
        }
    }
    return ok;
}
Esempio n. 2
0
//------------------------------------------------------------------------------
// select() -- select one of our components, using String or Number
//------------------------------------------------------------------------------
bool Component::select(const String* const name)
{
    bool ok = true;
    selected = 0;
    setSelectionName(0);
    if (name != 0) {
        setSelectionName(name);
        Pair* p = findByName(*name);
        if (p != 0) selected = (Component*) p->object();
        else {
            std::cerr << "Component::select: name not found!"  << std::endl; 
            ok = false;
        }
    }
    return ok;
}
Esempio n. 3
0
//------------------------------------------------------------------------------
// Class support functions
//------------------------------------------------------------------------------
Rotary2::Rotary2()
{
   STANDARD_CONSTRUCTOR()

   Basic::Integer* p = new Basic::Integer(1);    // default rotary item
   setSelectionName(p);
   p->unref();
}
Esempio n. 4
0
//------------------------------------------------------------------------------
// Class support functions
//------------------------------------------------------------------------------
Rotary::Rotary()
{
   STANDARD_CONSTRUCTOR()

   Basic::Integer* p = new Basic::Integer(1);    // default rotary item
   setSelectionName(p);
   p->unref();
   preDrawSelectList = true;
}
Esempio n. 5
0
bool Component::select(const Number* const num)
{
    bool ok {true};
    selected = nullptr;
    setSelectionName(nullptr);
    if (num != nullptr) {
        setSelectionName(num);
        Pair* p = findByIndex(num->getInt());
        if (p != nullptr) {
           selected = static_cast<Component*>(p->object());
        }
        else {
           std::cerr << "Component::select: index out of range; num = " << num->getInt() << std::endl;
           ok = false;
        }
    }
    return ok;
}
Esempio n. 6
0
bool Component::select(const Number* const num)
{
    bool ok = true;
    selected = 0;
    setSelectionName(0);
    if (num != 0) {
        setSelectionName(num);
        Pair* p = findByIndex(num->getInt());
        if (p != 0) {
           selected = (Component*) p->object();
        }
        else {
           std::cerr << "Component::select: index out of range; num = " << num->getInt() << std::endl;
           ok = false; 
        }
    }
    return ok;
}
Esempio n. 7
0
//------------------------------------------------------------------------------
// deleteData() -- delete this object's data
//------------------------------------------------------------------------------
void Component::deleteData()
{
    // just in case our components haven't heard, we're shutting down!
    shutdownNotification();

    // Delete component selection
    setSelectionName(0);
    selected = 0;

    // Delete list of components
    components = 0;
}
Esempio n. 8
0
void Component::deleteData()
{
    // just in case our components haven't heard, we're shutting down!
    shutdownNotification();

    // Delete component selection
    setSelectionName(nullptr);
    selected = nullptr;

    // Delete list of components
    components = nullptr;

    if (timingStats != nullptr) {
       timingStats->unref();
       timingStats = nullptr;
    }
}