Table percent widths and no widths

Radio buttons for pixels and percent
This commit is contained in:
David Gardiner 2016-02-20 17:37:19 +10:30
parent 266235baa9
commit 357f885b5e
14 changed files with 475 additions and 461 deletions

View File

@ -807,6 +807,7 @@
<SubType>UserControl</SubType> <SubType>UserControl</SubType>
</Compile> </Compile>
<Compile Include="Tables\HTMLTableColumn.cs" /> <Compile Include="Tables\HTMLTableColumn.cs" />
<Compile Include="Tables\PixelPercent.cs" />
<Compile Include="Tables\RowPropertiesForm.cs"> <Compile Include="Tables\RowPropertiesForm.cs">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>

View File

@ -113,47 +113,48 @@ namespace OpenLiveWriter.PostEditor.Tables
this.horizontalAlignmentControl = new OpenLiveWriter.PostEditor.Tables.HorizontalAlignmentControl(); this.horizontalAlignmentControl = new OpenLiveWriter.PostEditor.Tables.HorizontalAlignmentControl();
this.groupBoxCells.SuspendLayout(); this.groupBoxCells.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// groupBoxCells // groupBoxCells
// //
this.groupBoxCells.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) this.groupBoxCells.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.groupBoxCells.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.groupBoxCells.Controls.Add(this.verticalAlignmentControl); this.groupBoxCells.Controls.Add(this.verticalAlignmentControl);
this.groupBoxCells.Controls.Add(this.horizontalAlignmentControl); this.groupBoxCells.Controls.Add(this.horizontalAlignmentControl);
this.groupBoxCells.FlatStyle = System.Windows.Forms.FlatStyle.System; this.groupBoxCells.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.groupBoxCells.Location = new System.Drawing.Point(0, 0); this.groupBoxCells.Location = new System.Drawing.Point(0, 0);
this.groupBoxCells.Name = "groupBoxCells"; this.groupBoxCells.Name = "groupBoxCells";
this.groupBoxCells.Size = new System.Drawing.Size(304, 136); this.groupBoxCells.Size = new System.Drawing.Size(233, 108);
this.groupBoxCells.TabIndex = 2; this.groupBoxCells.TabIndex = 2;
this.groupBoxCells.TabStop = false; this.groupBoxCells.TabStop = false;
this.groupBoxCells.Text = "Cells"; this.groupBoxCells.Text = "Cells";
// //
// verticalAlignmentControl // verticalAlignmentControl
// //
this.verticalAlignmentControl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) this.verticalAlignmentControl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.verticalAlignmentControl.Location = new System.Drawing.Point(15, 56); this.verticalAlignmentControl.Location = new System.Drawing.Point(15, 60);
this.verticalAlignmentControl.Name = "verticalAlignmentControl"; this.verticalAlignmentControl.Name = "verticalAlignmentControl";
this.verticalAlignmentControl.Size = new System.Drawing.Size(283, 21); this.verticalAlignmentControl.Size = new System.Drawing.Size(212, 28);
this.verticalAlignmentControl.TabIndex = 1; this.verticalAlignmentControl.TabIndex = 1;
this.verticalAlignmentControl.VerticalAlignment = OpenLiveWriter.PostEditor.Tables.VerticalAlignment.Middle; this.verticalAlignmentControl.VerticalAlignment = OpenLiveWriter.PostEditor.Tables.VerticalAlignment.Middle;
// //
// horizontalAlignmentControl // horizontalAlignmentControl
// //
this.horizontalAlignmentControl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) this.horizontalAlignmentControl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.horizontalAlignmentControl.HorizontalAlignment = OpenLiveWriter.PostEditor.Tables.HorizontalAlignment.Left; this.horizontalAlignmentControl.HorizontalAlignment = OpenLiveWriter.PostEditor.Tables.HorizontalAlignment.Left;
this.horizontalAlignmentControl.Location = new System.Drawing.Point(15, 25); this.horizontalAlignmentControl.Location = new System.Drawing.Point(15, 25);
this.horizontalAlignmentControl.Name = "horizontalAlignmentControl"; this.horizontalAlignmentControl.Name = "horizontalAlignmentControl";
this.horizontalAlignmentControl.Size = new System.Drawing.Size(283, 21); this.horizontalAlignmentControl.Size = new System.Drawing.Size(212, 31);
this.horizontalAlignmentControl.TabIndex = 0; this.horizontalAlignmentControl.TabIndex = 0;
// //
// CellPropertiesControl // CellPropertiesControl
// //
this.Controls.Add(this.groupBoxCells); this.Controls.Add(this.groupBoxCells);
this.Name = "CellPropertiesControl"; this.Name = "CellPropertiesControl";
this.Size = new System.Drawing.Size(304, 136); this.Size = new System.Drawing.Size(239, 108);
this.groupBoxCells.ResumeLayout(false); this.groupBoxCells.ResumeLayout(false);
this.ResumeLayout(false); this.ResumeLayout(false);

View File

