ENDIF()
FIND_LIBRARY(CAS_FWOSPlugin FWOSPlugin )
+
+MESSAGE(STATUS "FWOS " ${CAS_FWOSPlugin})
+
FIND_LIBRARY(CAS_PTKernel PTKernel )
FIND_LIBRARY(CAS_TKAdvTools TKAdvTools )
FIND_LIBRARY(CAS_TKBin TKBin )
#Append Qt5's install prefix into CMAKE_MODULE_PATH
SET(CMAKE_MODULE_PATH "$ENV{QTDIR}" ${CMAKE_MODULE_PATH})
-SET(CMAKE_AUTOMOC ON)
-
# Widgets finds its own dependencies (QtGui and QtCore).
FIND_PACKAGE(Qt5Widgets REQUIRED)
FIND_PACKAGE(Qt5LinguistTools REQUIRED)
SET(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/CMakeCommon" ${CMAKE_MODULE_PATH})
-ADD_SUBDIRECTORY (src/ModelAPI)
-ADD_SUBDIRECTORY (src/Model)
+INCLUDE(Common)
+INCLUDE(FindQt5)
+
+#ADD_SUBDIRECTORY (src/ModelAPI)
+#ADD_SUBDIRECTORY (src/Model)
ADD_SUBDIRECTORY (src/XGUI)
ADD_SUBDIRECTORY (src/GeomModule)
\ No newline at end of file
@REM -------------------------
@REM CASCADE
@SET PATH=%CASROOT%;%CASROOT%\win32\bind;%PATH%
+@SET LIB=%CASROOT%\win32\libd;%LIB%
@set CSF_GraphicShr=%CASROOT%\win32\bind\TKOpenGl.dll
@set CSF_MDTVFontDirectory=%CASROOT%\src\FontMFT
@set CSF_LANGUAGE=us
--- /dev/null
+CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11)
+
+
+SET(PROJECT_HEADERS
+ GeomModule_Defs.h
+ GeomModule.h
+)
+
+SET(PROJECT_SOURCES
+ GeomModule.cpp
+)
+
+SET(PROJECT_RESOURCES
+ GeomModule_icons.qrc
+)
+
+SET(TEXT_RESOURCES
+ GeomModule_msg_en.ts
+)
+
+QT5_ADD_RESOURCES(PROJECT_COMPILED_RESOURCES ${PROJECT_RESOURCES})
+QT5_ADD_TRANSLATION(QM_RESOURCES ${TEXT_RESOURCES})
+
+SOURCE_GROUP ("Generated Files" FILES ${PROJECT_COMPILED_RESOURCES} ${QM_RESOURCES})
+SOURCE_GROUP ("Resource Files" FILES ${TEXT_RESOURCES} ${PROJECT_RESOURCES})
+
+ADD_DEFINITIONS(-DWIN32 -D_WINDOWS)
+
+ADD_LIBRARY(GeomModule SHARED
+ ${PROJECT_SOURCES}
+ ${PROJECT_HEADERS}
+ ${PROJECT_COMPILED_RESOURCES}
+ ${TEXT_RESOURCES}
+ ${QM_RESOURCES}
+)
+
+ADD_DEPENDENCIES(GeomModule XGUI)
+
+INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/src/XGUI)
+
+# The Qt5Widgets_LIBRARIES variable also includes QtGui and QtCore
+TARGET_LINK_LIBRARIES(GeomModule ${Qt5Widgets_LIBRARIES})
+
+INSTALL(TARGETS GeomModule DESTINATION bin)
+#INSTALL(FILES ${XML_RESOURCES} DESTINATION bin)
#include <QTextStream>
/*!Create and return new instance of XGUI_Module*/
-extern "C" GM_EXPORT XGUI_Module* createModule()
+extern "C" GM_EXPORT IModule* createModule(IWorkshop* theWshop)
{
- return new GeomModule();
+ return new GeomModule(theWshop);
}
-GeomModule::GeomModule()
+GeomModule::GeomModule(IWorkshop* theWshop)
{
- QString aDir = qApp->applicationDirPath();
- QString aXMLFile = aDir + QDir::separator() + "main_menu.xml";
-
- QFile aFile(aXMLFile);
- if (aFile.open((QIODevice::ReadOnly | QIODevice::Text))) {
- QTextStream aTextStream(&aFile);
- myMenuXML = aTextStream.readAll();
- }
+ myWorkshop = theWshop;
}
{
}
-QString GeomModule::moduleDescription() const
+
+void GeomModule::createFeatures()
{
- return myMenuXML;
+ int aPageId = myWorkshop->addWorkbench("Primitives");
+ int aGroupId = myWorkshop->addGroup(aPageId);
+ int aCommand = myWorkshop->addFeature(aPageId, aGroupId, "Box", "Create Box", QIcon(":icons/box.png"), QKeySequence());
+ aCommand = myWorkshop->addFeature(aPageId, aGroupId, "Cylinder", "Create Cylinder", QIcon(":icons/cylinder.png"), QKeySequence());
+ aCommand = myWorkshop->addFeature(aPageId, aGroupId, "Disk", "Create Disk", QIcon(":icons/disk.png"), QKeySequence());
+ aCommand = myWorkshop->addFeature(aPageId, aGroupId, "Torus", "Create Torus", QIcon(":icons/torus.png"), QKeySequence());
+
+ aPageId = myWorkshop->addWorkbench("Operations");
}
\ No newline at end of file
#include "GeomModule_Defs.h"
-#include <XGUI_Module.h>
+#include <XGUI_Interfaces.h>
-class GM_EXPORT GeomModule : public XGUI_Module
+class GM_EXPORT GeomModule : public IModule
{
public:
- GeomModule();
+ GeomModule(IWorkshop* theWshop);
virtual ~GeomModule();
- virtual QString moduleDescription() const;
+ virtual void createFeatures();
private:
QString myMenuXML;
+
+ IWorkshop* myWorkshop;
};
#endif
\ No newline at end of file
#if defined WIN32
-# if defined GM_EXPORTS || defined gm_EXPORTS
+# if defined GeomModule_EXPORTS
# define GM_EXPORT __declspec( dllexport )
# else
# define GM_EXPORT __declspec( dllimport )
--- /dev/null
+ <!DOCTYPE RCC><RCC version="1.0">
+ <qresource>
+ <file>icons/box.png</file>
+ <file>icons/cylinder.png</file>
+ <file>icons/disk.png</file>
+ <file>icons/torus.png</file>
+ </qresource>
+ </RCC>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS>
+<TS version="2.0" language="en_US">
+<context>
+ <name>@default</name>
+</context>
+<context>
+ <name>XGUI_Workshop</name>
+ <message>
+ <source>HOME_MENU_TITLE</source>
+ <translation>Home</translation>
+ </message>
+ <message>
+ <source>NEW_MENU</source>
+ <translation>New</translation>
+ </message>
+</context>
+</TS>
+++ /dev/null
-<?xml version="1.0" encoding="utf-8"?>
-<main_menu>
- <workbench name="Primitives">
- <group>
- <operation
- name="box_operation"
- icon=":icons/box.png"
- title="OPERATION_BOX_MENU"
- tooltip="OPERATION_BOX_TIP"
- />
- </group>
- </workbench>
-</main_menu>
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.11)
-INCLUDE(Common)
-INCLUDE(FindQt5)
+SET(CMAKE_AUTOMOC ON)
SET(PROJECT_HEADERS
XGUI_Command.h
+ XGUI_Interfaces.h
XGUI_MainMenu.h
XGUI_MainWindow.h
XGUI_MenuGroupPanel.h
- XGUI_Module.h
XGUI_Tools.h
XGUI_Workbench.h
XGUI_Workshop.h
--- /dev/null
+
+#ifndef XGUI_Interfaces_H
+#define XGUI_Interfaces_H
+
+#include <QString>
+#include <QIcon>
+#include <QKeySequence>
+
+class IWorkshop
+{
+public:
+ virtual int addWorkbench(const QString& theName) = 0;
+
+ virtual int addGroup(int thePageId) = 0;
+
+ virtual int addFeature(int thePageId, int theGroupId,
+ const QString& theTitle, const QString& theTip,
+ const QIcon& theIcon,
+ const QKeySequence& theKeys = QKeySequence()) = 0;
+};
+
+
+class IModule
+{
+public:
+ virtual void createFeatures() = 0;
+};
+
+
+//! This function must return a new module instance.
+extern "C"
+{
+ typedef IModule* (*CREATE_FUNC)(IWorkshop*);
+}
+
+#define CREATE_MODULE "createModule"
+
+
+#endif
\ No newline at end of file
#include <QToolButton>
#include <QAction>
#include <QTreeWidgetItem>
+#include <QLayout>
+#include <QLineEdit>
+#include <QGroupBox>
+#include <QFormLayout>
+#include <QDoubleSpinBox>
+#include <QPushButton>
XGUI_MainWindow::XGUI_MainWindow(QWidget* parent) :
QMainWindow(parent), myObjectBrowser(0)
myObjectBrowser->setHeaderHidden(true);
aDoc->setWidget(myObjectBrowser);
addDockWidget(Qt::LeftDockWidgetArea, aDoc);
- aDoc->hide();
+ //aDoc->hide();
aDoc = new QDockWidget(this);
aDoc->setFeatures(QDockWidget::AllDockWidgetFeatures | QDockWidget::DockWidgetVerticalTitleBar);
aMdiArea->addSubWindow(getSubWindow(), Qt::FramelessWindowHint);
fillObjectBrowser();
-
+ addPropertyPanel();
}
QWidget* XGUI_MainWindow::getSubWindow()
{
QMdiSubWindow* aSub = new QMdiSubWindow(this);
+ aSub->setGeometry(0,0, 600, 400);
QLabel* aLbl = new QLabel(aSub);
aLbl->setFrameStyle(QFrame::Sunken);
aLbl->setFrameShape(QFrame::Panel);
aItem->setIcon(0, QIcon(":pictures/features.png"));
}
}
+
+
+void XGUI_MainWindow::addPropertyPanel()
+{
+ QDockWidget* aPropPanel = new QDockWidget(this);
+ aPropPanel->setWindowTitle("Property panel");
+
+ QWidget* aContent = new QWidget(aPropPanel);
+ QVBoxLayout* aMainLay = new QVBoxLayout(aContent);
+ aMainLay->setContentsMargins(3,3,3,3);
+ aPropPanel->setWidget(aContent);
+
+ QWidget* aNameWgt = new QWidget(aContent);
+ QHBoxLayout* aNameLay = new QHBoxLayout(aNameWgt);
+ aNameLay->setContentsMargins(0,0,0,0);
+ aMainLay->addWidget(aNameWgt);
+
+ aNameLay->addWidget(new QLabel("Name", aNameWgt));
+ aNameLay->addWidget(new QLineEdit(aNameWgt));
+
+ QGroupBox* aGrpBox1 = new QGroupBox("Point", aContent);
+ aGrpBox1->setFlat(true);
+ QFormLayout* aFrmLay = new QFormLayout(aGrpBox1);
+ aFrmLay->setContentsMargins(0, 6, 0, 0);
+ aMainLay->addWidget(aGrpBox1);
+
+ QLabel* aLbl = new QLabel(aGrpBox1);
+ aLbl->setPixmap(QPixmap(":pictures/x_point.png"));
+ aFrmLay->addRow(aLbl, new QDoubleSpinBox(aGrpBox1));
+
+ aLbl = new QLabel(aGrpBox1);
+ aLbl->setPixmap(QPixmap(":pictures/y_point.png"));
+ aFrmLay->addRow(aLbl, new QDoubleSpinBox(aGrpBox1));
+
+ aLbl = new QLabel(aGrpBox1);
+ aLbl->setPixmap(QPixmap(":pictures/z_point.png"));
+ aFrmLay->addRow(aLbl, new QDoubleSpinBox(aGrpBox1));
+
+
+ aGrpBox1 = new QGroupBox("Normal vector", aContent);
+ aGrpBox1->setFlat(true);
+ aFrmLay = new QFormLayout(aGrpBox1);
+ aFrmLay->setContentsMargins(0, 6, 0, 0);
+ aMainLay->addWidget(aGrpBox1);
+
+ aLbl = new QLabel(aGrpBox1);
+ aLbl->setPixmap(QPixmap(":pictures/x_size.png"));
+ aFrmLay->addRow(aLbl, new QDoubleSpinBox(aGrpBox1));
+
+ aLbl = new QLabel(aGrpBox1);
+ aLbl->setPixmap(QPixmap(":pictures/y_size.png"));
+ aFrmLay->addRow(aLbl, new QDoubleSpinBox(aGrpBox1));
+
+ aLbl = new QLabel(aGrpBox1);
+ aLbl->setPixmap(QPixmap(":pictures/z_size.png"));
+ aFrmLay->addRow(aLbl, new QDoubleSpinBox(aGrpBox1));
+
+ aMainLay->addStretch(1);
+
+ QFrame* aFrm = new QFrame(aContent);
+ aFrm->setFrameStyle(QFrame::Sunken);
+ aFrm->setFrameShape(QFrame::Panel);
+ QHBoxLayout* aBtnLay = new QHBoxLayout(aFrm);
+ aBtnLay->setContentsMargins(0, 0, 0, 0);
+ aMainLay->addWidget(aFrm);
+
+ QPushButton* aBtn = new QPushButton(QIcon(":pictures/button_help.png"), "", aFrm);
+ aBtn->setFlat(true);
+ aBtnLay->addWidget(aBtn);
+ aBtnLay->addStretch(1);
+ aBtn = new QPushButton(QIcon(":pictures/button_cancel.png"), "", aFrm);
+ aBtn->setFlat(true);
+ aBtnLay->addWidget(aBtn);
+ aBtn = new QPushButton(QIcon(":pictures/button_ok.png"), "", aFrm);
+ aBtn->setFlat(true);
+ aBtnLay->addWidget(aBtn);
+
+ addDockWidget(Qt::RightDockWidgetArea, aPropPanel);
+}
\ No newline at end of file
private:
//!! For test purposes only
QWidget* getSubWindow();
+
void fillObjectBrowser();
+ void addPropertyPanel();
XGUI_MainMenu* myMenuBar;
+++ /dev/null
-
-#ifndef XGUI_Module_H
-#define XGUI_Module_H
-
-#include <QString>
-
-class XGUI_Module
-{
-public:
- //! Returns a string in XML format with definition of the module commands
- virtual QString moduleDescription() const = 0;
-};
-
-
-//! This function must return a new module instance.
-extern "C"
-{
- typedef XGUI_Module* (*CREATE_FUNC)();
-}
-
-#define CREATE_MODULE "createModule"
-
-
-#endif
\ No newline at end of file
void CommandsArea::resizeEvent(QResizeEvent* theEvent)
{
+ int x = widget()->x();
QScrollArea::resizeEvent(theEvent);
QRect aRect = widget()->childrenRect();
QSize aNewSize = theEvent->size();
if (aRect.width() > aNewSize.width())
aNewSize.setWidth(aRect.width() * 2);
widget()->resize(aNewSize);
+ widget()->move(x, 0);
}
myRightButton = new QPushButton(">", this);
myRightButton->setMaximumWidth(14);
- //myRightButton->setEnabled(false);
myRightButton->setVisible(false);
connect(myRightButton,SIGNAL(clicked()), this, SLOT(onRightScroll()));
aMainLayout->addWidget(myRightButton);
if (aW < aS.width())
myChildWidget->resize(aS.width(), myChildWidget->height());
- //myLeftButton->setEnabled(isExceedsLeft());
- //myRightButton->setEnabled(isExceedsRight());
myLeftButton->setVisible(isExceedsLeft());
myRightButton->setVisible(isExceedsRight());
}
myChildWidget->move( myChildWidget->pos().x() + SCROLL_STEP, 0 );
myLeftButton->setVisible(isExceedsLeft());
myRightButton->setVisible(isExceedsRight());
- //myLeftButton->setEnabled(isExceedsLeft());
- //myRightButton->setEnabled(isExceedsRight());
}
if (!isExceedsRight())
return;
myChildWidget->move( myChildWidget->pos().x() - SCROLL_STEP, 0 );
- //myLeftButton->setEnabled(isExceedsLeft());
- //myRightButton->setEnabled(isExceedsRight());
myLeftButton->setVisible(isExceedsLeft());
myRightButton->setVisible(isExceedsRight());
}
#include "XGUI_MainMenu.h"
#include "XGUI_Command.h"
#include "XGUI_Tools.h"
-#include "XGUI_Module.h"
#include <QApplication>
#include <QFileDialog>
QObject()
{
myMainWindow = new XGUI_MainWindow();
-
- // Set Logo
- //XGUI_MainMenu* aMenuBar = myMainWindow->menuBar();
- //aMenuBar->setLogo(QPixmap(":pictures/OCCLogo.png"));
}
//******************************************************
void XGUI_Workshop::startApplication()
{
initMenu();
- //loadModules();
+ activateModule();
myMainWindow->show();
}
int aPageId = addWorkbench(tr("HOME_MENU_TITLE"));
// File commands group
- int aGroupId = addPageGroup(aPageId);
+ int aGroupId = addGroup(aPageId);
XGUI_Command* aCommand;
- aCommand = createMenuCommand(aPageId, aGroupId, NEW_CMD, tr("NEW_MENU"), tr("NEW_MENU_TIP"),
- QIcon(":pictures/new.png"), QKeySequence::New);
- connect(aCommand, SIGNAL(triggered()), this, SLOT(onNew()));
+ //aCommand = createMenuCommand(aPageId, aGroupId, NEW_CMD, tr("NEW_MENU"), tr("NEW_MENU_TIP"),
+ // QIcon(":pictures/new.png"), QKeySequence::New);
+ //connect(aCommand, SIGNAL(triggered()), this, SLOT(onNew()));
- aCommand = createMenuCommand(aPageId, aGroupId, OPEN_CMD, tr("OPEN_MENU"), tr("OPEN_MENU_TIP"),
- QIcon(":pictures/open.png"), QKeySequence::Open);
- connect(aCommand, SIGNAL(triggered()), this, SLOT(onOpen()));
+ //aCommand = createMenuCommand(aPageId, aGroupId, OPEN_CMD, tr("OPEN_MENU"), tr("OPEN_MENU_TIP"),
+ // QIcon(":pictures/open.png"), QKeySequence::Open);
+ //connect(aCommand, SIGNAL(triggered()), this, SLOT(onOpen()));
aCommand = createMenuCommand(aPageId, aGroupId, SAVE_CMD, tr("SAVE_MENU"), tr("SAVE_MENU_TIP"),
QIcon(":pictures/save.png"), QKeySequence::Save);
connect(aCommand, SIGNAL(triggered()), this, SLOT(onSaveAs()));
aCommand->setEnabled(false);
- aCommand = createMenuCommand(aPageId, aGroupId, EXIT_CMD, tr("EXIT_MENU"), tr("EXIT_MENU_TIP"),
- QIcon(":pictures/close.png"), QKeySequence::Close);
- connect(aCommand, SIGNAL(triggered()), this, SLOT(onExit()));
-
// Edit commands group
- aGroupId = addPageGroup(aPageId);
+ //aGroupId = addGroup(aPageId);
aCommand = createMenuCommand(aPageId, aGroupId, UNDO_CMD, tr("UNDO_MENU"), tr("UNDO_MENU_TIP"),
QIcon(":pictures/undo.png"), QKeySequence::Undo);
aCommand = createMenuCommand(aPageId, aGroupId, REDO_CMD, tr("REDO_MENU"), tr("REDO_MENU_TIP"),
QIcon(":pictures/redo.png"), QKeySequence::Redo);
- aCommand = createMenuCommand(aPageId, aGroupId, CUT_CMD, tr("CUT_MENU"), tr("CUT_MENU_TIP"),
- QIcon(":pictures/cut.png"), QKeySequence::Cut);
+ //aCommand = createMenuCommand(aPageId, aGroupId, CUT_CMD, tr("CUT_MENU"), tr("CUT_MENU_TIP"),
+ // QIcon(":pictures/cut.png"), QKeySequence::Cut);
- aCommand = createMenuCommand(aPageId, aGroupId, COPY_CMD, tr("COPY_MENU"), tr("COPY_MENU_TIP"),
- QIcon(":pictures/copy.png"), QKeySequence::Copy);
+ //aCommand = createMenuCommand(aPageId, aGroupId, COPY_CMD, tr("COPY_MENU"), tr("COPY_MENU_TIP"),
+ // QIcon(":pictures/copy.png"), QKeySequence::Copy);
- aCommand = createMenuCommand(aPageId, aGroupId, PASTE_CMD, tr("PASTE_MENU"), tr("PASTE_MENU_TIP"),
- QIcon(":pictures/paste.png"), QKeySequence::Paste);
+ //aCommand = createMenuCommand(aPageId, aGroupId, PASTE_CMD, tr("PASTE_MENU"), tr("PASTE_MENU_TIP"),
+ // QIcon(":pictures/paste.png"), QKeySequence::Paste);
+
+ aCommand = createMenuCommand(aPageId, aGroupId, EXIT_CMD, tr("EXIT_MENU"), tr("EXIT_MENU_TIP"),
+ QIcon(":pictures/close.png"), QKeySequence::Close);
+ connect(aCommand, SIGNAL(triggered()), this, SLOT(onExit()));
// Tests
- aPageId = addWorkbench("Primitives");
- aGroupId = addPageGroup(aPageId);
-
- aCommand = createMenuCommand(aPageId, aGroupId, LAST_CMD, "Box", "Create Box", QIcon(":pictures/box.png"));
- aCommand = createMenuCommand(aPageId, aGroupId, LAST_CMD, "Cylinder", "Create Cylinder", QIcon(":pictures/cylinder.png"));
- aCommand = createMenuCommand(aPageId, aGroupId, LAST_CMD, "Disk", "Create Disk", QIcon(":pictures/disk.png"));
- aCommand = createMenuCommand(aPageId, aGroupId, LAST_CMD, "Torus", "Create Torus", QIcon(":pictures/torus.png"));
+ //aPageId = addWorkbench("Primitives");
+ //aGroupId = addGroup(aPageId);
+ //
+ //aCommand = createMenuCommand(aPageId, aGroupId, LAST_CMD, "Box", "Create Box", QIcon(":pictures/box.png"));
+ //aCommand = createMenuCommand(aPageId, aGroupId, LAST_CMD, "Cylinder", "Create Cylinder", QIcon(":pictures/cylinder.png"));
+ //aCommand = createMenuCommand(aPageId, aGroupId, LAST_CMD, "Disk", "Create Disk", QIcon(":pictures/disk.png"));
+ //aCommand = createMenuCommand(aPageId, aGroupId, LAST_CMD, "Torus", "Create Torus", QIcon(":pictures/torus.png"));
- aPageId = addWorkbench("Operations");
+ //aPageId = addWorkbench("Operations");
}
}
//******************************************************
-int XGUI_Workshop::addPageGroup(int thePageId)
+int XGUI_Workshop::addGroup(int thePageId)
{
XGUI_MainMenu* aMenuBar = myMainWindow->menuObject();
return aMenuBar->addGroup(thePageId);
}
//******************************************************
-XGUI_Module* XGUI_Workshop::loadModule(const QString& theModule)
+IModule* XGUI_Workshop::loadModule(const QString& theModule)
{
QString libName = library( theModule );
if ( libName.isEmpty() )
CREATE_FUNC crtInst = 0;
#ifdef WIN32
- HINSTANCE modLib = ::LoadLibrary( (LPTSTR) libName.utf16() );
+
+ HINSTANCE modLib = ::LoadLibrary( (LPTSTR) qPrintable(libName) );
if ( !modLib )
{
LPVOID lpMsgBuf;
}
#endif
- XGUI_Module* aModule = crtInst ? crtInst() : 0;
+ IModule* aModule = crtInst ? crtInst(this) : 0;
if ( !err.isEmpty() ) {
if ( mainWindow() && mainWindow()->isVisible() )
}
//******************************************************
-void XGUI_Workshop::loadModules()
+bool XGUI_Workshop::activateModule()
{
// Test of modules loading
- QStringList aModules;
- aModules << "GeomModule";
-
- foreach(QString aName, aModules) {
- XGUI_Module* aModule = loadModule(aName);
- buildModuleMenu(aModule->moduleDescription());
- }
+ IModule* aModule = loadModule("GeomModule");
+ if (!aModule)
+ return false;
+ aModule->createFeatures();
+ return true;
}
//******************************************************
-void XGUI_Workshop::buildModuleMenu(const QString& theXML)
+int XGUI_Workshop::addFeature(int thePageId, int theGroupId,
+ const QString& theTitle, const QString& theTip,
+ const QIcon& theIcon,
+ const QKeySequence& theKeys)
{
-
+ return (int) createMenuCommand(thePageId, theGroupId, LAST_CMD, theTitle, theTip, theIcon, theKeys);
}
#ifndef XGUI_WORKSHOP_H
#define XGUI_WORKSHOP_H
+#include "XGUI_Interfaces.h"
+
#include <QObject>
#include <QMap>
#include <QIcon>
class XGUI_Command;
class XGUI_Module;
-class XGUI_Workshop: public QObject
+class XGUI_Workshop: public QObject, IWorkshop
{
Q_OBJECT
public:
XGUI_MainWindow* mainWindow() const { return myMainWindow; }
+ virtual int addWorkbench(const QString& theName);
+ virtual int addGroup(int thePageId);
+ virtual int addFeature(int thePageId, int theGroupId,
+ const QString& theTitle, const QString& theTip,
+ const QIcon& theIcon,
+ const QKeySequence& theKeys = QKeySequence());
+
+
public slots:
void onNew();
void onOpen();
private:
void initMenu();
- XGUI_Module* loadModule(const QString& theModule);
- void loadModules();
-
- void buildModuleMenu(const QString& theXML);
+ IModule* loadModule(const QString& theModule);
+ bool activateModule();
- int addWorkbench(const QString& theName);
- int addPageGroup(int thePageId);
void addCommand(XCommandId theCommandId, int thePageId, int theGroupId, XGUI_Command* theCommand);
XGUI_Command* createMenuCommand(int thePageId, int theGroupId, XCommandId theCmdId,
const QString& theTitle, const QString& theTip,
<file>pictures/redo.png</file>
<file>pictures/undo.png</file>
<!--For test purposes-->
- <file>pictures/box.png</file>
- <file>pictures/cylinder.png</file>
- <file>pictures/disk.png</file>
- <file>pictures/torus.png</file>
+
<file>pictures/ViewPort.png</file>
<file>pictures/occ_view_ambient.png</file>
<file>pictures/properties.png</file>
<file>pictures/features.png</file>
+ <file>pictures/x_point.png</file>
+ <file>pictures/y_point.png</file>
+ <file>pictures/z_point.png</file>
+ <file>pictures/x_size.png</file>
+ <file>pictures/y_size.png</file>
+ <file>pictures/z_size.png</file>
+
+ <file>pictures/button_cancel.png</file>
+ <file>pictures/button_help.png</file>
+ <file>pictures/button_ok.png</file>
</qresource>
</RCC>