Switch to WPF.

Former-commit-id: e75aa871e3fecbe716c8dc49a348148d1bedf7f3
This commit is contained in:
David Anderson 2013-02-19 00:27:10 -08:00
parent 0ffd9caaed
commit a73ae02b7e
14 changed files with 277 additions and 2949 deletions

View File

@ -0,0 +1,8 @@
<Application x:Class="installtool.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
<Application.Resources>
</Application.Resources>
</Application>

View File

@ -0,0 +1,16 @@
using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;
namespace installtool
{
/// <summary>
/// Interaction logic for App.xaml
/// </summary>
public partial class App : Application
{
}
}

View File

@ -0,0 +1,11 @@
<UserControl x:Class="installtool.LicenseAccept"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<Grid>
</Grid>
</UserControl>

View File

@ -0,0 +1,27 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace installtool
{
/// <summary>
/// Interaction logic for LicenseAccept.xaml
/// </summary>
public partial class LicenseAccept : UserControl
{
public LicenseAccept()
{
InitializeComponent();
}
}
}

View File

@ -1,136 +0,0 @@
namespace installtool
{
partial class MainWindow
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainWindow));
this.pictureBox1 = new System.Windows.Forms.PictureBox();
this.panel1 = new System.Windows.Forms.Panel();
this.welcomeLabel_ = new System.Windows.Forms.Label();
this.welcomeText_ = new System.Windows.Forms.Label();
this.closeButton_ = new System.Windows.Forms.Button();
this.nextButton_ = new System.Windows.Forms.Button();
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).BeginInit();
this.panel1.SuspendLayout();
this.SuspendLayout();
//
// pictureBox1
//
this.pictureBox1.Image = ((System.Drawing.Image)(resources.GetObject("pictureBox1.Image")));
this.pictureBox1.Location = new System.Drawing.Point(0, 0);
this.pictureBox1.Name = "pictureBox1";
this.pictureBox1.Size = new System.Drawing.Size(164, 314);
this.pictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize;
this.pictureBox1.TabIndex = 0;
this.pictureBox1.TabStop = false;
//
// panel1
//
this.panel1.BackColor = System.Drawing.SystemColors.ControlLightLight;
this.panel1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;
this.panel1.Controls.Add(this.welcomeText_);
this.panel1.Controls.Add(this.welcomeLabel_);
this.panel1.Controls.Add(this.pictureBox1);
this.panel1.Location = new System.Drawing.Point(0, 0);
this.panel1.Margin = new System.Windows.Forms.Padding(0);
this.panel1.Name = "panel1";
this.panel1.Size = new System.Drawing.Size(560, 315);
this.panel1.TabIndex = 1;
//
// welcomeLabel_
//
this.welcomeLabel_.Font = new System.Drawing.Font("Segoe UI Semibold", 15.75F, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.welcomeLabel_.Location = new System.Drawing.Point(170, 3);
this.welcomeLabel_.Name = "welcomeLabel_";
this.welcomeLabel_.Size = new System.Drawing.Size(380, 103);
this.welcomeLabel_.TabIndex = 2;
this.welcomeLabel_.Text = "Welcome to the AMX Mod X 1.8.3 Setup Wizard";
//
// welcomeText_
//
this.welcomeText_.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.welcomeText_.Location = new System.Drawing.Point(172, 87);
this.welcomeText_.Name = "welcomeText_";
this.welcomeText_.Size = new System.Drawing.Size(378, 211);
this.welcomeText_.TabIndex = 3;
this.welcomeText_.Text = resources.GetString("welcomeText_.Text");
//
// closeButton_
//
this.closeButton_.Location = new System.Drawing.Point(12, 321);
this.closeButton_.Name = "closeButton_";
this.closeButton_.Size = new System.Drawing.Size(88, 30);
this.closeButton_.TabIndex = 6;
this.closeButton_.Text = "&Close";
this.closeButton_.UseVisualStyleBackColor = true;
this.closeButton_.Click += new System.EventHandler(this.closeButton__Click);
//
// nextButton_
//
this.nextButton_.Location = new System.Drawing.Point(454, 321);
this.nextButton_.Name = "nextButton_";
this.nextButton_.Size = new System.Drawing.Size(88, 30);
this.nextButton_.TabIndex = 5;
this.nextButton_.Text = "&Next";
this.nextButton_.UseVisualStyleBackColor = true;
//
// MainWindow
//
this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(554, 358);
this.Controls.Add(this.nextButton_);
this.Controls.Add(this.closeButton_);
this.Controls.Add(this.panel1);
this.Font = new System.Drawing.Font("Segoe UI", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon")));
this.MaximizeBox = false;
this.MinimizeBox = false;
this.Name = "MainWindow";
this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
this.Text = "Form1";
this.Load += new System.EventHandler(this.MainWindow_Load);
((System.ComponentModel.ISupportInitialize)(this.pictureBox1)).EndInit();
this.panel1.ResumeLayout(false);
this.panel1.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.PictureBox pictureBox1;
private System.Windows.Forms.Panel panel1;
private System.Windows.Forms.Label welcomeLabel_;
private System.Windows.Forms.Label welcomeText_;
private System.Windows.Forms.Button closeButton_;
private System.Windows.Forms.Button nextButton_;
}
}