@ -3,7 +3,7 @@
<!-- <!--
Microsoft ResX Schema Microsoft ResX Schema
Version 1.3 Version 2.0
The primary goals of this format is to allow a simple XML format The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the that is mostly human readable. The generation and parsing of the
@ -14,16 +14,17 @@
... ado.net/XML headers & schema ... ... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">1.3</resheader> <resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data> <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object] <value>[base64 mime encoded serialized .NET Framework object]</value>
</data> </data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object] <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data> </data>
There are any number of "resheader" rows that contain simple There are any number of "resheader" rows that contain simple
@ -35,7 +36,7 @@
Classes that don't support this are serialized and stored with the Classes that don't support this are serialized and stored with the
mimetype set. mimetype set.
The mimetype is used forserialized objects, and tells the The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly: extensible. For a given mimetype the value must be set accordingly:
@ -45,7 +46,7 @@
mimetype: application/x-microsoft.net.object.binary.base64 mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64 mimetype: application/x-microsoft.net.object.soap.base64
@ -59,18 +60,37 @@
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
--> -->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true"> <xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType> <xsd:complexType>
<xsd:choice maxOccurs="unbounded"> <xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data"> <xsd:element name="data">
<xsd:complexType> <xsd:complexType>
<xsd:sequence> <xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" /> <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="resheader"> <xsd:element name="resheader">
@ -89,78 +109,12 @@
<value>text/microsoft-resx</value> <value>text/microsoft-resx</value>
</resheader> </resheader>
<resheader name="version"> <resheader name="version">
<value>1.3</value> <value>2.0</value>
</resheader> </resheader>
<resheader name="reader"> <resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<data name="groupBoxCells.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="groupBoxCells.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>8, 8</value>
</data>
<data name="groupBoxCells.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="groupBoxCells.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="groupBoxCells.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="groupBoxCells.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="verticalAlignmentControl.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="verticalAlignmentControl.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="verticalAlignmentControl.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="horizontalAlignmentControl.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="horizontalAlignmentControl.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="horizontalAlignmentControl.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>80</value>
</data>
<data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>(Default)</value>
</data>
<data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Name">
<value>CellPropertiesControl</value>
</data>
<data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>8, 8</value>
</data>
</root> </root>

View File

@ -94,48 +94,54 @@ namespace OpenLiveWriter.PostEditor.Tables
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
OpenLiveWriter.PostEditor.Tables.CellProperties cellProperties1 = new OpenLiveWriter.PostEditor.Tables.CellProperties();
this.buttonOK = new System.Windows.Forms.Button(); this.buttonOK = new System.Windows.Forms.Button();
this.buttonCancel = new System.Windows.Forms.Button(); this.buttonCancel = new System.Windows.Forms.Button();
this.cellPropertiesControl = new OpenLiveWriter.PostEditor.Tables.CellPropertiesControl(); this.cellPropertiesControl = new OpenLiveWriter.PostEditor.Tables.CellPropertiesControl();
this.SuspendLayout(); this.SuspendLayout();
// //
// buttonOK // buttonOK
// //
this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonOK.FlatStyle = System.Windows.Forms.FlatStyle.System; this.buttonOK.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.buttonOK.Location = new System.Drawing.Point(85, 112); this.buttonOK.Location = new System.Drawing.Point(114, 158);
this.buttonOK.Name = "buttonOK"; this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(105, 33);
this.buttonOK.TabIndex = 2; this.buttonOK.TabIndex = 2;
this.buttonOK.Text = "OK"; this.buttonOK.Text = "OK";
this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click);
// //
// buttonCancel // buttonCancel
// //
this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.buttonCancel.FlatStyle = System.Windows.Forms.FlatStyle.System; this.buttonCancel.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.buttonCancel.Location = new System.Drawing.Point(166, 112); this.buttonCancel.Location = new System.Drawing.Point(227, 158);
this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(105, 33);
this.buttonCancel.TabIndex = 3; this.buttonCancel.TabIndex = 3;
this.buttonCancel.Text = "Cancel"; this.buttonCancel.Text = "Cancel";
// //
// cellPropertiesControl // cellPropertiesControl
// //
this.cellPropertiesControl.Location = new System.Drawing.Point(9, 8); cellProperties1.BackgroundColor = null;
cellProperties1.HorizontalAlignment = OpenLiveWriter.PostEditor.Tables.HorizontalAlignment.Left;
cellProperties1.VerticalAlignment = OpenLiveWriter.PostEditor.Tables.VerticalAlignment.Middle;
this.cellPropertiesControl.CellProperties = cellProperties1;
this.cellPropertiesControl.Location = new System.Drawing.Point(13, 11);
this.cellPropertiesControl.Name = "cellPropertiesControl"; this.cellPropertiesControl.Name = "cellPropertiesControl";
this.cellPropertiesControl.Size = new System.Drawing.Size(231, 97); this.cellPropertiesControl.Size = new System.Drawing.Size(323, 139);
this.cellPropertiesControl.TabIndex = 4; this.cellPropertiesControl.TabIndex = 4;
// //
// CellPropertiesForm // CellPropertiesForm
// //
this.AcceptButton = this.buttonOK; this.AcceptButton = this.buttonOK;
this.AutoScaleBaseSize = new System.Drawing.Size(5, 14);
this.CancelButton = this.buttonCancel; this.CancelButton = this.buttonCancel;
this.ClientSize = new System.Drawing.Size(250, 143); this.ClientSize = new System.Drawing.Size(345, 202);
this.Controls.Add(this.cellPropertiesControl); this.Controls.Add(this.cellPropertiesControl);
this.Controls.Add(this.buttonCancel); this.Controls.Add(this.buttonCancel);
this.Controls.Add(this.buttonOK); this.Controls.Add(this.buttonOK);
this.Location = new System.Drawing.Point(0, 0); this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.MaximizeBox = false; this.MaximizeBox = false;
this.MinimizeBox = false; this.MinimizeBox = false;
this.Name = "CellPropertiesForm"; this.Name = "CellPropertiesForm";

View File

