changeset 210:a6ce13e4ae89 xml-export-ui

Near Final XSL output
author Dan.Kulinski@dank-laptop.Global.Local
date Thu, 18 Aug 2011 11:15:51 -0600
parents f57957fe9009
children a0df71b24972
files FrmXmlExport.Designer.cs FrmXmlExport.cs
diffstat 2 files changed, 59 insertions(+), 29 deletions(-) [+]
line diff
     1.1 --- a/FrmXmlExport.Designer.cs	Sun Aug 14 23:04:42 2011 -0600
     1.2 +++ b/FrmXmlExport.Designer.cs	Thu Aug 18 11:15:51 2011 -0600
     1.3 @@ -33,9 +33,10 @@
     1.4              this.saveFileDialog1 = new System.Windows.Forms.SaveFileDialog();
     1.5              this.bttnOutputSelect = new IBBoard.Windows.Forms.IBBButton();
     1.6              this.cbApplyTransform = new System.Windows.Forms.CheckBox();
     1.7 -            this.cmbXslSelect = new System.Windows.Forms.ComboBox();
     1.8              this.bttnExport = new IBBoard.Windows.Forms.IBBButton();
     1.9              this.bttnCancel = new IBBoard.Windows.Forms.IBBButton();
    1.10 +            this.tbXslPath = new System.Windows.Forms.TextBox();
    1.11 +            this.bttnXslSelect = new IBBoard.Windows.Forms.IBBButton();
    1.12              this.SuspendLayout();
    1.13              // 
    1.14              // lbTitle
    1.15 @@ -46,7 +47,6 @@
    1.16              this.lbTitle.Size = new System.Drawing.Size(61, 13);
    1.17              this.lbTitle.TabIndex = 0;
    1.18              this.lbTitle.Text = "XML Ouput";
    1.19 -            this.lbTitle.Click += new System.EventHandler(this.ibbLabel1_Click);
    1.20              // 
    1.21              // tbOutputFile
    1.22              // 
    1.23 @@ -75,20 +75,7 @@
    1.24              this.cbApplyTransform.TabIndex = 3;
    1.25              this.cbApplyTransform.Text = "Apply XSL Transform";
    1.26              this.cbApplyTransform.UseVisualStyleBackColor = true;
    1.27 -            this.cbApplyTransform.CheckedChanged += new System.EventHandler(this.checkBox1_CheckedChanged);
    1.28 -            // 
    1.29 -            // cmbXslSelect
    1.30 -            // 
    1.31 -            this.cmbXslSelect.Enabled = false;
    1.32 -            this.cmbXslSelect.FormattingEnabled = true;
    1.33 -            this.cmbXslSelect.Items.AddRange(new object[] {
    1.34 -            "Default",
    1.35 -            "..."});
    1.36 -            this.cmbXslSelect.Location = new System.Drawing.Point(15, 77);
    1.37 -            this.cmbXslSelect.Name = "cmbXslSelect";
    1.38 -            this.cmbXslSelect.Size = new System.Drawing.Size(219, 21);
    1.39 -            this.cmbXslSelect.TabIndex = 4;
    1.40 -            this.cmbXslSelect.SelectedIndexChanged += new System.EventHandler(this.comboBox1_SelectedIndexChanged);
    1.41 +            this.cbApplyTransform.CheckedChanged += new System.EventHandler(this.cbApplyTransform_CheckedChanged);
    1.42              // 
    1.43              // bttnExport
    1.44              // 
    1.45 @@ -112,6 +99,25 @@
    1.46              this.bttnCancel.UseVisualStyleBackColor = true;
    1.47              this.bttnCancel.Click += new System.EventHandler(this.bttnCancel_Click);
    1.48              // 
    1.49 +            // tbXslPath
    1.50 +            // 
    1.51 +            this.tbXslPath.Enabled = false;
    1.52 +            this.tbXslPath.Location = new System.Drawing.Point(15, 77);
    1.53 +            this.tbXslPath.Name = "tbXslPath";
    1.54 +            this.tbXslPath.Size = new System.Drawing.Size(179, 20);
    1.55 +            this.tbXslPath.TabIndex = 7;
    1.56 +            // 
    1.57 +            // bttnXslSelect
    1.58 +            // 
    1.59 +            this.bttnXslSelect.Enabled = false;
    1.60 +            this.bttnXslSelect.Location = new System.Drawing.Point(202, 77);
    1.61 +            this.bttnXslSelect.Name = "bttnXslSelect";
    1.62 +            this.bttnXslSelect.Size = new System.Drawing.Size(32, 20);
    1.63 +            this.bttnXslSelect.TabIndex = 8;
    1.64 +            this.bttnXslSelect.Text = "...";
    1.65 +            this.bttnXslSelect.UseVisualStyleBackColor = true;
    1.66 +            this.bttnXslSelect.Click += new System.EventHandler(this.bttnXslSelect_Click);
    1.67 +            // 
    1.68              // FrmXmlExport
    1.69              // 
    1.70              this.AcceptButton = this.bttnExport;
    1.71 @@ -120,9 +126,10 @@
    1.72              this.CancelButton = this.bttnCancel;
    1.73              this.ClientSize = new System.Drawing.Size(241, 145);
    1.74              this.ControlBox = false;
    1.75 +            this.Controls.Add(this.bttnXslSelect);
    1.76 +            this.Controls.Add(this.tbXslPath);
    1.77              this.Controls.Add(this.bttnCancel);
    1.78              this.Controls.Add(this.bttnExport);
    1.79 -            this.Controls.Add(this.cmbXslSelect);
    1.80              this.Controls.Add(this.cbApplyTransform);
    1.81              this.Controls.Add(this.bttnOutputSelect);
    1.82              this.Controls.Add(this.tbOutputFile);
    1.83 @@ -147,8 +154,9 @@
    1.84          private System.Windows.Forms.SaveFileDialog saveFileDialog1;
    1.85          private Windows.Forms.IBBButton bttnOutputSelect;
    1.86          private System.Windows.Forms.CheckBox cbApplyTransform;
    1.87 -        private System.Windows.Forms.ComboBox cmbXslSelect;
    1.88          private Windows.Forms.IBBButton bttnExport;
    1.89          private Windows.Forms.IBBButton bttnCancel;
    1.90 +        private System.Windows.Forms.TextBox tbXslPath;
    1.91 +        private Windows.Forms.IBBButton bttnXslSelect;
    1.92      }
    1.93  }
    1.94 \ No newline at end of file
     2.1 --- a/FrmXmlExport.cs	Sun Aug 14 23:04:42 2011 -0600
     2.2 +++ b/FrmXmlExport.cs	Thu Aug 18 11:15:51 2011 -0600
     2.3 @@ -5,6 +5,7 @@
     2.4  using System.Drawing;
     2.5  using System.Linq;
     2.6  using System.Text;
     2.7 +using System.IO;
     2.8  using System.Windows.Forms;
     2.9  using IBBoard.WarFoundry.API.Objects;
    2.10  using IBBoard.WarFoundry.API.Exporters;
    2.11 @@ -20,19 +21,9 @@
    2.12              myArmy = army;
    2.13          }
    2.14  
    2.15 -        private void ibbLabel1_Click(object sender, EventArgs e)
    2.16 -        {
    2.17 -
    2.18 -        }
    2.19 -
    2.20          private void FrmXmlExport_Load(object sender, EventArgs e)
    2.21          {
    2.22 -
    2.23 -        }
    2.24 -
    2.25 -        private void checkBox1_CheckedChanged(object sender, EventArgs e)
    2.26 -        {
    2.27 -
    2.28 +            tbXslPath.Text = Directory.GetCurrentDirectory() + "\\xsl\\default_html.xsl";
    2.29          }
    2.30  
    2.31          private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
    2.32 @@ -63,6 +54,7 @@
    2.33          {
    2.34              if (cbApplyTransform.Checked)
    2.35              {
    2.36 +                WarFoundryXmlWithXslExporter.GetDefault().ExportArmyWithTransform(myArmy, tbOutputFile.Text, tbXslPath.Text);
    2.37              }
    2.38              else
    2.39              {
    2.40 @@ -70,6 +62,7 @@
    2.41              }
    2.42              
    2.43              this.DialogResult = DialogResult.OK;
    2.44 +            this.Hide();
    2.45          }
    2.46  
    2.47          private void tbOutputFile_Change(object sender, EventArgs e)
    2.48 @@ -83,5 +76,34 @@
    2.49                  bttnExport.Enabled = false;
    2.50              }
    2.51          }
    2.52 +
    2.53 +        private void cbApplyTransform_CheckedChanged(object sender, EventArgs e)
    2.54 +        {
    2.55 +            if (cbApplyTransform.Checked)
    2.56 +            {
    2.57 +                tbXslPath.Enabled = true;
    2.58 +                bttnXslSelect.Enabled = true;
    2.59 +            }
    2.60 +            else
    2.61 +            {
    2.62 +                tbXslPath.Enabled = false;
    2.63 +                bttnXslSelect.Enabled = false;
    2.64 +            }
    2.65 +        }
    2.66 +
    2.67 +        private void bttnXslSelect_Click(object sender, EventArgs e)
    2.68 +        {
    2.69 +            OpenFileDialog ofd = new OpenFileDialog();
    2.70 +            
    2.71 +            ofd.InitialDirectory = Directory.GetCurrentDirectory() + "\\xsl";
    2.72 +            ofd.Filter = "XSL Files|*.xsl";
    2.73 +            DialogResult result = ofd.ShowDialog();
    2.74 +
    2.75 +            if (result == DialogResult.OK)
    2.76 +            {
    2.77 +                tbXslPath.Text = ofd.FileName;
    2.78 +            }
    2.79 +          
    2.80 +        }
    2.81      }
    2.82  }