コード例 #1
0
ファイル: CanvasHost.cs プロジェクト: sundermann/cubano
        protected override void OnRealized()
        {
            base.OnRealized();

            WindowAttr attributes = new WindowAttr();

            attributes.WindowType = Gdk.WindowType.Child;
            attributes.X          = Allocation.X;
            attributes.Y          = Allocation.Y;
            attributes.Width      = Allocation.Width;
            attributes.Height     = Allocation.Height;
            attributes.Wclass     = WindowClass.InputOnly;
            attributes.EventMask  = (int)(
                EventMask.PointerMotionMask |
                EventMask.ButtonPressMask |
                EventMask.ButtonReleaseMask |
                EventMask.EnterNotifyMask |
                EventMask.LeaveNotifyMask |
                EventMask.ExposureMask);

            WindowAttributesType attributes_mask =
                WindowAttributesType.X | WindowAttributesType.Y | WindowAttributesType.Wmclass;

            event_window          = new Gdk.Window(GdkWindow, attributes, attributes_mask);
            event_window.UserData = Handle;

            AllocateChild();
            QueueResize();
        }
コード例 #2
0
ファイル: GtkEmbed2.cs プロジェクト: philstopford/Eto
        // Methods
        protected override void OnRealized()
        {
            WidgetFlags |= WidgetFlags.Realized;
            WindowAttr attributes = default(WindowAttr);

            attributes.X          = Allocation.X;
            attributes.Y          = Allocation.Y;
            attributes.Height     = Allocation.Height;
            attributes.Width      = Allocation.Width;
            attributes.WindowType = Gdk.WindowType.Child;
            attributes.Wclass     = WindowClass.InputOutput;
            attributes.Visual     = Visual;
            attributes.TypeHint   = (WindowTypeHint)100;
            attributes.Colormap   = Colormap;
            attributes.EventMask  = (int)(Events | EventMask.ExposureMask | EventMask.Button1MotionMask | EventMask.ButtonPressMask | EventMask.ButtonReleaseMask | EventMask.KeyPressMask | EventMask.KeyReleaseMask);
            WindowAttributesType attributes_mask = WindowAttributesType.X | WindowAttributesType.Y | WindowAttributesType.Colormap | WindowAttributesType.Visual;

            GdkWindow          = new Gdk.Window(ParentWindow, attributes, (int)attributes_mask);
            GdkWindow.UserData = Handle;
            Style = Style.Attach(GdkWindow);
            Style.SetBackground(GdkWindow, State);
            WidgetFlags &= ~WidgetFlags.NoWindow;
            NSView nSView = GtkMacInterop.GetNSView(this);

            nSView.RemoveFromSuperview();
            embedParent.AddSubview(nSView);
            nSView.Frame = new CGRect(0, 0, embedParent.Frame.Width, embedParent.Frame.Height);
        }
コード例 #3
0
        protected override void OnRealized()
        {
            WidgetFlags |= WidgetFlags.Realized | WidgetFlags.NoWindow;

            GdkWindow             = Parent.GdkWindow;
            cell_context.Drawable = GdkWindow;

            WindowAttr attributes = new WindowAttr();

            attributes.WindowType = Gdk.WindowType.Child;
            attributes.X          = Allocation.X;
            attributes.Y          = Allocation.Y;
            attributes.Width      = Allocation.Width;
            attributes.Height     = Allocation.Height;
            attributes.Wclass     = WindowClass.InputOnly;
            attributes.EventMask  = (int)(
                EventMask.PointerMotionMask |
                EventMask.KeyPressMask |
                EventMask.KeyReleaseMask |
                EventMask.ButtonPressMask |
                EventMask.ButtonReleaseMask |
                EventMask.LeaveNotifyMask |
                EventMask.ExposureMask);

            WindowAttributesType attributes_mask =
                WindowAttributesType.X | WindowAttributesType.Y | WindowAttributesType.Wmclass;

            event_window          = new Gdk.Window(GdkWindow, attributes, attributes_mask);
            event_window.UserData = Handle;

            OnDragSourceSet();
            MoveResize(Allocation);

            base.OnRealized();
        }
