FreeCAD

Форк
0
/
Workbench.cpp 
112 строк · 4.1 Кб
1
/***************************************************************************
2
 *   Copyright (c) 2005 Werner Mayer <wmayer[at]users.sourceforge.net>     *
3
 *                                                                         *
4
 *   This file is part of the FreeCAD CAx development system.              *
5
 *                                                                         *
6
 *   This library is free software; you can redistribute it and/or         *
7
 *   modify it under the terms of the GNU Library General Public           *
8
 *   License as published by the Free Software Foundation; either          *
9
 *   version 2 of the License, or (at your option) any later version.      *
10
 *                                                                         *
11
 *   This library  is distributed in the hope that it will be useful,      *
12
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
13
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
14
 *   GNU Library General Public License for more details.                  *
15
 *                                                                         *
16
 *   You should have received a copy of the GNU Library General Public     *
17
 *   License along with this library; see the file COPYING.LIB. If not,    *
18
 *   write to the Free Software Foundation, Inc., 59 Temple Place,         *
19
 *   Suite 330, Boston, MA  02111-1307, USA                                *
20
 *                                                                         *
21
 ***************************************************************************/
22

23
#include "PreCompiled.h"
24

25
#include <Gui/MenuManager.h>
26
#include <Gui/ToolBarManager.h>
27

28
#include "Workbench.h"
29

30

31
using namespace DrawingGui;
32

33
#if 0  // needed for Qt's lupdate utility
34
    qApp->translate("Workbench", "Drawing");
35
#endif
36

37
/// @namespace DrawingGui @class Workbench
38
TYPESYSTEM_SOURCE(DrawingGui::Workbench, Gui::StdWorkbench)
39

40
Workbench::Workbench()
41
{}
42

43
Workbench::~Workbench()
44
{}
45

46
Gui::MenuItem* Workbench::setupMenuBar() const
47
{
48
    Gui::MenuItem* root = StdWorkbench::setupMenuBar();
49
    Gui::MenuItem* item = root->findItem("&Windows");
50

51
    Gui::MenuItem* part = new Gui::MenuItem;
52
    root->insertItem(item, part);
53
    part->setCommand("Drawing");
54
    *part << "Drawing_Open";
55
    //*part << "Drawing_NewA3Landscape";
56
    *part << "Drawing_NewPage";
57
    *part << "Drawing_NewView";
58
    *part << "Drawing_OrthoViews";
59
    *part << "Drawing_OpenBrowserView";
60
    *part << "Drawing_Annotation";
61
    *part << "Drawing_Clip";
62
    *part << "Drawing_Symbol";
63
    *part << "Drawing_DraftView";
64
    *part << "Drawing_SpreadsheetView";
65
    *part << "Drawing_ExportPage";
66
    *part << "Separator";
67
    *part << "Drawing_ProjectShape";
68

69
    return root;
70
}
71

72
Gui::ToolBarItem* Workbench::setupToolBars() const
73
{
74
    Gui::ToolBarItem* root = StdWorkbench::setupToolBars();
75
    Gui::ToolBarItem* part = new Gui::ToolBarItem(root);
76
    part->setCommand("Drawing");
77
    *part << "Drawing_Open";
78
    //*part << "Drawing_NewA3Landscape";
79
    *part << "Drawing_NewPage";
80
    *part << "Drawing_NewView";
81
    *part << "Drawing_OrthoViews";
82
    *part << "Drawing_OpenBrowserView";
83
    *part << "Drawing_Annotation";
84
    *part << "Drawing_Clip";
85
    *part << "Drawing_Symbol";
86
    *part << "Drawing_DraftView";
87
    *part << "Drawing_SpreadsheetView";
88
    *part << "Drawing_ExportPage";
89
    return root;
90
}
91

92
Gui::ToolBarItem* Workbench::setupCommandBars() const
93
{
94
    // Part tools
95
    Gui::ToolBarItem* root = new Gui::ToolBarItem;
96
    Gui::ToolBarItem* img = new Gui::ToolBarItem(root);
97
    img->setCommand("I/O");
98
    *img << "Drawing_Open";
99
    img = new Gui::ToolBarItem(root);
100
    img->setCommand("Drawing types");
101
    //*img << "Drawing_NewA3Landscape";
102
    *img << "Drawing_NewPage";
103
    *img << "Drawing_OrthoViews";
104
    *img << "Drawing_OpenBrowserView";
105
    *img << "Drawing_Annotation";
106
    *img << "Drawing_Clip";
107
    *img << "Drawing_DraftView";
108
    img = new Gui::ToolBarItem(root);
109
    img->setCommand("Views");
110
    *img << "Drawing_NewView";
111
    return root;
112
}
113

Использование cookies

Мы используем файлы cookie в соответствии с Политикой конфиденциальности и Политикой использования cookies.

Нажимая кнопку «Принимаю», Вы даете АО «СберТех» согласие на обработку Ваших персональных данных в целях совершенствования нашего веб-сайта и Сервиса GitVerse, а также повышения удобства их использования.

Запретить использование cookies Вы можете самостоятельно в настройках Вашего браузера.