当前位置: 首页>>代码示例>>C#>>正文


C# Xwt类代码示例

本文整理汇总了C#中Xwt的典型用法代码示例。如果您正苦于以下问题:C# Xwt类的具体用法?C# Xwt怎么用?C# Xwt使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


Xwt类属于命名空间,在下文中一共展示了Xwt类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: OnDraw

        protected override void OnDraw(Xwt.Drawing.Context ctx, Xwt.Rectangle dirtyRect)
        {
            base.OnDraw(ctx, dirtyRect);

            if (pages == null)
            {
                return;
            }
            ctx.Font = this.Font;
            ctx.Save();

            int width = (int)(report.PageWidthPoints * Scale);
            int height = (int)(report.PageHeightPoints * Scale);
            //Xwt.Rectangle rep_r = new Xwt.Rectangle(1, 1, width - 1, height - 1);

            //RenderXwt render = new RenderXwt(ctx, Scale);
            //render.RunPage(pages);
            //ctx.Stroke();

            // Page Drawing using System.Drawing converted to Xwt Context
            PageDrawing render = new PageDrawing(ctx, 1f);
            render.RunPage(pages);
            ctx.Stroke();
            ctx.Save();
        }
开发者ID:hardsoft,项目名称:My-FyiReporting,代码行数:25,代码来源:ReportArea.cs

示例2: DragEventArgs

		public DragEventArgs (Point position, Xwt.Backends.TransferDataStore dataStore, DragDropAction action)
		{
			Data = dataStore;
			Position = position;
			Action = action;
			Success = false;
		}
开发者ID:StEvUgnIn,项目名称:xwt,代码行数:7,代码来源:DragEventArgs.cs

示例3: OnSetBackgroundColor

		protected override void OnSetBackgroundColor (Xwt.Drawing.Color color)
		{
			base.OnSetBackgroundColor (color);
			Widget.SetBackgroundColor (color);
			Widget.SetChildBackgroundColor (color);
			EventsRootWidget.SetBackgroundColor (color);
		}
开发者ID:m13253,项目名称:xwt,代码行数:7,代码来源:RadioButtonBackend.cs

