示例#1
0
        }                                          // not used here


        void Initialize(bool bInit)
        {
            if (bInit)
            {
                _fontFamily          = _doc.Font;
                _color               = _doc.Color;
                _fontSize            = _doc.FontSize;
                _horizontalAlignment = _doc.HorizontalAlignment;
                _verticalAlignment   = _doc.VerticalAlignment;
                _automaticAlignment  = _doc.AutomaticAlignment;

                _xOffset = _doc.XOffset;
                _yOffset = _doc.YOffset;
                _currentLabelStyleInstance = _doc.LabelFormat;
                _backgroundStyle           = _doc.BackgroundStyle;
            }

            if (null != View)
            {
                View.Font_Initialize(_fontFamily);

                View.Color_Initialize(_color);
                View.FontSize_Initialize(_fontSize);
                View.HorizontalAlignment_Initialize(System.Enum.GetNames(typeof(System.Drawing.StringAlignment)), System.Enum.GetName(typeof(System.Drawing.StringAlignment), _horizontalAlignment));
                View.VerticalAlignment_Initialize(System.Enum.GetNames(typeof(System.Drawing.StringAlignment)), System.Enum.GetName(typeof(System.Drawing.StringAlignment), _verticalAlignment));
                View.AutomaticAlignment_Initialize(this._automaticAlignment);
                View.Rotation = (float)_doc.Rotation;
                View.XOffset_Initialize(Serialization.NumberConversion.ToString(_xOffset * 100));
                View.YOffset_Initialize(Serialization.NumberConversion.ToString(_yOffset * 100));
                View.Background = _backgroundStyle;
                InitializeLabelStyle();
            }
        }
示例#2
0
        }                                                                    // not used here


        void Initialize(bool bInit)
        {
            if (bInit)
            {
                _font             = _doc.Font;
                _independentColor = _doc.IndependentColor;
                _color            = _doc.Color;

                _horizontalAlignment = _doc.HorizontalAlignment;
                _verticalAlignment   = _doc.VerticalAlignment;
                _attachToEdge        = _doc.AttachedAxis != null;
                _attachedEdge        = _doc.AttachedAxis;
                _xOffset             = _doc.XOffset;
                _yOffset             = _doc.YOffset;
                _labelColumn         = _doc.LabelColumn;
                _backgroundStyle     = _doc.BackgroundStyle;
            }

            if (null != View)
            {
                View.Font_Initialize(_font);
                View.IndependentColor_Initialize(_independentColor);
                View.Color_Initialize(_color);
                View.HorizontalAlignment_Initialize(System.Enum.GetNames(typeof(System.Drawing.StringAlignment)), System.Enum.GetName(typeof(System.Drawing.StringAlignment), _horizontalAlignment));
                View.VerticalAlignment_Initialize(System.Enum.GetNames(typeof(System.Drawing.StringAlignment)), System.Enum.GetName(typeof(System.Drawing.StringAlignment), _verticalAlignment));
                View.AttachToAxis_Initialize(_attachToEdge);
                SetAttachmentDirection();
                View.Rotation = (float)_doc.Rotation;
                View.XOffset_Initialize(Serialization.NumberConversion.ToString(_xOffset * 100));
                View.YOffset_Initialize(Serialization.NumberConversion.ToString(_yOffset * 100));
                View.Background = _backgroundStyle;

                InitializeLabelColumnText();
            }
        }
 private void SetAlign(StringAlignment al)
 {
     alignment = al;
     PutSetting("align", (int)alignment);
     leftToolStripMenuItem.Checked   = alignment == StringAlignment.Near;
     centerToolStripMenuItem.Checked = alignment == StringAlignment.Center;
     rightToolStripMenuItem.Checked  = alignment == StringAlignment.Far;
 }
示例#4
0
 private void SetAlign(StringAlignment al)
 {
     alignment = al;
     EliteDangerousCore.DB.UserDatabase.Instance.PutSettingInt(DbSave + "align", (int)alignment);
     leftToolStripMenuItem.Checked   = alignment == StringAlignment.Near;
     centerToolStripMenuItem.Checked = alignment == StringAlignment.Center;
     rightToolStripMenuItem.Checked  = alignment == StringAlignment.Far;
 }
示例#5
0
        private static StringFormat CreateStringFormat(System.Drawing.StringAlignment alignment, System.Drawing.StringAlignment lineAlignment)
        {
            StringFormat format = new StringFormat();

            format.Alignment     = alignment;
            format.LineAlignment = lineAlignment;
            return(format);
        }
示例#6
0
 private void SetAlign(StringAlignment al)
 {
     alignment = al;
     SQLiteDBClass.PutSettingInt(DbSave + "align", (int)alignment);
     leftToolStripMenuItem.Checked   = alignment == StringAlignment.Near;
     centerToolStripMenuItem.Checked = alignment == StringAlignment.Center;
     rightToolStripMenuItem.Checked  = alignment == StringAlignment.Far;
 }
