Example #1
0
    protected void OnToolboxSizeAllocated(object o, Gtk.SizeAllocatedArgs args)
    {
        Gtk.Frame fActive = (Gtk.Frame)o;
        Gtk.Frame fOther  = (o == fToolsRight)?fToolsLeft:fToolsRight;
        Settings.Instance.ToolboxOnRight = (fActive == fToolsRight);                    //recently touched frame becomes stored in preferences

        if (args.Allocation.Width < 5)
        {
            if (fOther.Visible)                         //ignore, if the other frame is already visible;
            {
                return;
            }
            fActive.Show();
            fOther.Show();
        }
        else
        {
            if (!fOther.Visible)                        //ignore, if the other frame is already hidden;
            {
                return;
            }
            fActive.WidthRequest = 1;
            fActive.Show();
            aTools.Reparent(fActive);
            fOther.Hide();
        }
    }
    void showWidgets(Constants.BellModes bellMode, Constants.EncoderVariablesCapture encoderMainVariable, EncoderRhythm encoderRhythm)
    {
        frame_best_and_worst.Hide();
        frame_conditions.Hide();
        hbox_jump_best_worst.Hide();
        hbox_run_best_worst.Hide();
        hbox_jump_conditions.Hide();
        hbox_run_conditions.Hide();
        frame_encoder_automatic_conditions.Hide();
        vbox_encoder_manual.Hide();
        notebook_encoder_conditions.Hide();
        vbox_encoder_stuff.Hide();

        notebook_main.GetNthPage(RHYTHMPAGE).Hide();
        notebook_main.ShowTabs = false;

        if (bellMode == Constants.BellModes.JUMPS)
        {
            frame_best_and_worst.Show();
            hbox_jump_best_worst.Show();
            hbox_jump_conditions.Show();
            frame_conditions.Show();
        }
        else if (bellMode == Constants.BellModes.RUNS)
        {
            frame_best_and_worst.Show();
            hbox_run_best_worst.Show();
            hbox_run_conditions.Show();
            frame_conditions.Show();
        }
        else             //encoder (grav and inertial)
        {
            vbox_encoder_stuff.Show();
            frame_encoder_automatic_conditions.Show();
            notebook_main.ShowTabs = true;

            vbox_encoder_manual.Show();
            if (checkbutton_encoder_show_manual_feedback.Active)
            {
                notebook_encoder_conditions.Show();
            }

            combo_encoder_main_variable.Active = UtilGtk.ComboMakeActive(combo_encoder_main_variable,
                                                                         Constants.GetEncoderVariablesCapture(encoderMainVariable));

            notebook_main.GetNthPage(RHYTHMPAGE).Show();
            encoder_rhythm_set_values(encoderRhythm);
        }

        label_test_sound_result.Text = "";
    }
Example #3
0
        public AudioView()
        {
            //			this.WidthRequest = 500; //250;
            //			this.HeightRequest = 375; //187;

            Frame frame = new Frame();
            frame.BorderWidth = 5;
            frame.Show();

            VBox vbox = new VBox(false, 0);
            frame.Add(vbox);
            vbox.Show();

            Label label = new Label(Catalog.GetString("Audio Chat in progress..."));

            label.Show();
            vbox.PackStart(label, false, true, 5);

            Button button = new Button(Catalog.GetString("End Call"));
            button.Clicked += OnCloseAudioClicked;
            button.Show();
            vbox.PackStart(button, false, true, 5);

            this.Add(frame);
        }
Example #4
0
 internal DesignSurfaceViewContent(string designerFile)
 {
     _loaded            = false;
     _designerFile      = designerFile;
     _propertyGridFrame = new Gtk.Frame();
     _propertyGridFrame.Show();
     _surfaceFrame = new DesignSurfaceViewFrame(_propertyGridFrame);
     _surfaceFrame.Show();
 }
