From 18efce00580c8e9d15c8bebbf00eca1ff2e5e971 Mon Sep 17 00:00:00 2001 From: Treeki Date: Fri, 17 Aug 2012 21:06:20 +0200 Subject: added the Pane tab layout, still got to make it work... --- lspaneeditor.cpp | 120 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- lspaneeditor.h | 22 ++++++++++ 2 files changed, 140 insertions(+), 2 deletions(-) diff --git a/lspaneeditor.cpp b/lspaneeditor.cpp index eae5813..2da39f5 100644 --- a/lspaneeditor.cpp +++ b/lspaneeditor.cpp @@ -1,10 +1,9 @@ #include "lspaneeditor.h" +#include LSPaneEditor::LSPaneEditor(QWidget *parent) : QWidget(parent) { - QGridLayout *layout = new QGridLayout(this); - m_headingLabel = new QLabel(this); m_addChildButton = new QToolButton(this); @@ -20,8 +19,125 @@ LSPaneEditor::LSPaneEditor(QWidget *parent) : m_removeButton->setToolButtonStyle(Qt::ToolButtonTextOnly); m_removeButton->setText("Remove This Pane"); + m_tabs = new QTabWidget(this); + + QGridLayout *layout = new QGridLayout(this); + layout->addWidget(m_headingLabel, 0, 0, 1, 1); layout->setColumnStretch(0, 1); layout->addWidget(m_addChildButton, 0, 1, 1, 1); layout->addWidget(m_removeButton, 0, 2, 1, 1); + + layout->addWidget(m_tabs, 1, 0, 1, 3); + + + createPaneTab(); +} + +void LSPaneEditor::createPaneTab() { + m_paneTab = new QWidget(this); + m_tabs->addTab(m_paneTab, "Pane"); + + + QGridLayout *gLayout; + + // Properties Box + QGroupBox *propBox = new QGroupBox("Basic Properties", m_paneTab); + gLayout = new QGridLayout(propBox); + + m_nameEntry = new QLineEdit(propBox); + m_nameEntry->setMaxLength(16); + + m_userDataEntry = new QLineEdit(propBox); + m_userDataEntry->setMaxLength(8); + + m_alpha = new QSpinBox(propBox); + m_alpha->setRange(0, 255); + + m_influencedAlpha = new QCheckBox("Influenced Alpha", propBox); + + // Column 0 + gLayout->addWidget(new QLabel("Name:", propBox), 0, 0, 1, 1); + gLayout->addWidget(m_nameEntry, 0, 1, 1, 1); + gLayout->addWidget(new QLabel("User Data:", propBox), 1, 0, 1, 1); + gLayout->addWidget(m_userDataEntry, 1, 1, 1, 1); + + // Colunm 1 + gLayout->addWidget(new QLabel("Alpha:", propBox), 0, 2, 1, 1); + gLayout->addWidget(m_alpha, 0, 3, 1, 1); + gLayout->addWidget(m_influencedAlpha, 1, 3, 1, 1); + + + // Geometry Box + QGroupBox *geoBox = new QGroupBox("Geometry", m_paneTab); + gLayout = new QGridLayout(geoBox); + + m_width = new QDoubleSpinBox(geoBox); + m_width->setRange(0.0, 100000.0); + m_height = new QDoubleSpinBox(geoBox); + m_height->setRange(0.0, 100000.0); + + m_horzOrigin = new QComboBox(geoBox); + m_horzOrigin->addItem("Left"); + m_horzOrigin->addItem("Center"); + m_horzOrigin->addItem("Right"); + + m_vertOrigin = new QComboBox(geoBox); + m_vertOrigin->addItem("Top"); + m_vertOrigin->addItem("Center"); + m_vertOrigin->addItem("Bottom"); + + m_widescreen = new QCheckBox("Widescreen", this); + m_visible = new QCheckBox("Visible", this); + + // Row 0 + gLayout->addWidget(new QLabel("Width:", geoBox), 0, 0, 1, 1); + gLayout->addWidget(m_width, 0, 1, 1, 1); + gLayout->addWidget(new QLabel("Height:", geoBox), 0, 2, 1, 1); + gLayout->addWidget(m_height, 0, 3, 1, 1); + + // Row 1 + gLayout->addWidget(new QLabel("Horizontal Origin:", geoBox), 1, 0, 1, 1); + gLayout->addWidget(m_horzOrigin, 1, 1, 1, 1); + gLayout->addWidget(new QLabel("Vertical Origin:", geoBox), 1, 2, 1, 1); + gLayout->addWidget(m_vertOrigin, 1, 3, 1, 1); + + // Row 2 + gLayout->addWidget(m_widescreen, 2, 0, 1, 2); + gLayout->addWidget(m_visible, 2, 2, 1, 2); + + + // Positioning Box + QGroupBox *posBox = new QGroupBox("Positioning", m_paneTab); + gLayout = new QGridLayout(posBox); + + m_transX = new QDoubleSpinBox(posBox); + m_transY = new QDoubleSpinBox(posBox); + m_transZ = new QDoubleSpinBox(posBox); + m_rotX = new QDoubleSpinBox(posBox); + m_rotY = new QDoubleSpinBox(posBox); + m_rotZ = new QDoubleSpinBox(posBox); + m_scaleX = new QDoubleSpinBox(posBox); + m_scaleY = new QDoubleSpinBox(posBox); + + gLayout->addWidget(new QLabel("Translation:", posBox), 0, 0, 1, 1); + gLayout->addWidget(m_transX, 0, 1, 1, 1); + gLayout->addWidget(m_transY, 0, 2, 1, 1); + gLayout->addWidget(m_transZ, 0, 3, 1, 1); + gLayout->addWidget(new QLabel("Rotation:", posBox), 1, 0, 1, 1); + gLayout->addWidget(m_rotX, 1, 1, 1, 1); + gLayout->addWidget(m_rotY, 1, 2, 1, 1); + gLayout->addWidget(m_rotZ, 1, 3, 1, 1); + gLayout->addWidget(new QLabel("Scale:", posBox), 2, 0, 1, 1); + gLayout->addWidget(m_scaleX, 2, 1, 1, 1); + gLayout->addWidget(m_scaleY, 2, 1, 1, 1); + + + // put it all together into one + + QVBoxLayout *layout = new QVBoxLayout(m_paneTab); + layout->addWidget(propBox); + layout->addWidget(geoBox); + layout->addWidget(posBox); + layout->addStretch(1); } diff --git a/lspaneeditor.h b/lspaneeditor.h index 92233cc..4955a72 100644 --- a/lspaneeditor.h +++ b/lspaneeditor.h @@ -7,6 +7,10 @@ #include #include #include +#include +#include +#include +#include class LSPaneEditor : public QWidget { Q_OBJECT @@ -20,6 +24,24 @@ private: QToolButton *m_addChildButton; QMenu *m_addChildMenu; QToolButton *m_removeButton; + + + // Main pane tab + QWidget *m_paneTab; + + QLineEdit *m_nameEntry, *m_userDataEntry; + QSpinBox *m_alpha; + QCheckBox *m_influencedAlpha; + + QDoubleSpinBox *m_width, *m_height; + QComboBox *m_horzOrigin, *m_vertOrigin; + QCheckBox *m_widescreen, *m_visible; + + QDoubleSpinBox *m_transX, *m_transY, *m_transZ; + QDoubleSpinBox *m_rotX, *m_rotY, *m_rotZ; + QDoubleSpinBox *m_scaleX, *m_scaleY; + + void createPaneTab(); signals: -- cgit v1.2.3