33#include <NDEVR/QTDesignObject.h>
34#include <NDEVR/GridlinesDialog.h>
35#if NDEVR_CROSS_SECTION
36#include <NDEVR/QTTools.h>
37#include <NDEVR/Button.h>
38#include <NDEVR/Translator.h>
39#include <QWidgetAction>
46 class GridButton :
public QObject
50 GridButton(Button* combo)
56 GridButton(
const DynamicPointer<QTDesignObject>& target, Button* combo)
63 void setTargets(
const Buffer<DynamicPointer<QTDesignObject>>& targets)
66 if (!m_dialog.isNull())
67 m_dialog->setTargets(targets);
69 void setTarget(
const DynamicPointer<QTDesignObject>& target)
72 m_targets.add(target);
73 if (!m_dialog.isNull())
74 m_dialog->setTarget(target);
79 m_combo->setup(
_t(
"Gridlines"),
"grid", [
this](Button*)
81 if (m_dialog.isNull())
83 m_dialog =
new GridlinesDialog();
84 m_dialog->setTargets(m_targets);
86 PopupInfo info(m_combo);
87 info.make_call_widget_dialog =
true;
89 if(!m_dialog->isVisible())
90 QTTools::ShowDialog(m_dialog, info);
92 QTTools::HideDialog(m_dialog);
101 void requestSettingsSignal();
103 Buffer<DynamicPointer<QTDesignObject>> m_targets;
104 Button* m_combo =
nullptr;
105 QPointer<GridlinesDialog> m_dialog;
#define _t(english_string)
Definition Translator.h:90