상속: XwtObject
예제 #1
0
        public void SetFont(object backend, Xwt.Drawing.Font font)
        {
            LayoutInfo li = (LayoutInfo)backend;

            li.Font = (NSFont)WidgetRegistry.GetBackend(font);
            UpdateInfo(li);
        }
예제 #2
0
        public void SetFont(object backend, Font font)
        {
            var c = (DrawingContext)backend;

            c.Font.Dispose();
            c.Font = font.ToDrawingFont();
        }
예제 #3
0
        public void SetFont(Font font)
        {
            this.Font = font;
            var f = (FontData)Toolkit.GetBackend(font);

            FormattedText.SetFontFamily(f.Family);
            FormattedText.SetFontSize(f.GetDeviceIndependentPixelSize());
            FormattedText.SetFontStretch(f.Stretch);
            FormattedText.SetFontStyle(f.Style);
            FormattedText.SetFontWeight(f.Weight);
        }
예제 #4
0
 public void SetFont(Font font)
 {
     if (!font.Equals(this.Font))
     {
         this.Font = font;
         if (formattedText != null)
         {
             ApplyFont();
         }
     }
 }
예제 #5
0
        public static void SelectFont(this Cairo.Context ctx, Font font)
        {
            Cairo.FontSlant slant;
            switch (font.Style) {
            case FontStyle.Oblique: slant = Cairo.FontSlant.Oblique; break;
            case FontStyle.Italic: slant = Cairo.FontSlant.Italic; break;
            default: slant = Cairo.FontSlant.Normal; break;
            }

            Cairo.FontWeight w = font.Weight >= FontWeight.Bold ? Cairo.FontWeight.Bold : Cairo.FontWeight.Normal;

            ctx.SelectFontFace (font.Family, slant, w);
        }
예제 #6
0
        /// <summary>Creates a new ListView2Item</summary>
        /// <param name="rowNumber">Number of owning row</param>
        /// <param name="colNumber">Number of owning column</param>
        /// <param name="rowTag">The item's tag</param>
        /// <param name="columns">Array of column information</param>
        /// <param name="data">The data that should be shown in this LV2I</param>
        /// <param name="font">Which font should be used</param>
        public ListView2Item(int rowNumber, int colNumber, string rowTag, ListView2.ColumnInfo[] columns, List<Object> data, Font font)
        {
            MinHeight = 16;
            HeightRequest = 16;
            MinWidth = 500;
            ExpandHorizontal = true;
            ExpandVertical = true;

            _Values = data.ToArray();
            _Cols = columns;
            _FontToDraw = font;
            Tag = rowTag;
            RowNo = rowNumber;
            ColNo = colNumber;

            QueueDraw();
        }
예제 #7
0
파일: Axis.cs 프로젝트: hwthomas/XwPlot
        private void UpdateScale()
        {
            if (labelFont != null) {
                labelFontScaled = Utils.ScaleFont (labelFont, FontScale);
            }

            if (tickTextFont != null) {
                tickTextFontScaled = Utils.ScaleFont (tickTextFont, FontScale);
            }
        }
예제 #8
0
        public override void SetFont(object backend, Font font)
        {
            var t = (TextLayoutBackend)backend;

            t.SetFont(font);
        }
예제 #9
0
파일: FontSelector.cs 프로젝트: m13253/xwt
		void SetFont(Font newFont)
		{
			selectedFont = newFont;
			previewText.Font = selectedFont;

			if (Math.Abs (spnSize.Value - selectedFont.Size) > double.Epsilon)
				spnSize.Value = selectedFont.Size;

			if (enableFontChangedEvent)
				Application.Invoke (delegate {
				EventSink.OnFontChanged ();
			});
		}
예제 #10
0
		public void SetFont(Font font)
		{
			if (!font.Equals(this.Font))
			{
				this.Font = font;
				if (formattedText != null)
					ApplyFont();
			}
		}
