Salome HOME
projects
/
modules
/
shaper.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
refs #30 - Sketch base GUI: create, draw lines
[modules/shaper.git]
/
src
/
XGUI
/
XGUI_ViewWindow.h
diff --git
a/src/XGUI/XGUI_ViewWindow.h
b/src/XGUI/XGUI_ViewWindow.h
index be28c95a0aba45dd6c337c1349379fa580c8572b..77b966d860a0901ba6eeac2250bab8db8f3c3c03 100644
(file)
--- a/
src/XGUI/XGUI_ViewWindow.h
+++ b/
src/XGUI/XGUI_ViewWindow.h
@@
-1,6
+1,7
@@
#ifndef XGUI_ViewWindow_H
#define XGUI_ViewWindow_H
#ifndef XGUI_ViewWindow_H
#define XGUI_ViewWindow_H
+#include "XGUI.h"
#include "XGUI_Constants.h"
#include "XGUI_ViewBackground.h"
#include "XGUI_Constants.h"
#include "XGUI_ViewBackground.h"
@@
-27,7
+28,7
@@
class QMdiSubWindow;
It contains a view port object (drawing area) and toolbars for view camera and window management.
Also it managements events in view port
*/
It contains a view port object (drawing area) and toolbars for view camera and window management.
Also it managements events in view port
*/
-class XGUI_ViewWindow: public QFrame
+class XGUI_
EXPORT XGUI_
ViewWindow: public QFrame
{
Q_OBJECT
public:
{
Q_OBJECT
public:
@@
-86,6
+87,12
@@
public:
//! Sets the current view window closable or not
void setClosable( const bool isClosable ) { myClosable = isClosable; }
//! Sets the current view window closable or not
void setClosable( const bool isClosable ) { myClosable = isClosable; }
+ //! Enable/Disable drawing of ribbon line
+ void enableDrawMode(bool toEnable) { myEnableDrawMode = toEnable; }
+
+ //! Returns true if ribbon line drawing enabled
+ bool isDrawModeEnabled() const { return myEnableDrawMode; }
+
signals:
//! Emited whien view transformation operation is started
void vpTransformationStarted(XGUI_ViewWindow::OperationType type);
signals:
//! Emited whien view transformation operation is started
void vpTransformationStarted(XGUI_ViewWindow::OperationType type);
@@
-174,17
+181,17
@@
public slots:
//! Reset point of view
void reset();
//! Reset point of view
void reset();
+ void windowActivated();
-protected:
- virtual void resizeEvent(QResizeEvent* theEvent);
+ void windowDeactivated();
+protected:
virtual void changeEvent(QEvent* theEvent);
virtual void changeEvent(QEvent* theEvent);
- virtual void enterEvent(QEvent* theEvent);
- virtual void leaveEvent(QEvent* theEvent);
-
virtual bool eventFilter(QObject *theObj, QEvent *theEvent);
virtual bool eventFilter(QObject *theObj, QEvent *theEvent);
+ virtual void showEvent(QShowEvent* theEvent);
+
private slots:
void onClose();
void onMinimize();
private slots:
void onClose();
void onMinimize();
@@
-196,7
+203,9
@@
private slots:
private:
enum WindowState
{
private:
enum WindowState
{
- MinimizedState, MaximizedState, NormalState
+ MinimizedState,
+ MaximizedState,
+ WindowNormalState
};
bool processWindowControls(QObject *theObj, QEvent *theEvent);
};
bool processWindowControls(QObject *theObj, QEvent *theEvent);
@@
-263,6
+272,7
@@
private:
bool myIsKeyFree;
bool myEventStarted; // set when transformation is in process
bool myClosable;
bool myIsKeyFree;
bool myEventStarted; // set when transformation is in process
bool myClosable;
+ bool myIsActive;
QCursor myCursor;
QCursor myCursor;
@@
-289,21
+299,19
@@
class ViewerToolbar: public QToolBar
{
Q_OBJECT
public:
{
Q_OBJECT
public:
- ViewerToolbar(QWidget* theParent, XGUI_ViewPort* thePort)
- : QToolBar(theParent), myVPort(thePort)
- {
- setBackgroundRole(QPalette::NoRole);
- setAttribute(Qt::WA_NoSystemBackground);
- setAttribute(Qt::WA_PaintOnScreen);
- }
+ ViewerToolbar(QWidget* theParent, XGUI_ViewPort* thePort);
- void repaintBackground();
+protected slots:
+ void onViewPortResized() { myResize = true; }
protected:
virtual void paintEvent(QPaintEvent* theEvent);
protected:
virtual void paintEvent(QPaintEvent* theEvent);
+
+
private:
XGUI_ViewPort* myVPort;
private:
XGUI_ViewPort* myVPort;
+ bool myResize;
};
//******************************************************
};
//******************************************************
@@
-316,19
+324,17
@@
class ViewerLabel: public QLabel
{
Q_OBJECT
public:
{
Q_OBJECT
public:
- ViewerLabel(QWidget* theParent, XGUI_ViewPort* thePort)
- : QLabel(theParent), myVPort(thePort)
- {
- setAttribute(Qt::WA_NoSystemBackground);
- }
+ ViewerLabel(QWidget* theParent, XGUI_ViewPort* thePort);
- void repaintBackground();
+protected slots:
+ void onViewPortResized() { myResize = true; }
protected:
virtual void paintEvent(QPaintEvent* theEvent);
private:
XGUI_ViewPort* myVPort;
protected:
virtual void paintEvent(QPaintEvent* theEvent);
private:
XGUI_ViewPort* myVPort;
+ bool myResize;
};
#endif
};
#endif