Example #5
0
		public void Attach (DockToolbar bar)
		{
			this.bar = bar;
			bar.FloatingDock = this;
			Frame f = new Frame ();
			f.Shadow = ShadowType.Out;
			f.Add (bar);
			Add (f);
			f.Show ();
			bar.Show ();
			Show ();
		}
Example #6
0
        public VideoView()
        {
            preview_pos = PreviewPos.ButtonRight;

            VBox vbox = new VBox(false, 0);
            vbox.Show();

            Frame frame = new Frame();
            //frame.BorderWidth = 5;
            frame.Show();

            vbox.Add(frame);

            mainView = new Gtk.EventBox();
            mainView.WidthRequest = 400;
            mainView.HeightRequest = 300;
            mainView.ModifyBg (Gtk.StateType.Normal, new Gdk.Color (255,255,255));
            mainView.ModifyBg (Gtk.StateType.Active, new Gdk.Color (255,255,255));
            mainView.Show();

            //this.WidthRequest = 333; // 500; //250;
            //this.HeightRequest = 250; // 375; //187; 250
            preview = new Gtk.DrawingArea ();
            preview.WidthRequest = 120; // 75; //150;
            preview.HeightRequest = 90; // 56; //112;
            preview.ModifyBg (Gtk.StateType.Normal, new Gdk.Color (0,0,0));
            preview.ModifyBg (Gtk.StateType.Active, new Gdk.Color (0,0,0));
            preview.Show();

            fix = new Gtk.Fixed ();
            fix.Put (preview, space, space);
            fix.Show();
            mainView.Add(fix);

            frame.Add(mainView);

            //			Label label = new Label(Catalog.GetString("Video Chat in progress..."));

            //			label.Show();
            //			vbox.PackStart(label, false, true, 0);

            Button button = new Button(Catalog.GetString("End Call"));
            button.Clicked += OnCloseVideoClicked;
            button.Show();
            vbox.PackStart(button, false, false, 5);

            this.Add(vbox);
            mainView.SizeAllocated += OnSizeAllocated;
            //			this.SizeRequested += OnsizeRequested;
            this.QueueResize ();
            MovePreview ();
        }
		public RemoteDesignerProcess ()
		{
			Application.Init ();
			
			designerFrame = new Gtk.Frame ();
			propGridFrame = new Gtk.Frame ();
			designerFrame.Shadow = ShadowType.None;
			propGridFrame.Shadow = ShadowType.None;
			designerFrame.BorderWidth = 0;
			
			designerFrame.Show ();
			propGridFrame.Show ();
		}
    void showWidgets(Constants.BellModes bellMode)
    {
        frame_best_and_worst.Hide();
        frame_conditions.Hide();
        hbox_jump_best_worst.Hide();
        hbox_run_best_worst.Hide();
        hbox_jump_conditions.Hide();
        hbox_run_conditions.Hide();
        frame_encoder_automatic_conditions.Hide();
        vbox_encoder_manual.Hide();
        notebook_encoder_conditions.Hide();

        if (bellMode == Constants.BellModes.JUMPS)
        {
            frame_best_and_worst.Show();
            hbox_jump_best_worst.Show();
            hbox_jump_conditions.Show();
            frame_conditions.Show();
        }
        else if (bellMode == Constants.BellModes.RUNS)
        {
            frame_best_and_worst.Show();
            hbox_run_best_worst.Show();
            hbox_run_conditions.Show();
            frame_conditions.Show();
        }
        else                                             //encoder
        {
            notebook_encoder_conditions.CurrentPage = 3; //power
            frame_encoder_automatic_conditions.Show();
            vbox_encoder_manual.Show();
            if (checkbutton_encoder_show_manual_feedback.Active)
            {
                notebook_encoder_conditions.Show();
            }
        }
    }
		internal AspNetEditViewContent (IViewContent viewContent)
		{
			this.viewContent = viewContent;

			designerFrame = new Frame ();
			designerFrame.CanFocus = true;
			designerFrame.Shadow = ShadowType.Out;
			designerFrame.BorderWidth = 1;
			
			viewContent.WorkbenchWindow.Closing += new WorkbenchWindowEventHandler(workbenchWindowClosingHandler);
			
			outlineStore = null;
			outlineView = null;
			
			designerFrame.Show ();
		}
        public DateEdit(System.DateTime time, DateEditFlags flags)
        {
            datetime          = new DateTimeZone(time);
            datetime.Changed += HandleDateTimeZoneChanged;
            this.flags        = flags;

            date_entry            = new Gtk.Entry();
            date_entry.WidthChars = 10;
            date_entry.Changed   += HandleDateEntryChanged;
            PackStart(date_entry, true, true, 0);

            Gtk.HBox b_box = new Gtk.HBox();
            b_box.PackStart(new Gtk.Label(Catalog.GetString("Calendar")), true, true, 0);
            b_box.PackStart(new Gtk.Arrow(Gtk.ArrowType.Down, Gtk.ShadowType.Out), true, false, 0);
            date_button          = new Gtk.Button(b_box);
            date_button.Clicked += HandleCalendarButtonClicked;
            PackStart(date_button, false, false, 0);

            calendar              = new Gtk.Calendar();
            calendar.DaySelected += HandleCalendarDaySelected;
            Gtk.Frame frame = new Gtk.Frame();
            frame.Add(calendar);
            cal_popup = new Gtk.Window(Gtk.WindowType.Popup);
            cal_popup.DestroyWithParent = true;
            cal_popup.Add(frame);
            cal_popup.Shown      += HandleCalendarPopupShown;
            cal_popup.GrabNotify += HandlePopupGrabNotify;
            frame.Show();
            calendar.Show();

            time_entry            = new Gtk.Entry();
            time_entry.WidthChars = 8;
            time_entry.Changed   += HandleTimeEntryChanged;
            PackStart(time_entry, true, true, 0);

            Gtk.CellRendererText timecell = new Gtk.CellRendererText();
            time_combo       = new Gtk.ComboBox();
            time_store       = new Gtk.TreeStore(typeof(string), typeof(int), typeof(int));
            time_combo.Model = time_store;
            time_combo.PackStart(timecell, true);
            time_combo.SetCellDataFunc(timecell, new CellLayoutDataFunc(TimeCellFunc));
            time_combo.Realized += FillTimeCombo;
            time_combo.Changed  += HandleTimeComboChanged;
            PackStart(time_combo, false, false, 0);

            zone_entry            = new Gtk.Entry();
            zone_entry.IsEditable = false;
            zone_entry.MaxLength  = 6;
            zone_entry.WidthChars = 6;
            PackStart(zone_entry, true, true, 0);

            Gtk.CellRendererText offsetcell = new Gtk.CellRendererText();
            offset_combo       = new Gtk.ComboBox();
            offset_combo.Model = new Gtk.TreeStore(typeof(string), typeof(int));
            offset_combo.PackStart(offsetcell, true);
            offset_combo.SetCellDataFunc(offsetcell, new CellLayoutDataFunc(OffsetCellFunc));
            FillOffsetCombo();
            offset_combo.Changed += HandleOffsetComboChanged;
            PackStart(offset_combo, false, false, 0);

            Update();
            ShowAll();
        }