예제 #11
0
 public void SetFont(object backend, Xwt.Drawing.Font font)
 {
     Pango.Layout tl = (Pango.Layout)backend;
     tl.FontDescription = (Pango.FontDescription)WidgetRegistry.GetBackend(font);
 }
예제 #12
0
        /// <summary>
        /// Create overview!
        /// </summary>
        public void CreateOverview(VBox RequestOverview, Font CaptionFont)
        {
            // Overview clear
            RequestOverview.Clear();

            // Information
            RequestOverview.PackStart(new Label(Director.Properties.Resources.RequestUrl + ":")
            {
                Font = CaptionFont

            }, false, false);

            // Create URL
            RequestOverview.PackStart(new LinkLabel(Url)
            {
                Uri = new Uri(Url),
                MarginLeft = 10
            }, false, false);

            // Method
            RequestOverview.PackStart(new Label(Director.Properties.Resources.RequestMethod + ":")
            {
                Font = CaptionFont,
                MarginTop = 20
            }, false, false);

            // Create URL
            RequestOverview.PackStart(new Label(HTTP_METHOD)
            {
                MarginLeft = 10
            }, false, false);

            // Headers
            if (Headers.Count > 0)
            {
                RequestOverview.PackStart(new Label(Director.Properties.Resources.RequestHeaders + ":")
                {
                    Font = CaptionFont,
                    MarginTop = 20
                }, false, false);
                foreach (var h in Headers)
                    RequestOverview.PackStart(new ListItem(string.Format("{0} - {1}", h.Name, h.Value)));
            }

            // Files
            if (Files.Count > 0)
            {
                RequestOverview.PackStart(new Label(Director.Properties.Resources.RequestFiles + ":")
                {
                    Font = CaptionFont,
                    MarginTop = 20
                }, false, false);
                foreach (var h in Files)
                    RequestOverview.PackStart(new ListItem(h.FileName));
            }

            // Request
            // Request
            if (RequestTemplate != null && RequestTemplate.Length > 0)
            {
                RequestOverview.PackStart(new Label(string.Format("{0} ({1}) :", Director.Properties.Resources.RequestTemplate, RequestTemplateTypeS))
                {
                    Font = CaptionFont,
                    MarginTop = 20
                }, false, false);

                TextEntry RequestTextEntry = new TextEntry()
                {
                    Margin = 10, Sensitive = false, MultiLine = true
                };

                if (RequestTemplateType == ContentType.JSON)
                {
                    RequestTextEntry.Text = JSONFormatter.Format(RequestTemplate);

                    if (RequestTextEntry.Text == null || RequestTextEntry.Text.Trim().Length == 0)
                        RequestTextEntry.Text = RequestTemplate;
                }
                else
                {
                    RequestTextEntry.Text = RequestTemplate;
                }
                RequestOverview.PackStart(RequestTextEntry);

                Button ClipboardButtonReq = new Button(Image.FromResource(DirectorImages.COPY_ICON), "")
                {
                    WidthRequest = 30,
                    HeightRequest = 30,
                    ExpandHorizontal = false,
                    ExpandVertical = false,
                    MarginRight = 10,
                    TooltipText = Director.Properties.Resources.CopyInClipboard
                };
                ClipboardButtonReq.Clicked += delegate
                {
                    Clipboard.SetText(RequestTextEntry.Text);
                };
                RequestOverview.PackStart(ClipboardButtonReq, hpos: WidgetPlacement.End);
            }

            // Requested code
            if (ExpectedStatusCode > 0)
            {
                RequestOverview.PackStart(new Label(Director.Properties.Resources.ExpectedStatusCode + ":")
                {
                    Font = CaptionFont
                }, false, false);
                RequestOverview.PackStart(new ListItem(ExpectedStatusCode + ""));
            }

            // Request
            if (ResponseTemplate != null && ResponseTemplate.Length > 0)
            {
                RequestOverview.PackStart(new Label(string.Format("{0} ({1}): ", Director.Properties.Resources.ResponseTemplate, ResponseTemplateTypeS))
                {
                    Font = CaptionFont,
                    MarginTop = (ExpectedStatusCode > 0) ? 20 : 0
                }, false, false);

                TextEntry ResponseTextEntry = new TextEntry()
                {
                    Margin = 10, Sensitive = false, MultiLine = true
                };

                if (ResponseTemplate.Trim().StartsWith("{"))
                {
                    ResponseTextEntry.Text = JSONFormatter.Format(ResponseTemplate);
                }
                else
                {
                    ResponseTextEntry.Text = ResponseTemplate;
                }
                RequestOverview.PackStart(ResponseTextEntry);
                Button ClipboardButton = new Button(Image.FromResource(DirectorImages.COPY_ICON), "")
                {
                    WidthRequest = 30,
                    HeightRequest = 30,
                    ExpandHorizontal = false,
                    ExpandVertical = false,
                    MarginRight = 10,
                    MarginBottom = 10,
                    TooltipText = Director.Properties.Resources.CopyInClipboard
                };
                ClipboardButton.Clicked += delegate
                {
                    Clipboard.SetText(ResponseTextEntry.Text);
                };
                RequestOverview.PackStart(ClipboardButton, hpos: WidgetPlacement.End);
            }
        }
