bool GUIElement::_commandEvent(const GUICommandEvent& ev) { if (ev.getType() == GUICommandEventType::FocusGained) { onFocusChanged(true); return !mOptionFlags.isSet(GUIElementOption::ClickThrough); } else if (ev.getType() == GUICommandEventType::FocusLost) { onFocusChanged(false); return !mOptionFlags.isSet(GUIElementOption::ClickThrough); } return false; }
void GUITextField::focusChanged(bool focus) { if (focus) { UndoRedo::instance().pushGroup("InputBox"); mHasInputFocus = true; onFocusChanged(true); } else { UndoRedo::instance().popGroup("InputBox"); mHasInputFocus = false; onFocusChanged(false); } }
void ODF::image_close_slot () { QModelIndexList indexes = image_list_view->selectionModel()->selectedIndexes(); if (indexes.size()) image_list_model->remove_item (indexes.first()); onFocusChanged(); if (overlay_frame->isChecked()) window.updateGL(); }
void GUIFloatField::focusChanged(bool focus) { if (focus) { UndoRedo::instance().pushGroup("InputBox"); mHasInputFocus = true; onFocusChanged(true); } else { UndoRedo::instance().popGroup("InputBox"); setText(applyRangeAndStep(mValue)); mHasInputFocus = false; onFocusChanged(false); } }
bool EventListenerFocus::init() { auto listener = [this](Event* event){ auto focusEvent = static_cast<EventFocus*>(event); onFocusChanged(focusEvent->_widgetLoseFocus, focusEvent->_widgetGetFocus); }; if (EventListener::init(Type::FOCUS, LISTENER_ID, listener)) { return true; } return false; }
void ODF::selection_changed_slot (const QItemSelection &, const QItemSelection &) { onFocusChanged(); Image* settings = get_image(); if (!settings) return; lmax_selector->setValue (settings->lmax); hide_negative_lobes_box->setChecked (settings->hide_negative_lobes); colour_by_direction_box->setChecked (settings->color_by_direction); overlay_scale->setValue (settings->scale); if (overlay_frame->isChecked()) window.updateGL(); }
void ODF::image_open_slot () { std::vector<std::string> list = Dialog::File::get_images (this, "Select overlay images to open"); if (list.empty()) return; size_t previous_size = image_list_model->rowCount(); if (!image_list_model->add_items (list, lmax_selector->value(), colour_by_direction_box->isChecked(), hide_negative_lobes_box->isChecked(), overlay_scale->value())) return; QModelIndex first = image_list_model->index (previous_size, 0, QModelIndex()); image_list_view->selectionModel()->select (first, QItemSelectionModel::ClearAndSelect); onFocusChanged(); if (overlay_frame->isChecked()) window.updateGL(); }
void ODF::interpolation_slot (int unused) { onFocusChanged(); if (overlay_frame->isChecked()) window.updateGL(); }