@ -3,7 +3,7 @@
<!-- <!--
Microsoft ResX Schema Microsoft ResX Schema
Version 1.3 Version 2.0
The primary goals of this format is to allow a simple XML format The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the that is mostly human readable. The generation and parsing of the
@ -14,16 +14,17 @@
... ado.net/XML headers & schema ... ... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">1.3</resheader> <resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data> <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object] <value>[base64 mime encoded serialized .NET Framework object]</value>
</data> </data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object] <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data> </data>
There are any number of "resheader" rows that contain simple There are any number of "resheader" rows that contain simple
@ -35,7 +36,7 @@
Classes that don't support this are serialized and stored with the Classes that don't support this are serialized and stored with the
mimetype set. mimetype set.
The mimetype is used forserialized objects, and tells the The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly: extensible. For a given mimetype the value must be set accordingly:
@ -45,7 +46,7 @@
mimetype: application/x-microsoft.net.object.binary.base64 mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64 mimetype: application/x-microsoft.net.object.soap.base64
@ -59,18 +60,37 @@
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
--> -->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true"> <xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType> <xsd:complexType>
<xsd:choice maxOccurs="unbounded"> <xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data"> <xsd:element name="data">
<xsd:complexType> <xsd:complexType>
<xsd:sequence> <xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" /> <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="resheader"> <xsd:element name="resheader">
@ -89,69 +109,12 @@
<value>text/microsoft-resx</value> <value>text/microsoft-resx</value>
</resheader> </resheader>
<resheader name="version"> <resheader name="version">
<value>1.3</value> <value>2.0</value>
</resheader> </resheader>
<resheader name="reader"> <resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<data name="buttonOK.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="buttonOK.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="buttonOK.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="buttonCancel.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="buttonCancel.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="buttonCancel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="cellPropertiesControl.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="cellPropertiesControl.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="cellPropertiesControl.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>(Default)</value>
</data>
<data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>8, 8</value>
</data>
<data name="$this.Name">
<value>CellPropertiesForm</value>
</data>
<data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>80</value>
</data>
<data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
</root> </root>

View File

@ -98,6 +98,7 @@ namespace OpenLiveWriter.PostEditor.Tables
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
OpenLiveWriter.PostEditor.Tables.CellProperties cellProperties1 = new OpenLiveWriter.PostEditor.Tables.CellProperties();
this.buttonCancel = new System.Windows.Forms.Button(); this.buttonCancel = new System.Windows.Forms.Button();
this.groupBoxSize = new System.Windows.Forms.GroupBox(); this.groupBoxSize = new System.Windows.Forms.GroupBox();
this.columnWidthControl = new OpenLiveWriter.PostEditor.Tables.ColumnWidthControl(); this.columnWidthControl = new OpenLiveWriter.PostEditor.Tables.ColumnWidthControl();
@ -106,70 +107,75 @@ namespace OpenLiveWriter.PostEditor.Tables
this.cellPropertiesControl = new OpenLiveWriter.PostEditor.Tables.CellPropertiesControl(); this.cellPropertiesControl = new OpenLiveWriter.PostEditor.Tables.CellPropertiesControl();
this.groupBoxSize.SuspendLayout(); this.groupBoxSize.SuspendLayout();
this.SuspendLayout(); this.SuspendLayout();
// //
// buttonCancel // buttonCancel
// //
this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonCancel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; this.buttonCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel;
this.buttonCancel.FlatStyle = System.Windows.Forms.FlatStyle.System; this.buttonCancel.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.buttonCancel.Location = new System.Drawing.Point(169, 184); this.buttonCancel.Location = new System.Drawing.Point(379, 201);
this.buttonCancel.Name = "buttonCancel"; this.buttonCancel.Name = "buttonCancel";
this.buttonCancel.Size = new System.Drawing.Size(105, 33);
this.buttonCancel.TabIndex = 3; this.buttonCancel.TabIndex = 3;
this.buttonCancel.Text = "Cancel"; this.buttonCancel.Text = "Cancel";
// //
// groupBoxSize // groupBoxSize
// //
this.groupBoxSize.Controls.Add(this.columnWidthControl); this.groupBoxSize.Controls.Add(this.columnWidthControl);
this.groupBoxSize.FlatStyle = System.Windows.Forms.FlatStyle.System; this.groupBoxSize.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.groupBoxSize.Location = new System.Drawing.Point(9, 8); this.groupBoxSize.Location = new System.Drawing.Point(13, 11);
this.groupBoxSize.Name = "groupBoxSize"; this.groupBoxSize.Name = "groupBoxSize";
this.groupBoxSize.Size = new System.Drawing.Size(234, 66); this.groupBoxSize.Size = new System.Drawing.Size(341, 79);
this.groupBoxSize.TabIndex = 0; this.groupBoxSize.TabIndex = 0;
this.groupBoxSize.TabStop = false; this.groupBoxSize.TabStop = false;
this.groupBoxSize.Text = "Size"; this.groupBoxSize.Text = "Size";
// //
// columnWidthControl // columnWidthControl
// //
this.columnWidthControl.ColumnWidth = 0; this.columnWidthControl.Location = new System.Drawing.Point(21, 25);
this.columnWidthControl.Location = new System.Drawing.Point(15, 24);
this.columnWidthControl.Name = "columnWidthControl"; this.columnWidthControl.Name = "columnWidthControl";
this.columnWidthControl.Size = new System.Drawing.Size(209, 23); this.columnWidthControl.Size = new System.Drawing.Size(308, 36);
this.columnWidthControl.TabIndex = 0; this.columnWidthControl.TabIndex = 0;
// //
// label11 // label11
// //
this.label11.Location = new System.Drawing.Point(1, 1); this.label11.Location = new System.Drawing.Point(1, 1);
this.label11.Name = "label11"; this.label11.Name = "label11";
this.label11.Size = new System.Drawing.Size(100, 23);
this.label11.TabIndex = 0; this.label11.TabIndex = 0;
// //
// buttonOK // buttonOK
// //
this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); this.buttonOK.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right)));
this.buttonOK.FlatStyle = System.Windows.Forms.FlatStyle.System; this.buttonOK.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.buttonOK.Location = new System.Drawing.Point(86, 184); this.buttonOK.Location = new System.Drawing.Point(262, 201);
this.buttonOK.Name = "buttonOK"; this.buttonOK.Name = "buttonOK";
this.buttonOK.Size = new System.Drawing.Size(105, 33);
this.buttonOK.TabIndex = 2; this.buttonOK.TabIndex = 2;
this.buttonOK.Text = "OK"; this.buttonOK.Text = "OK";
this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click); this.buttonOK.Click += new System.EventHandler(this.buttonOK_Click);
// //
// cellPropertiesControl // cellPropertiesControl
// //
this.cellPropertiesControl.Location = new System.Drawing.Point(9, 79); cellProperties1.BackgroundColor = null;
cellProperties1.HorizontalAlignment = OpenLiveWriter.PostEditor.Tables.HorizontalAlignment.Left;
cellProperties1.VerticalAlignment = OpenLiveWriter.PostEditor.Tables.VerticalAlignment.Middle;
this.cellPropertiesControl.CellProperties = cellProperties1;
this.cellPropertiesControl.Location = new System.Drawing.Point(13, 113);
this.cellPropertiesControl.Name = "cellPropertiesControl"; this.cellPropertiesControl.Name = "cellPropertiesControl";
this.cellPropertiesControl.Size = new System.Drawing.Size(234, 98); this.cellPropertiesControl.Size = new System.Drawing.Size(243, 120);
this.cellPropertiesControl.TabIndex = 1; this.cellPropertiesControl.TabIndex = 1;
// //
// ColumnPropertiesForm // ColumnPropertiesForm
// //
this.AcceptButton = this.buttonOK; this.AcceptButton = this.buttonOK;
this.AutoScaleBaseSize = new System.Drawing.Size(5, 14);
this.CancelButton = this.buttonCancel; this.CancelButton = this.buttonCancel;
this.ClientSize = new System.Drawing.Size(253, 215); this.ClientSize = new System.Drawing.Size(496, 245);
this.Controls.Add(this.cellPropertiesControl); this.Controls.Add(this.cellPropertiesControl);
this.Controls.Add(this.buttonOK); this.Controls.Add(this.buttonOK);
this.Controls.Add(this.groupBoxSize); this.Controls.Add(this.groupBoxSize);
this.Controls.Add(this.buttonCancel); this.Controls.Add(this.buttonCancel);
this.Location = new System.Drawing.Point(0, 0); this.Margin = new System.Windows.Forms.Padding(4, 4, 4, 4);
this.MaximizeBox = false; this.MaximizeBox = false;
this.MinimizeBox = false; this.MinimizeBox = false;
this.Name = "ColumnPropertiesForm"; this.Name = "ColumnPropertiesForm";

