summaryrefslogtreecommitdiff
path: root/lspaneeditor.cpp
blob: 2da39f5d9a505b19f21e658bc95dbd0f309423f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
#include "lspaneeditor.h"
#include <QGroupBox>

LSPaneEditor::LSPaneEditor(QWidget *parent) :
	QWidget(parent) {

	m_headingLabel = new QLabel(this);

	m_addChildButton = new QToolButton(this);
	m_addChildButton->setToolButtonStyle(Qt::ToolButtonTextBesideIcon);
	m_addChildButton->setPopupMode(QToolButton::InstantPopup);
	m_addChildButton->setText("Add Child Pane");

	m_addChildMenu = new QMenu(m_addChildButton);
	m_addChildMenu->addSeparator();
	m_addChildButton->setMenu(m_addChildMenu);

	m_removeButton = new QToolButton(this);
	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);
}