! * \brief CustomPointDock::bindingChanged * Bind CustomPoint to the cartesian plot coords or not * \param checked */
| 239 | * \param checked |
| 240 | */ |
| 241 | void CustomPointDock::bindingChanged(bool checked) { |
| 242 | ui.chbBindLogicalPos->setChecked(checked); |
| 243 | |
| 244 | // widgets for positioning using absolute plot distances |
| 245 | ui.lPositionX->setVisible(!checked); |
| 246 | ui.cbPositionX->setVisible(!checked); |
| 247 | ui.sbPositionX->setVisible(!checked); |
| 248 | |
| 249 | ui.lPositionY->setVisible(!checked); |
| 250 | ui.cbPositionY->setVisible(!checked); |
| 251 | ui.sbPositionY->setVisible(!checked); |
| 252 | |
| 253 | // widgets for positioning using logical plot coordinates |
| 254 | const auto* plot = static_cast<const CartesianPlot*>(m_point->parent(AspectType::CartesianPlot)); |
| 255 | if (plot) { |
| 256 | // x |
| 257 | bool numeric = (plot->xRangeFormatDefault() == RangeT::Format::Numeric); |
| 258 | if (numeric) { |
| 259 | ui.lPositionXLogical->setVisible(checked); |
| 260 | ui.sbPositionXLogical->setVisible(checked); |
| 261 | } else { |
| 262 | ui.lPositionXLogicalDateTime->setVisible(checked); |
| 263 | ui.dtePositionXLogical->setVisible(checked); |
| 264 | } |
| 265 | |
| 266 | // y |
| 267 | numeric = (plot->yRangeFormatDefault() == RangeT::Format::Numeric); |
| 268 | if (numeric) { |
| 269 | ui.lPositionYLogical->setVisible(checked); |
| 270 | ui.sbPositionYLogical->setVisible(checked); |
| 271 | } else { |
| 272 | ui.lPositionYLogicalDateTime->setVisible(checked); |
| 273 | ui.dtePositionYLogical->setVisible(checked); |
| 274 | } |
| 275 | } |
| 276 | |
| 277 | CONDITIONAL_LOCK_RETURN; |
| 278 | |
| 279 | for (auto* point : m_points) |
| 280 | point->setCoordinateBindingEnabled(checked); |
| 281 | } |
| 282 | |
| 283 | //********************************************************* |
| 284 | //**** SLOTs for changes triggered in CustomPoint ********* |
nothing calls this directly
no test coverage detected