示例#7
0
 public FontSetting(string fontName, FontStyle fontStyle, int size, Color foreColor, Color backColor, System.Drawing.StringAlignment textAlignment)
 {
     this._FontName = fontName;
     this._FontStyle = fontStyle;
     this._FontSize = size;
     this._ForeColor = foreColor;
     this._BackColor = backColor;
     this._TextAlignment = textAlignment;
 }
示例#8
0
 public static void SetChartHeaderTitle(BTChart chart, string titleText, System.Drawing.StringAlignment alignment, int titleFontSize)
 {
     chart.Header.Alignment  = alignment;
     chart.Header.Font.Bold  = false;
     chart.Header.Font.Name  = "Tahoma";
     chart.Header.Font.Size  = titleFontSize;
     chart.Header.Font.Color = Color.Black;
     chart.Header.Text       = titleText;
     chart.Header.Visible    = true;
 }
示例#9
0
        public void DrawString(string str, double x, double y, StringAlignment align, Size layoutRect, StringColorType colorType = StringColorType.Forground)
        {
            System.Drawing.StringAlignment old = this.sf.Alignment;

            this.sf.Alignment = System.Drawing.StringAlignment.Center;

            g.DrawString(str, this.font, new SolidBrush(this.Foreground), new RectangleF((float)x, (float)y, (float)layoutRect.Width, (float)layoutRect.Height), this.sf);

            this.sf.Alignment = old;
        }
示例#10
0
 public FontSetting(string fontName, FontStyle fontStyle, int size, Color foreColor, Color backColor, System.Drawing.StringAlignment textAlignment, bool show, bool inline, FootNoteDisplayStyle footnoteInLine)
 {
     this._FontName = fontName;
     this._FontStyle = fontStyle;
     this._FontSize = size;
     this._ForeColor = foreColor;
     this._BackColor = backColor;
     this._TextAlignment = textAlignment;
     this._Show = show;
     this._Inline = inline;
     this._TableFootnoteInLine = footnoteInLine;
 }
示例#11
0
 public void SetAlign(System.Drawing.StringAlignment align)
 {
     if (align == System.Drawing.StringAlignment.Center)
     {
         this.Align = RTFAlignment.Center;
     }
     else if (align == System.Drawing.StringAlignment.Far)
     {
         this.Align = RTFAlignment.Right;
     }
     else
     {
         this.Align = RTFAlignment.Left;
     }
 }
示例#12
0
 /// <summary>
 /// 输出文本对齐方式信息
 /// </summary>
 /// <param name="align">对齐方式</param>
 public void StyleWriteAlign(System.Drawing.StringAlignment align)
 {
     if (align == System.Drawing.StringAlignment.Far)
     {
         WriteStyleItem("text-align", "right");
     }
     else if (align == System.Drawing.StringAlignment.Center)
     {
         WriteStyleItem("text-align", "center");
     }
     else
     {
         WriteStyleItem("text-align", "left");
     }
 }
示例#13
0
 public CtrlStyledTab()
 {
     _TabSlant               = 2;
     _TagPageSelectedColor   = System.Drawing.Color.White;
     _TagPageUnselectedColor = System.Drawing.Color.LightGray;
     _TabTextVAlignment      = System.Drawing.StringAlignment.Center;
     _BorderColor            = System.Drawing.Color.DarkGray;
     _TabTextColor           = System.Drawing.Color.FromArgb(64, 64, 64);
     _TabFont   = new System.Drawing.Font("Tahoma", 9.0F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, 0);
     mBackColor = System.Drawing.Color.Transparent;
     InitializeComponent();
     SetStyle(System.Windows.Forms.ControlStyles.UserPaint, true);
     SetStyle(System.Windows.Forms.ControlStyles.AllPaintingInWmPaint, true);
     SetStyle(System.Windows.Forms.ControlStyles.DoubleBuffer, true);
     SetStyle(System.Windows.Forms.ControlStyles.ResizeRedraw, true);
     SetStyle(System.Windows.Forms.ControlStyles.SupportsTransparentBackColor, true);
     ControlAdded         += new System.Windows.Forms.ControlEventHandler(CtrlColourTab_ControlAdded);
     ControlRemoved       += new System.Windows.Forms.ControlEventHandler(CtrlColourTab_ControlRemoved);
     SelectedIndexChanged += new System.EventHandler(CtrlColourTab_SelectedIndexChanged);
     SizeMode              = System.Windows.Forms.TabSizeMode.Fixed;
     TabStop = false;
 }
示例#14
0
 public FontSetting(string fontName, FontStyle fontStyle, int size, Color foreColor, bool showBackColor, Color backColor, System.Drawing.StringAlignment textAlignment, bool show, bool inline, FootNoteDisplayStyle footnoteInLine, bool showAlternateColor, string alternateColor1, string alternateColor2, bool wordWrap, int columnWidth, bool formatDataValue)
 {
     this._FontName = fontName;
     this._FontStyle = fontStyle;
     this._FontSize = size;
     this._ForeColor = foreColor;
     this._BackColor = backColor;
     this._TextAlignment = textAlignment;
     this._Show = show;
     this._Inline = inline;
     this._TableFootnoteInLine = footnoteInLine;
     this._ShowAlternateColor = showAlternateColor;
     this._AlternateBackColor1 = alternateColor1;
     this._AlternateBackColor2 = alternateColor2;
     this._WordWrap = wordWrap;
     this._ColumnWidth = columnWidth;
     this._FormatDataValue = formatDataValue;
     this._ShowBackColor = showBackColor;
 }
示例#15
0
		public override void Deserialize(ItemSerializationContext context)
		{
			base.Deserialize(context);

            System.Xml.XmlElement ItemXmlSource = context.ItemXmlElement;

			m_BorderType=(eBorderType)System.Xml.XmlConvert.ToInt32(ItemXmlSource.GetAttribute("bt"));

            if (ItemXmlSource.HasAttribute("BorderSide"))
                m_BorderSide = (eBorderSide)System.Xml.XmlConvert.ToInt32(ItemXmlSource.GetAttribute("BorderSide"));
            else
                m_BorderSide = DEFAULT_BORDERSIDE;

			if(ItemXmlSource.HasAttribute("bc"))
                m_BackColor=BarFunctions.ColorFromString(ItemXmlSource.GetAttribute("bc"));
			else
				m_BackColor=Color.Empty;
			m_ForeColor=BarFunctions.ColorFromString(ItemXmlSource.GetAttribute("fc"));

            if (ItemXmlSource.HasAttribute("sc"))
            {
                m_SingleLineColor = BarFunctions.ColorFromString(ItemXmlSource.GetAttribute("sc"));
                if (m_SingleLineColor != SystemColors.ControlDark)
                    m_SingleLineColorCustom = true;
            }
            else
            {
                m_SingleLineColorCustom = false;
                m_SingleLineColor = SystemColors.ControlDark;
            }

			m_TextAlignment=(StringAlignment)System.Xml.XmlConvert.ToInt32(ItemXmlSource.GetAttribute("ta"));
			m_TextLineAlignment=(StringAlignment)System.Xml.XmlConvert.ToInt32(ItemXmlSource.GetAttribute("tla"));

			m_DividerStyle=System.Xml.XmlConvert.ToBoolean(ItemXmlSource.GetAttribute("ds"));

            m_PaddingLeft=System.Xml.XmlConvert.ToInt32(ItemXmlSource.GetAttribute("pl"));
			m_PaddingRight=System.Xml.XmlConvert.ToInt32(ItemXmlSource.GetAttribute("pr"));
			m_PaddingTop=System.Xml.XmlConvert.ToInt32(ItemXmlSource.GetAttribute("pt"));
			m_PaddingBottom=System.Xml.XmlConvert.ToInt32(ItemXmlSource.GetAttribute("pb"));

			m_Width=System.Xml.XmlConvert.ToInt32(ItemXmlSource.GetAttribute("w"));
			m_Height=System.Xml.XmlConvert.ToInt32(ItemXmlSource.GetAttribute("h"));

			// Load font information if it exists
			if(ItemXmlSource.HasAttribute("fontname"))
			{
				string FontName=ItemXmlSource.GetAttribute("fontname");
				float FontSize=System.Xml.XmlConvert.ToSingle(ItemXmlSource.GetAttribute("fontemsize"));
				System.Drawing.FontStyle FontStyle=(System.Drawing.FontStyle)System.Xml.XmlConvert.ToInt32(ItemXmlSource.GetAttribute("fontstyle"));
				try
				{
					this.Font=new Font(FontName,FontSize,FontStyle);
				}
				catch(Exception)
				{
                    this.Font = SystemFonts.DefaultFont; // System.Windows.Forms.SystemInformation.MenuFont.Clone() as Font;
				}
			}

			// Load Images
			foreach(System.Xml.XmlElement xmlElem in ItemXmlSource.ChildNodes)
			{
				if(xmlElem.Name=="images")
				{
					if(xmlElem.HasAttribute("imageindex"))
						m_ImageIndex=System.Xml.XmlConvert.ToInt32(xmlElem.GetAttribute("imageindex"));

					foreach(System.Xml.XmlElement xmlElem2 in xmlElem.ChildNodes)
					{
						switch(xmlElem2.GetAttribute("type"))
						{
							case "default":
							{
								m_Image=BarFunctions.DeserializeImage(xmlElem2);
								m_ImageIndex=-1;
								break;
							}
							case "icon":
							{
								m_Icon=BarFunctions.DeserializeIcon(xmlElem2);
								m_ImageIndex=-1;
								break;
							}
						}
					}
					break;
				}
			}
		}