コード例 #4
0
        /// <summary>
        /// Called when the window is realized (shown).
        /// </summary>
        protected override void OnRealized()
        {
            WidgetFlags |= WidgetFlags.Realized;
            var attributes = new WindowAttr();

            attributes.WindowType = WindowType.Child;
            attributes.X          = Allocation.X;
            attributes.Y          = Allocation.Y;
            attributes.Width      = Allocation.Width;
            attributes.Height     = Allocation.Height;
            attributes.Wclass     = WindowClass.InputOutput;
            attributes.Visual     = Visual;
            attributes.Colormap   = Colormap;
            attributes.EventMask  = (int)(Events | EventMask.ExposureMask);
            attributes.Mask       = Events | EventMask.ExposureMask;

            const WindowAttributesType mask =
                WindowAttributesType.X | WindowAttributesType.Y
                | WindowAttributesType.Colormap | WindowAttributesType.Visual;

            GdkWindow          = new Window(ParentWindow, attributes, mask);
            GdkWindow.UserData = Raw;
            Style        = Style.Attach(GdkWindow);
            WidgetFlags &= ~WidgetFlags.NoWindow;
        }
コード例 #5
0
        protected override void OnRealized()
        {
            WidgetFlags |= WidgetFlags.Realized | WidgetFlags.NoWindow;
            GdkWindow    = Parent.GdkWindow;

            WindowAttr attributes = new WindowAttr();

            attributes.WindowType = WindowType.Child;
            attributes.X          = Allocation.X;
            attributes.Y          = Allocation.Y;
            attributes.Width      = Allocation.Width;
            attributes.Height     = Allocation.Height;
            attributes.Wclass     = WindowClass.InputOnly;
            attributes.EventMask  = (int)(EventMask.ButtonPressMask | EventMask.ButtonReleaseMask | EventMask.ButtonMotionMask);

            const WindowAttributesType attributesMask = WindowAttributesType.X | WindowAttributesType.Y | WindowAttributesType.Wmclass;

            eventWindow          = new Window(GdkWindow, attributes, attributesMask);
            eventWindow.UserData = Handle;

            base.OnRealized();
        }
コード例 #6
0
        protected override void OnRealized()
        {
            WidgetFlags |= WidgetFlags.Realized;
            WindowAttr attributes = new WindowAttr()
            {
                WindowType = Gdk.WindowType.Child,
                X          = Allocation.X,
                Y          = Allocation.Y,
                Width      = Allocation.Width,
                Height     = Allocation.Height,
                Wclass     = WindowClass.InputOutput,
                Visual     = this.Visual,
                Colormap   = this.Colormap,
                EventMask  = (int)(this.Events | Gdk.EventMask.ExposureMask),
                Mask       = this.Events | Gdk.EventMask.ExposureMask,
            };

            WindowAttributesType mask = WindowAttributesType.X | WindowAttributesType.Y | WindowAttributesType.Colormap | WindowAttributesType.Visual;

            GdkWindow          = new Gdk.Window(ParentWindow, attributes, mask);
            GdkWindow.UserData = Raw;
            Style = Style.Attach(GdkWindow);
        }
コード例 #7
0
        protected override void OnRealized()
        {
            IsRealized = true;
            HasWindow  = false;

            Window = Parent.Window;

            WindowAttr attributes = new WindowAttr();

            attributes.WindowType = Gdk.WindowType.Child;
            attributes.X          = Allocation.X;
            attributes.Y          = Allocation.Y;
            attributes.Width      = Allocation.Width;
            attributes.Height     = Allocation.Height;
            attributes.Wclass     = WindowWindowClass.InputOnly;
            attributes.EventMask  = (int)(
                EventMask.PointerMotionMask |
                EventMask.KeyPressMask |
                EventMask.KeyReleaseMask |
                EventMask.ButtonPressMask |
                EventMask.ButtonReleaseMask |
                EventMask.ScrollMask |
                EventMask.LeaveNotifyMask |
                EventMask.ExposureMask);

            WindowAttributesType attributes_mask =
                WindowAttributesType.X | WindowAttributesType.Y | WindowAttributesType.Wmclass;

            event_window          = new Gdk.Window(Window, attributes, attributes_mask);
            event_window.UserData = Handle;

            OnDragSourceSet();
            MoveResize(Allocation);

            base.OnRealized();
        }