first working ui
This commit is contained in:
committed by
wmayer
parent
587a2476e5
commit
f4971d723f
@@ -53,6 +53,7 @@ set(PartGui_MOC_HDRS
|
||||
DlgSettings3DViewPartImp.h
|
||||
DlgSettingsGeneral.h
|
||||
DlgSettingsObjectColor.h
|
||||
DlgProjectionOnSurface.h
|
||||
PropertyEnumAttacherItem.h
|
||||
TaskFaceColors.h
|
||||
TaskShapeBuilder.h
|
||||
@@ -91,6 +92,7 @@ set(PartGui_UIC_SRCS
|
||||
DlgSettings3DViewPart.ui
|
||||
DlgSettingsGeneral.ui
|
||||
DlgSettingsObjectColor.ui
|
||||
DlgProjectionOnSurface.ui
|
||||
TaskFaceColors.ui
|
||||
TaskShapeBuilder.ui
|
||||
TaskLoft.ui
|
||||
@@ -161,6 +163,9 @@ SET(PartGui_SRCS
|
||||
DlgSettingsObjectColor.cpp
|
||||
DlgSettingsObjectColor.h
|
||||
DlgSettingsObjectColor.ui
|
||||
DlgProjectionOnSurface.cpp
|
||||
DlgProjectionOnSurface.h
|
||||
DlgProjectionOnSurface.ui
|
||||
Resources/Part.qrc
|
||||
PreCompiled.cpp
|
||||
PreCompiled.h
|
||||
|
||||
@@ -64,6 +64,7 @@
|
||||
#include "DlgRevolution.h"
|
||||
#include "DlgFilletEdges.h"
|
||||
#include "DlgPrimitives.h"
|
||||
#include "DlgProjectionOnSurface.h"
|
||||
#include "CrossSections.h"
|
||||
#include "Mirroring.h"
|
||||
#include "ViewProvider.h"
|
||||
@@ -2371,6 +2372,35 @@ bool CmdBoxSelection::isActive(void)
|
||||
return hasActiveDocument();
|
||||
}
|
||||
|
||||
//===========================================================================
|
||||
// Part_projectionOnSurface
|
||||
//===========================================================================
|
||||
DEF_STD_CMD_A(CmdPartProjectionOnSurface);
|
||||
|
||||
CmdPartProjectionOnSurface::CmdPartProjectionOnSurface()
|
||||
:Command("Part_projectionOnSurface")
|
||||
{
|
||||
sAppModule = "Part";
|
||||
sGroup = QT_TR_NOOP("Part");
|
||||
sMenuText = QT_TR_NOOP("Create projection on surface...");
|
||||
sToolTipText = QT_TR_NOOP("Create projection on surface...");
|
||||
sWhatsThis = "Part_projectionOnSurface";
|
||||
sStatusTip = sToolTipText;
|
||||
sPixmap = "Part_Extrude";
|
||||
}
|
||||
|
||||
void CmdPartProjectionOnSurface::activated(int iMsg)
|
||||
{
|
||||
Q_UNUSED(iMsg);
|
||||
PartGui::TaskProjectionOnSurface* dlg = new PartGui::TaskProjectionOnSurface();
|
||||
Gui::Control().showDialog(dlg);
|
||||
}
|
||||
|
||||
bool CmdPartProjectionOnSurface::isActive(void)
|
||||
{
|
||||
return (hasActiveDocument() && !Gui::Control().activeDialog());
|
||||
}
|
||||
|
||||
void CreatePartCommands(void)
|
||||
{
|
||||
Gui::CommandManager &rcCmdMgr = Gui::Application::Instance->commandManager();
|
||||
@@ -2419,4 +2449,5 @@ void CreatePartCommands(void)
|
||||
rcCmdMgr.addCommand(new CmdMeasureToggle3d());
|
||||
rcCmdMgr.addCommand(new CmdMeasureToggleDelta());
|
||||
rcCmdMgr.addCommand(new CmdBoxSelection());
|
||||
rcCmdMgr.addCommand(new CmdPartProjectionOnSurface());
|
||||
}
|
||||
|
||||
62
src/Mod/Part/Gui/DlgProjectionOnSurface.cpp
Normal file
62
src/Mod/Part/Gui/DlgProjectionOnSurface.cpp
Normal file
@@ -0,0 +1,62 @@
|
||||
#include "PreCompiled.h"
|
||||
|
||||
#include "DlgProjectionOnSurface.h"
|
||||
#include "ui_DlgProjectionOnSurface.h"
|
||||
|
||||
#include <Gui/BitmapFactory.h>
|
||||
|
||||
|
||||
|
||||
using namespace PartGui;
|
||||
|
||||
DlgProjectionOnSurface::DlgProjectionOnSurface(QWidget *parent) :
|
||||
QDialog(parent),
|
||||
ui(new Ui::DlgProjectionOnSurface)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
}
|
||||
|
||||
DlgProjectionOnSurface::~DlgProjectionOnSurface()
|
||||
{
|
||||
delete ui;
|
||||
}
|
||||
|
||||
TaskProjectionOnSurface::TaskProjectionOnSurface()
|
||||
{
|
||||
widget = new DlgProjectionOnSurface();
|
||||
taskbox = new Gui::TaskView::TaskBox(
|
||||
Gui::BitmapFactory().pixmap("Part_Extrude"),
|
||||
widget->windowTitle(), true, 0);
|
||||
taskbox->groupLayout()->addWidget(widget);
|
||||
Content.push_back(taskbox);
|
||||
}
|
||||
|
||||
TaskProjectionOnSurface::~TaskProjectionOnSurface()
|
||||
{
|
||||
// automatically deleted in the sub-class
|
||||
}
|
||||
|
||||
bool TaskProjectionOnSurface::accept()
|
||||
{
|
||||
widget->accept();
|
||||
return (widget->result() == QDialog::Accepted);
|
||||
}
|
||||
|
||||
bool TaskProjectionOnSurface::reject()
|
||||
{
|
||||
widget->reject();
|
||||
return true;
|
||||
}
|
||||
|
||||
void TaskProjectionOnSurface::clicked(int id)
|
||||
{
|
||||
if (id == QDialogButtonBox::Apply) {
|
||||
try {
|
||||
//widget->apply();
|
||||
}
|
||||
catch (Base::AbortException&) {
|
||||
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
52
src/Mod/Part/Gui/DlgProjectionOnSurface.h
Normal file
52
src/Mod/Part/Gui/DlgProjectionOnSurface.h
Normal file
@@ -0,0 +1,52 @@
|
||||
#ifndef DLGPROJECTIONONSURFACE_H
|
||||
#define DLGPROJECTIONONSURFACE_H
|
||||
|
||||
#include <QDialog>
|
||||
|
||||
#include <Gui/TaskView/TaskDialog.h>
|
||||
#include <Gui/TaskView/TaskView.h>
|
||||
|
||||
namespace Ui {
|
||||
}
|
||||
|
||||
namespace PartGui {
|
||||
|
||||
class Ui_DlgProjectionOnSurface;
|
||||
|
||||
class DlgProjectionOnSurface : public QDialog
|
||||
{
|
||||
//Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit DlgProjectionOnSurface(QWidget *parent = 0);
|
||||
~DlgProjectionOnSurface();
|
||||
|
||||
private:
|
||||
Ui_DlgProjectionOnSurface*ui;
|
||||
};
|
||||
|
||||
class TaskProjectionOnSurface : public Gui::TaskView::TaskDialog
|
||||
{
|
||||
//Q_OBJECT
|
||||
|
||||
public:
|
||||
TaskProjectionOnSurface();
|
||||
~TaskProjectionOnSurface();
|
||||
|
||||
public:
|
||||
bool accept();
|
||||
bool reject();
|
||||
void clicked(int);
|
||||
|
||||
virtual QDialogButtonBox::StandardButtons getStandardButtons() const
|
||||
{
|
||||
return QDialogButtonBox::Ok | QDialogButtonBox::Apply | QDialogButtonBox::Close;
|
||||
}
|
||||
|
||||
private:
|
||||
DlgProjectionOnSurface* widget;
|
||||
Gui::TaskView::TaskBox* taskbox;
|
||||
};
|
||||
|
||||
} // namespace PartGui
|
||||
#endif // DLGPROJECTIONONSURFACE_H
|
||||
32
src/Mod/Part/Gui/DlgProjectionOnSurface.ui
Normal file
32
src/Mod/Part/Gui/DlgProjectionOnSurface.ui
Normal file
@@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>DlgProjectionOnSurface</class>
|
||||
<widget class="QDialog" name="DlgProjectionOnSurface">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>400</width>
|
||||
<height>300</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Dialog</string>
|
||||
</property>
|
||||
<widget class="QPushButton" name="pushButton">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>180</x>
|
||||
<y>120</y>
|
||||
<width>75</width>
|
||||
<height>23</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>PushButton</string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
@@ -134,6 +134,7 @@ Gui::MenuItem* Workbench::setupMenuBar() const
|
||||
<< "Part_Offset"
|
||||
<< "Part_Offset2D"
|
||||
<< "Part_Thickness"
|
||||
<< "Part_projectionOnSurface"
|
||||
<< "Separator"
|
||||
<< "Part_EditAttachment";
|
||||
|
||||
@@ -188,7 +189,8 @@ Gui::ToolBarItem* Workbench::setupToolBars() const
|
||||
<< "Part_Loft"
|
||||
<< "Part_Sweep"
|
||||
<< "Part_CompOffset"
|
||||
<< "Part_Thickness";
|
||||
<< "Part_Thickness"
|
||||
<< "Part_projectionOnSurface";
|
||||
|
||||
Gui::ToolBarItem* boolop = new Gui::ToolBarItem(root);
|
||||
boolop->setCommand("Boolean");
|
||||
|
||||
Reference in New Issue
Block a user