//------------------------------------------------------------------------------ // 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; }
//------------------------------------------------------------------------------ // 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; }
//------------------------------------------------------------------------------ // Class support functions //------------------------------------------------------------------------------ Rotary2::Rotary2() { STANDARD_CONSTRUCTOR() Basic::Integer* p = new Basic::Integer(1); // default rotary item setSelectionName(p); p->unref(); }
//------------------------------------------------------------------------------ // Class support functions //------------------------------------------------------------------------------ Rotary::Rotary() { STANDARD_CONSTRUCTOR() Basic::Integer* p = new Basic::Integer(1); // default rotary item setSelectionName(p); p->unref(); preDrawSelectList = true; }
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; }
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; }
//------------------------------------------------------------------------------ // 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; }
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; } }