private void SetStatusNameAndPositionDesign(MDIChild mc)
{
if (mc.DrawCtl.SelectedCount <= 0)
{
statusPosition.Text = statusSelected.Text = "";
return;
}
// Handle position
var pos = mc.SelectionPosition;
var sz = mc.SelectionSize;
string spos;
if (pos.X == float.MinValue) // no item selected is probable cause
{
spos = "";
}
else
{
var rinfo = new RegionInfo(CultureInfo.CurrentCulture.LCID);
double m72 = DesignXmlDraw.POINTSIZED;
var x = pos.X/m72;
var y = pos.Y/m72;
var unit = rinfo.IsMetric ? Strings.RdlDesigner_Status_cm : Strings.RdlDesigner_Status_in;
if (rinfo.IsMetric)
{
x *= 2.54d;
y *= 2.54d;
}
if (sz.Width == float.MinValue) // item is in a table/matrix is probably cause
{
spos = string.Format(" x={0:0.00}{2}, y={1:0.00}{2} ",
x, y, unit);
}
else
{
var w = sz.Width/m72;
var h = sz.Height/m72;
if (rinfo.IsMetric)
{
w *= 2.54d;
h *= 2.54d;
}
spos = string.Format(" x={0:0.00}{4}, y={1:0.00}{4}, w={2:0.00}{4}, h={3:0.00}{4} ",
x, y, w, h, unit);
}
}
statusPosition.Text = spos;
// Handle text
statusSelected.Text = mc.SelectionName;
}