View File

@ -1,31 +0,0 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace installtool
{
public partial class MainWindow : Form
{
public MainWindow()
{
InitializeComponent();
}
private void MainWindow_Load(object sender, EventArgs e)
{
this.Text = "AMX Mod X " + Program.VersionString + " Setup Wizard";
welcomeLabel_.Text = "Welcome to the AMX Mod X " + Program.VersionString + " Setup Wizard";
welcomeText_.Text = welcomeText_.Text.Replace("{Version}", Program.VersionString);
}
private void closeButton__Click(object sender, EventArgs e)
{
Application.Exit();
}
}
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,18 @@
<Window x:Class="installtool.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" ResizeMode="CanMinimize" Icon="/installtool;component/Images/AMX.ico" WindowStartupLocation="CenterScreen" WindowStyle="SingleBorderWindow" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" Height="386" Width="560" Background="#FFF0F0F0" Loaded="Window_Loaded">
<Grid Height="315" Width="Auto" Name="contentPanel_" VerticalAlignment="Top">
<Grid Height="315" Width="Auto" Name="welcomePanel_" VerticalAlignment="Top" Background="White">
<Image Height="314" Width="164" HorizontalAlignment="Left" Name="image1" Stretch="None" VerticalAlignment="Top" Source="/installtool;component/Images/install.bmp" />
<TextBlock HorizontalAlignment="Left" Margin="170,6,0,0" Name="welcomeLabel_" VerticalAlignment="Top" FontSize="22" FontWeight="SemiBold" Width="368" MaxWidth="Infinity" MaxHeight="Infinity" FontStretch="Normal" Height="76" TextWrapping="Wrap">
Welcome to the AMX Mod X {Version} Setup Wizard
</TextBlock>
<TextBlock Height="183" HorizontalAlignment="Left" Margin="170,88,0,0" Name="welcomeText_" VerticalAlignment="Top" Width="362" TextWrapping="Wrap" Text="This wizard will guide you through the installation of AMX Mod X {Version}.&#x0a;&#x0a;It is recommended that you close any instances of Steam or any Steam games before continuing with this installation. If you will be installing to a remote server, temporarily quit that server now. You will need to relaunch it after installing AMX Mod X.&#x0a;&#x0a;Click Next to continue."/>
</Grid>
<Border BorderBrush="Silver" BorderThickness="1" Height="17" HorizontalAlignment="Left" Margin="-1,313,0,0" Name="border1" VerticalAlignment="Top" Width="560" />
<Button Content="_Close" Height="26" HorizontalAlignment="Left" Margin="12,0,0,-33" Name="closeButton_" VerticalAlignment="Bottom" Width="75" Click="closeButton__Click" />
<Button Content="_Next" Height="26" HorizontalAlignment="Left" Margin="451,0,0,-33" Name="nextButton_" VerticalAlignment="Bottom" Width="75" Click="nextButton__Click" />
<Button Content="_Back" Height="26" HorizontalAlignment="Left" Margin="360,0,0,-33" Name="backButton_" VerticalAlignment="Bottom" Width="75" IsEnabled="False" Click="backButton__Click" />
</Grid>
</Window>

View File

@ -0,0 +1,76 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace installtool
{
/// <summary>
/// Interaction logic for MainWindow.xaml
/// </summary>
public partial class MainWindow : Window
{
private UIElement currentPanel_;
private LicenseAccept licensePanel_;
public MainWindow()
{
InitializeComponent();
}
private void Window_Loaded(object sender, RoutedEventArgs e)
{
welcomeLabel_.Text = welcomeLabel_.Text.Replace("{Version}", Program.VersionString);
welcomeText_.Text = welcomeText_.Text.Replace("{Version}", Program.VersionString);
currentPanel_ = welcomePanel_;
}
private void closeButton__Click(object sender, RoutedEventArgs e)
{
Application.Current.Shutdown();
}
private void swap(UIElement to)
{
currentPanel_.Visibility = Visibility.Hidden;
to.Visibility = Visibility.Visible;
currentPanel_ = to;
}
private void backButton__Click(object sender, RoutedEventArgs e)
{
if (currentPanel_ == licensePanel_)
{
swap(welcomePanel_);
}
}
private void nextButton__Click(object sender, RoutedEventArgs e)
{
if (licensePanel_ == null || currentPanel_ == welcomePanel_)
{
if (licensePanel_ == null)
{
licensePanel_ = new LicenseAccept();
contentPanel_.Children.Add(licensePanel_);
}
swap(licensePanel_);
}
if (currentPanel_ != welcomePanel_)
{
backButton_.IsEnabled = true;
}
}
}
}

View File

@ -1,21 +0,0 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
namespace installtool
{
static public partial class Program
{
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
Application.EnableVisualStyles();
Application.SetCompatibleTextRenderingDefault(false);
Application.Run(new MainWindow());
}
}
}

