public ScaleTickMid AddTickMid(double value, bool permanent) { if (this.Range.ScaleType != 0 && value <= 0.0) { return(null); } ScaleTickMid scaleTickMid = new ScaleTickMid(); scaleTickMid.Value = value; scaleTickMid.Color = this.TickMid.Color; scaleTickMid.ForeColor = this.TickMid.ForeColor; scaleTickMid.Font = this.TickMid.Font; scaleTickMid.Thickness = this.TickMid.Thickness; scaleTickMid.Length = this.TickMid.Length; scaleTickMid.TextVisible = this.TickMid.TextVisible; scaleTickMid.TextMargin = this.TickMid.TextMargin; scaleTickMid.Alignment = this.TickMid.Alignment; scaleTickMid.Permanent = permanent; if (this.DegreeModeEnabled) { scaleTickMid.Text = this.TextFormatting.GetText(Math2.AngleNormalized(scaleTickMid.Value)); } else { scaleTickMid.Text = this.TextFormatting.GetText(scaleTickMid.Value); } ((ISubClassBase)scaleTickMid).AmbientOwner = this; ((IScaleTickBase)scaleTickMid).Display = this; this.TickList.Add(scaleTickMid); return(scaleTickMid); }
public ScaleTickMid AddTickMid(double value, string text, bool permanent) { ScaleTickMid scaleTickMid = this.AddTickMid(value, permanent); scaleTickMid.Text = text; return(scaleTickMid); }
protected override void CreateObjects() { base.CreateObjects(); this.m_GeneratorAuto = new ScaleGeneratorAuto(); base.AddSubClass(this.GeneratorAuto); this.m_GeneratorFixed = new ScaleGeneratorFixed(); base.AddSubClass(this.GeneratorFixed); this.m_TickMajor = new ScaleTickMajor(); base.AddSubClass(this.TickMajor); this.m_TickMid = new ScaleTickMid(); base.AddSubClass(this.TickMid); this.m_TickMinor = new ScaleTickMinor(); base.AddSubClass(this.TickMinor); this.TextFormatting = new TextFormatDoubleAll(); ((IScaleGeneratorBase)this.m_GeneratorAuto).Display = this; ((IScaleGeneratorBase)this.m_GeneratorFixed).Display = this; this.m_TickInfo = new ScaleTickInfo(this); ((ISubClassBase)this.TickMajor).ColorAmbientSource = AmbientColorSouce.Color; ((ISubClassBase)this.TickMinor).ColorAmbientSource = AmbientColorSouce.Color; ((ISubClassBase)this.TickMid).ColorAmbientSource = AmbientColorSouce.Color; this.m_MajorIncrement = 10.0; this.m_MinorIncrement = 1.0; base.ColorAmbientSource = AmbientColorSouce.ForeColor; }