SVN r534
SVN-Revision: r534
This commit is contained in:
@@ -16,6 +16,7 @@ using System.Linq;
|
||||
using System.Text;
|
||||
using System.Windows.Forms;
|
||||
using DevExpress.XtraEditors;
|
||||
using System.IO;
|
||||
|
||||
namespace Lskj.Control
|
||||
{
|
||||
@@ -28,11 +29,50 @@ namespace Lskj.Control
|
||||
/// 文本控件
|
||||
/// </summary>
|
||||
public MemoEdit TextEdit { get { return txtEdit; } }
|
||||
|
||||
/// <summary>
|
||||
/// 存储文件地址(用于保存上传)
|
||||
/// </summary>
|
||||
public string filepath;
|
||||
public LabelRemarkEdit()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
public void BandAllowDrop()
|
||||
{
|
||||
txtEdit.AllowDrop = true;
|
||||
txtEdit.DragEnter += OnDragEnter;
|
||||
txtEdit.DragDrop += OnDragDrop;
|
||||
}
|
||||
/// <summary>
|
||||
/// 拖拽完成触发
|
||||
/// </summary>
|
||||
/// <param name="sender"></param>
|
||||
/// <param name="e"></param>
|
||||
private void OnDragDrop(object sender, DragEventArgs e)
|
||||
{
|
||||
var file = ((string[])e.Data.GetData(DataFormats.FileDrop))[0];
|
||||
txtEdit.Text = Path.GetFileName(file);
|
||||
this.filepath = file;
|
||||
}
|
||||
/// <summary>
|
||||
/// <para>说明:移动到目标表格</para>
|
||||
/// <para>创建人:龚宇超</para>
|
||||
/// <para>创建日期:2017-11-13 </para>
|
||||
/// <para>修改人:</para>
|
||||
/// <para>修改日期:</para>
|
||||
/// <para>修改备注:</para>
|
||||
/// <para>版本:1.0</para>
|
||||
/// </summary>
|
||||
/// <param name="sender">The source of the event.</param>
|
||||
/// <param name="e">The <see cref="System.Windows.Forms.DragEventArgs"/> instance containing the event data.</param>
|
||||
protected void OnDragEnter(object sender, System.Windows.Forms.DragEventArgs e)
|
||||
{
|
||||
if (e.Data.GetDataPresent(DataFormats.FileDrop) &&
|
||||
((string[])e.Data.GetData(DataFormats.FileDrop)).Length == 1)
|
||||
e.Effect = DragDropEffects.Copy;
|
||||
else
|
||||
e.Effect = DragDropEffects.None;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// <para>说明:设置控件显示文本</para>
|
||||
@@ -70,7 +110,7 @@ namespace Lskj.Control
|
||||
{
|
||||
Graphics g = this.lblText.CreateGraphics();
|
||||
SizeF sizeF = g.MeasureString(value, this.lblText.Font);
|
||||
this.plLeft.Width = (int)sizeF.Width + PaddingLeft ;
|
||||
this.plLeft.Width = (int)sizeF.Width + PaddingLeft;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -143,39 +183,4 @@ namespace Lskj.Control
|
||||
/// <summary>
|
||||
/// 只读文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the read only label.</value>
|
||||
public override bool ReadOnly
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.ReadOnly;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.ReadOnly = value;
|
||||
this.txtEdit.Properties.ReadOnly = value;
|
||||
this.lblText.ForeColor = value ? base.ReadOnlyLabelForceColor : Required ? base.RequiredLabelForceColor : base.DefaultLabelForceColor;
|
||||
}
|
||||
}
|
||||
/// <summary>
|
||||
/// 必填文本颜色
|
||||
/// </summary>
|
||||
/// <value>The color of the required label.</value>
|
||||
public override bool Required
|
||||
{
|
||||
get
|
||||
{
|
||||
return base.Required;
|
||||
}
|
||||
set
|
||||
{
|
||||
base.Required = value;
|
||||
if (value)
|
||||
{
|
||||
this.lblText.ForeColor = base.RequiredLabelForceColor;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
///
|
||||
@@ -268,6 +268,10 @@ namespace Lskj.Control.Model
|
||||
/// </summary>
|
||||
public bool HighlightContent { get; set; }
|
||||
/// <summary>
|
||||
/// 是否为拖拽绑定控件
|
||||
/// </summary>
|
||||
public bool FileUploadControl { get; set; }
|
||||
/// <summary>
|
||||
///条件拼接
|
||||
/// </summary>
|
||||
public bool Montage { get; set; }
|
||||
|
||||
@@ -3819,6 +3819,7 @@ namespace Lskj.Control.Model
|
||||
model.TreeCheckModel = item.Table.Columns.Contains("TreeCheckModel") ? item["TreeCheckModel"] + "" : "";
|
||||
|
||||
model.ControlTitleColor = item.Table.Columns.Contains("ControlTitleColor") ? item["ControlTitleColor"] + "" : "";
|
||||
model.FileUploadControl = item.Table.Columns.Contains("FileUploadControl") ? "1".Equals(item["FileUploadControl"] + "") : false;
|
||||
model.HighlightContent = item.Table.Columns.Contains("HighlightContent") ? "1".Equals(item["HighlightContent"] + "") : false;
|
||||
model.Montage = item.Table.Columns.Contains("montage") ? "1".Equals(item["montage"] + "") : false;
|
||||
model.DisplayPermissions = item.Table.Columns.Contains("DisplayPermissions") ? item["DisplayPermissions"] + "" : "";
|
||||
@@ -4084,6 +4085,10 @@ namespace Lskj.Control.Model
|
||||
remarkEdit.TextEdit.TextChanged += new EventHandler(OnTextEditTextChanged);
|
||||
if (!isLoadBorder) remarkEdit.TextEdit.BorderStyle = DevExpress.XtraEditors.Controls.BorderStyles.NoBorder;
|
||||
baseControl = remarkEdit;
|
||||
if (!model.FileUploadControl)
|
||||
{
|
||||
remarkEdit.BandAllowDrop();
|
||||
}
|
||||
break;
|
||||
case ControlType.LabMemoEdit:
|
||||
// 备注框A
|
||||
|
||||
Reference in New Issue
Block a user