View File

@ -1,6 +1,8 @@
using System.Reflection;
using System.Resources;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Windows;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
@ -19,8 +21,25 @@
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("4f8228ef-bf0b-4c1d-beba-5dbdad44fbcd")]
//In order to begin building localizable applications, set
//<UICulture>CultureYouAreCodingWith</UICulture> in your .csproj file
//inside a <PropertyGroup>. For example, if you are using US english
//in your source files, set the <UICulture> to en-US. Then uncomment
//the NeutralResourceLanguage attribute below. Update the "en-US" in
//the line below to match the UICulture setting in the project file.
//[assembly: NeutralResourcesLanguage("en-US", UltimateResourceFallbackLocation.Satellite)]
[assembly: ThemeInfo(
ResourceDictionaryLocation.None, //where theme specific resource dictionaries are located
//(used if a resource is not found in the page,
// or application resource dictionaries)
ResourceDictionaryLocation.SourceAssembly //where the generic resource dictionary is located
//(used if a resource is not found in the page,
// app, or any theme specific resource dictionaries)
)]
// Version information for an assembly consists of the following four values:
//

View File

@ -1,7 +1,7 @@
<?xml version='1.0' encoding='utf-8'?>
<SettingsFile xmlns="http://schemas.microsoft.com/VisualStudio/2004/01/settings" CurrentProfile="(Default)">
<SettingsFile xmlns="uri:settings" CurrentProfile="(Default)">
<Profiles>
<Profile Name="(Default)" />
</Profiles>
<Settings />
</SettingsFile>
</SettingsFile>

View File

@ -5,7 +5,7 @@
<Platform Condition=" '$(Platform)' == '' ">x86</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{C9F82E7A-C0B3-415C-A8DD-B8F478A5DF6C}</ProjectGuid>
<ProjectGuid>{6D7FAAE2-55EA-4CB4-8070-5A28F4BF078E}</ProjectGuid>
<OutputType>WinExe</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>installtool</RootNamespace>
@ -13,6 +13,23 @@
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
<TargetFrameworkProfile>Client</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
<ProjectTypeGuids>{60dc8134-eba5-43b8-bcc9-bb4bc16c2548};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<WarningLevel>4</WarningLevel>
<PublishUrl>publish\</PublishUrl>
<Install>true</Install>
<InstallFrom>Disk</InstallFrom>
<UpdateEnabled>false</UpdateEnabled>
<UpdateMode>Foreground</UpdateMode>
<UpdateInterval>7</UpdateInterval>
<UpdateIntervalUnits>Days</UpdateIntervalUnits>
<UpdatePeriodically>false</UpdatePeriodically>
<UpdateRequired>false</UpdateRequired>
<MapFileExtensions>true</MapFileExtensions>
<ApplicationRevision>0</ApplicationRevision>
<ApplicationVersion>1.0.0.%2a</ApplicationVersion>
<IsWebBootstrapper>false</IsWebBootstrapper>
<UseApplicationTrust>false</UseApplicationTrust>
<BootstrapperEnabled>true</BootstrapperEnabled>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
<PlatformTarget>x86</PlatformTarget>
@ -35,47 +52,96 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Deployment" />
<Reference Include="System.Drawing" />
<Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" />
<Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference>
<Reference Include="WindowsBase" />
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
</ItemGroup>
<ItemGroup>
<Compile Include="Main.cs">
<SubType>Form</SubType>
</Compile>
<Compile Include="Main.Designer.cs">
<DependentUpon>Main.cs</DependentUpon>
</Compile>
<Compile Include="Program.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="Version.cs" />
<EmbeddedResource Include="Main.resx">
<DependentUpon>Main.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
<ApplicationDefinition Include="App.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</EmbeddedResource>
</ApplicationDefinition>
<Compile Include="LicenseAccept.xaml.cs">
<DependentUpon>LicenseAccept.xaml</DependentUpon>
</Compile>
<Compile Include="Version.cs" />
<Page Include="LicenseAccept.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="MainWindow.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
<Compile Include="App.xaml.cs">
<DependentUpon>App.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
<Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs">
<SubType>Code</SubType>
</Compile>
<Compile Include="Properties\Resources.Designer.cs">
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<Compile Include="Properties\Settings.Designer.cs">
<AutoGen>True</AutoGen>
<DependentUpon>Settings.settings</DependentUpon>
<DesignTimeSharedInput>True</DesignTimeSharedInput>
</Compile>
<EmbeddedResource Include="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
<None Include="Properties\Settings.settings">
<Generator>SettingsSingleFileGenerator</Generator>
<LastGenOutput>Settings.Designer.cs</LastGenOutput>
</None>
<AppDesigner Include="Properties\" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\AMX.ico" />
</ItemGroup>
<ItemGroup>
<Resource Include="Images\install.bmp" />
</ItemGroup>
<ItemGroup>
<BootstrapperPackage Include=".NETFramework,Version=v4.0,Profile=Client">
<Visible>False</Visible>
<ProductName>Microsoft .NET Framework 4 Client Profile %28x86 and x64%29</ProductName>
<Install>true</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Client.3.5">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1">
<Visible>False</Visible>
<ProductName>.NET Framework 3.5 SP1</ProductName>
<Install>false</Install>
</BootstrapperPackage>
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1">
<Visible>False</Visible>
<ProductName>Windows Installer 3.1</ProductName>
<Install>true</Install>
</BootstrapperPackage>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View File

@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 11.00
# Visual C# Express 2010
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "installtool", "installtool.csproj", "{C9F82E7A-C0B3-415C-A8DD-B8F478A5DF6C}"
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "installtool", "installtool.csproj", "{6D7FAAE2-55EA-4CB4-8070-5A28F4BF078E}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -9,10 +9,10 @@ Global
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{C9F82E7A-C0B3-415C-A8DD-B8F478A5DF6C}.Debug|x86.ActiveCfg = Debug|x86
{C9F82E7A-C0B3-415C-A8DD-B8F478A5DF6C}.Debug|x86.Build.0 = Debug|x86
{C9F82E7A-C0B3-415C-A8DD-B8F478A5DF6C}.Release|x86.ActiveCfg = Release|x86
{C9F82E7A-C0B3-415C-A8DD-B8F478A5DF6C}.Release|x86.Build.0 = Release|x86
{6D7FAAE2-55EA-4CB4-8070-5A28F4BF078E}.Debug|x86.ActiveCfg = Debug|x86
{6D7FAAE2-55EA-4CB4-8070-5A28F4BF078E}.Debug|x86.Build.0 = Debug|x86
{6D7FAAE2-55EA-4CB4-8070-5A28F4BF078E}.Release|x86.ActiveCfg = Release|x86
{6D7FAAE2-55EA-4CB4-8070-5A28F4BF078E}.Release|x86.Build.0 = Release|x86
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE