From 90ad7e3470a135bc37278efffea580ce8137bee6 Mon Sep 17 00:00:00 2001 From: balazs-bamer Date: Tue, 13 Jan 2015 18:16:30 +0100 Subject: [PATCH] Next try for showing dialog Does not work yet. --- src/Mod/Surface/Gui/BSurf.cpp | 40 +++++++++++++++++++++++++++++------ src/Mod/Surface/Gui/BSurf.h | 5 +++-- 2 files changed, 36 insertions(+), 9 deletions(-) diff --git a/src/Mod/Surface/Gui/BSurf.cpp b/src/Mod/Surface/Gui/BSurf.cpp index ab81001934..5d2aa20e3b 100644 --- a/src/Mod/Surface/Gui/BSurf.cpp +++ b/src/Mod/Surface/Gui/BSurf.cpp @@ -39,6 +39,7 @@ #include #include #include +#include using namespace SurfaceGui; //#undef CS_FUTURE // multi-threading causes some problems @@ -82,6 +83,31 @@ public: return std::vector(); } + virtual bool setEdit(int ModNum) + { + // When double-clicking on the item for this sketch the + // object unsets and sets its edit mode without closing + // the task panel + Gui::TaskView::TaskDialog* dlg = Gui::Control().activeDialog(); + TaskBSurf* tDlg = qobject_cast(dlg); + // start the edit dialog + if(dlg) + Gui::Control().showDialog(tDlg); + else + Gui::Control().showDialog(new TaskBSurf(this)); +// draw(); + return true; + } + + virtual void unsetEdit(int ModNum) + { + /*if(!Gui::Selection().isSelected(pcObject) || !Visibility.getValue()) { + internal_vp.switch_node(false); + pcModeSwitch->whichChild = -1; + m_selected = false; + } */ + } + /* void setCoords(const std::vector& v) { }*/ @@ -89,8 +115,8 @@ public: private: }; -BSurf::BSurf(const Base::BoundBox3d& bb, QWidget* parent, Qt::WFlags fl) - : QDialog(parent, fl), bbox(bb) +BSurf::BSurf(ViewProviderBSurf* vp) + //: QDialog(parent, fl), bbox(bb) { ui = new Ui_DlgBSurf(); ui->setupUi(this); @@ -155,14 +181,14 @@ void BSurf::on_fillType_curved_clicked() // --------------------------------------- -TaskBSurf::TaskBSurf(const Base::BoundBox3d& bb) +TaskBSurf::TaskBSurf(ViewProviderBSurf* vp) { - widget = new BSurf(bb); - taskbox = new Gui::TaskView::TaskBox( + widget = new BSurf(vp); +/* taskbox = new Gui::TaskView::TaskBox( NULL, widget->windowTitle(), true, 0); - taskbox->groupLayout()->addWidget(widget); - Content.push_back(taskbox); + taskbox->groupLayout()->addWidget(widget);*/ + Content.push_back(widget); } TaskBSurf::~TaskBSurf() diff --git a/src/Mod/Surface/Gui/BSurf.h b/src/Mod/Surface/Gui/BSurf.h index 8f507182ef..6c79c51137 100644 --- a/src/Mod/Surface/Gui/BSurf.h +++ b/src/Mod/Surface/Gui/BSurf.h @@ -44,7 +44,7 @@ namespace SurfaceGui filltype_t fillType; public: - BSurf(const Base::BoundBox3d& bb, QWidget* parent = 0, Qt::WFlags fl = 0); + BSurf(ViewProviderBSurf* vp); ~BSurf(); void accept(); void apply(); @@ -77,7 +77,7 @@ namespace SurfaceGui Q_OBJECT public: - TaskBSurf(const Base::BoundBox3d& bb); + TaskBSurf(ViewProviderBSurf* vp); ~TaskBSurf(); public: @@ -90,6 +90,7 @@ namespace SurfaceGui private: BSurf* widget; Gui::TaskView::TaskBox* taskbox; + ViewProviderBSurf* view; }; } //namespace Surface