View File

@ -3,7 +3,7 @@
<!-- <!--
Microsoft ResX Schema Microsoft ResX Schema
Version 1.3 Version 2.0
The primary goals of this format is to allow a simple XML format The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the that is mostly human readable. The generation and parsing of the
@ -14,16 +14,17 @@
... ado.net/XML headers & schema ... ... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">1.3</resheader> <resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data> <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object] <value>[base64 mime encoded serialized .NET Framework object]</value>
</data> </data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object] <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data> </data>
There are any number of "resheader" rows that contain simple There are any number of "resheader" rows that contain simple
@ -35,7 +36,7 @@
Classes that don't support this are serialized and stored with the Classes that don't support this are serialized and stored with the
mimetype set. mimetype set.
The mimetype is used forserialized objects, and tells the The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly: extensible. For a given mimetype the value must be set accordingly:
@ -45,7 +46,7 @@
mimetype: application/x-microsoft.net.object.binary.base64 mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64 mimetype: application/x-microsoft.net.object.soap.base64
@ -59,18 +60,37 @@
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
--> -->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true"> <xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType> <xsd:complexType>
<xsd:choice maxOccurs="unbounded"> <xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data"> <xsd:element name="data">
<xsd:complexType> <xsd:complexType>
<xsd:sequence> <xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" /> <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="resheader"> <xsd:element name="resheader">
@ -89,105 +109,12 @@
<value>text/microsoft-resx</value> <value>text/microsoft-resx</value>
</resheader> </resheader>
<resheader name="version"> <resheader name="version">
<value>1.3</value> <value>2.0</value>
</resheader> </resheader>
<resheader name="reader"> <resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<data name="buttonCancel.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="buttonCancel.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="buttonCancel.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="groupBoxSize.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="groupBoxSize.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>8, 8</value>
</data>
<data name="groupBoxSize.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="groupBoxSize.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="groupBoxSize.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="groupBoxSize.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="columnWidthControl.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="columnWidthControl.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="columnWidthControl.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="label11.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="label11.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="label11.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="buttonOK.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="buttonOK.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="buttonOK.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="cellPropertiesControl.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="cellPropertiesControl.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="cellPropertiesControl.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>(Default)</value>
</data>
<data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>8, 8</value>
</data>
<data name="$this.Name">
<value>ColumnPropertiesForm</value>
</data>
<data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>80</value>
</data>
<data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
</root> </root>

View File

