diff --git a/PROMS/Volian.Controls.Library/PreviewMultiLineRO.Designer.cs b/PROMS/Volian.Controls.Library/PreviewMultiLineRO.Designer.cs new file mode 100644 index 00000000..0c36b366 --- /dev/null +++ b/PROMS/Volian.Controls.Library/PreviewMultiLineRO.Designer.cs @@ -0,0 +1,82 @@ +namespace Volian.Controls.Library +{ + partial class PreviewMultiLineRO + { + /// + /// 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.btnCancel = new DevComponents.DotNetBar.ButtonX(); + this.rtbPreviewMlRO = new System.Windows.Forms.RichTextBox(); + this.SuspendLayout(); + // + // btnCancel + // + this.btnCancel.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; + this.btnCancel.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btnCancel.Location = new System.Drawing.Point(391, 531); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(80, 33); + this.btnCancel.TabIndex = 1; + this.btnCancel.Text = "Close"; + this.btnCancel.ThemeAware = true; + // + // rtbPreviewMlRO + // + this.rtbPreviewMlRO.Font = new System.Drawing.Font("Courier New", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.rtbPreviewMlRO.Location = new System.Drawing.Point(12, 12); + this.rtbPreviewMlRO.Name = "rtbPreviewMlRO"; + this.rtbPreviewMlRO.ReadOnly = true; + this.rtbPreviewMlRO.Size = new System.Drawing.Size(804, 513); + this.rtbPreviewMlRO.TabIndex = 2; + this.rtbPreviewMlRO.Text = ""; + // + // PreviewMultiLineRO + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.AutoScroll = true; + this.CancelButton = this.btnCancel; + this.ClientSize = new System.Drawing.Size(828, 576); + this.Controls.Add(this.rtbPreviewMlRO); + this.Controls.Add(this.btnCancel); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "PreviewMultiLineRO"; + this.ShowIcon = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "PreviewMultiLineRO"; + this.ResumeLayout(false); + + } + + #endregion + + private DevComponents.DotNetBar.ButtonX btnCancel; + private System.Windows.Forms.RichTextBox rtbPreviewMlRO; + } +} \ No newline at end of file diff --git a/PROMS/Volian.Controls.Library/PreviewMultiLineRO.cs b/PROMS/Volian.Controls.Library/PreviewMultiLineRO.cs new file mode 100644 index 00000000..02ae1c4d --- /dev/null +++ b/PROMS/Volian.Controls.Library/PreviewMultiLineRO.cs @@ -0,0 +1,20 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace Volian.Controls.Library +{ + public partial class PreviewMultiLineRO : DevComponents.DotNetBar.Office2007Form //Form + { + public PreviewMultiLineRO(string thetext, string title) + { + InitializeComponent(); + this.rtbPreviewMlRO.Text = thetext; + this.Text = title; + } + } +} \ No newline at end of file diff --git a/PROMS/Volian.Controls.Library/PreviewMultiLineRO.resx b/PROMS/Volian.Controls.Library/PreviewMultiLineRO.resx new file mode 100644 index 00000000..19dc0dd8 --- /dev/null +++ b/PROMS/Volian.Controls.Library/PreviewMultiLineRO.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/PROMS/Volian.Controls.Library/PreviewROImage.Designer.cs b/PROMS/Volian.Controls.Library/PreviewROImage.Designer.cs new file mode 100644 index 00000000..45cb60e9 --- /dev/null +++ b/PROMS/Volian.Controls.Library/PreviewROImage.Designer.cs @@ -0,0 +1,84 @@ +namespace Volian.Controls.Library +{ + partial class PreviewROImage + { + /// + /// 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.roImage = new System.Windows.Forms.PictureBox(); + this.btnClose = new DevComponents.DotNetBar.ButtonX(); + ((System.ComponentModel.ISupportInitialize)(this.roImage)).BeginInit(); + this.SuspendLayout(); + // + // roImage + // + this.roImage.Location = new System.Drawing.Point(12, 12); + this.roImage.Name = "roImage"; + this.roImage.Size = new System.Drawing.Size(747, 535); + this.roImage.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.roImage.TabIndex = 0; + this.roImage.TabStop = false; + // + // btnClose + // + this.btnClose.AccessibleRole = System.Windows.Forms.AccessibleRole.PushButton; + this.btnClose.ColorTable = DevComponents.DotNetBar.eButtonColor.OrangeWithBackground; + this.btnClose.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnClose.Font = new System.Drawing.Font("Microsoft Sans Serif", 10.2F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.btnClose.Location = new System.Drawing.Point(341, 553); + this.btnClose.Name = "btnClose"; + this.btnClose.Size = new System.Drawing.Size(75, 35); + this.btnClose.TabIndex = 1; + this.btnClose.Text = "Close"; + this.btnClose.ThemeAware = true; + // + // PreviewROImage + // + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btnClose; + this.ClientSize = new System.Drawing.Size(776, 600); + this.Controls.Add(this.btnClose); + this.Controls.Add(this.roImage); + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "PreviewROImage"; + this.ShowIcon = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen; + this.Text = "PreviewROImage"; + this.TopMost = true; + ((System.ComponentModel.ISupportInitialize)(this.roImage)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.PictureBox roImage; + private DevComponents.DotNetBar.ButtonX btnClose; + } +} \ No newline at end of file diff --git a/PROMS/Volian.Controls.Library/PreviewROImage.cs b/PROMS/Volian.Controls.Library/PreviewROImage.cs new file mode 100644 index 00000000..4f6bb888 --- /dev/null +++ b/PROMS/Volian.Controls.Library/PreviewROImage.cs @@ -0,0 +1,36 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace Volian.Controls.Library +{ + public partial class PreviewROImage : DevComponents.DotNetBar.Office2007Form //Form + { + public PreviewROImage(string filename, string title) + { + InitializeComponent(); + Image.GetThumbnailImageAbort myCallback = + new Image.GetThumbnailImageAbort(ThumbnailCallback); + + Bitmap bm = new Bitmap(filename); //Bitmap(filename); + SizeF sizef = new SizeF(bm.Width / bm.HorizontalResolution, + bm.Height / bm.VerticalResolution); + // 747 & 535 is the size of the image window (roImage). + float fscale = Math.Min(747 / sizef.Width, 535 / sizef.Height); + sizef.Width *= fscale; + sizef.Height *= fscale; + Image thmb = bm.GetThumbnailImage((int)sizef.Width, (int)sizef.Height, myCallback, IntPtr.Zero); + + this.roImage.Image = thmb; + this.Text = title; + } + public bool ThumbnailCallback() + { + return false; + } + } +} \ No newline at end of file diff --git a/PROMS/Volian.Controls.Library/PreviewROImage.resx b/PROMS/Volian.Controls.Library/PreviewROImage.resx new file mode 100644 index 00000000..19dc0dd8 --- /dev/null +++ b/PROMS/Volian.Controls.Library/PreviewROImage.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/PROMS/Volian.Controls.Library/StepTabRibbon.cs b/PROMS/Volian.Controls.Library/StepTabRibbon.cs index 04ce3987..a41ecc63 100644 --- a/PROMS/Volian.Controls.Library/StepTabRibbon.cs +++ b/PROMS/Volian.Controls.Library/StepTabRibbon.cs @@ -44,12 +44,17 @@ namespace Volian.Controls.Library void _MyStepRTB_LinkChanged(object sender, StepPanelLinkEventArgs args) { // do all Transition and ReferencedObject menu items/buttons based on whether a 'link is selected' and the link type. - btnCMGoTo.Enabled = btnGoTo.Enabled = (_MyStepRTB.MyLinkText != null); - if (btnCMGoTo.Enabled == true) // must have some link test, use it to set edit of transition or ro... + btnCMGoTo.Enabled = btnGoTo.Enabled = _MyStepRTB.SelectionProtected; //(_MyStepRTB.MyLinkText != null); + if (btnCMGoTo.Enabled == true && _MyStepRTB.MyLinkText != null) // must have some link test, use it to set edit of transition or ro... { btnCMEditTran.Enabled = _MyStepRTB.MyLinkText.IndexOf("Transition") > -1; // selected link must be a transition btnCMEditRO.Enabled = _MyStepRTB.MyLinkText.IndexOf("ReferencedObject") > -1; // selected link must be ro } + else + { + btnCMEditTran.Enabled = false; + btnCMEditRO.Enabled = false; + } } void MyStepRTB_Leave(object sender, EventArgs e) { @@ -81,12 +86,17 @@ namespace Volian.Controls.Library btnCMPaste.Enabled = btnPaste.Enabled = (iData.GetDataPresent(DataFormats.Text) || iData.GetDataPresent(DataFormats.Rtf)); // do all Transition and ReferencedObject menu items/buttons based on whether a 'link is selected' and the link type. - btnCMGoTo.Enabled = btnGoTo.Enabled = (_MyStepRTB.MyLinkText != null); - if (btnCMGoTo.Enabled == true) // must have some link test, use it to set edit of transition or ro... + btnCMGoTo.Enabled = btnGoTo.Enabled = _MyStepRTB.SelectionProtected; //(_MyStepRTB.MyLinkText != null); + if (btnCMGoTo.Enabled == true && _MyStepRTB.MyLinkText != null) // must have some link test, use it to set edit of transition or ro... { btnCMEditTran.Enabled = _MyStepRTB.MyLinkText.IndexOf("Transition")>-1; // selected link must be a transition btnCMEditRO.Enabled = _MyStepRTB.MyLinkText.IndexOf("ReferencedObject") > -1; // selected link must be ro } + else + { + btnCMEditTran.Enabled = false; + btnCMEditRO.Enabled = false; + } } public StepTabRibbon() {