Example #11
0
        private void AddSection (Section section)
        {
            Frame frame = null;

            if (section.Count == 0) {
                return;
            }

            if (section.ShowLabel) {
                frame = new Frame ();
                Label label = new Label ();
                label.Markup = String.Format ("<b>{0}</b>", GLib.Markup.EscapeText (section.Name));
                label.UseUnderline = true;
                label.Show ();
                frame.LabelWidget = label;
                frame.LabelXalign = 0.0f;
                frame.LabelYalign = 0.5f;
                frame.Shadow = ShadowType.None;
                frame.Show ();
                PackStart (frame, false, false, 0);
            }

            Alignment alignment = new Alignment (0.0f, 0.0f, 1.0f, 1.0f);
            alignment.TopPadding = (uint)(frame == null ? 0 : 5);
            alignment.LeftPadding = section.ShowLabel ? (uint)12 : (uint)0;
            alignment.Show ();

            if (frame != null) {
                frame.Add (alignment);
            } else {
                PackStart (alignment, false, false, 0);
            }

            SectionBox box = new SectionBox (section);
            box.Show ();

            alignment.Add (box);
        }
        public QueryBuilder(QueryBuilderModel model)
            : base()
        {
            this.model = model;

            matchesBox = new QueryBuilderMatches(model);
            matchesBox.Spacing = 5;
            matchesBox.Show();

            Alignment matchesAlignment = new Alignment(0.0f, 0.0f, 1.0f, 1.0f);
            matchesAlignment.Show();
            matchesAlignment.SetPadding(10, 10, 10, 10);
            matchesAlignment.Add(matchesBox);

            Frame matchesFrame = new Frame(null);
            matchesFrame.Show();
            matchesFrame.Add(matchesAlignment);

            matchesFrame.LabelWidget = BuildMatchHeader();

            PackStart(matchesFrame, true, true, 0);
            PackStart(BuildLimitFooter(), false, false, 0);
        }