예제 #13
0
 internal FontFace(string name, object backend)
 {
     Name = name;
     Font = new Font(backend);
 }
예제 #14
0
 /// <summary>
 /// Draw a information on the ListView2Item
 /// </summary>
 /// <param name="What">What should be drawed</param>
 /// <param name="Where">Where (position by X) should be drawed</param>
 /// <param name="On">On what Drawing.Context the information should be drawed</param>
 /// <param name="MaxWidth">The limit of the picture's width</param>
 /// <param name="TextColor">The text foreground color</param>
 /// <param name="WhatFont">Which font is used to draw the onject</param>
 private void Draw(object What, double Where, Context On, double MaxWidth, Color TextColor, Font WhatFont)
 {
     if (What.GetType() != typeof (Image)
         &&
         What.GetType() != typeof (DirItem))
     {
         TextLayout tl = new TextLayout(this)
         {
             Text = What.ToString(),
             Font = WhatFont,
             Width = MaxWidth,
             Trimming = TextTrimming.WordElipsis
         };
         On.SetColor (TextColor);
         On.DrawTextLayout(tl, Where + 4, 0);
     }
     if (What is Image)
     {
         On.DrawImage(What as Image, Where + 2, 0);
     }
 }
예제 #15
0
 internal FontFace(string name, Font font)
 {
     Name = name;
     Font = font;
 }
예제 #16
0
 public Font WithSettings(Font fromFont)
 {
     return(WithSettings(fromFont.Size, fromFont.Style, fromFont.Weight, fromFont.Stretch));
 }
예제 #17
0
파일: FontSelector.cs 프로젝트: m13253/xwt
		void UpdateFaceList (Font font)
		{
			storeFace.Clear ();
			int row = -1;
			foreach (var face in font.GetAvailableFontFaces ()) {
				row = storeFace.AddRow ();
				storeFace.SetValues (row, dfaceName, face.Name, dfaceFont, face.Font, dfaceMarkup, "<span font=\"" + face.Font.WithSize (listFace.Font.Size) + "\">" + face.Name + "</span>");
			}
			if (row >= 0) {
				listFace.SelectRow (0);
			}
			listFace.QueueForReallocate ();
		}
