~ubuntu-branches/ubuntu/raring/openwalnut/raring

« back to all changes in this revision

Viewing changes to src/qt4gui/controlPanel/WPropertyMatrix4X4Widget.h

  • Committer: Package Import Robot
  • Author(s): Sebastian Eichelbaum
  • Date: 2012-12-12 11:26:32 UTC
  • mfrom: (3.1.1 sid)
  • Revision ID: package-import@ubuntu.com-20121212112632-xhiuwkxuz5h0idkh
Tags: 1.3.1+hg5849-1
* Minor changes compared to 1.3.0 but included several bug fixes.
* See http://www.openwalnut.org/versions/4

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//---------------------------------------------------------------------------
 
2
//
 
3
// Project: OpenWalnut ( http://www.openwalnut.org )
 
4
//
 
5
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
 
6
// For more information see http://www.openwalnut.org/copying
 
7
//
 
8
// This file is part of OpenWalnut.
 
9
//
 
10
// OpenWalnut is free software: you can redistribute it and/or modify
 
11
// it under the terms of the GNU Lesser General Public License as published by
 
12
// the Free Software Foundation, either version 3 of the License, or
 
13
// (at your option) any later version.
 
14
//
 
15
// OpenWalnut is distributed in the hope that it will be useful,
 
16
// but WITHOUT ANY WARRANTY; without even the implied warranty of
 
17
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
18
// GNU Lesser General Public License for more details.
 
19
//
 
20
// You should have received a copy of the GNU Lesser General Public License
 
21
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
 
22
//
 
23
//---------------------------------------------------------------------------
 
24
 
 
25
#ifndef WPROPERTYMATRIX4X4WIDGET_H
 
26
#define WPROPERTYMATRIX4X4WIDGET_H
 
27
 
 
28
#include <string>
 
29
 
 
30
#include <QtGui/QLineEdit>
 
31
#include <QtGui/QSlider>
 
32
#include <QtGui/QHBoxLayout>
 
33
 
 
34
#include "WPropertyWidget.h"
 
35
 
 
36
class WScaleLabel;
 
37
 
 
38
/**
 
39
 * Implements a property widget for MATRIX4X4.
 
40
 */
 
41
class WPropertyMatrix4X4Widget: public WPropertyWidget
 
42
{
 
43
    Q_OBJECT
 
44
public:
 
45
    /**
 
46
     * Constructor. Creates a new widget appropriate for the specified property.
 
47
     *
 
48
     * \param property the property to handle
 
49
     * \param parent the parent widget.
 
50
     * \param propertyGrid the grid used to layout the labels and property widgets
 
51
     */
 
52
    WPropertyMatrix4X4Widget( WPropMatrix4X4 property, QGridLayout* propertyGrid, QWidget* parent = 0 );
 
53
 
 
54
    /**
 
55
     * Destructor.
 
56
     */
 
57
    virtual ~WPropertyMatrix4X4Widget();
 
58
 
 
59
protected:
 
60
    /**
 
61
     * Called whenever the widget should update.
 
62
     */
 
63
    virtual void update();
 
64
 
 
65
    /**
 
66
     * The integer property represented by this widget.
 
67
     */
 
68
    WPropMatrix4X4 m_matrixProperty;
 
69
 
 
70
    /**
 
71
     * The edit field showing the value of the slider
 
72
     */
 
73
    QLineEdit m_edits[16];
 
74
 
 
75
    /**
 
76
     * Layout used to position the label and the widgets
 
77
     */
 
78
    QVBoxLayout m_layout;
 
79
 
 
80
    /**
 
81
     * Used to show the property as text.
 
82
     */
 
83
    WScaleLabel m_asText;
 
84
 
 
85
    /**
 
86
     * The layout used for the pure output (information properties)
 
87
     */
 
88
    QHBoxLayout m_infoLayout;
 
89
 
 
90
    /**
 
91
     * Updates the property using the edit X Y and Z widgets.
 
92
     *
 
93
     * \param validateOnly true if the prop should not really be set. Just validated.
 
94
     */
 
95
    void setPropertyFromWidgets( bool validateOnly = false );
 
96
 
 
97
private:
 
98
public slots:
 
99
 
 
100
    /**
 
101
     * Called whenever the edit field changes
 
102
     */
 
103
    void editChanged();
 
104
 
 
105
    /**
 
106
     * Called when the text in m_edit changes.
 
107
     *
 
108
     * \param text
 
109
     */
 
110
    void textEdited( const QString& text );
 
111
};
 
112
 
 
113
#endif  // WPROPERTYMATRIX4X4WIDGET_H
 
114