private void btnUniformScaleLink_Click(object sender, EventArgs e) { if (_scaleLinkType == ScaleLinkType.Linked) { _scaleLinkType = ScaleLinkType.Unlinked; this.btnUniformScaleLink.BackgroundImage = SVGParser.GetBitmapFromSVG(SVGImages.link_broken_black, new Size(18, 18)); this.txtUniformScaleFactor.ReadOnly = true; this.plUniformScaleFactor.BackColor = Color.LightGray; this.txtUniformScaleFactor.BackColor = Color.LightGray; this.btnUniformScaleLink.Tag = false; } else { _scaleLinkType = ScaleLinkType.Linked; this.btnUniformScaleLink.BackgroundImage = SVGParser.GetBitmapFromSVG(SVGImages.link_black, new Size(18, 18)); this.txtUniformScaleFactor.ReadOnly = false; this.plUniformScaleFactor.BackColor = Color.White; this.txtUniformScaleFactor.BackColor = Color.White; this.btnUniformScaleLink.Tag = true; } UpdateLinkedLines(); menuItemToolStripMenuItem_Click(null, null); }
void SetElements(bool bInit) { if (bInit) { if (m_bXAxis) { m_LinkType = m_Layer.LinkedScales.X.AxisLinkType; m_OrgA = m_Layer.LinkedScales.X.LinkOrgA; m_OrgB = m_Layer.LinkedScales.X.LinkOrgB; m_EndA = m_Layer.LinkedScales.X.LinkEndA; m_EndB = m_Layer.LinkedScales.X.LinkEndB; } else { m_LinkType = m_Layer.LinkedScales.Y.AxisLinkType; m_OrgA = m_Layer.LinkedScales.Y.LinkOrgA; m_OrgB = m_Layer.LinkedScales.Y.LinkOrgB; m_EndA = m_Layer.LinkedScales.Y.LinkEndA; m_EndB = m_Layer.LinkedScales.Y.LinkEndB; } } if (null != View) { View.LinkType_Initialize(m_LinkType); View.OrgA_Initialize(m_OrgA.ToString()); View.OrgB_Initialize(m_OrgB.ToString()); View.EndA_Initialize(m_EndA.ToString()); View.EndB_Initialize(m_EndB.ToString()); } }
/// <summary> /// Set all parameters of the axis link by once. /// </summary> /// <param name="linktype">The type of the axis link, i.e. None, Straight or Custom.</param> /// <param name="orgA">The value a of x-axis link for link of axis origin: org' = a + b*org.</param> /// <param name="orgB">The value b of x-axis link for link of axis origin: org' = a + b*org.</param> /// <param name="endA">The value a of x-axis link for link of axis end: end' = a + b*end.</param> /// <param name="endB">The value b of x-axis link for link of axis end: end' = a + b*end.</param> public void SetLinkParameter(ScaleLinkType linktype, double orgA, double orgB, double endA, double endB) { if (linktype == ScaleLinkType.Straight) { orgA = 0; orgB = 1; endA = 0; endB = 1; } bool linkaxis = (linktype != ScaleLinkType.None); if ( (linkaxis != this.IsLinked) || (orgA != this.LinkOrgA) || (orgB != this.LinkOrgB) || (endA != this.LinkEndA) || (endB != this.LinkEndB)) { this._isLinked = linkaxis; this._linkOrgA = orgA; this._linkOrgB = orgB; this._linkEndA = endA; this._linkEndB = endB; if (IsLinked) { OnScaleInstanceChanged(); } } }
public void EhView_LinkTypeChanged(ScaleLinkType linktype) { m_LinkType = linktype; if (null != View) { View.Enable_OrgAndEnd_Boxes(linktype == ScaleLinkType.Custom); } }
public void LinkType_Initialize(ScaleLinkType linktype) { switch (linktype) { case ScaleLinkType.None: this.m_rbLinkAxisNone.Checked = true; EnableCustom(false); break; case ScaleLinkType.Straight: this.m_rbLinkAxisStraight.Checked = true; EnableCustom(false); break; case ScaleLinkType.Custom: this.m_rbLinkAxisCustom.Checked = true; EnableCustom(true); break; } }
/// <summary> /// Set all parameters of the axis link by once. /// </summary> /// <param name="linktype">The type of the axis link, i.e. None, Straight or Custom.</param> /// <param name="orgA">The value a of x-axis link for link of axis origin: org' = a + b*org.</param> /// <param name="orgB">The value b of x-axis link for link of axis origin: org' = a + b*org.</param> /// <param name="endA">The value a of x-axis link for link of axis end: end' = a + b*end.</param> /// <param name="endB">The value b of x-axis link for link of axis end: end' = a + b*end.</param> public void SetLinkParameter(ScaleLinkType linktype, double orgA, double orgB, double endA, double endB) { if (linktype == ScaleLinkType.Straight) { orgA = 0; orgB = 1; endA = 0; endB = 1; } if ( (orgA != LinkOrgA) || (orgB != LinkOrgB) || (endA != LinkEndA) || (endB != LinkEndB)) { _linkOrgA = orgA; _linkOrgB = orgB; _linkEndA = endA; _linkEndB = endB; OnScaleInstanceChanged(); } }
/// <summary> /// Set all parameters of the axis link by once. /// </summary> /// <param name="linktype">The type of the axis link, i.e. None, Straight or Custom.</param> /// <param name="orgA">The value a of x-axis link for link of axis origin: org' = a + b*org.</param> /// <param name="orgB">The value b of x-axis link for link of axis origin: org' = a + b*org.</param> /// <param name="endA">The value a of x-axis link for link of axis end: end' = a + b*end.</param> /// <param name="endB">The value b of x-axis link for link of axis end: end' = a + b*end.</param> public void SetLinkParameter(ScaleLinkType linktype, double orgA, double orgB, double endA, double endB) { if (linktype == ScaleLinkType.Straight) { orgA = 0; orgB = 1; endA = 0; endB = 1; } if ( (orgA != this.LinkOrgA) || (orgB != this.LinkOrgB) || (endA != this.LinkEndA) || (endB != this.LinkEndB)) { this._linkOrgA = orgA; this._linkOrgB = orgB; this._linkEndA = endA; this._linkEndB = endB; OnScaleInstanceChanged(); } }
public void LinkType_Initialize(ScaleLinkType linktype) { switch(linktype) { case ScaleLinkType.None: this.m_rbLinkAxisNone.Checked = true; EnableCustom(false); break; case ScaleLinkType.Straight: this.m_rbLinkAxisStraight.Checked = true; EnableCustom(false); break; case ScaleLinkType.Custom: this.m_rbLinkAxisCustom.Checked = true; EnableCustom(true); break; } }
/// <summary> /// Set all parameters of the axis link by once. /// </summary> /// <param name="linktype">The type of the axis link, i.e. None, Straight or Custom.</param> /// <param name="orgA">The value a of x-axis link for link of axis origin: org' = a + b*org.</param> /// <param name="orgB">The value b of x-axis link for link of axis origin: org' = a + b*org.</param> /// <param name="endA">The value a of x-axis link for link of axis end: end' = a + b*end.</param> /// <param name="endB">The value b of x-axis link for link of axis end: end' = a + b*end.</param> public void SetLinkParameter(ScaleLinkType linktype, double orgA, double orgB, double endA, double endB) { if (linktype == ScaleLinkType.Straight) { orgA = 0; orgB = 1; endA = 0; endB = 1; } bool linkaxis = (linktype != ScaleLinkType.None); if ( (linkaxis != this.IsLinked) || (orgA != this.LinkOrgA) || (orgB != this.LinkOrgB) || (endA != this.LinkEndA) || (endB != this.LinkEndB)) { this._isLinked = linkaxis; this._linkOrgA = orgA; this._linkOrgB = orgB; this._linkEndA = endA; this._linkEndB = endB; if (IsLinked) OnScaleInstanceChanged(); } }