예제 #18
0
		/// <summary>
		/// Shows the dialog.
		/// </summary>
		public bool Run (WindowFrame parentWindow)
		{
			var backend = Toolkit.CurrentEngine.Backend.CreateBackend<ISelectFontDialogBackend> ();
			if (backend == null)
				backend = new DefaultSelectFontDialogBackend (parentWindow);
			try {
				backend.SelectedFont = SelectedFont;
				backend.Title = Title;
				backend.PreviewText = PreviewText;
				return backend.Run ((IWindowFrameBackend)Toolkit.CurrentEngine.GetSafeBackend (parentWindow));
			} catch (Exception ex) {
				Console.WriteLine (ex);
				return false;
			} finally {
				font = backend.SelectedFont;
				backend.Dispose ();
			}
		}
예제 #19
0
        /// <summary>
        /// Create result vbox data item.
        /// </summary>
        public void CreateResult(VBox RequestStatus, Font CaptionFont)
        {
            // Clear
            RequestStatus.Clear();

            // Nothing to do!
            if (RequestRemoteResult == null)
            {
                RequestStatus.PackStart(new Label(Director.Properties.Resources.NoResponse)
                {
                    Font = CaptionFont
                });
                return;
            }

            // iterate
            bool first = true;
            foreach (var i in RequestRemoteResult)
            {
                if (i.Type == 1)
                {
                    RequestStatus.PackStart(new Label(i.Data)
                    {
                        Font = CaptionFont,
                        MarginTop = (first) ? 0 : 20
                    }, false, false);
                }
                else if (i.Type == 2)
                {
                    RequestStatus.PackStart(new ListItem(i.Data));
                }
                else
                {
                    TextEntry RequestTextEntry = new TextEntry()
                    {
                        Margin = 10,
                        Text = i.Data,
                        Sensitive = false,
                        MultiLine = true
                    };
                    RequestStatus.PackStart(RequestTextEntry);
                    Button ClipboardButtonReq = new Button(Image.FromResource(DirectorImages.COPY_ICON), "")
                    {
                        WidthRequest = 30,
                        HeightRequest = 30,
                        ExpandHorizontal = false,
                        ExpandVertical = false,
                        MarginRight = 10,
                        TooltipText = Director.Properties.Resources.CopyInClipboard
                    };
                    ClipboardButtonReq.Clicked += delegate
                    {
                        Clipboard.SetText(RequestTextEntry.Text);
                    };
                    RequestStatus.PackStart(ClipboardButtonReq, hpos: WidgetPlacement.End);
                }

                first = false;
            }
        }
예제 #20
0
 public void SetFont(Font font)
 {
     this.Font = font;
     var f = (FontData)Toolkit.GetBackend (font);
     FormattedText.SetFontFamily (f.Family);
     FormattedText.SetFontSize (f.GetDeviceIndependentPixelSize ());
     FormattedText.SetFontStretch (f.Stretch);
     FormattedText.SetFontStyle (f.Style);
     FormattedText.SetFontWeight (f.Weight);
 }
예제 #21
0
 public override void SetFont(object backend, Font font)
 {
     LayoutBackend la = (LayoutBackend) backend;
     la.Measured = false;
     la.Font = font;
 }
예제 #22
0
		void DisposeFont ()
		{
			if (font != null) {
				//				font.Dispsoe ();
				font = null;
			}
		}
 public void SetFont(object backend, Font font)
 {
 }
예제 #24
0
 public void SetFont(object backend, Xwt.Drawing.Font font)
 {
 }
예제 #25
0
        public override void SetFont(object backend, Xwt.Drawing.Font font)
        {
            var tl = (PangoBackend)backend;

            tl.Layout.FontDescription = (Pango.FontDescription)ApplicationContext.Toolkit.GetSafeBackend(font);
        }
예제 #26
0
파일: ArrowItem.cs 프로젝트: parnham/NPlot
 private void Init()
 {
     textFont_ = Font.FromName ("Tahoma 10");
 }
