changeset 34:c3c64e139e5f default tip

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!
author IBBoard <dev@ibboard.co.uk>
date Sat, 07 Aug 2010 16:02:53 +0000
parents be876c03054f
children
files IBBoard.WarFoundry.GUI.QtSharp.csproj Widgets/UnitWidget.cs qt-gui/UnitWidgetLayout.cs qt-gui/UnitWidgetLayout.ui
diffstat 4 files changed, 189 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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 @@
     <Compile Include="qt-gui\CreateNewUnitLayout.cs" />
     <Compile Include="NewUnitDialog.cs" />
     <Compile Include="Widgets\UnitWidget.cs" />
+    <Compile Include="qt-gui\UnitWidgetLayout.cs" />
   </ItemGroup>
   <ItemGroup>
     <None Include="compile-ui.sh" />
@@ -109,6 +110,7 @@
     <None Include="icons\ui\add.png">
       <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
     </None>
+    <None Include="qt-gui\UnitWidgetLayout.ui" />
   </ItemGroup>
   <ItemGroup>
     <Folder Include="qt-gui\" />
--- 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);
+		}
+}
 }
 
--- /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
+
--- /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 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>UnitWidgetLayout</class>
+ <widget class="QWidget" name="UnitWidgetLayout">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>528</width>
+    <height>362</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>Form</string>
+  </property>
+  <widget class="QTableView" name="statsView">
+   <property name="geometry">
+    <rect>
+     <x>10</x>
+     <y>40</y>
+     <width>511</width>
+     <height>101</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QSpinBox" name="unitSize">
+   <property name="geometry">
+    <rect>
+     <x>470</x>
+     <y>10</y>
+     <width>51</width>
+     <height>25</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QLabel" name="unitSizeLabel">
+   <property name="geometry">
+    <rect>
+     <x>390</x>
+     <y>10</y>
+     <width>55</width>
+     <height>15</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>TextLabel</string>
+   </property>
+  </widget>
+  <widget class="QLineEdit" name="unitName">
+   <property name="geometry">
+    <rect>
+     <x>10</x>
+     <y>10</y>
+     <width>261</width>
+     <height>25</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QLabel" name="pointsSize">
+   <property name="geometry">
+    <rect>
+     <x>290</x>
+     <y>10</y>
+     <width>55</width>
+     <height>15</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>TextLabel</string>
+   </property>
+  </widget>
+  <widget class="QListView" name="listView">
+   <property name="geometry">
+    <rect>
+     <x>110</x>
+     <y>150</y>
+     <width>311</width>
+     <height>101</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QLabel" name="equipmentLabel">
+   <property name="geometry">
+    <rect>
+     <x>10</x>
+     <y>150</y>
+     <width>91</width>
+     <height>101</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>TextLabel</string>
+   </property>
+   <property name="alignment">
+    <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
+   </property>
+  </widget>
+ </widget>
+ <resources/>
+ <connections/>
+</ui>