示例4: RequestPopup

		internal async void RequestPopup (Xwt.Rectangle rect)
		{
			var token = popupSrc.Token;

			diff = await Task.Run (async delegate {
				try {
					foreach (var op in await codeAction.GetPreviewOperationsAsync (token)) {
						var ac = op as ApplyChangesOperation;
						if (ac == null) {
							continue;
						}
						var changedDocument = ac.ChangedSolution.GetDocument (documentContext.AnalysisDocument.Id);

						changedTextDocument = TextEditorFactory.CreateNewDocument (new StringTextSource ((await changedDocument.GetTextAsync (token)).ToString ()), editor.FileName);
						try {
							var list = new List<DiffHunk> (editor.GetDiff (changedTextDocument, new DiffOptions (false, true)));
							if (list.Count > 0)
								return list;
						} catch (Exception e) {
							LoggingService.LogError ("Error while getting preview list diff.", e);
						}

					}
				} catch (OperationCanceledException) {}
				return new List<DiffHunk> ();
			});
			if (diff.Count > 0 && !token.IsCancellationRequested)
				ShowPopup (rect, PopupPosition.Left);
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:29,代码来源:RefactoringPreviewTooltipWindow.cs

示例5: ShowDialog

        /// <summary>Shows dialog</summary>
        /// <returns><value>True</value> if user want to proceed current operation, and <value>False</value> if user don't.</returns>
        public bool ShowDialog(Xwt.WindowFrame parent = null)
        {
            Build();
            Xwt.Command DialogResult = null;
            if (parent == null){
                DialogResult = this.Run();
            }
            else{
                DialogResult = this.Run(parent);
            }
            //4beginners: xwtdialog.Run() == winform.ShowDialog() == vb6form.Show(vbModal);

            if (DialogResult == null) return false;
            switch (DialogResult.Id) //hack due to C# limitation (it's unable to do switch(){} on custon types)
            {
                case "Add":
                case "Apply":
                case "Clear":
                case "Copy":
                case "Cut":
                case "Delete":
                case "Ok":
                case "Paste":
                case "Remove":
                case "Save":
                case "SaveAs":
                case "Yes":
                    return true;
            }
            return false;
        }
开发者ID:kekekeks,项目名称:fcmd,代码行数:33,代码来源:InputBox.cs

示例6: SendKeyPressed

		bool SendKeyPressed (Xwt.KeyEventArgs kargs)
		{
			if (KeyPressed != null)
				KeyPressed (this, kargs);

			return kargs.Handled;
		}
开发者ID:nerzhulart,项目名称:monodevelop,代码行数:7,代码来源:SearchBar.cs

示例7: MakePopover

 public static NSPopover MakePopover(Xwt.Widget child, Color backgroundColor)
 {
     return new NSPopover {
         Behavior = NSPopoverBehavior.Transient,
         ContentViewController = new FactoryViewController (child) { BackgroundColor = backgroundColor.ToCGColor () }
     };
 }
开发者ID:henriquemotaesteves,项目名称:xwt,代码行数:7,代码来源:PopoverBackend.cs

示例8: InputBox

        public InputBox(string AskText, string DefaultValue, Xwt.Command[] Buttons)
        {
            lblQuestion.Text = AskText;
            txtAnwser.Text = DefaultValue;

            this.Buttons.Add(Buttons);
        }
开发者ID:kekekeks,项目名称:fcmd,代码行数:7,代码来源:InputBox.cs

示例9: NotifyClicked

		internal void NotifyClicked (Xwt.PointerButton button)
		{
			if (Clicked != null)
				Clicked (this, new StatusBarIconClickedEventArgs {
					Button = button,
				});
		}
开发者ID:RussellHaley,项目名称:monodevelop,代码行数:7,代码来源:StatusBar.cs

示例10: CreateTooltipWindow

		public override Control CreateTooltipWindow (TextEditor editor, DocumentContext ctx, TooltipItem item, int offset, Xwt.ModifierKeys modifierState)
		{
			var result = new LanguageItemWindow (GetExtensibleTextEditor (editor), modifierState, null, (string)item.Item, null);
			if (result.IsEmpty)
				return null;
			return result;
		}
开发者ID:FreeBSD-DotNet,项目名称:monodevelop,代码行数:7,代码来源:CompileErrorTooltipProvider.cs

示例11: OnDraw

        protected override void OnDraw(Xwt.Drawing.Context ctx, Rectangle dirtyRect)
        {
            if (!Sensitive)
            {
                ctx.GlobalAlpha = .5d;
            }
            if (image == null)
            {
                ctx.SetColor(bg);
                ctx.Rectangle(dirtyRect);
                ctx.Fill();
            }
            else
                ctx.DrawImage(image, new Rectangle(0, 0, WidthRequest, HeightRequest));

            if (mOver && Sensitive)
            {
                ctx.SetColor(mOverColor);
                ctx.Rectangle(dirtyRect);
                ctx.Fill();
            }

            if (mDown)
            {
                ctx.SetColor(mOverColor);
                ctx.Rectangle(dirtyRect);
                ctx.Fill();
            }

            //ctx.SetColor(Colors.Red);
            //ctx.Rectangle(0, 0, WidthRequest, HeightRequest);
            //ctx.Stroke();
        }
开发者ID:fourtf,项目名称:4Plug,代码行数:33,代码来源:ImageButton.cs

示例12: OnDraw

 protected override void OnDraw(Xwt.Drawing.Context ctx, Xwt.Rectangle dirtyRect)
 {
     ctx.Rectangle(dirtyRect);
     ctx.SetColor(Colors.White);
     ctx.Fill();
     this.Buttons.ForEach(X => DrawGradientButton(ctx, X));
 }
开发者ID:ksigne,项目名称:xwt-extensions,代码行数:7,代码来源:CarouselTable.cs

示例13: OnDraw

        protected override void OnDraw(Xwt.Drawing.Context ctx, Xwt.Rectangle dirtyRect)
        {
            base.OnDraw(ctx, dirtyRect);

            if (pages == null)
            {
                return;
            }
            ctx.Save();

            //Xwt.Rectangle rep_r = new Xwt.Rectangle(1, 1, width - 1, height - 1);

            //RenderXwt render = new RenderXwt(ctx, Scale);
            //render.RunPage(pages);
            //ctx.Stroke();

            if (_defaultBackend == Backend.PureXwt)
            {
                RenderXwt render = new RenderXwt(ctx, this, 1f);
                render.RunPage(pages);
            }
            else
            {
                // Page Drawing using System.Drawing converted to Xwt Context
                PageDrawing render = new PageDrawing(ctx, 1f, Convert.ToInt32(this.MinWidth), Convert.ToInt32(this.MinHeight));
                render.RunPage(pages);
            }
            ctx.Stroke();
            ctx.Save();
        }
开发者ID:jackwanger,项目名称:My-FyiReporting,代码行数:30,代码来源:ReportArea.cs

示例14: Show

        public void Show(Xwt.Popover.Position orientation, Xwt.Widget reference, Xwt.Rectangle positionRect, Widget child)
        {
            var parent = reference.ParentWindow;
            popover = new PopoverWindow ((Gtk.Widget)((WidgetBackend)Toolkit.GetBackend (child)).NativeWidget, orientation);
            popover.SetPadding (frontend.Padding);
            popover.TransientFor = ((WindowFrameBackend)Toolkit.GetBackend (parent)).Window;
            popover.DestroyWithParent = true;
            popover.Hidden += (o, args) => {
                popover.ReleaseInnerWidget ();
                sink.OnClosed ();
                popover.Destroy ();
            };

            var screenBounds = reference.ScreenBounds;
            if (positionRect == Rectangle.Zero)
                positionRect = new Rectangle (Point.Zero, screenBounds.Size);
            positionRect = positionRect.Offset (screenBounds.Location);
            var position = new Point (positionRect.Center.X, popover.ArrowPosition == Popover.Position.Top ? positionRect.Bottom : positionRect.Top);
            popover.ShowAll ();
            popover.GrabFocus ();
            int w, h;
            popover.GetSize (out w, out h);
            popover.Move ((int)position.X - w / 2, (int)position.Y);
            popover.SizeAllocated += (o, args) => { popover.Move ((int)position.X - args.Allocation.Width / 2, (int)position.Y); popover.GrabFocus (); };
        }
开发者ID:shines77,项目名称:xwt,代码行数:25,代码来源:PopoverBackend.cs

示例15: OnSetBackgroundColor

		protected override void OnSetBackgroundColor (Xwt.Drawing.Color color)
		{
			// Gtk3 workaround (by rpc-scandinavia, see https://github.com/mono/xwt/pull/411)
			var selectedColor = Widget.GetBackgroundColor(StateType.Selected);
			Widget.SetBackgroundColor (StateType.Normal, Xwt.Drawing.Colors.Transparent);
			Widget.SetBackgroundColor (StateType.Selected, selectedColor);
			base.OnSetBackgroundColor (color);
		}
开发者ID:m13253,项目名称:xwt,代码行数:8,代码来源:TableViewBackend.cs


注:本文中的Xwt类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。