Mod/Sketcher/Gui/Workbench.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
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
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
00073 ;
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
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
00124 ;
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
00149 Gui::ToolBarItem* root = new Gui::ToolBarItem;
00150 return root;
00151 }
00152