TaskPatternRectangularParameters.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (c) 2011 Juergen Riegel <FreeCAD@juergen-riegel.net>        *
00003  *                                                                         *
00004  *   This file is part of the FreeCAD CAx development system.              *
00005  *                                                                         *
00006  *   This library is free software; you can redistribute it and/or         *
00007  *   modify it under the terms of the GNU Library General Public           *
00008  *   License as published by the Free Software Foundation; either          *
00009  *   version 2 of the License, or (at your option) any later version.      *
00010  *                                                                         *
00011  *   This library  is distributed in the hope that it will be useful,      *
00012  *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
00013  *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
00014  *   GNU Library General Public License for more details.                  *
00015  *                                                                         *
00016  *   You should have received a copy of the GNU Library General Public     *
00017  *   License along with this library; see the file COPYING.LIB. If not,    *
00018  *   write to the Free Software Foundation, Inc., 59 Temple Place,         *
00019  *   Suite 330, Boston, MA  02111-1307, USA                                *
00020  *                                                                         *
00021  ***************************************************************************/
00022 
00023 
00024 #include "PreCompiled.h"
00025 
00026 #ifndef _PreComp_
00027 #endif
00028 
00029 #include "ui_TaskPatternRectangularParameters.h"
00030 #include "TaskPatternRectangularParameters.h"
00031 #include <Gui/Application.h>
00032 #include <Gui/Document.h>
00033 #include <Gui/BitmapFactory.h>
00034 #include <Gui/ViewProvider.h>
00035 #include <Gui/WaitCursor.h>
00036 #include <Base/Console.h>
00037 #include <Gui/Selection.h>
00038 #include <Gui/Command.h>
00039 
00040 
00041 using namespace PartDesignGui;
00042 using namespace Gui;
00043 
00044 /* TRANSLATOR PartDesignGui::TaskPatternRectangularParameters */
00045 
00046 TaskPatternRectangularParameters::TaskPatternRectangularParameters(QWidget *parent)
00047     : TaskBox(Gui::BitmapFactory().pixmap("document-new"),tr("TaskPatternRectangularParameters"),true, parent)
00048 {
00049     // we need a separate container widget to add all controls to
00050     proxy = new QWidget(this);
00051     ui = new Ui_TaskPatternRectangularParameters();
00052     ui->setupUi(proxy);
00053     QMetaObject::connectSlotsByName(this);
00054 
00055     this->groupLayout()->addWidget(proxy);
00056 
00057     Gui::Selection().Attach(this);
00058 }
00059 
00060 TaskPatternRectangularParameters::~TaskPatternRectangularParameters()
00061 {
00062     delete ui;
00063     Gui::Selection().Detach(this);
00064 }
00065 
00066 void TaskPatternRectangularParameters::changeEvent(QEvent *e)
00067 {
00068     TaskBox::changeEvent(e);
00069     if (e->type() == QEvent::LanguageChange) {
00070         ui->retranslateUi(proxy);
00071     }
00072 }
00073 
00075 void TaskPatternRectangularParameters::OnChange(Gui::SelectionSingleton::SubjectType &rCaller,
00076                               Gui::SelectionSingleton::MessageType Reason)
00077 {
00078     if (Reason.Type == SelectionChanges::AddSelection ||
00079         Reason.Type == SelectionChanges::RmvSelection ||
00080         Reason.Type == SelectionChanges::SetSelection ||
00081         Reason.Type == SelectionChanges::ClrSelection) {
00082     }
00083 }
00085 
00086 //**************************************************************************
00087 //**************************************************************************
00088 // TaskDialog
00089 //++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
00090 
00091 TaskDlgPatternRectangularParameters::TaskDlgPatternRectangularParameters(ViewProviderPatternRectangular *PatternRectangularView)
00092     : TaskDialog(),PatternRectangularView(PatternRectangularView)
00093 {
00094     assert(PatternRectangularView);
00095     parameter  = new TaskPatternRectangularParameters();
00096 
00097     Content.push_back(parameter);
00098 }
00099 
00100 TaskDlgPatternRectangularParameters::~TaskDlgPatternRectangularParameters()
00101 {
00102 
00103 }
00104 
00105 //==== calls from the TaskView ===============================================================
00106 
00107 
00108 void TaskDlgPatternRectangularParameters::open()
00109 {
00110 
00111 }
00112 
00113 void TaskDlgPatternRectangularParameters::clicked(int)
00114 {
00115     
00116 }
00117 
00118 bool TaskDlgPatternRectangularParameters::accept()
00119 {
00120     return true;
00121 }
00122 
00123 bool TaskDlgPatternRectangularParameters::reject()
00124 {
00125     Gui::Command::openCommand("PatternRectangular changed");
00126     Gui::Command::doCommand(Gui::Command::Gui,"Gui.activeDocument().resetEdit()");
00127     Gui::Command::doCommand(Gui::Command::Doc,"App.ActiveDocument.recompute()");
00128     Gui::Command::commitCommand();
00129 
00130     return true;
00131 }
00132 
00133 void TaskDlgPatternRectangularParameters::helpRequested()
00134 {
00135 
00136 }
00137 
00138 
00139 
00140 
00141 #include "moc_TaskPatternRectangularParameters.cpp"

Generated on Wed Nov 23 19:00:43 2011 for FreeCAD by  doxygen 1.6.1