You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
127 lines
4.0 KiB
127 lines
4.0 KiB
using DevExpress.XtraEditors; |
|
using ESRI.ArcGIS.Carto; |
|
using ESRI.ArcGIS.Geodatabase; |
|
using KGIS.Plugin.LayerProperty.Utils; |
|
using System; |
|
using System.Collections.Generic; |
|
using System.ComponentModel; |
|
using System.Data; |
|
using System.Drawing; |
|
using System.Linq; |
|
using System.Text; |
|
using System.Threading.Tasks; |
|
using System.Windows.Forms; |
|
|
|
namespace KGIS.Plugin.LayerProperty.View |
|
{ |
|
public partial class FormPointLabelRatation : XtraForm |
|
{ |
|
private string selectedField; |
|
private esriLabelRotationType labelRotationType; |
|
private bool perpendicularToAngle; |
|
public string RotationField |
|
{ |
|
get |
|
{ |
|
return this.selectedField; |
|
} |
|
set |
|
{ |
|
this.selectedField = value; |
|
} |
|
} |
|
public esriLabelRotationType LabelRotationType |
|
{ |
|
get |
|
{ |
|
return this.labelRotationType; |
|
} |
|
set |
|
{ |
|
this.labelRotationType = value; |
|
} |
|
} |
|
public bool PerpendicularToAngle |
|
{ |
|
get |
|
{ |
|
return this.perpendicularToAngle; |
|
} |
|
set |
|
{ |
|
this.perpendicularToAngle = value; |
|
this.chkPerpendicularAngle.Checked = value; |
|
} |
|
} |
|
public FormPointLabelRatation() |
|
{ |
|
InitializeComponent(); |
|
} |
|
public bool Init(IFields fields, string defaultField, bool perpendicularToAngle, esriLabelRotationType rotationType) |
|
{ |
|
try |
|
{ |
|
this.labelRotationType = rotationType; |
|
this.selectedField = defaultField; |
|
this.perpendicularToAngle = perpendicularToAngle; |
|
this.chkPerpendicularAngle.Checked = perpendicularToAngle; |
|
Utils.Util.InitFieldList(ref this.cmbFields, fields, defaultField, false, true); |
|
if (rotationType == esriLabelRotationType.esriRotateLabelGeographic) |
|
{ |
|
this.chkGeographic.Checked = true; |
|
this.chkArithmetic.Checked = false; |
|
} |
|
else |
|
{ |
|
if (rotationType == esriLabelRotationType.esriRotateLabelArithmetic) |
|
{ |
|
this.chkArithmetic.Checked = true; |
|
this.chkGeographic.Checked = false; |
|
} |
|
} |
|
} |
|
catch (Exception ex) |
|
{ |
|
//RdbUtil.AddException(ex); |
|
} |
|
return false; |
|
} |
|
private void btnOk_Click(object sender, System.EventArgs e) |
|
{ |
|
try |
|
{ |
|
base.DialogResult = DialogResult.OK; |
|
base.Close(); |
|
} |
|
catch (Exception ex) |
|
{ |
|
//RdbUtil.AddException(ex); |
|
} |
|
} |
|
private void btnCancel_Click(object sender, System.EventArgs e) |
|
{ |
|
base.DialogResult = DialogResult.Cancel; |
|
base.Close(); |
|
} |
|
private void chkPerpendicularAngle_CheckedChanged(object sender, System.EventArgs e) |
|
{ |
|
this.perpendicularToAngle = this.chkPerpendicularAngle.Checked; |
|
} |
|
private void cmbFields_SelectedIndexChanged(object sender, System.EventArgs e) |
|
{ |
|
ItemInfo<IField, string> itemInfo = this.cmbFields.SelectedItem as ItemInfo<IField, string>; |
|
if (itemInfo != null) |
|
{ |
|
this.selectedField = itemInfo.InnerValue.Name; |
|
} |
|
} |
|
private void chkGeographic_CheckedChanged(object sender, System.EventArgs e) |
|
{ |
|
this.labelRotationType = esriLabelRotationType.esriRotateLabelGeographic; |
|
} |
|
private void chkArithmetic_CheckedChanged(object sender, System.EventArgs e) |
|
{ |
|
this.labelRotationType = esriLabelRotationType.esriRotateLabelArithmetic; |
|
} |
|
} |
|
}
|
|
|