#include "VTKViewer_MarkerDlg.h"
#include "VTKViewer_MarkerWidget.h"
+#include <SUIT_Application.h>
+#include <SUIT_MessageBox.h>
+#include <SUIT_ResourceMgr.h>
+#include <SUIT_Session.h>
+
#include <QFrame>
#include <QHBoxLayout>
+#include <QKeyEvent>
/*!
* Class : VTKViewer_MarkerDlg
aTopLayout->setSpacing( 0 );
aTopLayout->setMargin( 0 );
aTopLayout->addWidget( myMarkerWidget );
+
+ connect( this, SIGNAL( dlgHelp() ), this, SLOT( onHelp() ) );
}
/*!
{
}
+void VTKViewer_MarkerDlg::setHelpData( const QString& theModuleName,
+ const QString& theHelpFileName )
+{
+ myModuleName = theModuleName;
+ myHelpFileName = theHelpFileName;
+}
+
+void VTKViewer_MarkerDlg::keyPressEvent( QKeyEvent* e )
+{
+ QtxDialog::keyPressEvent( e );
+ if ( e->isAccepted() )
+ return;
+
+ if ( e->key() == Qt::Key_F1 ) {
+ e->accept();
+ onHelp();
+ }
+}
+
+void VTKViewer_MarkerDlg::onHelp()
+{
+ if( myModuleName.isNull() || myHelpFileName.isNull() )
+ return;
+
+ SUIT_Application* app = SUIT_Session::session()->activeApplication();
+ if (app)
+ app->onHelpContextModule(myModuleName, myHelpFileName);
+ else {
+ QString platform;
+#ifdef WIN32
+ platform = "winapplication";
+#else
+ platform = "application";
+#endif
+ SUIT_MessageBox::warning(this, tr("WRN_WARNING"),
+ tr("EXTERNAL_BROWSER_CANNOT_SHOW_PAGE").
+ arg(app->resourceMgr()->stringValue("ExternalBrowser",
+ platform)).
+ arg(myHelpFileName));
+ }
+}
+
void VTKViewer_MarkerDlg::setCustomMarkerMap( VTK::MarkerMap theMarkerMap )
{
myMarkerWidget->setCustomMarkerMap( theMarkerMap );
VTKViewer_MarkerDlg( QWidget* = 0 );
virtual ~VTKViewer_MarkerDlg();
+ void setHelpData( const QString& theModuleName,
+ const QString& theHelpFileName );
+
void setCustomMarkerMap( VTK::MarkerMap );
VTK::MarkerMap getCustomMarkerMap();
VTK::MarkerScale getStandardMarkerScale() const;
int getCustomMarkerID() const;
+protected:
+ void keyPressEvent( QKeyEvent* );
+
+private slots:
+ void onHelp();
+
private:
VTKViewer_MarkerWidget* myMarkerWidget;
+
+ QString myModuleName;
+ QString myHelpFileName;
};
#endif