Mod/Sketcher/Gui/Workbench.cpp

Go to the documentation of this file.
00001 /***************************************************************************
00002  *   Copyright (c) 2008 Jürgen Riegel (juergen.riegel@web.de)              *
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 # include <qobject.h>
00028 #endif
00029 
00030 #include "Workbench.h"
00031 #include <Gui/MenuManager.h>
00032 #include <Gui/ToolBarManager.h>
00033 
00034 using namespace SketcherGui;
00035 
00036 #if 0 // needed for Qt's lupdate utility
00037     qApp->translate("Workbench", "Sketcher");
00038     qApp->translate("Workbench", "Sketcher geometries");
00039     qApp->translate("Workbench", "Sketcher constraints");
00040 #endif
00041 
00043 TYPESYSTEM_SOURCE(SketcherGui::Workbench, Gui::StdWorkbench)
00044 
00045 Workbench::Workbench()
00046 {
00047 }
00048 
00049 Workbench::~Workbench()
00050 {
00051 }
00052 
00053 Gui::MenuItem* Workbench::setupMenuBar() const
00054 {
00055     Gui::MenuItem* root = StdWorkbench::setupMenuBar();
00056     Gui::MenuItem* item = root->findItem("&Windows");
00057 
00058     Gui::MenuItem* sketch = new Gui::MenuItem;
00059     root->insertItem(item, sketch);
00060     sketch->setCommand("Ske&tch");
00061     Gui::MenuItem* geom = new Gui::MenuItem();
00062     geom->setCommand("Sketcher geometries");
00063     *geom /*<< "Sketcher_CreatePoint"*/
00064           << "Sketcher_CreateArc"
00065           << "Sketcher_CreateCircle"
00066           << "Sketcher_CreateLine"
00067           << "Sketcher_CreatePolyline"
00068           << "Sketcher_CreateRectangle"
00069           << "Sketcher_CreateFillet"
00070           << "Sketcher_Trimming"
00071           << "Sketcher_ToggleConstruction"
00072           /*<< "Sketcher_CreateText"*/
00073           /*<< "Sketcher_CreateDraftLine"*/;
00074     Gui::MenuItem* cons = new Gui::MenuItem();
00075     cons->setCommand("Sketcher constraints");
00076     *cons << "Sketcher_ConstrainLock"
00077           << "Sketcher_ConstrainCoincident"
00078           << "Sketcher_ConstrainPointOnObject"
00079           << "Sketcher_ConstrainDistanceX"
00080           << "Sketcher_ConstrainDistanceY"
00081           << "Sketcher_ConstrainVertical"
00082           << "Sketcher_ConstrainHorizontal"
00083           << "Sketcher_ConstrainDistance"
00084           << "Sketcher_ConstrainRadius"
00085           << "Sketcher_ConstrainParallel"
00086           << "Sketcher_ConstrainPerpendicular"
00087           << "Sketcher_ConstrainAngle"
00088           << "Sketcher_ConstrainTangent"
00089           << "Sketcher_ConstrainEqual"
00090           << "Sketcher_ConstrainSymmetric";
00091     *sketch 
00092         << "Sketcher_NewSketch"
00093         << "Sketcher_LeaveSketch"
00094         << "Sketcher_ViewSketch"
00095         << "Sketcher_MapSketch"
00096         << geom
00097         << cons
00098         << "Separator" 
00099     ;
00100 
00101     return root;
00102 }
00103 
00104 Gui::ToolBarItem* Workbench::setupToolBars() const
00105 {
00106     Gui::ToolBarItem* root = StdWorkbench::setupToolBars();
00107 
00108     Gui::ToolBarItem* part = new Gui::ToolBarItem(root);
00109     part->setCommand("Sketcher");
00110     *part << "Sketcher_NewSketch"<< "Sketcher_LeaveSketch";
00111 
00112     part = new Gui::ToolBarItem(root);
00113     part->setCommand("Sketcher geometries");
00114     *part /*<< "Sketcher_CreatePoint" */
00115           << "Sketcher_CreateArc"
00116           << "Sketcher_CreateCircle"
00117           << "Sketcher_CreateLine"
00118           << "Sketcher_CreatePolyline"
00119           << "Sketcher_CreateRectangle"
00120           << "Sketcher_CreateFillet"
00121           << "Sketcher_Trimming"
00122           << "Sketcher_ToggleConstruction"
00123           /*<< "Sketcher_CreateText"*/
00124           /*<< "Sketcher_CreateDraftLine"*/;
00125 
00126     part = new Gui::ToolBarItem(root);
00127     part->setCommand("Sketcher constraints");
00128     *part << "Sketcher_ConstrainLock"
00129           << "Sketcher_ConstrainCoincident"
00130           << "Sketcher_ConstrainPointOnObject"
00131           << "Sketcher_ConstrainDistanceX"
00132           << "Sketcher_ConstrainDistanceY"
00133           << "Sketcher_ConstrainVertical"
00134           << "Sketcher_ConstrainHorizontal"
00135           << "Sketcher_ConstrainDistance"
00136           << "Sketcher_ConstrainRadius"
00137           << "Sketcher_ConstrainParallel"
00138           << "Sketcher_ConstrainPerpendicular"
00139           << "Sketcher_ConstrainAngle"
00140           << "Sketcher_ConstrainTangent"
00141           << "Sketcher_ConstrainEqual"
00142           << "Sketcher_ConstrainSymmetric";
00143      return root;
00144 }
00145 
00146 Gui::ToolBarItem* Workbench::setupCommandBars() const
00147 {
00148     // Part tools
00149     Gui::ToolBarItem* root = new Gui::ToolBarItem;
00150     return root;
00151 }
00152 

Generated on Wed Nov 23 19:01:11 2011 for FreeCAD by  doxygen 1.6.1