# HG changeset patch # User IBBoard # Date 1281196973 0 # Node ID c3c64e139e5ff0aac1f50c6e2a36a1ed3c605fc0 # Parent be876c03054fd9871543ecb196b9748f25a4cda2 Re #245: Create unit tab implementation * Create layout for unit tab widget * Start to populate values WARNING: Qyoto/Qt# seems unstable now and segfaults when new units are added! diff -r be876c03054f -r c3c64e139e5f IBBoard.WarFoundry.GUI.QtSharp.csproj --- a/IBBoard.WarFoundry.GUI.QtSharp.csproj Sat Aug 07 15:40:37 2010 +0000 +++ b/IBBoard.WarFoundry.GUI.QtSharp.csproj Sat Aug 07 16:02:53 2010 +0000 @@ -43,6 +43,7 @@ + @@ -109,6 +110,7 @@ PreserveNewest + diff -r be876c03054f -r c3c64e139e5f Widgets/UnitWidget.cs --- a/Widgets/UnitWidget.cs Sat Aug 07 15:40:37 2010 +0000 +++ b/Widgets/UnitWidget.cs Sat Aug 07 16:02:53 2010 +0000 @@ -8,9 +8,23 @@ { public class UnitWidget : QWidget { + private Ui_UnitWidgetLayout layout; + private Unit unit; + public UnitWidget(Unit unit) { + layout = new Ui_UnitWidgetLayout(); + layout.SetupUi(this); + this.unit = unit; + + PopulateValues(); } - } + + private void PopulateValues() + { + layout.unitName.SetText(unit.Name); + layout.unitSize.SetValue(unit.Size); + } +} } diff -r be876c03054f -r c3c64e139e5f qt-gui/UnitWidgetLayout.cs --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qt-gui/UnitWidgetLayout.cs Sat Aug 07 16:02:53 2010 +0000 @@ -0,0 +1,71 @@ +/******************************************************************************** +** Form generated from reading ui file 'UnitWidgetLayout.ui' +** +** Created: Sat Aug 7 16:50:14 2010 +** by: Qt User Interface Compiler for C# version 4.6.3 +** +** WARNING! All changes made in this file will be lost when recompiling ui file! +********************************************************************************/ + + +using Qyoto; + +public class Ui_UnitWidgetLayout +{ + public QTableView statsView; + public QSpinBox unitSize; + public QLabel unitSizeLabel; + public QLineEdit unitName; + public QLabel pointsSize; + public QListView listView; + public QLabel equipmentLabel; + + public void SetupUi(QWidget UnitWidgetLayout) + { + if (UnitWidgetLayout.ObjectName == "") + UnitWidgetLayout.ObjectName = "UnitWidgetLayout"; + QSize Size = new QSize(528, 362); + Size = Size.ExpandedTo(UnitWidgetLayout.MinimumSizeHint()); + UnitWidgetLayout.Size = Size; + statsView = new QTableView(UnitWidgetLayout); + statsView.ObjectName = "statsView"; + statsView.Geometry = new QRect(10, 40, 511, 101); + unitSize = new QSpinBox(UnitWidgetLayout); + unitSize.ObjectName = "unitSize"; + unitSize.Geometry = new QRect(470, 10, 51, 25); + unitSizeLabel = new QLabel(UnitWidgetLayout); + unitSizeLabel.ObjectName = "unitSizeLabel"; + unitSizeLabel.Geometry = new QRect(390, 10, 55, 15); + unitName = new QLineEdit(UnitWidgetLayout); + unitName.ObjectName = "unitName"; + unitName.Geometry = new QRect(10, 10, 261, 25); + pointsSize = new QLabel(UnitWidgetLayout); + pointsSize.ObjectName = "pointsSize"; + pointsSize.Geometry = new QRect(290, 10, 55, 15); + listView = new QListView(UnitWidgetLayout); + listView.ObjectName = "listView"; + listView.Geometry = new QRect(110, 150, 311, 101); + equipmentLabel = new QLabel(UnitWidgetLayout); + equipmentLabel.ObjectName = "equipmentLabel"; + equipmentLabel.Geometry = new QRect(10, 150, 91, 101); + equipmentLabel.Alignment = Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignLeading") | Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignLeft") | Qyoto.Qyoto.GetCPPEnumValue("Qt", "AlignTop"); + + RetranslateUi(UnitWidgetLayout); + + QMetaObject.ConnectSlotsByName(UnitWidgetLayout); + } // SetupUi + + public void RetranslateUi(QWidget UnitWidgetLayout) + { + UnitWidgetLayout.WindowTitle = QApplication.Translate("UnitWidgetLayout", "Form", null, QApplication.Encoding.UnicodeUTF8); + unitSizeLabel.Text = QApplication.Translate("UnitWidgetLayout", "TextLabel", null, QApplication.Encoding.UnicodeUTF8); + pointsSize.Text = QApplication.Translate("UnitWidgetLayout", "TextLabel", null, QApplication.Encoding.UnicodeUTF8); + equipmentLabel.Text = QApplication.Translate("UnitWidgetLayout", "TextLabel", null, QApplication.Encoding.UnicodeUTF8); + } // RetranslateUi + +} + +namespace Ui { + public class UnitWidgetLayout : Ui_UnitWidgetLayout {} +} // namespace Ui + diff -r be876c03054f -r c3c64e139e5f qt-gui/UnitWidgetLayout.ui --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/qt-gui/UnitWidgetLayout.ui Sat Aug 07 16:02:53 2010 +0000 @@ -0,0 +1,101 @@ + + + UnitWidgetLayout + + + + 0 + 0 + 528 + 362 + + + + Form + + + + + 10 + 40 + 511 + 101 + + + + + + + 470 + 10 + 51 + 25 + + + + + + + 390 + 10 + 55 + 15 + + + + TextLabel + + + + + + 10 + 10 + 261 + 25 + + + + + + + 290 + 10 + 55 + 15 + + + + TextLabel + + + + + + 110 + 150 + 311 + 101 + + + + + + + 10 + 150 + 91 + 101 + + + + TextLabel + + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + + + + + +