# HG changeset patch
# User Dan.Kulinski@dank-laptop.Global.Local
# Date 1313384682 21600
# Node ID f57957fe90090e8a227738a5db462002d335b4fb
# Parent 256f2f2f6e8c2042123e71eebf0e8b73c3213ac6
UI Dialog for XML output
diff -r 256f2f2f6e8c -r f57957fe9009 FrmXmlExport.Designer.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/FrmXmlExport.Designer.cs Sun Aug 14 23:04:42 2011 -0600
@@ -0,0 +1,154 @@
+namespace IBBoard.WarFoundry.GUI.WinForms
+{
+ partial class FrmXmlExport
+ {
+ ///
+ /// Required designer variable.
+ ///
+ private System.ComponentModel.IContainer components = null;
+
+ ///
+ /// Clean up any resources being used.
+ ///
+ /// true if managed resources should be disposed; otherwise, false.
+ protected override void Dispose(bool disposing)
+ {
+ if (disposing && (components != null))
+ {
+ components.Dispose();
+ }
+ base.Dispose(disposing);
+ }
+
+ #region Windows Form Designer generated code
+
+ ///
+ /// Required method for Designer support - do not modify
+ /// the contents of this method with the code editor.
+ ///
+ private void InitializeComponent()
+ {
+ this.lbTitle = new IBBoard.Windows.Forms.IBBLabel();
+ this.tbOutputFile = new System.Windows.Forms.TextBox();
+ this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
+ this.bttnOutputSelect = new IBBoard.Windows.Forms.IBBButton();
+ this.cbApplyTransform = new System.Windows.Forms.CheckBox();
+ this.cmbXslSelect = new System.Windows.Forms.ComboBox();
+ this.bttnExport = new IBBoard.Windows.Forms.IBBButton();
+ this.bttnCancel = new IBBoard.Windows.Forms.IBBButton();
+ this.SuspendLayout();
+ //
+ // lbTitle
+ //
+ this.lbTitle.AutoSize = true;
+ this.lbTitle.Location = new System.Drawing.Point(12, 9);
+ this.lbTitle.Name = "lbTitle";
+ this.lbTitle.Size = new System.Drawing.Size(61, 13);
+ this.lbTitle.TabIndex = 0;
+ this.lbTitle.Text = "XML Ouput";
+ this.lbTitle.Click += new System.EventHandler(this.ibbLabel1_Click);
+ //
+ // tbOutputFile
+ //
+ this.tbOutputFile.Location = new System.Drawing.Point(15, 28);
+ this.tbOutputFile.Name = "tbOutputFile";
+ this.tbOutputFile.Size = new System.Drawing.Size(179, 20);
+ this.tbOutputFile.TabIndex = 1;
+ this.tbOutputFile.TextChanged += new System.EventHandler(this.tbOutputFile_Change);
+ //
+ // bttnOutputSelect
+ //
+ this.bttnOutputSelect.Location = new System.Drawing.Point(202, 28);
+ this.bttnOutputSelect.Name = "bttnOutputSelect";
+ this.bttnOutputSelect.Size = new System.Drawing.Size(32, 20);
+ this.bttnOutputSelect.TabIndex = 2;
+ this.bttnOutputSelect.Text = "...";
+ this.bttnOutputSelect.UseVisualStyleBackColor = true;
+ this.bttnOutputSelect.Click += new System.EventHandler(this.bttnOutputSelect_Click);
+ //
+ // cbApplyTransform
+ //
+ this.cbApplyTransform.AutoSize = true;
+ this.cbApplyTransform.Location = new System.Drawing.Point(15, 54);
+ this.cbApplyTransform.Name = "cbApplyTransform";
+ this.cbApplyTransform.Size = new System.Drawing.Size(125, 17);
+ this.cbApplyTransform.TabIndex = 3;
+ this.cbApplyTransform.Text = "Apply XSL Transform";
+ this.cbApplyTransform.UseVisualStyleBackColor = true;
+ this.cbApplyTransform.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
+ //
+ // cmbXslSelect
+ //
+ this.cmbXslSelect.Enabled = false;
+ this.cmbXslSelect.FormattingEnabled = true;
+ this.cmbXslSelect.Items.AddRange(new object[] {
+ "Default",
+ "..."});
+ this.cmbXslSelect.Location = new System.Drawing.Point(15, 77);
+ this.cmbXslSelect.Name = "cmbXslSelect";
+ this.cmbXslSelect.Size = new System.Drawing.Size(219, 21);
+ this.cmbXslSelect.TabIndex = 4;
+ this.cmbXslSelect.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
+ //
+ // bttnExport
+ //
+ this.bttnExport.Enabled = false;
+ this.bttnExport.Location = new System.Drawing.Point(78, 116);
+ this.bttnExport.Name = "bttnExport";
+ this.bttnExport.Size = new System.Drawing.Size(75, 23);
+ this.bttnExport.TabIndex = 5;
+ this.bttnExport.Text = "&Export";
+ this.bttnExport.UseVisualStyleBackColor = true;
+ this.bttnExport.Click += new System.EventHandler(this.bttnExport_Click);
+ //
+ // bttnCancel
+ //
+ this.bttnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
+ this.bttnCancel.Location = new System.Drawing.Point(159, 116);
+ this.bttnCancel.Name = "bttnCancel";
+ this.bttnCancel.Size = new System.Drawing.Size(75, 23);
+ this.bttnCancel.TabIndex = 6;
+ this.bttnCancel.Text = "&Cancel";
+ this.bttnCancel.UseVisualStyleBackColor = true;
+ this.bttnCancel.Click += new System.EventHandler(this.bttnCancel_Click);
+ //
+ // FrmXmlExport
+ //
+ this.AcceptButton = this.bttnExport;
+ this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
+ this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
+ this.CancelButton = this.bttnCancel;
+ this.ClientSize = new System.Drawing.Size(241, 145);
+ this.ControlBox = false;
+ this.Controls.Add(this.bttnCancel);
+ this.Controls.Add(this.bttnExport);
+ this.Controls.Add(this.cmbXslSelect);
+ this.Controls.Add(this.cbApplyTransform);
+ this.Controls.Add(this.bttnOutputSelect);
+ this.Controls.Add(this.tbOutputFile);
+ this.Controls.Add(this.lbTitle);
+ this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
+ this.Name = "FrmXmlExport";
+ this.ShowIcon = false;
+ this.ShowInTaskbar = false;
+ this.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide;
+ this.Text = "Export as XML";
+ this.TopMost = true;
+ this.Load += new System.EventHandler(this.FrmXmlExport_Load);
+ this.ResumeLayout(false);
+ this.PerformLayout();
+
+ }
+
+ #endregion
+
+ private Windows.Forms.IBBLabel lbTitle;
+ private System.Windows.Forms.TextBox tbOutputFile;
+ private System.Windows.Forms.SaveFileDialog saveFileDialog1;
+ private Windows.Forms.IBBButton bttnOutputSelect;
+ private System.Windows.Forms.CheckBox cbApplyTransform;
+ private System.Windows.Forms.ComboBox cmbXslSelect;
+ private Windows.Forms.IBBButton bttnExport;
+ private Windows.Forms.IBBButton bttnCancel;
+ }
+}
\ No newline at end of file
diff -r 256f2f2f6e8c -r f57957fe9009 FrmXmlExport.cs
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/FrmXmlExport.cs Sun Aug 14 23:04:42 2011 -0600
@@ -0,0 +1,87 @@
+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;
+using IBBoard.WarFoundry.API.Objects;
+using IBBoard.WarFoundry.API.Exporters;
+
+namespace IBBoard.WarFoundry.GUI.WinForms
+{
+ public partial class FrmXmlExport : Form
+ {
+ Army myArmy = null;
+ public FrmXmlExport(Army army)
+ {
+ InitializeComponent();
+ myArmy = army;
+ }
+
+ private void ibbLabel1_Click(object sender, EventArgs e)
+ {
+
+ }
+
+ private void FrmXmlExport_Load(object sender, EventArgs e)
+ {
+
+ }
+
+ private void checkBox1_CheckedChanged(object sender, EventArgs e)
+ {
+
+ }
+
+ private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
+ {
+
+ }
+
+ private void bttnOutputSelect_Click(object sender, EventArgs e)
+ {
+ SaveFileDialog sfd = new SaveFileDialog();
+ sfd.Filter = "XML File|*.xml|HTML File|*.html|XHTML File|*.xhtml";
+ sfd.Title = "Save XML output";
+ sfd.ShowDialog();
+
+ if (sfd.FileName != "")
+ {
+ tbOutputFile.Text = sfd.FileName;
+ }
+ }
+
+ private void bttnCancel_Click(object sender, EventArgs e)
+ {
+ this.DialogResult = DialogResult.Cancel;
+ this.Hide();
+ }
+
+ private void bttnExport_Click(object sender, EventArgs e)
+ {
+ if (cbApplyTransform.Checked)
+ {
+ }
+ else
+ {
+ WarFoundryXmlWithXslExporter.GetDefault().ExportArmy(myArmy, tbOutputFile.Text);
+ }
+
+ this.DialogResult = DialogResult.OK;
+ }
+
+ private void tbOutputFile_Change(object sender, EventArgs e)
+ {
+ if (tbOutputFile.Text != "")
+ {
+ bttnExport.Enabled = true;
+ }
+ else
+ {
+ bttnExport.Enabled = false;
+ }
+ }
+ }
+}
diff -r 256f2f2f6e8c -r f57957fe9009 FrmXmlExport.resx
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/FrmXmlExport.resx Sun Aug 14 23:04:42 2011 -0600
@@ -0,0 +1,123 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ text/microsoft-resx
+
+
+ 2.0
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
+
+
+ 17, 17
+
+
\ No newline at end of file