00001 /*************************************************************************** 00002 * Copyright (c) 2005 Werner Mayer <wmayer[at]users.sourceforge.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 # include <qobject.h> 00028 #endif 00029 00030 #include "Workbench.h" 00031 #include <Gui/MenuManager.h> 00032 #include <Gui/ToolBarManager.h> 00033 00034 using namespace DrawingGui; 00035 00036 #if 0 // needed for Qt's lupdate utility 00037 qApp->translate("Workbench", "Drawing"); 00038 #endif 00039 00041 TYPESYSTEM_SOURCE(DrawingGui::Workbench, Gui::StdWorkbench) 00042 00043 Workbench::Workbench() 00044 { 00045 } 00046 00047 Workbench::~Workbench() 00048 { 00049 } 00050 00051 Gui::MenuItem* Workbench::setupMenuBar() const 00052 { 00053 Gui::MenuItem* root = StdWorkbench::setupMenuBar(); 00054 Gui::MenuItem* item = root->findItem("&Windows"); 00055 00056 Gui::MenuItem* part = new Gui::MenuItem; 00057 root->insertItem(item, part); 00058 part->setCommand("Drawing"); 00059 *part << "Drawing_Open"; 00060 //*part << "Drawing_NewA3Landscape"; 00061 *part << "Drawing_NewPage"; 00062 *part << "Drawing_NewView"; 00063 *part << "Drawing_ExportPage"; 00064 00065 return root; 00066 } 00067 00068 Gui::ToolBarItem* Workbench::setupToolBars() const 00069 { 00070 Gui::ToolBarItem* root = StdWorkbench::setupToolBars(); 00071 Gui::ToolBarItem* part = new Gui::ToolBarItem(root); 00072 part->setCommand("Drawing"); 00073 *part << "Drawing_Open"; 00074 //*part << "Drawing_NewA3Landscape"; 00075 *part << "Drawing_NewPage"; 00076 *part << "Drawing_NewView"; 00077 *part << "Drawing_ExportPage"; 00078 return root; 00079 } 00080 00081 Gui::ToolBarItem* Workbench::setupCommandBars() const 00082 { 00083 // Part tools 00084 Gui::ToolBarItem* root = new Gui::ToolBarItem; 00085 Gui::ToolBarItem* img = new Gui::ToolBarItem(root); 00086 img->setCommand("I/O"); 00087 *img << "Drawing_Open"; 00088 img = new Gui::ToolBarItem(root); 00089 img->setCommand("Drawing types"); 00090 //*img << "Drawing_NewA3Landscape"; 00091 *img << "Drawing_NewPage"; 00092 img = new Gui::ToolBarItem(root); 00093 img->setCommand("Views"); 00094 *img << "Drawing_NewView"; 00095 return root; 00096 } 00097