view MainWindow.cs @ 1:4ff09911ef64

Re #242: Create Qt# UI for WarFoundry * Convert to Visual Studio 2005 project * Add Solution file * Update compile script to be more readable and to check whether rebuilds are needed
author IBBoard <dev@ibboard.co.uk>
date Sat, 23 Jan 2010 19:55:54 +0000
parents 620c62ba4d07
children cf68a996b3f1
line wrap: on
line source

// This file (MainWindow.cs) is a part of the IBBoard.WarFoundry.API project and is copyright 2009 IBBoard
// 
// The file and the library/program it is in are licensed and distributed, without warranty, under the GNU Affero GPL license, either version 3 of the License or (at your option) any later version. Please see COPYING for more information and the full license.
using System;
using System.Collections.Generic;
using Qyoto;

public partial class MainWindow : QMainWindow
{
	private Ui_MainWindowLayout layout;
	
	public MainWindow ()
	{
		layout = new Ui_MainWindowLayout();
		layout.SetupUi(this);
		WindowIcon = new QIcon("icons/App.png");
		AddMenuActions();
		SetUpToolbar();
	}
	
	private void AddMenuActions()
	{
		layout.unitTabs.Clear();
	}
	
	private void SetUpToolbar()
	{
		List<QAction> actions = new List<QAction>(){
			layout.actionCreateArmy,
			layout.actionOpenArmy,
			layout.actionSaveArmy};
		layout.toolBar.AddActions(actions);
		layout.toolBar.AddSeparator();
		layout.toolBar.AddAction(layout.actionUndo);
		layout.toolBar.AddAction(layout.actionRedo);
		layout.toolBar.AddSeparator();
	}
}