コード例 #1
0
ファイル: Gallery.cs プロジェクト: samiudheen/mono-soc-2007
        private void expand_Clicked(object Sender, EventArgs e)
        {
            GalleryPopupWindow popup = new GalleryPopupWindow(this);

            popup.ShowAll();

            int x, y;

            ParentWindow.GetRootOrigin(out x, out y);
            x += Allocation.X;
            y += Allocation.Y;

            popup.GdkWindow.Move(x, y);
        }
コード例 #2
0
ファイル: Gallery.cs プロジェクト: MASGAU/gtk-sharp-ribbon
        private void OnButtonReleased(object o, ButtonReleaseEventArgs args)
        {
            if(popup != null) {
                Grab.Remove(popup);
                Gdk.Pointer.Ungrab(0);
                Gdk.Keyboard.Ungrab(0);

                popup.Hide ();
                popup.Destroy();
                popup = null;
            }
        }
コード例 #3
0
ファイル: Gallery.cs プロジェクト: MASGAU/gtk-sharp-ribbon
        private void expand_ValueChanged(object Sender, EventArgs e)
        {
            if(expand.Value)
            {
                popup = new GalleryPopupWindow (this);
                popup.Realized += delegate {
                    int x, y;
                    ParentWindow.GetOrigin (out x, out y);
                    x += Allocation.X;
                    y += Allocation.Y;
                    popup.GdkWindow.Move (x, y);
                };

                popup.Hidden += delegate {
                    expand.ValueChanged -= expand_ValueChanged;
                    expand.Value = false;
                    expand.QueueDraw ();
                    expand.ValueChanged += expand_ValueChanged;
                };
                popup.Show ();

                popup.ButtonReleaseEvent += OnButtonReleased;
                popup.AddEvents ((int) Gdk.EventMask.ButtonPressMask);
                Grab.Add(popup);

                Gdk.GrabStatus grabbed = Gdk.Pointer.Grab(popup.GdkWindow, true, Gdk.EventMask.ButtonReleaseMask, null, null, 0);
                if(grabbed == Gdk.GrabStatus.Success) {
                    grabbed = Gdk.Keyboard.Grab(popup.GdkWindow, true, 0);

                    if(grabbed != Gdk.GrabStatus.Success)
                    {
                        Grab.Remove(popup);
                        popup.Hide ();
                        popup.Destroy();
                        popup = null;

                        return;
                    }
                } else {
                    Grab.Remove(popup);
                    popup.Hide ();
                    popup.Destroy();
                    popup = null;
                }
            }
            else
            {
                if (popup != null)
                {
                    Grab.Remove(popup);
                    popup.Hide ();
                    popup.Destroy();
                    popup = null;
                }
            }
        }
コード例 #4
0
ファイル: Gallery.cs プロジェクト: JianwenSun/mono-soc-2007
		private void expand_Clicked(object Sender, EventArgs e)
		{
			GalleryPopupWindow popup = new GalleryPopupWindow (this);
			popup.ShowAll ();
			
			int x, y;
			ParentWindow.GetRootOrigin (out x, out y);
			x += Allocation.X;
			y += Allocation.Y;
			
			popup.GdkWindow.Move (x, y);
		}