@ -32,7 +32,9 @@ namespace OpenLiveWriter.PostEditor.Tables
{ {
private OpenLiveWriter.Controls.NumericTextBox textBoxWidth; private OpenLiveWriter.Controls.NumericTextBox textBoxWidth;
private System.Windows.Forms.Label labelWidth; private System.Windows.Forms.Label labelWidth;
private System.Windows.Forms.Label labelPixels; private RadioButton rbPixels;
private RadioButton rbPercent;
/// <summary> /// <summary>
/// Required designer variable. /// Required designer variable.
/// </summary> /// </summary>
@ -43,7 +45,7 @@ namespace OpenLiveWriter.PostEditor.Tables
// This call is required by the Windows.Forms Form Designer. // This call is required by the Windows.Forms Form Designer.
InitializeComponent(); InitializeComponent();
this.labelWidth.Text = Res.Get(StringId.WidthLabel); this.labelWidth.Text = Res.Get(StringId.WidthLabel);
this.labelPixels.Text = Res.Get(StringId.pixels); this.rbPixels.Text = Res.Get(StringId.pixels);
} }
protected override void OnLoad(EventArgs e) protected override void OnLoad(EventArgs e)
@ -53,12 +55,13 @@ namespace OpenLiveWriter.PostEditor.Tables
using (new AutoGrow(this, AnchorStyles.Right, false)) using (new AutoGrow(this, AnchorStyles.Right, false))
{ {
DisplayHelper.AutoFitSystemLabel(labelWidth, 0, int.MaxValue); DisplayHelper.AutoFitSystemLabel(labelWidth, 0, int.MaxValue);
DisplayHelper.AutoFitSystemLabel(labelPixels, 0, int.MaxValue); DisplayHelper.AutoFitSystemRadioButton(rbPixels, 0, int.MaxValue);
LayoutHelper.DistributeHorizontally(8, labelWidth, textBoxWidth, labelPixels); DisplayHelper.AutoFitSystemRadioButton(rbPercent, 0, int.MaxValue);
LayoutHelper.DistributeHorizontally(8, labelWidth, textBoxWidth, rbPixels, rbPercent);
} }
} }
public int ColumnWidth public PixelPercent ColumnWidth
{ {
get get
{ {
@ -66,22 +69,36 @@ namespace OpenLiveWriter.PostEditor.Tables
{ {
try try
{ {
return int.Parse(textBoxWidth.Text, CultureInfo.CurrentCulture); var units = rbPercent.Checked ? PixelPercentUnits.Percentage : PixelPercentUnits.Pixels;
return new PixelPercent(textBoxWidth.Text, CultureInfo.CurrentCulture, units);
} }
catch catch
{ {
return 0; return new PixelPercent();
} }
} }
else else
return 0; return new PixelPercent();
} }
set set
{ {
if (value != 0) if (value.Units != PixelPercentUnits.Undefined)
textBoxWidth.Text = value.ToString(CultureInfo.CurrentCulture); {
textBoxWidth.Text = value.Value.ToString(CultureInfo.CurrentCulture);
}
else else
{
textBoxWidth.Text = String.Empty; textBoxWidth.Text = String.Empty;
}
if (value.Units == PixelPercentUnits.Percentage)
{
rbPercent.Checked = true;
}
else
{
rbPixels.Checked = true;
}
} }
} }
@ -92,20 +109,19 @@ namespace OpenLiveWriter.PostEditor.Tables
public bool ValidateInput(int maxValue) public bool ValidateInput(int maxValue)
{ {
int result; if (!PixelPercent.CanParse(textBoxWidth.Text))
if (textBoxWidth.Text == String.Empty || !Int32.TryParse(textBoxWidth.Text, out result))
{ {
DisplayMessage.Show(MessageId.UnspecifiedValue, this, Res.Get(StringId.Width)); DisplayMessage.Show(MessageId.UnspecifiedValue, this, Res.Get(StringId.Width));
textBoxWidth.Focus(); textBoxWidth.Focus();
return false; return false;
} }
else if (ColumnWidth <= 0) else if (ColumnWidth.Units != PixelPercentUnits.Undefined && ColumnWidth.Value <= 0)
{ {
DisplayMessage.Show(MessageId.InvalidNumberPositiveOnly, FindForm(), Res.Get(StringId.Width)); DisplayMessage.Show(MessageId.InvalidNumberPositiveOnly, FindForm(), Res.Get(StringId.Width));
textBoxWidth.Focus(); textBoxWidth.Focus();
return false; return false;
} }
else if (maxValue > 0 && ColumnWidth >= maxValue) else if (maxValue > 0 && ColumnWidth.Units != PixelPercentUnits.Undefined && ColumnWidth.Value >= maxValue)
{ {
DisplayMessage.Show(MessageId.ValueExceedsMaximum, FindForm(), maxValue, Res.Get(StringId.Width)); DisplayMessage.Show(MessageId.ValueExceedsMaximum, FindForm(), maxValue, Res.Get(StringId.Width));
textBoxWidth.Focus(); textBoxWidth.Focus();
@ -139,50 +155,66 @@ namespace OpenLiveWriter.PostEditor.Tables
/// </summary> /// </summary>
private void InitializeComponent() private void InitializeComponent()
{ {
this.textBoxWidth = new OpenLiveWriter.Controls.NumericTextBox();
this.labelWidth = new System.Windows.Forms.Label(); this.labelWidth = new System.Windows.Forms.Label();
this.labelPixels = new System.Windows.Forms.Label(); this.rbPixels = new System.Windows.Forms.RadioButton();
this.rbPercent = new System.Windows.Forms.RadioButton();
this.textBoxWidth = new OpenLiveWriter.Controls.NumericTextBox();
this.SuspendLayout(); this.SuspendLayout();
// //
// textBoxWidth
//
this.textBoxWidth.Location = new System.Drawing.Point(72, 0);
this.textBoxWidth.MaxLength = 9;
this.textBoxWidth.Name = "textBoxWidth";
this.textBoxWidth.Size = new System.Drawing.Size(46, 20);
this.textBoxWidth.TabIndex = 2;
this.textBoxWidth.Text = "";
//
// labelWidth // labelWidth
// //
this.labelWidth.FlatStyle = System.Windows.Forms.FlatStyle.System; this.labelWidth.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.labelWidth.Location = new System.Drawing.Point(0, 3); this.labelWidth.Location = new System.Drawing.Point(0, 3);
this.labelWidth.Name = "labelWidth"; this.labelWidth.Name = "labelWidth";
this.labelWidth.Size = new System.Drawing.Size(64, 15); this.labelWidth.Size = new System.Drawing.Size(64, 15);
this.labelWidth.TabIndex = 0; this.labelWidth.TabIndex = 0;
this.labelWidth.Text = "&Width:"; this.labelWidth.Text = "&Width:";
// //
// labelPixels // rbPixels
// //
this.labelPixels.FlatStyle = System.Windows.Forms.FlatStyle.System; this.rbPixels.AutoSize = true;
this.labelPixels.Location = new System.Drawing.Point(120, 3); this.rbPixels.Checked = true;
this.labelPixels.Name = "labelPixels"; this.rbPixels.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.labelPixels.Size = new System.Drawing.Size(63, 15); this.rbPixels.Location = new System.Drawing.Point(124, 3);
this.labelPixels.TabIndex = 3; this.rbPixels.Name = "rbPixels";
this.labelPixels.Text = "pixels"; this.rbPixels.Size = new System.Drawing.Size(67, 22);
// this.rbPixels.TabIndex = 4;
this.rbPixels.TabStop = true;
this.rbPixels.Text = "pixels";
this.rbPixels.UseVisualStyleBackColor = true;
//
// rbPercent
//
this.rbPercent.AutoSize = true;
this.rbPercent.FlatStyle = System.Windows.Forms.FlatStyle.System;
this.rbPercent.Location = new System.Drawing.Point(194, 3);
this.rbPercent.Name = "rbPercent";
this.rbPercent.Size = new System.Drawing.Size(80, 22);
this.rbPercent.TabIndex = 5;
this.rbPercent.Text = "percent";
this.rbPercent.UseVisualStyleBackColor = true;
//
// textBoxWidth
//
this.textBoxWidth.Location = new System.Drawing.Point(72, 0);
this.textBoxWidth.MaxLength = 9;
this.textBoxWidth.Name = "textBoxWidth";
this.textBoxWidth.Size = new System.Drawing.Size(46, 22);
this.textBoxWidth.TabIndex = 2;
//
// ColumnWidthControl // ColumnWidthControl
// //
this.Controls.Add(this.labelPixels); this.Controls.Add(this.rbPercent);
this.Controls.Add(this.rbPixels);
this.Controls.Add(this.textBoxWidth); this.Controls.Add(this.textBoxWidth);
this.Controls.Add(this.labelWidth); this.Controls.Add(this.labelWidth);
this.Name = "ColumnWidthControl"; this.Name = "ColumnWidthControl";
this.Size = new System.Drawing.Size(348, 23); this.Size = new System.Drawing.Size(284, 23);
this.ResumeLayout(false); this.ResumeLayout(false);
this.PerformLayout();
} }
#endregion #endregion
} }

View File

@ -3,7 +3,7 @@
<!-- <!--
Microsoft ResX Schema Microsoft ResX Schema
Version 1.3 Version 2.0
The primary goals of this format is to allow a simple XML format The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the that is mostly human readable. The generation and parsing of the
@ -14,16 +14,17 @@
... ado.net/XML headers & schema ... ... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader> <resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">1.3</resheader> <resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data> <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object] <value>[base64 mime encoded serialized .NET Framework object]</value>
</data> </data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object] <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data> </data>
There are any number of "resheader" rows that contain simple There are any number of "resheader" rows that contain simple
@ -35,7 +36,7 @@
Classes that don't support this are serialized and stored with the Classes that don't support this are serialized and stored with the
mimetype set. mimetype set.
The mimetype is used forserialized objects, and tells the The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly: extensible. For a given mimetype the value must be set accordingly:
@ -45,7 +46,7 @@
mimetype: application/x-microsoft.net.object.binary.base64 mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64 mimetype: application/x-microsoft.net.object.soap.base64
@ -59,18 +60,37 @@
: and then encoded with base64 encoding. : and then encoded with base64 encoding.
--> -->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true"> <xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType> <xsd:complexType>
<xsd:choice maxOccurs="unbounded"> <xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data"> <xsd:element name="data">
<xsd:complexType> <xsd:complexType>
<xsd:sequence> <xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence> </xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" /> <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType> </xsd:complexType>
</xsd:element> </xsd:element>
<xsd:element name="resheader"> <xsd:element name="resheader">
@ -89,69 +109,12 @@
<value>text/microsoft-resx</value> <value>text/microsoft-resx</value>
</resheader> </resheader>
<resheader name="version"> <resheader name="version">
<value>1.3</value> <value>2.0</value>
</resheader> </resheader>
<resheader name="reader"> <resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<data name="textBoxWidth.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="textBoxWidth.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="textBoxWidth.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="labelWidth.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="labelWidth.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="labelWidth.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="labelPixels.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="labelPixels.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="labelPixels.Modifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="$this.TrayLargeIcon" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Locked" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.SnapToGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.Language" type="System.Globalization.CultureInfo, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>(Default)</value>
</data>
<data name="$this.DrawGrid" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>True</value>
</data>
<data name="$this.TrayHeight" type="System.Int32, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>80</value>
</data>
<data name="$this.Localizable" type="System.Boolean, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>False</value>
</data>
<data name="$this.DefaultModifiers" type="System.CodeDom.MemberAttributes, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>Private</value>
</data>
<data name="$this.Name">
<value>ColumnWidthControl</value>
</data>
<data name="$this.GridSize" type="System.Drawing.Size, System.Drawing, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>8, 8</value>
</data>
</root> </root>

View File

@ -36,11 +36,11 @@ namespace OpenLiveWriter.PostEditor.Tables
} }
} }
public int Width public PixelPercent Width
{ {
get get
{ {
return TableHelper.GetCellWidth(_baseCell); return new PixelPercent((string) _baseCell.width); //TableHelper.GetCellWidth(_baseCell);
} }
set set
{ {
@ -245,13 +245,14 @@ namespace OpenLiveWriter.PostEditor.Tables
private class CellWidthProcessor : IColumnCellProcessor private class CellWidthProcessor : IColumnCellProcessor
{ {
private int _width; private PixelPercent _width;
public CellWidthProcessor(int width) { _width = width; } public CellWidthProcessor(PixelPercent width) { _width = width; }
public void ProcessCell(IHTMLTableCell cell) public void ProcessCell(IHTMLTableCell cell)
{ {
if (_width > 0) if (_width > 0 && _width.Units != PixelPercentUnits.Undefined)
{ {
cell.width = _width.ToString(CultureInfo.InvariantCulture); cell.width = _width.ToString(CultureInfo.InvariantCulture);
} }
else else

View File

@ -0,0 +1,143 @@
using System;
using System.Diagnostics;
using System.Globalization;
namespace OpenLiveWriter.PostEditor.Tables
{
public enum PixelPercentUnits
{
Undefined,
Pixels,
Percentage
}
/// <summary>
/// Represents a value that can be a number of pixels or a percentage
/// </summary>
[DebuggerDisplay("{Value} {Units}")]
public struct PixelPercent
{
public PixelPercent(int value, PixelPercentUnits units) : this()
{
Units = units;
if (value < 0)
throw new ArgumentOutOfRangeException("value", value, "value must be greater than zero");
if (value > 100 && units == PixelPercentUnits.Percentage)
throw new ArgumentOutOfRangeException("value", value,
"value when percent must be less or equal to 100");
Value = value;
}
public PixelPercent(string text, IFormatProvider provider, PixelPercentUnits units)
{
if (string.IsNullOrEmpty(text))
{
Value = 0;
Units = PixelPercentUnits.Undefined;
}
else
{
var s = text.Trim();
Units = units;
var value = int.Parse(s, provider);
Value = value;
}
}
public PixelPercent(string text, IFormatProvider provider) : this()
{
if (string.IsNullOrEmpty(text))
{
Value = 0;
Units = PixelPercentUnits.Undefined;
}
else
{
var s = text.Trim();
var units = PixelPercentUnits.Pixels;
if (s.EndsWith("%"))
{
units = PixelPercentUnits.Percentage;
s = s.TrimEnd('%');
}
var value = int.Parse(s, provider);
Value = value;
Units = units;
}
}
public static bool CanParse(string text)
{
try
{
var p = new PixelPercent(text, CultureInfo.InvariantCulture);
return true;
}
catch (Exception)
{
return false;
}
}
public PixelPercent(string text) : this(text, CultureInfo.CurrentCulture)
{
}
public int Value { get; private set; }
public PixelPercentUnits Units { get; private set; }
public static PixelPercent operator / (PixelPercent left, int right)
{
if (right <= 0)
throw new InvalidOperationException("Can't divide PixelPercent by zero or negative numbers");
if (left.Units == PixelPercentUnits.Undefined)
throw new InvalidOperationException("Can't divide PixelPercent as it doesn't have an assigned value");
return new PixelPercent(left.Value / right, left.Units);
}
public static PixelPercent operator * (PixelPercent left, int right)
{
throw new NotImplementedException();
}
public static implicit operator int(PixelPercent value)
{
return value.Value;
}
public static implicit operator PixelPercent(int value)
{
return new PixelPercent(value, PixelPercentUnits.Pixels);
}
public override string ToString()
{
return ToString(CultureInfo.CurrentCulture);
}
public string ToString(IFormatProvider provider)
{
switch (Units)
{
case PixelPercentUnits.Percentage:
return String.Format(provider, "{0}%", Value);
case PixelPercentUnits.Pixels:
return String.Format(provider, "{0}", Value);
default:
return String.Empty;
}
}
}
}

View File

@ -38,7 +38,7 @@ namespace OpenLiveWriter.PostEditor.Tables
if (parentCellBlock is IHTMLTableCell) if (parentCellBlock is IHTMLTableCell)
{ {
int parentCellWidth = parentCellBlock.clientWidth != 0 ? parentCellBlock.clientWidth : parentCellBlock.scrollWidth; int parentCellWidth = parentCellBlock.clientWidth != 0 ? parentCellBlock.clientWidth : parentCellBlock.scrollWidth;
parameters.Properties.Width = Math.Min(parameters.Properties.Width, parentCellWidth); parameters.Properties.Width = Math.Min(parentCellWidth, parameters.Properties.Width);
} }
} }
@ -58,7 +58,19 @@ namespace OpenLiveWriter.PostEditor.Tables
tableHtml.Append("<tbody>\r\n"); tableHtml.Append("<tbody>\r\n");
// write cells // write cells
int columnWidth = parameters.Properties.Width / parameters.Columns; string columnWidth = String.Empty;
switch (parameters.Properties.Width.Units)
{
case PixelPercentUnits.Pixels:
int width = parameters.Properties.Width / parameters.Columns;
columnWidth = string.Format(" width=\"{0}\"", width);
break;
case PixelPercentUnits.Percentage:
columnWidth = string.Format(" width=\"{0}%\"", 100 / parameters.Columns);
break;
}
for (int r = 0; r < parameters.Rows; r++) for (int r = 0; r < parameters.Rows; r++)
{ {
tableHtml.Append("<tr>\r\n"); tableHtml.Append("<tr>\r\n");
@ -67,11 +79,12 @@ namespace OpenLiveWriter.PostEditor.Tables
{ {
// add default alignment and width to each cell // add default alignment and width to each cell
string valign = " valign=\"top\""; // (more natural/expected behavior than middle) string valign = " valign=\"top\""; // (more natural/expected behavior than middle)
tableHtml.AppendFormat("<td {0} width=\"{1}\"></td>\r\n", valign, columnWidth); tableHtml.AppendFormat("<td {0}{1}></td>\r\n", valign, columnWidth);
} }
tableHtml.Append("</tr>\r\n"); tableHtml.Append("</tr>\r\n");
} }
// end table // end table
tableHtml.Append("</tbody>\r\n"); tableHtml.Append("</tbody>\r\n");
@ -447,22 +460,27 @@ namespace OpenLiveWriter.PostEditor.Tables
// get the existing width, calculate the delta, then spread // get the existing width, calculate the delta, then spread
// the delta across all of the columns // the delta across all of the columns
int existingWidth = TableHelper.GetTableWidth(TableSelection.Table); var existingWidth = TableHelper.GetTableWidth(TableSelection.Table);
int changeInWidth = value.Width - existingWidth;
IHTMLTableRow firstRow = TableSelection.Table.rows.item(0, 0) as IHTMLTableRow; if (existingWidth.Units == PixelPercentUnits.Pixels)
if (firstRow.cells.length > 0)
{ {
int changePerColumn = changeInWidth / firstRow.cells.length; int changeInWidth = value.Width - existingWidth;
int leftoverChange = changeInWidth % firstRow.cells.length; IHTMLTableRow firstRow = TableSelection.Table.rows.item(0, 0) as IHTMLTableRow;
foreach (IHTMLTableCell cell in firstRow.cells) if (firstRow.cells.length > 0)
{ {
HTMLTableColumn column = new HTMLTableColumn(TableSelection.Table, cell); int changePerColumn = changeInWidth / firstRow.cells.length;
column.Width = column.Width + changePerColumn + leftoverChange; int leftoverChange = changeInWidth % firstRow.cells.length;
leftoverChange = 0; // allocate only once foreach (IHTMLTableCell cell in firstRow.cells)
{
HTMLTableColumn column = new HTMLTableColumn(TableSelection.Table, cell);
column.Width = column.Width + changePerColumn + leftoverChange;
leftoverChange = 0; // allocate only once
}
} }
} }
// also set the width of the whole table to match the columns // also set the width of the whole table to match the columns
TableSelection.Table.width = value.Width; TableSelection.Table.width = value.Width.ToString();
// update borders // update borders
TableHelper.UpdateDesignTimeBorders(TableSelection.Table); TableHelper.UpdateDesignTimeBorders(TableSelection.Table);
@ -1326,12 +1344,7 @@ namespace OpenLiveWriter.PostEditor.Tables
} }
private string _borderSize = String.Empty; private string _borderSize = String.Empty;
public int Width public PixelPercent Width { get; set; }
{
get { return _width; }
set { _width = value; }
}
private int _width = 0;
} }
public class CellProperties public class CellProperties
@ -1377,12 +1390,8 @@ namespace OpenLiveWriter.PostEditor.Tables
public class ColumnProperties public class ColumnProperties
{ {
public int Width public PixelPercent Width { get; set; }
{
get { return _width; }
set { _width = value; }
}
private int _width = 0;
public CellProperties CellProperties public CellProperties CellProperties
{ {

View File

@ -93,22 +93,22 @@ namespace OpenLiveWriter.PostEditor.Tables
} }
} }
public static int GetTableWidth(IHTMLTable table) public static PixelPercent GetTableWidth(IHTMLTable table)
{ {
if (table.width != null) if (table.width != null)
{ {
try try
{ {
return int.Parse(table.width.ToString(), CultureInfo.InvariantCulture); return new PixelPercent(table.width.ToString(), CultureInfo.InvariantCulture);
} }
catch catch
{ {
return 0; return new PixelPercent();
} }
} }
else else
{ {
return 0; return new PixelPercent();
} }
} }
@ -132,8 +132,14 @@ namespace OpenLiveWriter.PostEditor.Tables
} }
} }
public static int GetTableLogicalEditingWidth(IHTMLTable table) public static PixelPercent GetTableLogicalEditingWidth(IHTMLTable table)
{ {
// If percentage, then just keep that
var width = GetTableWidth(table);
if (width.Units == PixelPercentUnits.Percentage || width.Units == PixelPercentUnits.Undefined)
return width;
// value to return (default to zero) // value to return (default to zero)
int logicalWidth = 0; int logicalWidth = 0;
@ -173,9 +179,9 @@ namespace OpenLiveWriter.PostEditor.Tables
public static void SynchronizeTableWidthForEditing(IHTMLTable table) public static void SynchronizeTableWidthForEditing(IHTMLTable table)
{ {
int logicalWidth = TableHelper.GetTableLogicalEditingWidth(table); var logicalWidth = TableHelper.GetTableLogicalEditingWidth(table);
if (logicalWidth > 0) if (logicalWidth > 0 && logicalWidth.Units != PixelPercentUnits.Undefined)
table.width = logicalWidth; table.width = logicalWidth.ToString();
else else
(table as IHTMLElement).removeAttribute("width", 0); (table as IHTMLElement).removeAttribute("width", 0);
} }

View File

@ -119,7 +119,9 @@ namespace OpenLiveWriter.PostEditor.Tables
TableCreationParameters creationParameters = CreateDefaultParameters(); TableCreationParameters creationParameters = CreateDefaultParameters();
numericTextBoxRows.Text = creationParameters.Rows.ToString(CultureInfo.CurrentCulture); numericTextBoxRows.Text = creationParameters.Rows.ToString(CultureInfo.CurrentCulture);
numericTextBoxColumns.Text = creationParameters.Columns.ToString(CultureInfo.CurrentCulture); numericTextBoxColumns.Text = creationParameters.Columns.ToString(CultureInfo.CurrentCulture);
columnWidthControl.Text = creationParameters.Properties.Width.ToString(CultureInfo.CurrentCulture);
var width = creationParameters.Properties.Width;
columnWidthControl.Text = width.ToString(CultureInfo.CurrentCulture);
InitializeFormProperties(creationParameters.Properties); InitializeFormProperties(creationParameters.Properties);
// show the dialog // show the dialog
@ -376,7 +378,7 @@ namespace OpenLiveWriter.PostEditor.Tables
tableProperties.CellPadding = TableEditingSettings.DefaultCellPadding; tableProperties.CellPadding = TableEditingSettings.DefaultCellPadding;
tableProperties.CellSpacing = TableEditingSettings.DefaultCellSpacing; tableProperties.CellSpacing = TableEditingSettings.DefaultCellSpacing;
tableProperties.BorderSize = TableEditingSettings.DefaultBorderSize; tableProperties.BorderSize = TableEditingSettings.DefaultBorderSize;
tableProperties.Width = TableEditingSettings.DefaultWidth; tableProperties.Width = new PixelPercent();
// return default parameters // return default parameters
return new TableCreationParameters( return new TableCreationParameters(
@ -479,7 +481,7 @@ namespace OpenLiveWriter.PostEditor.Tables
// //
this.columnWidthControl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) this.columnWidthControl.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right))); | System.Windows.Forms.AnchorStyles.Right)));
this.columnWidthControl.ColumnWidth = 0; this.columnWidthControl.ColumnWidth = new PixelPercent();
this.columnWidthControl.ImeMode = System.Windows.Forms.ImeMode.Off; this.columnWidthControl.ImeMode = System.Windows.Forms.ImeMode.Off;
this.columnWidthControl.Location = new System.Drawing.Point(16, 55); this.columnWidthControl.Location = new System.Drawing.Point(16, 55);
this.columnWidthControl.Name = "columnWidthControl"; this.columnWidthControl.Name = "columnWidthControl";