internal static FrameworkElement CreateCellRenderer(TreeNode node, CellView view) { if (view is TextCellView) { DataField field = ((TextCellView)view).TextField; int index = field.Index; SWC.TextBlock label = new SWC.TextBlock(); label.Text = (node.Values[index] ?? "null").ToString(); label.Padding = new Thickness(2); return(label); } else if (view is ImageCellView) { DataField field = ((ImageCellView)view).ImageField; int index = field.Index; SWM.ImageSource image = (SWM.ImageSource)WidgetRegistry.GetBackend(node.Values[index]); SWC.Image imageCtrl = new SWC.Image { Source = image, Width = image.Width, Height = image.Height }; return(imageCtrl); } throw new NotImplementedException(); }
/* * Constructor */ public DebugServerFrame(String filename, int port) { // // Required for Windows Form Designer support // InitializeComponent(); _filename = filename; _port = port; _appliance = null; _debugConnection = new DebugConnection(this); _running = false; _connections = new ArrayList(); this.logPanel.Size = this.ClientSize; this.logBox.Size = new System.Drawing.Size(this.logPanel.Size.Width, this.logPanel.Size.Height - this.logBox.Location.Y); _undefineDialog = new UndefineDlg(this); SetupRulePhases(); _widgetRegistry = WidgetRegistryParser.Parse(Globals.GetWidgetRegistryFileName()); SetupSmartCIOManager(); AddLogLine("Parsing specification from " + filename + "..."); OpenSpec(filename); AddLogLine("Done."); }
public override void DrawTextLayout(object backend, TextLayout layout, double x, double y) { Pango.Layout pl = (Pango.Layout)WidgetRegistry.GetBackend(layout); CairoContextBackend ctx = (CairoContextBackend)backend; ctx.Context.MoveTo(x, y); if (layout.Height <= 0) { Pango.CairoHelper.ShowLayout(ctx.Context, pl); } else { var lc = pl.LineCount; var scale = Pango.Scale.PangoScale; double h = 0; for (int i = 0; i < lc; i++) { var line = pl.Lines [i]; var ext = new Pango.Rectangle(); var extl = new Pango.Rectangle(); line.GetExtents(ref ext, ref extl); h += (extl.Height / scale); if (h > layout.Height) { break; } ctx.Context.MoveTo(x, y + h); Pango.CairoHelper.ShowLayoutLine(ctx.Context, line); } } }
static bool PrepareForDragOperation(IntPtr sender, IntPtr sel, IntPtr dragInfo) { IViewObject <T> ob = Runtime.GetNSObject(sender) as IViewObject <T>; if (ob == null) { return(false); } var backend = (ViewBackend <T, S>)WidgetRegistry.GetBackend(ob.Frontend); NSDraggingInfo di = new NSDraggingInfo(dragInfo); var types = di.DraggingPasteboard.Types.Select(t => ToXwtDragType(t)).ToArray(); var pos = new Point(di.DraggingLocation.X, di.DraggingLocation.Y); if ((backend.currentEvents & WidgetEvent.DragDropCheck) != 0) { var args = new DragCheckEventArgs(pos, types, ConvertAction(di.DraggingSourceOperationMask)); bool res = Toolkit.Invoke(delegate { backend.eventSink.OnDragDropCheck(args); }); if (args.Result == DragDropResult.Canceled || !res) { return(false); } } return(true); }
public void SetBuffer(IRichTextBuffer buffer) { var buf = buffer as RichTextBuffer; if (buf == null) { throw new ArgumentException("Passed buffer is of incorrect type", "buffer"); } if (links != null) { foreach (var link in links) { link.NavigateToUrl -= HandleNavigateToUrl; } } Widget.Buffer = buf; links = new LinkLabel [buf.Links.Count]; for (var i = 0; i < links.Length; i++) { var link = buf.Links [i]; var label = new LinkLabel(link.Text) { Uri = link.Href }; label.NavigateToUrl += HandleNavigateToUrl; Widget.AddChildAtAnchor((Gtk.Widget)WidgetRegistry.GetNativeWidget(label), link.Anchor); links [i] = label; } }
public Command Run(WindowFrame transientFor, MessageDescription message) { this.icon = GetIcon(message.Icon); this.buttons = ConvertButtons(message.Buttons); if (message.SecondaryText == null) { message.SecondaryText = String.Empty; } else { message.Text = message.Text + "\r\n\r\n" + message.SecondaryText; message.SecondaryText = String.Empty; } var wb = (WindowFrameBackend)WidgetRegistry.GetBackend(transientFor); if (wb != null) { this.dialogResult = MessageBox.Show(wb.Window, message.Text, message.SecondaryText, this.buttons, this.icon, this.defaultResult, this.options); } else { this.dialogResult = MessageBox.Show(message.Text, message.SecondaryText, this.buttons, this.icon, this.defaultResult, this.options); } return(ConvertResultToCommand(this.dialogResult)); }
public object Create(Context context) { GtkContext c = (GtkContext)WidgetRegistry.GetBackend(context); var pl = Pango.CairoHelper.CreateLayout(c.Context); return(pl); }
/// <summary> /// Shows the dialog. /// </summary> public bool Run(WindowFrame parentWindow) { try { running = true; Backend.Initialize(filters, multiselect, initialFileName); if (!string.IsNullOrEmpty(currentFolder)) { Backend.CurrentFolder = currentFolder; } if (activeFilter != null) { Backend.ActiveFilter = activeFilter; } if (!string.IsNullOrEmpty(title)) { Backend.Title = title; } return(Backend.Run((IWindowFrameBackend)WidgetRegistry.GetBackend(parentWindow))); } finally { currentFolder = Backend.CurrentFolder; activeFilter = Backend.ActiveFilter; fileName = Backend.FileName; fileNames = Backend.FileNames; currentFolder = Backend.CurrentFolder; running = false; Backend.Cleanup(); } }
public virtual void DrawTextLayout(object backend, TextLayout layout, double x, double y) { Cairo.Context ctx = ((CairoContextBackend)backend).Context; var lb = WidgetRegistry.GetBackend(layout); CairoTextLayoutBackendHandler.Draw(ctx, lb, x, y); }
static bool PerformDragOperation(IntPtr sender, IntPtr sel, IntPtr dragInfo) { IViewObject <T> ob = Runtime.GetNSObject(sender) as IViewObject <T>; if (ob == null) { return(false); } var backend = (ViewBackend <T, S>)WidgetRegistry.GetBackend(ob.Frontend); NSDraggingInfo di = new NSDraggingInfo(dragInfo); var pos = new Point(di.DraggingLocation.X, di.DraggingLocation.Y); if ((backend.currentEvents & WidgetEvent.DragDrop) != 0) { TransferDataStore store = new TransferDataStore(); FillDataStore(store, di.DraggingPasteboard, ob.View.RegisteredDragTypes()); var args = new DragEventArgs(pos, store, ConvertAction(di.DraggingSourceOperationMask)); Toolkit.Invoke(delegate { backend.eventSink.OnDragDrop(args); }); return(args.Success); } else { return(false); } }
public Command Run(WindowFrame parent) { Toolkit.InvokePlatformCode(delegate { Backend.RunLoop((IWindowFrameBackend)WidgetRegistry.GetBackend(parent)); }); return(resultCommand); }
public override void InitializeApplication() { NSApplication.Init(); Hijack(); pool = new NSAutoreleasePool(); NSApplication.SharedApplication.Delegate = appDelegate; WidgetRegistry.RegisterBackend(typeof(Xwt.Window), typeof(WindowBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.Label), typeof(LabelBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.HBox), typeof(BoxBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.VBox), typeof(BoxBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.Button), typeof(ButtonBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.Notebook), typeof(NotebookBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.TreeView), typeof(TreeViewBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.ListView), typeof(ListViewBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.Canvas), typeof(CanvasBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.Drawing.Image), typeof(ImageHandler)); WidgetRegistry.RegisterBackend(typeof(Xwt.Drawing.Context), typeof(ContextBackendHandler)); WidgetRegistry.RegisterBackend(typeof(Xwt.Drawing.Gradient), typeof(GradientBackendHandler)); WidgetRegistry.RegisterBackend(typeof(Xwt.Drawing.TextLayout), typeof(TextLayoutBackendHandler)); WidgetRegistry.RegisterBackend(typeof(Xwt.Drawing.Font), typeof(FontBackendHandler)); WidgetRegistry.RegisterBackend(typeof(Xwt.Menu), typeof(MenuBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.MenuItem), typeof(MenuItemBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.ComboBox), typeof(ComboBoxBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.TextEntry), typeof(TextEntryBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.ImageView), typeof(ImageViewBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.Table), typeof(BoxBackend)); }
void UpdateButton(DialogButton btn, Gtk.Button b) { if (!string.IsNullOrEmpty(btn.Label) && btn.Image == null) { b.Label = btn.Label; } else if (string.IsNullOrEmpty(btn.Label) && btn.Image != null) { var pix = (Gdk.Pixbuf)WidgetRegistry.GetBackend(btn.Image); b.Image = new Gtk.Image(pix); } else if (!string.IsNullOrEmpty(btn.Label)) { Gtk.Box box = new Gtk.HBox(false, 3); var pix = (Gdk.Pixbuf)WidgetRegistry.GetBackend(btn.Image); box.PackStart(new Gtk.Image(pix), false, false, 0); box.PackStart(new Gtk.Label(btn.Label), true, true, 0); b.Image = box; } if (btn.Visible) { b.ShowAll(); } else { b.Hide(); } b.Sensitive = btn.Sensitive; }
public void SetFont(object backend, Xwt.Drawing.Font font) { LayoutInfo li = (LayoutInfo)backend; li.Font = (NSFont)WidgetRegistry.GetBackend(font); UpdateInfo(li); }
public static bool GetSelectionData(Gtk.SelectionData data, TransferDataStore target) { TransferDataType type = Util.AtomToType(data.Target.Name); if (type == null || data.Length <= 0) { return(false); } if (type == TransferDataType.Text) { target.AddText(data.Text); } else if (data.TargetsIncludeImage(false)) { target.AddImage(WidgetRegistry.CreateFrontend <Xwt.Drawing.Image> (data.Pixbuf)); } else if (type == TransferDataType.Uri) { var uris = System.Text.Encoding.UTF8.GetString(data.Data).Split('\n').Where(u => !string.IsNullOrEmpty(u)).Select(u => new Uri(u)).ToArray(); target.AddUris(uris); } else { target.AddValue(type, data.Data); } return(true); }
public override void InitializeApplication() { Gtk.Application.Init(); WidgetRegistry.RegisterBackend(typeof(Xwt.Window), typeof(WindowBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.Label), typeof(LabelBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.HBox), typeof(BoxBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.VBox), typeof(BoxBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.Button), typeof(ButtonBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.Notebook), typeof(NotebookBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.TreeView), typeof(TreeViewBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.TreeStore), typeof(TreeStoreBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.ListView), typeof(ListViewBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.ListStore), typeof(ListStoreBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.Canvas), typeof(CanvasBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.Drawing.Image), typeof(ImageHandler)); WidgetRegistry.RegisterBackend(typeof(Xwt.Drawing.Context), typeof(ContextBackendHandler)); WidgetRegistry.RegisterBackend(typeof(Xwt.Drawing.Gradient), typeof(GradientBackendHandler)); WidgetRegistry.RegisterBackend(typeof(Xwt.Drawing.TextLayout), typeof(TextLayoutBackendHandler)); WidgetRegistry.RegisterBackend(typeof(Xwt.Drawing.Font), typeof(FontBackendHandler)); WidgetRegistry.RegisterBackend(typeof(Xwt.Menu), typeof(MenuBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.MenuItem), typeof(MenuItemBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.ScrollView), typeof(ScrollViewBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.ComboBox), typeof(ComboBoxBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.Design.DesignerSurface), typeof(DesignerSurfaceBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.MenuButton), typeof(MenuButtonBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.TextEntry), typeof(TextEntryBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.ToggleButton), typeof(ToggleButtonBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.ImageView), typeof(ImageViewBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.Backends.IAlertDialogBackend), typeof(AlertDialogBackend)); }
public Command Run(WindowFrame transientFor, MessageDescription message) { GtkAlertDialog alertDialog = new GtkAlertDialog(message); alertDialog.FocusButton(message.DefaultButton); var wb = (IGtkWidgetBackend)WidgetRegistry.GetBackend(transientFor); var win = wb != null ? (Gtk.Window)wb.Widget : null; MessageService.ShowCustomDialog(alertDialog, win); if (alertDialog.ApplyToAll) { ApplyToAll = true; } var res = alertDialog.ResultButton; if (res == null) { // If the dialog is closed clicking the close window button we may have no result. // In that case, try to find a cancelling button if (message.Buttons.Contains(Command.Cancel)) { return(Command.Cancel); } else if (message.Buttons.Contains(Command.No)) { return(Command.No); } else if (message.Buttons.Contains(Command.Close)) { return(Command.Close); } } return(res); }
public override void InitializeApplication() { application = new System.Windows.Application(); WidgetRegistry.RegisterBackend(typeof(Window), typeof(WindowBackend)); WidgetRegistry.RegisterBackend(typeof(Menu), typeof(MenuBackend)); WidgetRegistry.RegisterBackend(typeof(MenuItem), typeof(MenuItemBackend)); }
public void DrawTextLayout(object backend, TextLayout layout, double x, double y) { Pango.Layout pl = (Pango.Layout)WidgetRegistry.GetBackend(layout); GtkContext ctx = (GtkContext)backend; Gdk.GC gc = ctx.Widget.Style.BlackGC; ctx.Widget.GdkWindow.DrawLayout(gc, (int)x, (int)y, pl); }
public object Create(Context context) { CairoContextBackend c = (CairoContextBackend)WidgetRegistry.GetBackend(context); LayoutBackend b = new LayoutBackend(); b.Context = c; return(b); }
public void DrawTextLayout(object backend, TextLayout layout, double x, double y) { Pango.Layout pl = (Pango.Layout)WidgetRegistry.GetBackend(layout); GtkContext ctx = (GtkContext)backend; ctx.Context.MoveTo(x, y); Pango.CairoHelper.ShowLayout(ctx.Context, pl); }
public override void InitializeApplication() { application = System.Windows.Application.Current; if (application == null) { application = new System.Windows.Application(); } WidgetRegistry.RegisterBackend(typeof(Window), typeof(WindowBackend)); WidgetRegistry.RegisterBackend(typeof(Dialog), typeof(DialogBackend)); WidgetRegistry.RegisterBackend(typeof(Notebook), typeof(NotebookBackend)); WidgetRegistry.RegisterBackend(typeof(Menu), typeof(MenuBackend)); WidgetRegistry.RegisterBackend(typeof(MenuItem), typeof(MenuItemBackend)); WidgetRegistry.RegisterBackend(typeof(CheckBoxMenuItem), typeof(CheckboxMenuItemBackend)); WidgetRegistry.RegisterBackend(typeof(RadioButtonMenuItem), typeof(RadioButtonMenuItemBackend)); WidgetRegistry.RegisterBackend(typeof(SeparatorMenuItem), typeof(SeparatorMenuItemBackend)); WidgetRegistry.RegisterBackend(typeof(Table), typeof(BoxBackend)); WidgetRegistry.RegisterBackend(typeof(Box), typeof(BoxBackend)); WidgetRegistry.RegisterBackend(typeof(Label), typeof(LabelBackend)); WidgetRegistry.RegisterBackend(typeof(TextEntry), typeof(TextEntryBackend)); WidgetRegistry.RegisterBackend(typeof(Button), typeof(ButtonBackend)); WidgetRegistry.RegisterBackend(typeof(ToggleButton), typeof(ToggleButtonBackend)); WidgetRegistry.RegisterBackend(typeof(MenuButton), typeof(MenuButtonBackend)); WidgetRegistry.RegisterBackend(typeof(CheckBox), typeof(CheckBoxBackend)); WidgetRegistry.RegisterBackend(typeof(TreeView), typeof(TreeViewBackend)); WidgetRegistry.RegisterBackend(typeof(TreeStore), typeof(TreeStoreBackend)); WidgetRegistry.RegisterBackend(typeof(ImageView), typeof(ImageViewBackend)); WidgetRegistry.RegisterBackend(typeof(Separator), typeof(SeparatorBackend)); WidgetRegistry.RegisterBackend(typeof(Image), typeof(ImageHandler)); WidgetRegistry.RegisterBackend(typeof(Font), typeof(FontBackendHandler)); WidgetRegistry.RegisterBackend(typeof(Clipboard), typeof(ClipboardBackend)); WidgetRegistry.RegisterBackend(typeof(ComboBox), typeof(ComboBoxBackend)); WidgetRegistry.RegisterBackend(typeof(ComboBoxEntry), typeof(ComboBoxEntryBackend)); WidgetRegistry.RegisterBackend(typeof(ScrollView), typeof(ScrollViewBackend)); WidgetRegistry.RegisterBackend(typeof(Frame), typeof(FrameBackend)); WidgetRegistry.RegisterBackend(typeof(Canvas), typeof(CanvasBackend)); WidgetRegistry.RegisterBackend(typeof(Context), typeof(ContextBackendHandler)); WidgetRegistry.RegisterBackend(typeof(Gradient), typeof(GradientBackendHandler)); WidgetRegistry.RegisterBackend(typeof(TextLayout), typeof(TextLayoutBackendHandler)); WidgetRegistry.RegisterBackend(typeof(Widget), typeof(CustomWidgetBackend)); WidgetRegistry.RegisterBackend(typeof(Paned), typeof(PanedBackend)); WidgetRegistry.RegisterBackend(typeof(ScrollAdjustment), typeof(ScrollAdjustmentBackend)); WidgetRegistry.RegisterBackend(typeof(OpenFileDialog), typeof(OpenFileDialogBackend)); WidgetRegistry.RegisterBackend(typeof(SelectFolderDialog), typeof(SelectFolderDialogBackend)); WidgetRegistry.RegisterBackend(typeof(IAlertDialogBackend), typeof(AlertDialogBackend)); WidgetRegistry.RegisterBackend(typeof(ImageBuilder), typeof(ImageBuilderBackendHandler)); WidgetRegistry.RegisterBackend(typeof(ImagePattern), typeof(ImagePatternBackendHandler)); WidgetRegistry.RegisterBackend(typeof(ListView), typeof(ListViewBackend)); WidgetRegistry.RegisterBackend(typeof(ListStore), typeof(ListDataSource)); WidgetRegistry.RegisterBackend(typeof(ListBox), typeof(ListBoxBackend)); WidgetRegistry.RegisterBackend(typeof(Placement), typeof(BoxBackend)); WidgetRegistry.RegisterBackend(typeof(Popover), typeof(PopoverBackend)); WidgetRegistry.RegisterBackend(typeof(ProgressBar), typeof(ProgressBarBackend)); WidgetRegistry.RegisterBackend(typeof(RichTextView), typeof(RichTextViewBackend)); WidgetRegistry.RegisterBackend(typeof(LinkLabel), typeof(LinkLabelBackend)); WidgetRegistry.RegisterBackend(typeof(Spinner), typeof(SpinnerBackend)); }
public void Fill(ICellSource source, object pos) { Image img = (Image)source.GetValue(pos, cellView.ImageField.Index); if (img != null) { ObjectValue = (NSImage)WidgetRegistry.GetBackend(img); } }
static void DraggingExited(IntPtr sender, IntPtr sel, IntPtr dragInfo) { IViewObject <T> ob = Runtime.GetNSObject(sender) as IViewObject <T>; if (ob != null) { var backend = (ViewBackend <T, S>)WidgetRegistry.GetBackend(ob.Frontend); backend.eventSink.OnDragLeave(EventArgs.Empty); } }
void MarkDestroyed(Widget w) { var bk = (WidgetBackend)WidgetRegistry.GetBackend(w); bk.destroyed = true; foreach (var c in w.Surface.Children) { MarkDestroyed(c); } }
public PUCFrame() { // // Required for Windows Form Designer support // InitializeComponent(); Debug.Assert(DEFAULT_FRAME == null, "PUCFrame should only be instantiated once."); PUCFrame.DEFAULT_FRAME = this; _measureCtl = new MeasureStringControl(); this.Controls.Add(_measureCtl); _measureCtl.Location = new Point(0, 0); _measureCtl.Size = new Size(0, 0); _measureCtl.Enabled = false; Globals.Init(VERSION_STRING, "\\Storage\\PUC\\pucdata.xml", this, this, this, this, _measureCtl, "\\Storage\\PUC\\smartphone.xml"); _uiEventQueue = new Queue(); _appliances = new ArrayList(); _servers = new ArrayList(); this.Text = Globals.GetVersionString(); AddLogText(Globals.GetVersionString() + " Starting..."); this.logPanel.Size = this.ClientSize; this.logBox.Size = new System.Drawing.Size(this.logPanel.Size.Width, this.logPanel.Size.Height - this.logBox.Location.Y); _connectDialog = new PhoneConnectDlg(this); _optionsDialog = new PhoneOptionsDlg(); _leftMenuStack = new Stack(); LeftMenuStackItem item = new LeftMenuStackItem("Open", new EventHandler(this.openItem_Click)); this.PushLeftMenuStack(item); _mutex = new Mutex(); SetupRecentList(); SetupRulePhases(); _registry = WidgetRegistryParser.Parse(Globals.GetWidgetRegistryFileName()); SetupSmartCIOManager(); AddLogLine("Done."); }
void HandleWidgetDragDataReceived(object o, Gtk.DragDataReceivedArgs args) { dragDataRequests--; string type = Util.AtomToType(args.SelectionData.Target.Name); if (type == null) { args.RetVal = false; return; } if (args.SelectionData.Length > 0) { if (type == TransferDataType.Text) { dragData.AddText(args.SelectionData.Text); } else if (args.SelectionData.TargetsIncludeImage(false)) { dragData.AddImage(WidgetRegistry.CreateFrontend <Xwt.Drawing.Image> (args.SelectionData.Pixbuf)); } else if (type == TransferDataType.Uri) { var uris = System.Text.Encoding.UTF8.GetString(args.SelectionData.Data).Split('\n').Where(u => !string.IsNullOrEmpty(u)).Select(u => new Uri(u)).ToArray(); dragData.AddUris(uris); } else { dragData.AddValue(type, args.SelectionData.Data); } } if (dragDataRequests == 0) { if (dragDataForMotion) { DragOverEventArgs da = new DragOverEventArgs(lastDragPosition, dragData, ConvertDragAction(args.Context.Actions)); Toolkit.Invoke(delegate { EventSink.OnDragOver(da); }); Gdk.Drag.Status(args.Context, ConvertDragAction(da.AllowedAction), args.Time); } else { // Use Context.Action here since that's the action selected in DragOver var cda = ConvertDragAction(args.Context.Action); DragEventArgs da = new DragEventArgs(lastDragPosition, dragData, cda); Toolkit.Invoke(delegate { EventSink.OnDragDrop(da); }); Gtk.Drag.Finish(args.Context, da.Success, cda == DragDropAction.Move, args.Time); } } }
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { Image image = value as Image; if (image == null) { return(null); } return(WidgetRegistry.GetBackend(image)); }
public void UpdateLabel(NotebookTab tab, string hint) { IWidgetBackend widget = (IWidgetBackend)WidgetRegistry.GetBackend(tab.Child); var v = GetWidget(widget); var t = FindTab(v); if (t != null) { t.Label = tab.Label; } }
public override void InitializeApplication() { NSApplication.Init(); //Hijack (); pool = new NSAutoreleasePool(); NSApplication.SharedApplication.Delegate = appDelegate; WidgetRegistry.RegisterBackend(typeof(Xwt.Window), typeof(WindowBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.Label), typeof(LabelBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.HBox), typeof(BoxBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.VBox), typeof(BoxBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.Button), typeof(ButtonBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.Notebook), typeof(NotebookBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.TreeView), typeof(TreeViewBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.ListView), typeof(ListViewBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.Canvas), typeof(CanvasBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.Drawing.Image), typeof(ImageHandler)); WidgetRegistry.RegisterBackend(typeof(Xwt.Drawing.Context), typeof(ContextBackendHandler)); WidgetRegistry.RegisterBackend(typeof(Xwt.Drawing.ImageBuilder), typeof(ImageBuilderBackendHandler)); WidgetRegistry.RegisterBackend(typeof(Xwt.Drawing.ImagePattern), typeof(ImagePatternBackendHandler)); WidgetRegistry.RegisterBackend(typeof(Xwt.Drawing.Gradient), typeof(GradientBackendHandler)); WidgetRegistry.RegisterBackend(typeof(Xwt.Drawing.TextLayout), typeof(TextLayoutBackendHandler)); WidgetRegistry.RegisterBackend(typeof(Xwt.Drawing.Font), typeof(FontBackendHandler)); WidgetRegistry.RegisterBackend(typeof(Xwt.Menu), typeof(MenuBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.MenuItem), typeof(MenuItemBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.CheckBoxMenuItem), typeof(CheckBoxMenuItemBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.RadioButtonMenuItem), typeof(RadioButtonMenuItemBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.SeparatorMenuItem), typeof(SeparatorMenuItemBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.ComboBox), typeof(ComboBoxBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.ComboBoxEntry), typeof(ComboBoxEntryBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.TextEntry), typeof(TextEntryBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.ImageView), typeof(ImageViewBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.Table), typeof(BoxBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.CheckBox), typeof(CheckBoxBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.Frame), typeof(FrameBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.ScrollView), typeof(ScrollViewBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.ToggleButton), typeof(ToggleButtonBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.VSeparator), typeof(SeparatorBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.HSeparator), typeof(SeparatorBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.HPaned), typeof(PanedBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.VPaned), typeof(PanedBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.Backends.IAlertDialogBackend), typeof(AlertDialogBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.StatusIcon), typeof(StatusIconBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.ProgressBar), typeof(ProgressBarBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.ListStore), typeof(Xwt.DefaultListStoreBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.LinkLabel), typeof(LinkLabelBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.Placement), typeof(BoxBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.Spinner), typeof(SpinnerBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.SpinButton), typeof(SpinButtonBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.Expander), typeof(ExpanderBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.Popover), typeof(PopoverBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.SelectFolderDialog), typeof(SelectFolderDialogBackend)); WidgetRegistry.RegisterBackend(typeof(Xwt.OpenFileDialog), typeof(OpenFileDialogBackend)); }