top_srcdir=@top_srcdir@
top_builddir=../..
srcdir=@srcdir@
-VPATH=.:@srcdir@:@top_srcdir@/idl
+VPATH=.:@srcdir@:@top_srcdir@/idl:@srcdir@/resources
@COMMENCE@
SUPERVGraph_ViewModel.h \
SUPERVGraph.h
+# .po files to transmit in .qm
+PO_FILES = SUPERVGraph_images.po \
+ SUPERVGraph_msg_en.po
+
# Libraries targets
LIB = libSUPERVGraph.la
SUPERVGraph_ViewManager_moc.cxx \
SUPERVGraph_ViewModel_moc.cxx
+RESOURCES_FILES = view_pan.png \
+ view_reset.png
+
LIB_CLIENT_IDL =
CPPFLAGS+=$(QT_INCLUDES) $(OCC_INCLUDES) $(PYTHON_INCLUDES) $(BOOST_CPPFLAGS) -I${KERNEL_ROOT_DIR}/include/salome
#include "SUPERVGraph_ViewFrame.h"
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+
//QT Include
#include <qlayout.h>
#include <qcolordialog.h>
int G = QAD_CONFIG->getSetting("SUPERVGraph:BackgroundColorGreen").toInt();
int B = QAD_CONFIG->getSetting("SUPERVGraph:BackgroundColorBlue").toInt();
setBackgroundColor(QColor(R,G,B));*/
+
+ myToolBar = new QToolBar(this);
+ myToolBar->setCloseMode(QDockWindow::Undocked);
+ myToolBar->setLabel(tr("LBL_TOOLBAR_LABEL"));
+ createActions();
+ createToolBar();
+}
+
+void SUPERVGraph_ViewFrame::createActions()
+{
+ if (!myActionsMap.isEmpty()) return;
+ SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
+ QAction* aAction;
+
+ // Panning
+ aAction = new QAction(tr("MNU_PAN_VIEW"), aResMgr->loadPixmap( "SUPERVGraph", tr( "ICON_SUPERVGraph_PAN" ) ),
+ tr( "MNU_PAN_VIEW" ), 0, this);
+ aAction->setStatusTip(tr("DSC_PAN_VIEW"));
+ connect(aAction, SIGNAL(activated()), this, SLOT(onViewPan()));
+ myActionsMap[ PanId ] = aAction;
+
+ // Reset
+ aAction = new QAction(tr("MNU_RESET_VIEW"), aResMgr->loadPixmap( "SUPERVGraph", tr( "ICON_SUPERVGraph_RESET" ) ),
+ tr( "MNU_RESET_VIEW" ), 0, this);
+ aAction->setStatusTip(tr("DSC_RESET_VIEW"));
+ connect(aAction, SIGNAL(activated()), this, SLOT(onViewReset()));
+ myActionsMap[ ResetId ] = aAction;
+}
+
+//================================================================
+// Function : createToolBar
+// Purpose :
+//================================================================
+void SUPERVGraph_ViewFrame::createToolBar()
+{
+ myActionsMap[PanId]->addTo(myToolBar);
+ myActionsMap[ResetId]->addTo(myToolBar);
}
SUPERVGraph_ViewFrame::~SUPERVGraph_ViewFrame() {}
#include "SUIT_PopupClient.h"
#include "SUIT_ViewWindow.h"
+#include <qaction.h>
+
class SUPERVGRAPH_EXPORT SUPERVGraph_View: public QWidget, public SUIT_PopupClient {
Q_OBJECT;
public:
void onViewTrihedron();
protected:
- void resizeEvent( QResizeEvent* theEvent );
+ void resizeEvent( QResizeEvent* theEvent );
private:
+ void createActions();
+ void createToolBar();
+
+ //! Actions ID
+ enum { PanId, ResetId };
+ typedef QMap<int, QAction*> ActionsMap;
+
+ ActionsMap myActionsMap;
+ QToolBar* myToolBar;
+
SUPERVGraph_View* myView;
};
#endif
--- /dev/null
+// File: SUPERVGraph_msg_en.po
+// Created: 11/22/2005 10:55:36 PM
+// Author: Margarita Karpunina
+// Copyright (C) CEA 2005
+
+msgid "LBL_TOOLBAR_LABEL"
+msgstr "View Operations"
+
+msgid "DSC_RESET_VIEW"
+msgstr "Reset View Point"
+
+msgid "MNU_RESET_VIEW"
+msgstr "Reset"
+
+msgid "DSC_PAN_VIEW"
+msgstr "Panning the view"
+
+msgid "MNU_PAN_VIEW"
+msgstr "Panning"
<parameter name="SalomeApp" value="${SUITRoot}/resources"/>
<parameter name="OB" value="${SUITRoot}/resources"/>
<parameter name="CAM" value="${SUITRoot}/resources"/>
+ <parameter name="SUPERVGraph" value="${SUITRoot}/resources"/>
<parameter name="GEOM" value="${GEOM_ROOT_DIR}/share/salome/resources"/>
<parameter name="LIGHT" value="${LIGHT_ROOT_DIR}/share/salome/resources"/>
<parameter name="SMESH" value="${SMESH_ROOT_DIR}/share/salome/resources"/>