Example #13
0
        private void PrepareGUI()
        {
            Glade.XML gladeXML = Glade.XML.FromAssembly("blam.glade",
                                                        "mainWindow", null);
            gladeXML.Autoconnect(this);

            channelList = new ChannelList(mCollection);
            ((Container)channelListSw).Child = channelList;

            channelList.ChannelSelectedEvent   += ChannelSelected;
            channelList.EditChannelEvent       += EditChannelActivated;
            channelList.MarkChannelAsReadEvent += MarkChannelAsReadActivated;
            channelList.RemoveChannelEvent     += RemoveChannelActivated;
            channelList.RefreshChannelEvent    += RefreshChannelActivated;

			itemList = new ItemList(itemView, channelList);
			((Container)itemListSw).Child = itemList;

            itemView = new ItemView(itemList);

            Frame f = new Frame ();
            f.Shadow = ShadowType.In;
            f.Add (itemView);
            itemPaned.Add2 (f);
            f.Show ();
            itemView.OnUrl += OnUrl;

			// a bit silly to do it every time, but works
			itemList.PropertyChanged += (sender, e) => printMenuItem.Sensitive = true;

            trayIcon = new TrayIcon (Catalog.GetString ("Blam News Reader"), mCollection);
            trayIcon.ButtonPressEvent += TrayIconButtonPressCb;
            trayIcon.RefreshAllEvent += RefreshAllActivated;
            trayIcon.PreferencesEvent += PreferencesActivated;
            trayIcon.AboutEvent += AboutActivated;
            trayIcon.QuitEvent += QuitActivated;

            channelsLabelText = channelsLabel.Text;
            UpdateTotalNumberOfUnread ();

            printMenuItem.Sensitive = false;
            SensitizeChannelMenuItems(false);

            // Setup drag-n-drop
            Gtk.Drag.DestSet(mainWindow, DestDefaults.All,
                             DragEntries, DragAction.Copy | DragAction.Move);
            mainWindow.DragDataReceived += DragDataReceivedCb;

            RestoreWindowState();

            mainWindow.IconName = "blam";

            mainWindow.ShowAll ();

            bool ShowItemList = Conf.Get(Preference.SHOW_ITEM_LIST, true);
            if(ShowItemList){
                itemPaned.Child1.Visible = true;
            } else {
                itemPaned.Child1.Visible = false;
            }

            channelDialog = new ChannelDialog (this);
            addGroupDialog = new AddGroupDialog (this);
            preferencesDialog = new PreferencesDialog (this.Window);
            opmlDialog = new OpmlDialog (this.Window);
            opmlDialog.ChannelAdded += channel => mCollection.Add(channel, true);
            opmlDialog.ImportFinished += OpmlImportFinished;

        }