示例#16
0
 public void EhView_HorizontalAlignmentChanged(string newValue)
 {
     _horizontalAlignment = (StringAlignment)System.Enum.Parse(typeof(StringAlignment), newValue);
 }
示例#17
0
 public void EhView_VerticalAlignmentChanged(string newValue)
 {
     _verticalAlignment = (StringAlignment)System.Enum.Parse(typeof(StringAlignment), newValue);
 }
 public void EhView_VerticalAlignmentChanged(string newValue)
 {
   _verticalAlignment = (StringAlignment)System.Enum.Parse(typeof(StringAlignment),newValue);
 }
 public void EhView_HorizontalAlignmentChanged(string newValue)
 {
   _horizontalAlignment = (StringAlignment)System.Enum.Parse(typeof(StringAlignment),newValue);
 }
    public UseDocument UseDocumentCopy { set { _useDocumentCopy = value; } } // not used here


    void Initialize(bool bInit)
    {
      if(bInit)
      {
        _font = _doc.Font;
        _independentColor = _doc.IndependentColor;
        _color = _doc.Color;
        
        _horizontalAlignment = _doc.HorizontalAlignment;
        _verticalAlignment = _doc.VerticalAlignment;
        _attachToEdge = _doc.AttachedAxis!=null;
        _attachedEdge = _doc.AttachedAxis;
        _xOffset      = _doc.XOffset;
        _yOffset      = _doc.YOffset;
        _labelColumn = _doc.LabelColumn;
        _backgroundStyle = _doc.BackgroundStyle;
      }

      if(null!=View)
      {
        View.Font_Initialize(_font);
        View.IndependentColor_Initialize(_independentColor);
        View.Color_Initialize(_color);
        View.HorizontalAlignment_Initialize(System.Enum.GetNames(typeof(System.Drawing.StringAlignment)),System.Enum.GetName(typeof(System.Drawing.StringAlignment),_horizontalAlignment));
        View.VerticalAlignment_Initialize(System.Enum.GetNames(typeof(System.Drawing.StringAlignment)),System.Enum.GetName(typeof(System.Drawing.StringAlignment),_verticalAlignment));
        View.AttachToAxis_Initialize(_attachToEdge);
        SetAttachmentDirection();
        View.Rotation = (float)_doc.Rotation;
        View.XOffset_Initialize(Serialization.NumberConversion.ToString(_xOffset*100));
        View.YOffset_Initialize(Serialization.NumberConversion.ToString(_yOffset*100));
        View.Background = _backgroundStyle;

        InitializeLabelColumnText();
      }
    }
    public UseDocument UseDocumentCopy { set { } } // not used here


    void Initialize(bool bInit)
    {
      if(bInit)
      {
        _fontFamily  = _doc.Font;
        _color = _doc.Color;
        _fontSize = _doc.FontSize;
        _horizontalAlignment = _doc.HorizontalAlignment;
        _verticalAlignment = _doc.VerticalAlignment;
        _automaticAlignment = _doc.AutomaticAlignment;
        
        _xOffset      = _doc.XOffset;
        _yOffset      = _doc.YOffset;
        _currentLabelStyleInstance = _doc.LabelFormat;
        _backgroundStyle = _doc.BackgroundStyle;
      }

      if(null!=View)
      {
        View.Font_Initialize(_fontFamily);
      
        View.Color_Initialize(_color);
        View.FontSize_Initialize(_fontSize);
        View.HorizontalAlignment_Initialize(System.Enum.GetNames(typeof(System.Drawing.StringAlignment)),System.Enum.GetName(typeof(System.Drawing.StringAlignment),_horizontalAlignment));
        View.VerticalAlignment_Initialize(System.Enum.GetNames(typeof(System.Drawing.StringAlignment)),System.Enum.GetName(typeof(System.Drawing.StringAlignment),_verticalAlignment));
        View.AutomaticAlignment_Initialize(this._automaticAlignment);
        View.Rotation = (float)_doc.Rotation;
        View.XOffset_Initialize(Serialization.NumberConversion.ToString(_xOffset*100));
        View.YOffset_Initialize(Serialization.NumberConversion.ToString(_yOffset*100));
        View.Background = _backgroundStyle;
        InitializeLabelStyle();
      }
    }
示例#22
0
 public static StringAlignment ToNPlot(this SD.StringAlignment value) => (StringAlignment)value;