예제 #27
0
파일: Utils.cs 프로젝트: parnham/NPlot
 /// <summary>
 /// Get a Font exactly the same as the passed in one, except for scale factor.
 /// </summary>
 /// <param name="initial">The font to scale.</param>
 /// <param name="scale">Scale by this factor.</param>
 /// <returns>The scaled font.</returns>
 public static Font ScaleFont(Font initial, double scale)
 {
     Font scaled = initial.WithScaledSize (scale);
     return scaled;
 }
예제 #28
0
 public void SetFont(object backend, Font font)
 {
     var c = (DrawingContext) backend;
     c.Font.Dispose();
     c.Font = font.ToDrawingFont ();
 }
예제 #29
0
 public void SetFont(object backend, Font font)
 {
     ((TextLayoutContext)backend).Font = font.ToDrawingFont();
 }
예제 #30
0
 private void Init()
 {
     textFont_ = Font.SystemSansSerifFont.WithSize (10);
 }
        public override void SetFont(object backend, Xwt.Drawing.Font font)
        {
            var tl = (GdiTextLayoutBackend)backend;

            tl.Font = font;
        }
예제 #32
0
        public override void SetFont(object backend, Xwt.Drawing.Font font)
        {
            LayoutInfo li = (LayoutInfo)backend;

            li.Font = (NSFont)Toolkit.GetBackend(font);
        }
예제 #33
0
파일: Font.cs 프로젝트: TheBrainTech/xwt
		public Font WithSettings (Font fromFont)
		{
			return WithSettings (fromFont.Size, fromFont.Style, fromFont.Weight, fromFont.Stretch);
		}
예제 #34
0
파일: Font.cs 프로젝트: TheBrainTech/xwt
		internal FontFace (string name, Font font)
		{
			Name = name;
			Font = font;
		}
예제 #35
0
파일: Font.cs 프로젝트: TheBrainTech/xwt
		internal FontFace (string name, object backend)
		{
			Name = name;
			Font = new Font (backend);
		}
예제 #36
0
파일: TextLayout.cs 프로젝트: Sinien/xwt
 internal void InitForToolkit(Toolkit tk)
 {
     if (ToolkitEngine == null || ToolkitEngine != tk) {
         // If this is a re-initialization we dispose the previous state
         if (handler != null) {
             Dispose ();
             GC.ReRegisterForFinalize (this);
         }
         ToolkitEngine = tk;
         handler = ToolkitEngine.TextLayoutBackendHandler;
         Backend = handler.Create ();
         Setup ();
         font = (Font)tk.ValidateObject (font);
         if (font != null)
             handler.SetFont (Backend, font);
         if (text != null)
             handler.SetText (Backend, text);
         if (width != -1)
             handler.SetWidth (Backend, width);
         if (height != -1)
             handler.SetHeight (Backend, height);
         if (attributes != null && attributes.Count > 0)
             foreach (var attr in attributes)
                 handler.AddAttribute (Backend, attr);
     }
 }
예제 #37
0
 public override void SetFont(object backend, Font font)
 {
     ((TextLayoutContext) backend).Font = font.ToDrawingFont();
 }
예제 #38
0
 public abstract void SetFont(object backend, Font font);
예제 #39
0
 public override void SetFont(object backend, Font font)
 {
 }
예제 #40
0
 public override void SetFont(object backend, Font font)
 {
     var t = (TextLayoutBackend)backend;
     t.SetFont (font);
 }
예제 #41
0
        public override void SetFont(object backend, Xwt.Drawing.Font font)
        {
            LayoutInfo li = (LayoutInfo)backend;

            li.Font = ((FontData)ApplicationContext.Toolkit.GetSafeBackend(font)).Font;
        }
예제 #42
0
파일: Font.cs 프로젝트: carlosalberto/xwt
 public static Font FromName(string name, double size)
 {
     Font f = new Font ();
     f.Backend = handler.CreateFromName (name, size);
     return f;
 }
예제 #43
0
 public static SD.Font ToGdi(this Font value)
 {
     return((SD.Font)value.GetBackend());
 }