Example #14
0
        public void ShowCalendar()
        {
            popup = new Window(WindowType.Popup);
            popup.Screen = parent.Screen;

            Frame frame = new Frame();
            frame.Shadow = ShadowType.Out;
            frame.Show();

            popup.Add(frame);

            VBox box = new VBox(false, 0);
            box.Show();
            frame.Add(box);

            cal = new Calendar();
            cal.DisplayOptions = CalendarDisplayOptions.ShowHeading
                                 | CalendarDisplayOptions.ShowDayNames
                                 | CalendarDisplayOptions.ShowWeekNumbers;

            cal.KeyPressEvent += OnCalendarKeyPressed;
            popup.ButtonPressEvent += OnButtonPressed;

            cal.Show();

            Alignment calAlignment = new Alignment(0.0f, 0.0f, 1.0f, 1.0f);
            calAlignment.Show();
            calAlignment.SetPadding(4, 4, 4, 4);
            calAlignment.Add(cal);

            box.PackStart(calAlignment, false, false, 0);

            //Requisition req = SizeRequest();

            parent.GdkWindow.GetOrigin(out xPos, out yPos);
            //			popup.Move(x + Allocation.X, y + Allocation.Y + req.Height + 3);
            popup.Move(xPos, yPos);
            popup.Show();
            popup.GrabFocus();

            Grab.Add(popup);

            Gdk.GrabStatus grabbed = Gdk.Pointer.Grab(popup.GdkWindow, true,
                                     Gdk.EventMask.ButtonPressMask
                                     | Gdk.EventMask.ButtonReleaseMask
                                     | Gdk.EventMask.PointerMotionMask, null, null, CURRENT_TIME);

            if (grabbed == Gdk.GrabStatus.Success) {
                grabbed = Gdk.Keyboard.Grab(popup.GdkWindow,
                                            true, CURRENT_TIME);

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

            cal.DaySelected += OnCalendarDaySelected;
            cal.MonthChanged += OnCalendarMonthChanged;

            cal.Date = date;
        }
Example #15
0
        private void BuildPopup(double min, double max, double step)
        {
            dock = new Window(WindowType.Popup);
            dock.Screen = Screen;
            dock.ButtonPressEvent += OnDockButtonPressEvent;
            dock.KeyPressEvent += OnDockKeyPressEvent;
            dock.KeyReleaseEvent += OnDockKeyReleaseEvent;
            dock.ScrollEvent += OnPlusMinusScollEvent;
            dock.Hidden += OnDockHidden;

            Frame frame = new Frame();
            frame.Shadow = ShadowType.Out;
            frame.Show();

            dock.Add(frame);

            VBox box = new VBox(false, 0);
            box.Show();

            frame.Add(box);

            Label label = new Label();
            label.Markup = "<b><big>+</big></b>";
            plus = new Button(label);
            plus.Relief = ReliefStyle.None;
            plus.ButtonPressEvent += OnPlusMinusButtonPressEvent;
            plus.ButtonReleaseEvent += OnPlusMinusButtonReleaseEvent;
            plus.ScrollEvent += OnPlusMinusScollEvent;
            plus.ShowAll();
            box.PackStart(plus, false, true, 0);

            slider = new VolumeScale(this, min, max, step);
            slider.SetSizeRequest(-1, SCALE_SIZE);
            slider.DrawValue = false;
            slider.Inverted = true;
            slider.Show();
            box.PackStart(slider, true, true, 0);

            label = new Label();
            label.Markup = "<b><big>\u2212</big></b>";
            minus = new Button(label);
            minus.Relief = ReliefStyle.None;
            minus.ButtonPressEvent += OnPlusMinusButtonPressEvent;
            minus.ButtonReleaseEvent += OnPlusMinusButtonReleaseEvent;
            minus.ScrollEvent += OnPlusMinusScollEvent;
            minus.ShowAll();
            box.PackEnd(minus, false, true, 0);

            Show();
        }
		public DateEdit (System.DateTime time, DateEditFlags flags)
		{
			datetime = new DateTimeZone (time);
			datetime.Changed += HandleDateTimeZoneChanged;
			this.flags = flags;

			date_entry = new Gtk.Entry ();
			date_entry.WidthChars = 10;
			date_entry.Changed += HandleDateEntryChanged;
			PackStart (date_entry, true, true, 0);
		
			Gtk.HBox b_box = new Gtk.HBox ();
			b_box.PackStart (new Gtk.Label (Catalog.GetString ("Calendar")), true, true, 0);
			b_box.PackStart (new Gtk.Arrow(Gtk.ArrowType.Down, Gtk.ShadowType.Out), true, false, 0);
			date_button = new Gtk.Button (b_box);
			date_button.Clicked += HandleCalendarButtonClicked;
			PackStart (date_button, false, false, 0);

			calendar = new Gtk.Calendar ();
			calendar.DaySelected += HandleCalendarDaySelected;
			Gtk.Frame frame = new Gtk.Frame ();
			frame.Add (calendar);
			cal_popup = new Gtk.Window (Gtk.WindowType.Popup);
			cal_popup.DestroyWithParent = true;
			cal_popup.Add (frame);
			cal_popup.Shown += HandleCalendarPopupShown;
			cal_popup.GrabNotify += HandlePopupGrabNotify;
			frame.Show ();
			calendar.Show ();

			time_entry = new Gtk.Entry ();
			time_entry.WidthChars = 8;
			time_entry.Changed += HandleTimeEntryChanged;
			PackStart (time_entry, true, true, 0);

			Gtk.CellRendererText timecell = new Gtk.CellRendererText ();
			time_combo = new Gtk.ComboBox ();
			time_store = new Gtk.TreeStore (typeof (string), typeof (int), typeof (int)); 
			time_combo.Model = time_store;
			time_combo.PackStart (timecell, true);
			time_combo.SetCellDataFunc (timecell, new CellLayoutDataFunc (TimeCellFunc));
			time_combo.Realized += FillTimeCombo;
			time_combo.Changed += HandleTimeComboChanged;
			PackStart (time_combo, false, false, 0);

			zone_entry = new Gtk.Entry ();
			zone_entry.IsEditable = false;
			zone_entry.MaxLength = 6;
			zone_entry.WidthChars = 6;
			PackStart (zone_entry, true, true, 0);

			Gtk.CellRendererText offsetcell = new Gtk.CellRendererText ();
			offset_combo = new Gtk.ComboBox ();
			offset_combo.Model = new Gtk.TreeStore (typeof (string), typeof (int));
			offset_combo.PackStart (offsetcell, true);
			offset_combo.SetCellDataFunc (offsetcell, new CellLayoutDataFunc (OffsetCellFunc));
			FillOffsetCombo ();
			offset_combo.Changed += HandleOffsetComboChanged;
			PackStart (offset_combo, false, false, 0);

			Update ();
			ShowAll ();
		}
Example #17
0
        private void inicia()
        {
            /* Create a new window */
                        Window window = new Window ("Ejemplo de frames y tal ...");

                        /* Here we connect the "destroy" event to a signal handler */
                        window.DeleteEvent += delete_event;

                        window.SetSizeRequest(500, 400);
                        /* Sets the border width of the window. */
                        window.BorderWidth= 10;

                        /* Create a Frame */
                        //Frame frame = new Frame("MyFrame");
            frame = new Frame("MyFrame");
                        window.Add(frame);

                        /* Set the frame's label */
                        frame.Label = "Mueveme!!!!";

                        /* Align the label at the right of the frame */

                        //frame.SetLabelAlign((float)1.0,(float)0.0); esta anticuado
            //valores entre 0.0 y 1.0, indica cada extremo
            frame.LabelXalign = (float)1.0;
            frame.LabelYalign = (float)1.0;

                        /* Set the style of the frame */
                        frame.ShadowType = (ShadowType) 4;

            /* aƱade mis cositas*/
            frame.Add(rellenoDelFrame());

                        frame.Show();

                        /* Display the window & all widgets*/
                        window.ShowAll();
        }
Example #18
0
        private void ShowCalendar()
        {
            popup = new Window(WindowType.Popup);
            popup.Screen = tree.Screen;

            Frame frame = new Frame();
            frame.Shadow = ShadowType.Out;
            frame.Show();

            popup.Add(frame);

            VBox box = new VBox(false, 0);
            box.Show();
            frame.Add(box);

            cal = new Calendar();
            cal.DisplayOptions = CalendarDisplayOptions.ShowHeading
                                 | CalendarDisplayOptions.ShowDayNames
                                 | CalendarDisplayOptions.ShowWeekNumbers;

            cal.KeyPressEvent += OnCalendarKeyPressed;
            popup.ButtonPressEvent += OnButtonPressed;

            cal.Show();

            Alignment calAlignment = new Alignment(0.0f, 0.0f, 1.0f, 1.0f);
            calAlignment.Show();
            calAlignment.SetPadding(4, 4, 4, 4);
            calAlignment.Add(cal);

            box.PackStart(calAlignment, false, false, 0);

            // FIXME: Make the popup appear directly below the date
            Gdk.Rectangle allocation = tree.Allocation;
            //   Gtk.Requisition req = tree.SizeRequest ();
            int x = 0, y = 0;
            tree.GdkWindow.GetOrigin(out x, out y);
            //   popup.Move(x + allocation.X, y + allocation.Y + req.Height + 3);
            popup.Move(x + allocation.X, y + allocation.Y);
            popup.Show();
            popup.GrabFocus();

            Grab.Add(popup);

            Gdk.GrabStatus grabbed = Gdk.Pointer.Grab(popup.GdkWindow, true,
                                     Gdk.EventMask.ButtonPressMask
                                     | Gdk.EventMask.ButtonReleaseMask
                                     | Gdk.EventMask.PointerMotionMask, null, null, CURRENT_TIME);

            if (grabbed == Gdk.GrabStatus.Success) {
                grabbed = Gdk.Keyboard.Grab(popup.GdkWindow,
                                            true, CURRENT_TIME);

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

            cal.DaySelectedDoubleClick += OnCalendarDaySelected;
            cal.ButtonPressEvent += OnCalendarButtonPressed;

            cal.Date = date == DateTime.MinValue ? DateTime.Now : date;
        }
        void CreateWidget()
        {
            Homogeneous = false;
            Spacing = 1;

            Add (date_entry = new Entry () {WidthChars = 10, IsEditable = true});
            date_entry.Changed += HandleDateEntryChanged;
            date_entry.Show ();
            var bbox = new HBox ();
            Widget w;
            bbox.Add (w = calendar_label = new Label (Catalog.GetString ("Calendar")));
            w.Show ();
            bbox.Add (w = new Arrow (ArrowType.Down, ShadowType.Out));
            w.Show ();
            bbox.Show ();
            Add (date_button = new Button (bbox));
            date_button.Clicked += HandleCalendarButtonClicked;
            date_button.Show ();
            Add (time_entry = new Entry () {WidthChars = 12, IsEditable = true});
            time_entry.Changed += HandleTimeEntryChanged;
            time_entry.Show ();
            Add (offset_entry = new Entry () {WidthChars = 6, IsEditable = true});
            offset_entry.Changed += HandleOffsetEntryChanged;
            offset_entry.Show ();

            calendar = new Calendar ();
            calendar.DaySelected += HandleCalendarDaySelected;
            calendar.DaySelectedDoubleClick += HandleCalendarDaySelectedDoubleClick;
            var frame = new Frame ();
            frame.Add (calendar);
            calendar.Show ();
            calendar_popup = new Window (WindowType.Popup) {DestroyWithParent = true, Resizable = false};
            calendar_popup.Add (frame);
            calendar_popup.DeleteEvent += HandlePopupDeleted;
            calendar_popup.KeyPressEvent += HandlePopupKeyPressed;
            calendar_popup.ButtonPressEvent += HandlePopupButtonPressed;
            frame.Show ();

            UpdateWidget ();
        }
		internal DesignSurfaceViewContent (string designerFile)
		{
			_loaded = false;
			_designerFile = designerFile;
			_propertyGridFrame = new Gtk.Frame ();
			_propertyGridFrame.Show ();
			_surfaceFrame = new DesignSurfaceViewFrame (_propertyGridFrame);
			_surfaceFrame.Show ();
		}
        public SqlQueryView()
            : base()
        {
            control = new Frame ();
            control.Show ();

            VBox vbox = new VBox ();
            vbox.Show ();

            Tooltips tips = new Tooltips ();

            Toolbar toolbar = new Toolbar ();
            vbox.PackStart 	(toolbar, false, true, 0);
            toolbar.Show ();

            Image image = new Image ();
            image.Pixbuf = Gdk.Pixbuf.LoadFromResource ("MonoQuery.Execute");
            image.Show ();

            Button execute = new Button (image);
            execute.Clicked += new EventHandler (OnExecute);
            execute.Relief = ReliefStyle.None;
            tips.SetTip (execute, "Execute", "");
            toolbar.Add (execute);
            execute.Show ();

            image = new Image ();
            image.Pixbuf = Gdk.Pixbuf.LoadFromResource ("MonoQuery.RunFromCursor");
            image.Show ();

            Button run = new Button (image);
            run.Clicked += new EventHandler (OnRunFromCursor);
            run.Relief = ReliefStyle.None;
            tips.SetTip (run, "Run from cursor", "");
            toolbar.Add (run);
            run.Show ();

            image = new Image ();
            image.Pixbuf = Gdk.Pixbuf.LoadFromResource ("MonoQuery.Explain");
            image.Show ();

            Button explain = new Button (image);
            explain.Clicked += new EventHandler (OnExplain);
            explain.Relief = ReliefStyle.None;
            tips.SetTip (explain, "Explain query", "");
            toolbar.Add (explain);
            explain.Show ();

            image = new Image ();
            image.Pixbuf = Gdk.Pixbuf.LoadFromResource ("MonoQuery.Stop");
            image.Show ();

            Button stop = new Button (image);
            stop.Clicked += new EventHandler (OnStop);
            stop.Relief = ReliefStyle.None;
            stop.Sensitive = false;
            tips.SetTip (stop, "Stop", "");
            toolbar.Add (stop);
            stop.Show ();

            VSeparator sep = new VSeparator ();
            toolbar.Add (sep);
            sep.Show ();

            model = new ListStore (typeof (string), typeof (DbProviderBase));

            providers = new ComboBox ();
            providers.Model = model;
            CellRendererText ctext = new CellRendererText ();
            providers.PackStart (ctext, true);
            providers.AddAttribute (ctext, "text", 0);
            toolbar.Add (providers);
            providers.Show ();

            SourceLanguagesManager lm = new SourceLanguagesManager ();
            SourceLanguage lang = lm.GetLanguageFromMimeType ("text/x-sql");
            SourceBuffer buf = new SourceBuffer (lang);
            buf.Highlight = true;
            sourceView = new SourceView (buf);
            sourceView.ShowLineNumbers = true;
            sourceView.Show ();

            ScrolledWindow scroller = new ScrolledWindow ();
            scroller.Add (sourceView);
            scroller.Show ();
            vbox.PackStart (scroller, true, true, 0);

            control.Add (vbox);

            service = (MonoQueryService)
                ServiceManager.GetService (typeof (MonoQueryService));
            changedHandler
                 = (EventHandler) Runtime.DispatchService.GuiDispatch (
                    new EventHandler (OnProvidersChanged));
            service.Providers.Changed += changedHandler;

            foreach (DbProviderBase p in service.Providers) {
                model.AppendValues (p.Name, p);
            }
        }