public ModelElementTypeViewer(IBroadcaster hub)
 {
     _hub = hub;
     base.PackStart(new Gtk.Label("Model Element type:"), false, false, 2);
     _lblType = new Gtk.Label();
     base.PackStart(_lblType, false, false, 2);
     base.PackStart(new Gtk.Label(String.Empty), true, true, 0);
     // "Up" button
     Gtk.Image image = new Gtk.Image();
     image.Stock = Gtk.Stock.GoUp;
     _btnGoUp = new Gtk.Button();
     _btnGoUp.Add(image);
     _btnGoUp.Relief = Gtk.ReliefStyle.None;
     _btnGoUp.Clicked += new EventHandler(OnGoUpButtonClicked);
     _btnGoUp.Sensitive = false;
     base.PackStart(_btnGoUp, false, false, 0);
     // "Delete" button
     image = new Gtk.Image();
     image.Stock = Gtk.Stock.Delete;
     Gtk.Button btnDelete = new Gtk.Button();
     btnDelete.Add(image);
     btnDelete.Relief = Gtk.ReliefStyle.None;
     btnDelete.Clicked += new EventHandler(OnDeleteButtonClicked);
     btnDelete.Sensitive = true;
     base.PackStart(btnDelete, false, false, 0);
 }
Example #2
0
		public Tab (string tabName)
		{
			if (tabName == null)
				throw new ArgumentNullException ("tabName");

			Label label = new Label (tabName); 
			label.Justify = Justification.Left;
			label.UseUnderline = false;
			
			Gtk.Image image = new Gtk.Image (Stock.Close, IconSize.Menu);
			image.Xalign = 0.5f;
			image.Yalign = 0.5f;
 
			Button button = new Button ();
			button.HeightRequest = 20;
			button.WidthRequest = 20;
			button.Relief = ReliefStyle.None;
			button.CanFocus = false;
			button.Clicked += delegate {
				if (CloseButtonClicked != null)
					CloseButtonClicked (this, EventArgs.Empty);
			};
			button.Add (image);

			this.PackStart (label, true, true, 0);
			this.PackEnd (button, false, false, 0);
			this.ShowAll ();
		}
Example #3
0
		public ViewOrderDetailEdit() : base()
		{
			rex = new Regex(@"(?<int>\d*)?(?<sep>.)?(?<dec>\d*)?");
			ni = (System.Globalization.NumberFormatInfo)System.Globalization.CultureInfo.CurrentUICulture.NumberFormat.Clone();
			ni.NumberDecimalSeparator = ".";
			
			this.Resize(this.NRows, this.NColumns+1 );
						
			spinprice.FocusGrabbed += this.OnActive;
			spinprice.IsEditable = false;
			spinquant.FocusGrabbed += this.OnActive;
			spinquant.IsEditable = false;
			
			Button butclearprice;
			butclearprice = new Button();
			butclearprice.Add( new Image(Stock.Clear, IconSize.Button) );
			butclearprice.Clicked += OnClearPrice;
			butclearprice.CanFocus = false;
			
			Button butclearquant;
			butclearquant = new Button();
			butclearquant.Add( new Image(Stock.Clear, IconSize.Button) );
			butclearquant.Clicked += OnClearQuant;
			butclearquant.CanFocus = false;
			
			this.Attach(butclearprice,2,3,1,2,AttachOptions.Expand,AttachOptions.Fill,0,0);
			this.Attach(butclearquant,2,3,2,3,AttachOptions.Expand,AttachOptions.Fill,0,0);
			
			this.ShowAll();
		}
Example #4
0
 // Constructor
 private NoteBookLabel(DI.Diagram diagram)
     : base(1, 3, false)
 {
     _parent = null;
     _diagram = diagram;
     //this must change depending of the diagram's type
     string diagramType = ((DI.SimpleSemanticModelElement)diagram.SemanticModel).TypeInfo;
     _icon = GetIcon(diagramType);
     //_icon = new Gdk.Pixbuf (new Gdk.Colorspace(), false, 8, 15, 15);
     //_icon.Fill (0xffff0000);
     //
     Attach(new Gtk.Image(_icon), 0, 1, 0, 1);
     //
     _label = new Label(_diagram.Name);
     Attach(_label, 1, 2, 0, 1);
     //
     Image image = new Image();
     image.Stock = Gtk.Stock.Close;
     _close_button = new Button();
     _close_button.Add(image);
     _close_button.HeightRequest = 20;
     _close_button.WidthRequest = 20;
     _close_button.Relief = Gtk.ReliefStyle.None;
     _close_button.Clicked += OnCloseButtonClicked;
     Tooltips ttips = new Tooltips ();
     ttips.SetTip (_close_button, GettextCatalog.GetString ("Close diagram"), GettextCatalog.GetString ("Close diagram"));
     //_close_button.
     Attach(_close_button, 2, 3, 0, 1);
     ShowAll();
 }
		/*
		 * Constructor
		 */
		public FindBar (PhotoQuery query, TreeModel model) : base(new HBox())
		{
			this.query = query;
            box = Child as HBox;

			box.Spacing = 6;
            box.BorderWidth = 2;

			box.PackStart (new Label (Catalog.GetString ("Find:")), false, false, 0);

			entry = new Entry ();
			entry.Completion = new LogicEntryCompletion (entry, model);

			entry.TextInserted  += HandleEntryTextInserted;
			entry.TextDeleted   += HandleEntryTextDeleted;
			entry.KeyPressEvent += HandleEntryKeyPress;

			box.PackStart (entry, true, true, 0);

			Button clear_button = new Gtk.Button ();
			clear_button.Add (new Gtk.Image ("gtk-close", Gtk.IconSize.Button));
			clear_button.Clicked += HandleCloseButtonClicked;
			clear_button.Relief = Gtk.ReliefStyle.None;
			box.PackStart (clear_button, false, false, 0);
		}
Example #6
0
        /*
         * Constructor
         */
        public FindBar(PhotoQuery query, TreeModel model) : base(new HBox())
        {
            this.query = query;
            box        = Child as HBox;

            box.Spacing     = 6;
            box.BorderWidth = 2;

            box.PackStart(new Label(Catalog.GetString("Find:")), false, false, 0);

            entry            = new Entry();
            entry.Completion = new LogicEntryCompletion(entry, model);

            entry.TextInserted  += HandleEntryTextInserted;
            entry.TextDeleted   += HandleEntryTextDeleted;
            entry.KeyPressEvent += HandleEntryKeyPress;

            box.PackStart(entry, true, true, 0);

            Button clear_button = new Gtk.Button();

            clear_button.Add(new Gtk.Image("gtk-close", Gtk.IconSize.Button));
            clear_button.Clicked += HandleCloseButtonClicked;
            clear_button.Relief   = Gtk.ReliefStyle.None;
            box.PackStart(clear_button, false, false, 0);
        }
Example #7
0
		public ViewNameIcon() : base()
		{
			upbutton = new Button();
			upbutton.Add( new Image(Stock.GoUp, IconSize.Button) );
			upbutton.Clicked += OnUpClicked;
			downbutton = new Button();			
			downbutton.Add( new Image(Stock.GoDown, IconSize.Button) );
			downbutton.Clicked += OnDownClicked;
			swindow = new ScrolledWindow();
			view = new IconView();
			
			CellRendererPixbuf cellicon= new CellRendererPixbuf();
			CellRendererText celltext = new CellRendererText();
			celltext.Xalign=0.5f;
			view.PackStart(cellicon, false);
			view.SetCellDataFunc(cellicon, CellRenderFunctions.RenderIcon);
			view.PackStart(celltext, false);
			view.SetCellDataFunc(celltext, CellRenderFunctions.RenderName);
			view.SelectionMode = Gtk.SelectionMode.Browse;
			view.SelectionChanged += OnSelectionChanged;
			view.ItemActivated += OnRowActivated;
			swindow.Add(view);
			swindow.HscrollbarPolicy = PolicyType.Never;
			swindow.VscrollbarPolicy = PolicyType.Automatic;
			this.PackStart(upbutton, false, false, 0);
			this.PackStart(swindow, true, true, 0);
			this.PackStart(downbutton, false, false, 0);
			
			store = new StoreBase();
			view.Model=store.ViewModel;
			
			ShowAll();
		}
Example #8
0
        public static void NextPlayer(string name)
        {
            var but = new Gtk.Button( );

            but.TooltipMarkup = "Po kliknutí bude hrát další hráč";
            HBox hbox = new HBox();

            global::Gtk.Image im = new global::Gtk.Image();
            Label             l  = new Label();

            l.Markup = "Na tahu je hráč:\n <b>" + name + "</b>\n\nOK";
            hbox.PackStart(im);
            hbox.PackEnd(l);
            but.Add(hbox);
            var win = new Gtk.Window(Gtk.WindowType.Toplevel);

            but.Clicked += delegate {
                win.HideAll();
                win.Dispose();
                win.Destroy();
            };
            win.Add(but);
            win.Fullscreen();
            win.ShowAll();
        }
Example #9
0
 public static Button CreateSmallStockButton(string stock)
 {
     Button button = new Button ();
     Image image = new Image (stock, IconSize.Menu);
     button.Add (image);
     button.Relief = ReliefStyle.None;
     image.Show ();
     return button;
 }
Example #10
0
        Gtk.Widget CreatePopupButton()
        {
            this.popupButton = new Gtk.Button {
                WidthRequest = 20,
                CanFocus     = true
            };

            popupButton.Add(new Gtk.Arrow(Gtk.ArrowType.Down, Gtk.ShadowType.Out));

            return(popupButton);
        }
Example #11
0
		Gtk.Widget CreatePopupButton ()
		{
			this.popupButton = new Gtk.Button {
				WidthRequest = 20,
				CanFocus = true
			};

			popupButton.Add (new Gtk.Arrow (Gtk.ArrowType.Down, Gtk.ShadowType.Out));

			return popupButton;
		}
Example #12
0
		public static Button create_button_stock_image(String stockid,String tooltip){
			Button tb = new  Button(stockid);
			tb.Remove(tb.Child);
			VBox v = new VBox();
			v.Add(new Gtk.Image(tb.RenderIcon(stockid,IconSize.SmallToolbar,tooltip)));
			tb.Add(v);
			tb.WidthRequest = 30;
			tb.CanFocus = false;
			tb.TooltipText = tooltip;
			tb.HasTooltip = true;
			return tb;
		}
Example #13
0
		private Gtk.Button MakeButton (Gtk.HBox header, string icon, EventHandler handler)
		{
			Gtk.Button button = new Gtk.Button ();
			Gtk.Image img = new Gtk.Image (icon, Gtk.IconSize.Button);
			button.Add (img);
			button.Relief = Gtk.ReliefStyle.None;
			button.Clicked += handler;

			header.PackStart (button, false, false, 0);
			button.ShowAll ();

			return button;
		}
Example #14
0
        private Gtk.Button MakeButton(Gtk.HBox header, string icon, EventHandler handler)
        {
            Gtk.Button button = new Gtk.Button();
            Gtk.Image  img    = new Gtk.Image(icon, Gtk.IconSize.Button);
            button.Add(img);
            button.Relief   = Gtk.ReliefStyle.None;
            button.Clicked += handler;

            header.PackStart(button, false, false, 0);
            button.ShowAll();

            return(button);
        }
Example #15
0
        private Gtk.Button StockButton(string stockid, string label)
        {
            Gtk.HBox button_contents = new HBox(false, 0);
            button_contents.Show();
            Gtk.Widget button_image = new Gtk.Image(stockid, Gtk.IconSize.Button);
            button_image.Show();
            button_contents.PackStart(button_image, false, false, 1);
            Gtk.Label button_label = new Gtk.Label(label);
            button_label.Show();
            button_contents.PackStart(button_label, false, false, 1);

            Gtk.Button button = new Gtk.Button();
            button.Add(button_contents);

            return(button);
        }
Example #16
0
		public ViewOrderEdit() : base()
		{
			comboorder = new ComboBoxOrders();
			comboorder.Changed += OnOrderChanged;
			comboorder.WidthRequest = 200;
			
			butneworder = new Button();
			butneworder.Add( new Image(Stock.New, IconSize.Button) );
			butneworder.Clicked += OnNewOrderClicked;
			
			buteditorder = new Button();
			buteditorder.Add( new Image(Stock.Edit, IconSize.Button) );
			buteditorder.Clicked += OnEditOrderClicked;

			butdelorder = new Button();
			butdelorder.Add( new Image(Stock.Delete, IconSize.Button) );
			butdelorder.Clicked += OnDeleteOrderClicked;

			HBox hb = new HBox();
			hb.PackStart(butdelorder, false, false, 0);
			hb.PackStart(comboorder,true, true, 0 );
			hb.PackStart(butneworder, false, false, 0 );
			hb.PackStart(buteditorder, false,false,0 );
			
			viewtot = new ViewOrderTotal();
			
			view = new ViewOrderDetails();
			view.HeaderVisible = true;
			view.FilterColumn="OrderId";			
			view.SelectionChanged += OnOrderDetailChanged;
			
			Frame frame = new Frame();
			frame.Label = "Oder item";
			viewdet = new ViewOrderDetailEdit();
			frame.Add(viewdet);
			
			pad = new KeyPad();
			pad.Clicked += OnPadClicked;
			
			PackStart(hb, false, true, 0);
			PackStart(viewtot, false, true, 3);
			PackStart(view, true, true, 3);
			PackStart(frame, false, false,3);
			PackStart(pad, false, true, 3);
		}
Example #17
0
        public void AddWidget(KeyAction action, string desc, HotKey key, int position)
        {
            uint row_top, row_bottom, col_left, col_right;
            HBox box;
            Label descLabel, keyLabel;
            Button edit;
            Gtk.Image editImage;

            box = new HBox ();
            box.Spacing = 5;
            descLabel = new Label ();
            descLabel.Markup = String.Format ("<b>{0}</b>", desc);
            keyLabel = new Label ();
            keyLabel.Markup = GLib.Markup.EscapeText (key.ToString());
            edit = new Button ();
            editImage = new Gtk.Image (LongoMatch.Gui.Helpers.Misc.LoadIcon ("longomatch-pencil", 24));
            edit.Add (editImage);
            box.PackStart (descLabel, true, true, 0);
            box.PackStart (keyLabel, false, true, 0);
            box.PackStart (edit, false, true, 0);
            box.ShowAll ();

            sgroup.AddWidget (keyLabel);
            descLabel.Justify = Justification.Left;
            descLabel.SetAlignment (0f, 0.5f);
            edit.Clicked += (sender, e) => {
                HotKey hotkey = Config.GUIToolkit.SelectHotkey (key);
                if (hotkey != null) {
                    if (Config.Hotkeys.ActionsHotkeys.ContainsValue (hotkey)) {
                        Config.GUIToolkit.ErrorMessage (Catalog.GetString ("Hotkey already in use: ") +
                                                        GLib.Markup.EscapeText (hotkey.ToString()), this);
                    } else {
                        Config.Hotkeys.ActionsHotkeys[action] = hotkey;
                        Config.Save ();
                        keyLabel.Markup = GLib.Markup.EscapeText (hotkey.ToString());
                    }
                }
            };

            row_top = (uint)(position / table.NColumns);
            row_bottom = (uint)row_top + 1;
            col_left = (uint)position % table.NColumns;
            col_right = (uint)col_left + 1;
            table.Attach (box, col_left, col_right, row_top, row_bottom);
        }
        public TabLabel(Label label, Gtk.Image icon)
            : base(false, 2)
        {
            this.icon = icon;
            this.PackStart (icon, false, true, 2);

            title = label;
            this.PackStart (title, true, true, 0);

            btn = new Button ();
            btn.Add (new Gtk.Image (GetType().Assembly, "MonoDevelop.Close.png"));
            btn.Relief = ReliefStyle.None;
            btn.SetSizeRequest (18, 18);
            this.PackStart (btn, false, false, 2);
            this.ClearFlag (WidgetFlags.CanFocus);

            this.ShowAll ();
        }
Example #19
0
        public MainWindow(HttpAgent httpAgent, IRepositoryFactory repositoryFactory)
            : base(Gtk.WindowType.Toplevel)
        {
            this.httpAgent = httpAgent;

            WindowPosition = WindowPosition.Center;

            rekeningRepository = repositoryFactory.CreateRepository<IRekeningRepository>();
            consumptieRepository = repositoryFactory.CreateRepository<IConsumptieRepository>();

            // Rekeningen overzicht
            rekeningOverzichtWidget = new RekeningOverzichtWidget();
            rekeningOverzichtWidget.Refresh(rekeningRepository.GetAll());
            rekeningOverzichtWidget.RekeningClicked += handleRekeningClicked;

            // Afrekenen button
            Pango.FontDescription fontDescription = Pango.FontDescription.FromString("Arial");
            fontDescription.Size = 13000;
            fontDescription.Weight = Pango.Weight.Bold;
            Label afrekenenLabel = new Label("Afrekenen");
            afrekenenLabel.ModifyFont(fontDescription);
            afrekenenButton = new Button();
            afrekenenButton.Add(afrekenenLabel);
            afrekenenButton.Clicked += handleAfrekenenButtonClicked;

            // Rechter panel (bestellingen)
            bestellingenOverzichtWidget = new BestellingenOverzichtWidget();

            box = new HBox(false, 3);
            box.PackStart(rekeningOverzichtWidget);
            box.PackStart(bestellingenOverzichtWidget);

            // Main box
            vbox = new VBox(false, 0);
            vbox.PackStart(box);
            vbox.PackEnd(afrekenenButton);
            Add(vbox);

            ShowAll();

            this.DeleteEvent += OnDeleteEvent;
        }
            // FIXME clicking the spinbutton too fast seems to switch the view to browse

            public FaceBox(Gtk.Box tb, PhotoImageView vw) : base()
            {
                m_list     = new ArrayList();
                face_store = Core.Database.Faces;
                View       = vw;
                tag_store  = FSpot.Core.Database.Tags;

                Gtk.Label lab = new Gtk.Label("Face det:");
                lab.Show();
                tb.PackStart(lab, false, true, 0);

                face_button = new ToolbarButton();
                face_button.Add(new Gtk.Image("f-spot-sepia", IconSize.Button));
                tb.PackStart(face_button, false, true, 0);

                face_button.Clicked += HandleFaceButtonClicked;

                tag_entry = new Gtk.Entry("test");
                tag_entry.Show();
                tag_entry.Sensitive = false;
                tb.PackStart(tag_entry, false, true, 0);

                m_newtag_button = new  ToolbarButton();
                m_newtag_button.Add(new Gtk.Image("f-spot-new-tag", IconSize.Button));
                m_newtag_button.Show();
                m_newtag_button.Sensitive = false;
                tb.PackStart(m_newtag_button, false, true, 0);

                m_newtag_button.Clicked += HandleNewTagButtonClicked;

                m_spin = new SpinButton(1, 1, 1);
                m_spin.Show();
                m_spin.Sensitive = false;
                tb.PackStart(m_spin, false, true, 0);

                m_spin.Changed += HandleSpinChanged;

                //m.spin.ValueChanged += jesli w bazie, to pokaz jego tag
                //this.Add(tag_widget);
            }
Example #21
0
		public ViewBase() : base()
		{	
			upbutton = new Button();
			upbutton.Add( new Image(Stock.GoUp, IconSize.Button) );
			upbutton.Clicked += OnUpClicked;
			downbutton = new Button();
			downbutton.Add( new Image(Stock.GoDown, IconSize.Button) );
			downbutton.Clicked += OnDownClicked;
			swindow = new ScrolledWindow();
			treeview = new TreeView();
			treeview.Selection.Changed += OnSelectionChanged;
			treeview.RowActivated += OnRowActivated;
			swindow.Add(treeview);
			this.PackStart(upbutton, false, false, 0);
			this.PackStart(swindow, true, true, 0);
			this.PackStart(downbutton, false, false, 0);
			
			store = new StoreBase();
			treeview.Model=store.ViewModel;
			
			ShowAll();
		}
Example #22
0
		static void SetButtonIcon (Button button, string stockIcon)
		{
			Alignment alignment = new Alignment (0.5f, 0.5f, 0f, 0f);
			Label label = new Label (button.Label);
			HBox hbox = new HBox (false, 2);
			Image image = new Image ();
			
			image.Pixbuf = Stetic.IconLoader.LoadIcon (button, stockIcon, IconSize.Button);
			image.Show ();
			hbox.Add (image);
			
			label.Show ();
			hbox.Add (label);
			
			hbox.Show ();
			alignment.Add (hbox);
			
			button.Child.Destroy ();
			
			alignment.Show ();
			button.Add (alignment);
		}
Example #23
0
        public static void Main(string[] args)
        {
            Application.Init();

                        /* Create a new window */
                        Window window = new Window ("Pixmap'd Buttons!");

                        /* It's a good idea to do this for all windows. */
                        window.DeleteEvent += delete_event;

                        /* Sets the border width of the window. */
                        window.BorderWidth = 10;

            window.Resize(400,300);

                        /* Create a new button */
                        Button button = new Button();

                        /* Connect the "clicked" signal of the button to our callback */
                        button.Clicked += callback;

                        /* This calls our box creating function */
                        Widget box = xpm_label_box ("info.xpm", "cool button");

                        /* Pack and show all our widgets */
                        box.Show();

                        button.Add(box);

                        button.Show();

                        window.Add(button);

                        window.ShowAll();

                        /* Rest in gtk_main and wait for the fun to begin! */
                        Application.Run();
        }
Example #24
0
        public GroupSelector()
            : base()
        {
            SetFlag (WidgetFlags.NoWindow);

            background = Rectangle.Zero;
            glass = new Glass (this);
            min_limit = new Limit (this, Limit.LimitType.Min);
            max_limit = new Limit (this, Limit.LimitType.Max);

            left = new Gtk.Button ();
            //left.Add (new Gtk.Image (Gtk.Stock.GoBack, Gtk.IconSize.Button));
            left.Add (new Gtk.Arrow (Gtk.ArrowType.Left, Gtk.ShadowType.None));
            left.Relief = Gtk.ReliefStyle.None;
            //left.Clicked += HandleScrollLeft;
            left.Pressed += HandleLeftPressed;
            left.ButtonReleaseEvent += HandleScrollReleaseEvent;
            left_delay = new Delay (50, new GLib.IdleHandler (HandleScrollLeft));

            right = new Gtk.Button ();
            //right.Add (new Gtk.Image (Gtk.Stock.GoForward, Gtk.IconSize.Button));
            right.Add (new Gtk.Arrow (Gtk.ArrowType.Right, Gtk.ShadowType.None));
            right.Relief = Gtk.ReliefStyle.None;
            right.Pressed += HandleRightPressed;
            right.ButtonReleaseEvent += HandleScrollReleaseEvent;
            right_delay = new Delay (50, new GLib.IdleHandler (HandleScrollRight));
            //right.Clicked += HandleScrollRight;

            this.Put (left, 0, 0);
            this.Put (right, 100, 0);
            left.Show ();
            right.Show ();

            CanFocus = true;

            Mode = RangeType.Min;
            UpdateButtons ();
        }
        protected DockItemGrip()
        {
            WidgetFlags |= WidgetFlags.NoWindow;

            Widget.PushCompositeChild ();
            closeButton = new Button ();
            Widget.PopCompositeChild ();

            closeButton.WidgetFlags &= ~WidgetFlags.CanFocus;
            closeButton.Parent = this;
            closeButton.Relief = ReliefStyle.None;
            closeButton.Show ();

            Image image = new Image (GdlStock.Close, IconSize.Menu);
            closeButton.Add (image);
            image.Show ();

            closeButton.Clicked += new EventHandler (CloseClicked);

            Widget.PushCompositeChild ();
            iconifyButton = new Button ();
            Widget.PopCompositeChild ();

            iconifyButton.WidgetFlags &= ~WidgetFlags.CanFocus;
            iconifyButton.Parent = this;
            iconifyButton.Relief = ReliefStyle.None;
            iconifyButton.Show ();

            image = new Image (GdlStock.MenuLeft, IconSize.Menu);
            iconifyButton.Add (image);
            image.Show ();

            iconifyButton.Clicked += new EventHandler (IconifyClicked);

            tooltips = new Tooltips ();
            tooltips.SetTip (iconifyButton, "Iconify", "Iconify this dock");
            tooltips.SetTip (closeButton, "Close", "Close this dock");
        }
Example #26
0
        public GroupSelector() : base()
        {
            SetFlag(WidgetFlags.NoWindow);

            background = Rectangle.Zero;
            glass      = new Glass(this);
            min_limit  = new Limit(this, Limit.LimitType.Min);
            max_limit  = new Limit(this, Limit.LimitType.Max);

            left = new Gtk.Button();
            //left.Add (new Gtk.Image (Gtk.Stock.GoBack, Gtk.IconSize.Button));
            left.Add(new Gtk.Arrow(Gtk.ArrowType.Left, Gtk.ShadowType.None));
            left.Relief = Gtk.ReliefStyle.None;
            //left.Clicked += HandleScrollLeft;
            left.Pressed            += HandleLeftPressed;
            left.ButtonReleaseEvent += HandleScrollReleaseEvent;
            left_delay = new DelayedOperation(50, new GLib.IdleHandler(HandleScrollLeft));

            right = new Gtk.Button();
            //right.Add (new Gtk.Image (Gtk.Stock.GoForward, Gtk.IconSize.Button));
            right.Add(new Gtk.Arrow(Gtk.ArrowType.Right, Gtk.ShadowType.None));
            right.Relief              = Gtk.ReliefStyle.None;
            right.Pressed            += HandleRightPressed;
            right.ButtonReleaseEvent += HandleScrollReleaseEvent;
            right_delay = new DelayedOperation(50, new GLib.IdleHandler(HandleScrollRight));
            //right.Clicked += HandleScrollRight;

            this.Put(left, 0, 0);
            this.Put(right, 100, 0);
            left.Show();
            right.Show();

            CanFocus = true;

            Mode = RangeType.Min;
            UpdateButtons();
        }
        private void Build()
        {
            box = new HBox(false, 0);
            box.SetSizeRequest(40, 40);
            box.BorderWidth = 2;

            button          = new Button();
            button.Clicked += CyclePoint;

            lblpoints = new Label();
            Pango.FontDescription desc = Pango.FontDescription.FromString("Bebas Neue 14");
            lblpoints.ModifyFont(desc);
            lblpoints.Text = points[10];


            button.Add(lblpoints);
            button.ShowAll();

            box.Add(this.button);
            box.ShowAll();

            // This damn this call is anoyingly needed otherwise it shant build
            this.Add(box);
        }
Example #28
0
	public DocumentTab (Notebook docTabs) : base ()
	{
		doc_tabs = docTabs;
		InitializeProperties ();
		
		editor = new DocumentEditor ();
		this.Add (editor);
		
		tab_label = new HBox (false, 2);
		title_label = new Label ("Untitled");
		
		// Close tab button
		Button tabClose = new Button ();
		Image img = new Image (Stock.Close, IconSize.SmallToolbar);
		tabClose.Add (img);
		tabClose.Relief = ReliefStyle.None;
		tabClose.SetSizeRequest (23, 23);
		tabClose.Clicked += new EventHandler (OnTabClose);
		
		tab_label.PackStart (title_label, true, true, 0);
		tab_label.PackStart (tabClose, false, false, 2);
		
		tab_label.ShowAll ();
	}
Example #29
0
        public ComparisonWidget(VersionControlDocumentInfo info)
        {
            vAdjustment          = new Adjustment(0, 0, 0, 0, 0, 0);
            vAdjustment.Changed += HandleAdjustmentChanged;

            vScrollBar = new VScrollbar(vAdjustment);
            AddChild(vScrollBar);
            vScrollBar.Hide();

            hAdjustment          = new Adjustment(0, 0, 0, 0, 0, 0);
            hAdjustment.Changed += HandleAdjustmentChanged;

            leftHScrollBar = new HScrollbar(hAdjustment);
            AddChild(leftHScrollBar);

            rightHScrollBar = new HScrollbar(hAdjustment);
            AddChild(rightHScrollBar);

            originalComboBox      = new DropDownBox();
            originalComboBox.Text = "Local";
            AddChild(originalComboBox);

            originalEditor = new TextEditor();
            AddChild(originalEditor);
            originalEditor.SetScrollAdjustments(hAdjustment, vAdjustment);

            diffComboBox      = new DropDownBox();
            diffComboBox.Text = "Base";
            AddChild(diffComboBox);

            diffEditor = new TextEditor();

            AddChild(diffEditor);
            diffEditor.Document.ReadOnly = true;
            diffEditor.SetScrollAdjustments(hAdjustment, vAdjustment);
            this.vAdjustment.ValueChanged += delegate {
                middleArea.QueueDraw();
            };

            overview = new OverviewRenderer(this);
            AddChild(overview);

            middleArea = new MiddleArea(this);
            AddChild(middleArea);

            prev = new Button();
            prev.Add(new Arrow(ArrowType.Up, ShadowType.None));
            AddChild(prev);
            prev.ShowAll();
            prev.Clicked += delegate {
                if (this.Diff == null)
                {
                    return;
                }
                originalEditor.GrabFocus();

                int line = originalEditor.Caret.Line;
                int max = -1, searched = -1;
                foreach (Diff.Hunk hunk in this.Diff)
                {
                    if (hunk.Same)
                    {
                        continue;
                    }
                    max = System.Math.Max(hunk.Left.Start, max);
                    if (hunk.Left.Start < line)
                    {
                        searched = System.Math.Max(hunk.Left.Start, searched);
                    }
                }
                if (max >= 0)
                {
                    originalEditor.Caret.Line = searched < 0 ? max : searched;
                    originalEditor.CenterToCaret();
                }
            };

            next             = new Button();
            next.BorderWidth = 0;
            next.Add(new Arrow(ArrowType.Down, ShadowType.None));
            next.Clicked += delegate {
                if (this.Diff == null)
                {
                    return;
                }
                originalEditor.GrabFocus();

                int line = originalEditor.Caret.Line;
                int min = Int32.MaxValue, searched = Int32.MaxValue;
                foreach (Diff.Hunk hunk in this.Diff)
                {
                    if (hunk.Same)
                    {
                        continue;
                    }
                    min = System.Math.Min(hunk.Left.Start, min);
                    if (hunk.Left.Start > line)
                    {
                        searched = System.Math.Min(hunk.Left.Start, searched);
                    }
                }
                if (min < Int32.MaxValue)
                {
                    originalEditor.Caret.Line = searched == Int32.MaxValue ? min : searched;
                    originalEditor.CenterToCaret();
                }
            };
            AddChild(next);
            next.ShowAll();

            this.DoubleBuffered         = true;
            originalEditor.ExposeEvent += HandleLeftEditorExposeEvent;
            diffEditor.ExposeEvent     += HandleRightEditorExposeEvent;
        }
Example #30
0
		public ComparisonWidget (VersionControlDocumentInfo info)
		{
			this.info = info;
			vAdjustment = new Adjustment (0, 0, 0, 0, 0, 0);
			vAdjustment.Changed += HandleAdjustmentChanged;
			leftVAdjustment = new Adjustment (0, 0, 0, 0, 0, 0);
			Connect (leftVAdjustment, vAdjustment);
			
			rightVAdjustment =  new Adjustment (0, 0, 0, 0, 0, 0);
			Connect (rightVAdjustment, vAdjustment);
			
			vScrollBar = new VScrollbar (vAdjustment);
			AddChild (vScrollBar);
			vScrollBar.Hide ();
			
			hAdjustment = new Adjustment (0, 0, 0, 0, 0, 0);
			hAdjustment.Changed += HandleAdjustmentChanged;
			leftHAdjustment = new Adjustment (0, 0, 0, 0, 0, 0);
			Connect (leftHAdjustment, hAdjustment);
			
			rightHAdjustment =  new Adjustment (0, 0, 0, 0, 0, 0);
			Connect (rightHAdjustment, hAdjustment);
			
			leftHScrollBar = new HScrollbar (hAdjustment);
			AddChild (leftHScrollBar);
			
			rightHScrollBar = new HScrollbar (hAdjustment);
			AddChild (rightHScrollBar);
			
			originalEditor = new TextEditor ();
			originalEditor.Caret.PositionChanged += CaretPositionChanged;
			originalEditor.FocusInEvent += EditorFocusIn;
			AddChild (originalEditor);
			originalEditor.SetScrollAdjustments (leftHAdjustment, leftVAdjustment);
			
			originalComboBox = new DropDownBox ();
			originalComboBox.WindowRequestFunc = CreateComboBoxSelector;
			originalComboBox.Text = "Local";
			originalComboBox.Tag = originalEditor;
			AddChild (originalComboBox);
			
			diffEditor = new TextEditor ();
			diffEditor.Caret.PositionChanged += CaretPositionChanged;
			diffEditor.FocusInEvent += EditorFocusIn;
			
			AddChild (diffEditor);
			diffEditor.Document.ReadOnly = true;
			diffEditor.SetScrollAdjustments (leftHAdjustment, leftVAdjustment);
			this.vAdjustment.ValueChanged += delegate {
				middleArea.QueueDraw ();
			};
			
			diffComboBox = new DropDownBox ();
			diffComboBox.WindowRequestFunc = CreateComboBoxSelector;
			diffComboBox.Text = "Base";
			diffComboBox.Tag = diffEditor;
			AddChild (diffComboBox);
			
			
			overview = new OverviewRenderer (this);
			AddChild (overview);
			
			middleArea = new MiddleArea (this);
			AddChild (middleArea);
			
			prev = new Button ();
			prev.Add (new Arrow (ArrowType.Up, ShadowType.None));
			AddChild (prev);
			prev.ShowAll ();
			prev.Clicked += delegate {
				if (this.Diff == null)
					return;
				originalEditor.GrabFocus ();
				
				int line = originalEditor.Caret.Line;
				int max  = -1, searched = -1;
				foreach (Diff.Hunk hunk in this.Diff) {
					if (hunk.Same)
						continue;
					max = System.Math.Max (hunk.Right.Start, max);
					if (hunk.Right.Start < line)
						searched = System.Math.Max (hunk.Right.Start, searched);
				}
				if (max >= 0) {
					originalEditor.Caret.Line = searched < 0 ? max : searched;
					originalEditor.CenterToCaret ();
				}
			};
			
			next = new Button ();
			next.BorderWidth = 0;
			next.Add (new Arrow (ArrowType.Down, ShadowType.None));
			next.Clicked += delegate {
				if (this.Diff == null)
					return;
				originalEditor.GrabFocus ();
				
				int line = originalEditor.Caret.Line;
				int min  = Int32.MaxValue, searched = Int32.MaxValue;
				foreach (Diff.Hunk hunk in this.Diff) {
					if (hunk.Same)
						continue;
					min = System.Math.Min (hunk.Right.Start, min);
					if (hunk.Right.Start > line)
						searched = System.Math.Min (hunk.Right.Start, searched);
				}
				if (min < Int32.MaxValue) {
					originalEditor.Caret.Line = searched == Int32.MaxValue ? min : searched;
					originalEditor.CenterToCaret ();
				}
			};
			AddChild (next);
			next.ShowAll ();
			
			this.DoubleBuffered = true;
			originalEditor.ExposeEvent += HandleLeftEditorExposeEvent;
			diffEditor.ExposeEvent += HandleRightEditorExposeEvent;
			info.Document.Editor.Document.TextReplaced += HandleInfoDocumentTextEditorDataDocumentTextReplaced;
		}
        private Widget RenderTrack(XmlNode node, int rank)
        {
            Button track_button = new Button ();
            track_button.Relief = ReliefStyle.None;

            HBox box = new HBox ();

            Label label = new Label ();
            label.Ellipsize = Pango.EllipsizeMode.End;
            label.Xalign = 0;
            label.Markup = String.Format ("{0}. {1}", rank, GLib.Markup.EscapeText (node.SelectSingleNode ("name").InnerText).Trim ());

            if (node.SelectSingleNode ("track_id") != null) {
                box.PackEnd (new Image (Gdk.Pixbuf.LoadFromResource("play.png")), false, false, 0);
                track_button.Clicked += delegate(object o, EventArgs args) {
                    PlayerEngineCore.OpenPlay (Globals.Library.GetTrack (Convert.ToInt32 (node.SelectSingleNode ("track_id").InnerText)));
                };
            } else {
                track_button.Clicked += delegate(object o, EventArgs args) {
                    Gnome.Url.Show (node.SelectSingleNode ("url").InnerText);
                };
            }

            box.PackStart (label, true, true, 0);

            track_button.Add (box);

            return track_button;
        }
        private Widget RenderSimilarArtist(XmlNode node)
        {
            Button artist_button = new Button ();
            artist_button.Relief = ReliefStyle.None;

            HBox box = new HBox ();
            Viewport vp = new Viewport ();
            vp.Add (RenderImage (node.SelectSingleNode ("image_small").InnerText));
            box.PackStart (vp, false, false, 0);

            Label label = new Label ();
            label.Ellipsize = Pango.EllipsizeMode.End;
            label.Xalign = 0;

            label.Markup = String.Format ("{0}\n<small><span foreground=\"grey\">{1}% {2}</span></small>",
                              GLib.Markup.EscapeText (node.SelectSingleNode ("name").InnerText).Trim (),
                              node.SelectSingleNode ("match").InnerText,
                              Catalog.GetString ("similarity"));
            box.PackEnd (label, true, true, 3);

            artist_button.Add (box);

            artist_button.Clicked += delegate(object o, EventArgs args) {
                Gnome.Url.Show (node.SelectSingleNode ("url").InnerText);
            };

            return artist_button;
        }
        // FIXME: Image?
        private Widget RenderAlbum(XmlNode node, int rank)
        {
            Button album_button = new Button ();
            album_button.Relief = ReliefStyle.None;

            Label label = new Label ();
            label.Ellipsize = Pango.EllipsizeMode.End;
            label.Xalign = 0;
            label.Markup = String.Format ("{0}. {1}", rank, GLib.Markup.EscapeText (node.SelectSingleNode ("name").InnerText).Trim ());
            album_button.Add (label);

            album_button.Clicked += delegate(object o, EventArgs args) {
                Gnome.Url.Show (node.SelectSingleNode ("url").InnerText);
            };

            return album_button;
        }
        void AppendFile(MediaFile file)
        {
            HBox box;
            Button delButton;
            Gtk.Image delImage;
            VideoFileInfo fileinfo;

            if (file == null)
                return;
            Files.Add (file);
            box = new HBox ();
            delButton = new Button ();
            delButton.Relief = ReliefStyle.None;
            delButton.CanFocus = false;
            delImage = new Gtk.Image ("gtk-remove", IconSize.Button);
            delButton.Add (delImage);
            delButton.Clicked += (object sender, EventArgs e) => {
                filesbox.Remove (box);
                Files.Remove (file);
                CheckStatus ();
            };
            fileinfo = new VideoFileInfo ();
            fileinfo.SetMediaFile (file);
            box.PackStart (fileinfo, true, true, 0);
            box.PackStart (delButton, false, false, 0);
            box.ShowAll ();
            filesbox.PackStart (box, false, true, 0);
        }
Example #35
0
        public void ShowAccountForm()
        {
            Reset ();

            VBox layout_vertical = new VBox (false, 0);

                DeleteEvent += PreventClose;

                Label header = new Label ("<span size='x-large'><b>" +
                                        _("Welcome to SparkleShare!") +
                                          "</b></span>") {
                    UseMarkup = true,
                    Xalign = 0
                };

                Label information = new Label (_("Before we can create a SparkleShare folder on this " +
                                                 "computer, we need a few bits of information from you.")) {
                    Xalign = 0,
                    Wrap   = true
                };

                Table table = new Table (4, 2, true) {
                    RowSpacing = 6
                };

                    UnixUserInfo unix_user_info = new UnixUserInfo (UnixEnvironment.UserName);

                    Label name_label = new Label ("<b>" + _("Full Name:") + "</b>") {
                        UseMarkup = true,
                        Xalign    = 0
                    };

                    NameEntry = new Entry (unix_user_info.RealName);
                    NameEntry.Changed += delegate {
                        CheckAccountForm ();
                    };

                    EmailEntry = new Entry (SparkleShare.Controller.UserEmail);
                    EmailEntry.Changed += delegate {
                        CheckAccountForm ();
                    };

                    Label email_label = new Label ("<b>" + _("Email:") + "</b>") {
                        UseMarkup = true,
                        Xalign    = 0
                    };

                table.Attach (name_label, 0, 1, 0, 1);
                table.Attach (NameEntry, 1, 2, 0, 1);
                table.Attach (email_label, 0, 1, 1, 2);
                table.Attach (EmailEntry, 1, 2, 1, 2);

                    NextButton = new Button (_("Next")) {
                        Sensitive = false
                    };

                    NextButton.Clicked += delegate (object o, EventArgs args) {

                        NextButton.Remove (NextButton.Child);
                        NextButton.Add (new Label (_("Configuring…")));

                        NextButton.Sensitive = false;
                        table.Sensitive       = false;

                        NextButton.ShowAll ();

                        SparkleShare.Controller.UserName  = NameEntry.Text;
                        SparkleShare.Controller.UserEmail = EmailEntry.Text;

                        SparkleShare.Controller.GenerateKeyPair ();
                        SparkleShare.Controller.AddKey ();

                        SparkleShare.Controller.FirstRun = false;

                        DeleteEvent += PreventClose;
                        ShowServerForm ();

                    };

                AddButton (NextButton);

            layout_vertical.PackStart (header, false, false, 0);
            layout_vertical.PackStart (information, false, false, 21);
            layout_vertical.PackStart (new Label (""), false, false, 0);
            layout_vertical.PackStart (table, false, false, 0);

            Add (layout_vertical);

            CheckAccountForm ();

            ShowAll ();
        }
Example #36
0
	public Tab(Browser br) 
	{

		browser = br;
		CurrentNode = br.help_tree;
		ShowTabs = false;
		ShowBorder = false;
		TabBorder = 0;
		TabHborder = 0;
		history = new History (browser.back_button, browser.forward_button);
		
		//
		// First Page
		//
		ScrolledWindow html_container = new ScrolledWindow();
		html_container.Show();
		
		//
		// Setup the HTML rendering and preview area
		//

		html = GetRenderer (browser.engine, browser);
		html_preview = GetRenderer (browser.engine, browser);
		if (html == null || html_preview == null)
			throw new Exception ("Couldn't find html renderer!");

		browser.capabilities = html.Capabilities;

		HelpSource.FullHtml = false;
		HelpSource.UseWebdocCache = true;
		if ((html.Capabilities & Capabilities.Css) != 0)
			HelpSource.use_css = true;

		//Prepare Font for css (TODO: use GConf?)
		if ((html.Capabilities & Capabilities.Fonts) != 0 && SettingsHandler.Settings.preferred_font_size == 0) { 
			Pango.FontDescription font_desc = Pango.FontDescription.FromString ("Sans 12");
			SettingsHandler.Settings.preferred_font_family = font_desc.Family;
			SettingsHandler.Settings.preferred_font_size = 100; //size: 100%
		}
		
		html_container.Add (html.HtmlPanel);
		html.UrlClicked += new EventHandler (browser.LinkClicked);
		html.OnUrl += new EventHandler (browser.OnUrlMouseOver);
		browser.context_id = browser.statusbar.GetContextId ("");
		
		AppendPage(html_container, new Label("Html"));
		
		//
		// Second Page: editing
		//
		VBox vbox1 = new VBox(false, 0);
		
		VBox MainPart = new VBox(false, 0);
		
		//
		// TextView for XML code
		//
		ScrolledWindow sw = new ScrolledWindow();
		text_editor = new TextView();
		text_editor.Buffer.Changed += new EventHandler (EditedTextChanged);
		text_editor.WrapMode = WrapMode.Word;
		sw.Add(text_editor);
		text_editor.FocusOutEvent += new FocusOutEventHandler (FocusOut);
		
		//
		// XML editing buttons
		//
		HBox EdBots = new HBox(false, 2);
		Button button1 = new Button("<e_xample>");
		EdBots.PackStart(button1);
		Button button2 = new Button("<list>");
		EdBots.PackStart(button2);
		Button button3 = new Button("<_table>");
		EdBots.PackStart(button3);
		Button button4 = new Button("<_see...>");
		EdBots.PackStart(button4);
		Button button5 = new Button("<_para>");
		EdBots.PackStart(button5);
		Button button6 = new Button("Add Note");
		EdBots.PackStart(button6);
		
		button1.Clicked += new EventHandler (OnInsertExampleClicked);
		button2.Clicked += new EventHandler (OnInsertListClicked);
		button3.Clicked += new EventHandler (OnInsertTableClicked);
		button4.Clicked += new EventHandler (OnInsertType);
		button5.Clicked += new EventHandler (OnInsertParaClicked);
		button6.Clicked += new EventHandler (OnInsertNoteClicked);
		
		Frame html_preview_frame = new Frame("Preview");
		ScrolledWindow html_preview_container = new ScrolledWindow();
		//
		// code preview panel
		//
		html_preview_container.Add (html_preview.HtmlPanel);
		html_preview_frame.Add(html_preview_container);
		
		MainPart.PackStart(sw);
		MainPart.PackStart(EdBots, false, false, 0);
		MainPart.PackStart(html_preview_frame);
		
		//
		// Close and Save buttons
		//
		HBox MainBots = new HBox(false, 3);
		HBox Filling = new HBox(false, 0);
		Button close = new Button("C_lose");
		Button save = new Button("S_ave");
		Button restore = new Button("_Restore");
		
		close.Clicked += new EventHandler (OnCancelEdits);
		save.Clicked += new EventHandler (OnSaveEdits);
		restore.Clicked += new EventHandler (OnRestoreEdits);
		
		MainBots.PackStart(Filling);
		MainBots.PackStart(close, false, false, 0);
		MainBots.PackStart(save, false, false, 0);
		MainBots.PackStart(restore, false, false, 0);
		
		vbox1.PackStart(MainPart);
		vbox1.PackStart(MainBots, false, false, 0);
		
		AppendPage(vbox1, new Label("Edit XML"));
		
		//
		//Create the Label for the Tab
		//
		TabLabel = new HBox(false, 2);
		
		titleLabel = new Label("");
		
		//Close Tab button
		Button tabClose = new Button();
		Image img = new Image(Stock.Close, IconSize.SmallToolbar);
		tabClose.Add(img);
		tabClose.Relief = Gtk.ReliefStyle.None;
		tabClose.SetSizeRequest (18, 18);
		tabClose.Clicked += new EventHandler (browser.OnCloseTab);
		
		//Icon showed when the Tab is in Edit Mode
		EditImg = new Image (Stock.Convert, IconSize.SmallToolbar);
		
		TabLabel.PackStart (EditImg, false, true, 2);
		TabLabel.PackStart (titleLabel, true, true, 0);
		TabLabel.PackStart (tabClose, false, false, 2);
		
		// needed, otherwise even calling show_all on the notebook won't
		// make the hbox contents appear.
		TabLabel.ShowAll();
		EditImg.Visible = false;
	
	}
Example #37
0
        public QueryWidget(PhotoQuery query, Db db) : base(new HBox())
        {
            box             = Child as HBox;
            box.Spacing     = 6;
            box.BorderWidth = 2;

            this.query     = query;
            query.Changed += HandleChanged;

            label = new Gtk.Label(Strings.FindColonSpace);
            label.Show();
            label.Ypad = 9;
            box.PackStart(label, false, false, 0);

            untagged = new Gtk.Label(Strings.UntaggedPhotos)
            {
                Visible = false
            };
            box.PackStart(untagged, false, false, 0);

            comma1_label = new Gtk.Label(", ")
            {
                Visible = false
            };
            box.PackStart(comma1_label, false, false, 0);

            rated = new Gtk.Label(Strings.RatedPhotos)
            {
                Visible = false
            };
            box.PackStart(rated, false, false, 0);

            comma2_label = new Gtk.Label(", ")
            {
                Visible = false
            };
            box.PackStart(comma2_label, false, false, 0);

            rollfilter = new Gtk.Label(Strings.ImportRoll)
            {
                Visible = false
            };
            box.PackStart(rollfilter, false, false, 0);

            folder_query_widget = new FolderQueryWidget(query)
            {
                Visible = false
            };
            box.PackStart(folder_query_widget, false, false, 0);

            Logic = new LogicWidget(query, db.Tags);
            Logic.Show();
            box.PackStart(Logic, true, true, 0);

            warning_box = new Gtk.HBox();
            warning_box.PackStart(new Gtk.Label(string.Empty));

            var warning_image = new Gtk.Image("gtk-info", Gtk.IconSize.Button);

            warning_image.Show();
            warning_box.PackStart(warning_image, false, false, 0);

            clear_button = new Gtk.Button();
            clear_button.Add(new Gtk.Image("gtk-close", Gtk.IconSize.Button));
            clear_button.Clicked    += HandleClearButtonClicked;
            clear_button.Relief      = Gtk.ReliefStyle.None;
            clear_button.TooltipText = Strings.ClearSearch;
            box.PackEnd(clear_button, false, false, 0);

            refresh_button = new Gtk.Button();
            refresh_button.Add(new Gtk.Image("gtk-refresh", Gtk.IconSize.Button));
            refresh_button.Clicked    += HandleRefreshButtonClicked;
            refresh_button.Relief      = Gtk.ReliefStyle.None;
            refresh_button.TooltipText = Strings.RefreshSearch;
            box.PackEnd(refresh_button, false, false, 0);

            var warning = new Gtk.Label(Strings.NoMatchingPhotosFound);

            warning_box.PackStart(warning, false, false, 0);
            warning_box.ShowAll();
            warning_box.Spacing = 6;
            warning_box.Visible = false;

            box.PackEnd(warning_box, false, false, 0);

            warning_box.Visible = false;
        }
        public PhotoView(IBrowsableCollection query)
            : base()
        {
            this.query = query;

            description_delay = new FSpot.Delay(1000, new GLib.IdleHandler(CommitPendingChanges));
            this.Destroyed   += HandleDestroy;

            Name = "ImageContainer";
            Box vbox = new VBox(false, 6);

            Add(vbox);

            background = new EventBox();
            Frame frame = new Frame();

            background.Add(frame);

            frame.ShadowType = ShadowType.In;
            vbox.PackStart(background, true, true, 0);

            Box inner_vbox = new VBox(false, 2);

            frame.Add(inner_vbox);

            photo_view = new FSpot.PhotoImageView(query);
            photo_view.PhotoChanged     += HandlePhotoChanged;
            photo_view.SelectionChanged += HandleSelectionChanged;

            photo_view_scrolled = new ScrolledWindow(null, null);

            photo_view_scrolled.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);
            photo_view_scrolled.ShadowType = ShadowType.None;
            photo_view_scrolled.Add(photo_view);
            photo_view_scrolled.ButtonPressEvent += HandleButtonPressEvent;
            photo_view.AddEvents((int)EventMask.KeyPressMask);
            inner_vbox.PackStart(photo_view_scrolled, true, true, 0);

            HBox inner_hbox = new HBox(false, 2);

            //inner_hbox.BorderWidth = 6;

            tag_view = new TagView();
            inner_hbox.PackStart(tag_view, false, true, 0);
            SetColors();

            Label comment = new Label(Catalog.GetString("Comment:"));

            inner_hbox.PackStart(comment, false, false, 0);
            description_entry = new Entry();
            inner_hbox.PackStart(description_entry, true, true, 0);
            description_entry.Changed += HandleDescriptionChanged;

            inner_vbox.PackStart(inner_hbox, false, true, 0);

            Box toolbar_hbox = new HBox(false, 6);

            vbox.PackStart(toolbar_hbox, false, true, 0);

            toolbar_hbox.PackStart(CreateConstraintsOptionMenu(), false, false, 0);

            crop_button = new ToolbarButton();
            crop_button.Add(new Gtk.Image("f-spot-crop", IconSize.Button));
            toolbar_hbox.PackStart(crop_button, false, true, 0);

            crop_button.Clicked += new EventHandler(HandleCropButtonClicked);

            redeye_button = new ToolbarButton();
            redeye_button.Add(new Gtk.Image("f-spot-red-eye", IconSize.Button));
            toolbar_hbox.PackStart(redeye_button, false, true, 0);

            redeye_button.Clicked += new EventHandler(HandleRedEyeButtonClicked);

            color_button = new ToolbarButton();
            color_button.Add(new Gtk.Image("f-spot-adjust-colors", IconSize.Button));
            toolbar_hbox.PackStart(color_button, false, true, 0);

            color_button.Clicked += new EventHandler(HandleColorButtonClicked);

            desaturate_button = new ToolbarButton();
            desaturate_button.Add(new Gtk.Image("f-spot-desaturate", IconSize.Button));
            toolbar_hbox.PackStart(desaturate_button, false, true, 0);
            desaturate_button.Clicked += HandleDesaturateButtonClicked;

            sepia_button = new ToolbarButton();
            sepia_button.Add(new Gtk.Image("f-spot-sepia", IconSize.Button));
            toolbar_hbox.PackStart(sepia_button, false, true, 0);
            sepia_button.Clicked += HandleSepiaButtonClicked;

            ItemAction straighten = new TiltEditorAction(photo_view);

            toolbar_hbox.PackStart(straighten.GetToolButton(false), false, true, 0);

            ItemAction softfocus = new SoftFocusEditorAction(photo_view);

            toolbar_hbox.PackStart(softfocus.GetToolButton(false), false, true, 0);

            ItemAction autocolor = new AutoColor(photo_view.Item);

            toolbar_hbox.PackStart(autocolor.GetToolButton(false), false, true, 0);

            /* Face detection ! */

            face_widget = new FaceBox(toolbar_hbox, photo_view);

            vbox.PackStart(face_widget, false, true, 0);
            /* Spacer Label */
            toolbar_hbox.PackStart(new Label(String.Empty), true, true, 0);

            count_label = new Label(String.Empty);
            toolbar_hbox.PackStart(count_label, false, true, 0);

            display_previous_button = new ToolbarButton();
            Gtk.Image display_previous_image = new Gtk.Image(Stock.GoBack, IconSize.Button);
            display_previous_button.Add(display_previous_image);
            display_previous_button.Clicked += new EventHandler(HandleDisplayPreviousButtonClicked);
            toolbar_hbox.PackStart(display_previous_button, false, true, 0);

            display_next_button = new ToolbarButton();
            Gtk.Image display_next_image = new Gtk.Image(Stock.GoForward, IconSize.Button);
            display_next_button.Add(display_next_image);
            display_next_button.Clicked += new EventHandler(HandleDisplayNextButtonClicked);
            toolbar_hbox.PackStart(display_next_button, false, true, 0);

            tips.Enable();


            UpdateButtonSensitivity();

            vbox.ShowAll();
            tips.SetTip(color_button, Catalog.GetString("Adjust the photo colors"), String.Empty);
            tips.SetTip(constraints_option_menu, Catalog.GetString("Constrain the aspect ratio of the selection"), String.Empty);
            tips.SetTip(display_next_button, Catalog.GetString("Next photo"), String.Empty);
            tips.SetTip(display_previous_button, Catalog.GetString("Previous photo"), String.Empty);
            tips.SetTip(desaturate_button, Catalog.GetString("Convert the photo to black and white"), String.Empty);
            tips.SetTip(sepia_button, Catalog.GetString("Convert the photo to sepia tones"), String.Empty);

            Realized += delegate(object o, EventArgs e) { SetColors(); };
        }
Example #39
0
        private Gtk.Widget CreateContents()
        {
            Gtk.HBox entryLine = new HBox(false, 4);

            Gtk.Label words = new Gtk.Label(Catalog.GetString("Search terms:"));
            entryLine.PackStart(words, false, false, 3);

            history = new Gtk.ListStore(new Type[] { typeof(string) });

            Gtk.EntryCompletion comp = new Gtk.EntryCompletion();
            comp.Model      = history;
            comp.TextColumn = 0;

            entry            = new Gtk.Entry("");
            entry.Activated += new EventHandler(this.DoSearch);
            entry.Completion = comp;
            entryLine.PackStart(entry, true, true, 3);

            words = new Gtk.Label("");
            entryLine.PackStart(words, false, false, 3);

            Gtk.ComboBox combo = FilterComboBox();
            combo.Changed += new EventHandler(this.ChangeType);
            entryLine.PackStart(combo, false, false, 3);

            Gtk.HBox   buttonContents = new HBox(false, 0);
            Gtk.Widget buttonImg      = Beagle.Images.GetWidget("icon-search.png");
            buttonContents.PackStart(buttonImg, false, false, 1);
            Gtk.Label buttonLabel = new Gtk.Label(Catalog.GetString("Find"));
            buttonContents.PackStart(buttonLabel, false, false, 1);

            Gtk.Button button = new Gtk.Button();
            button.Add(buttonContents);
            button.Clicked += new EventHandler(this.DoSearch);
            entryLine.PackStart(button, false, false, 3);

            Gtk.Button clearButton = new Gtk.Button();
            clearButton.Label    = "Clear";
            clearButton.Clicked += new EventHandler(this.ClearSearch);
            entryLine.PackStart(clearButton, false, false, 4);

            canvas = new TileCanvas();
            canvas.Show();

            HBox pager = new HBox();

            page_label = new Label();
            page_label.Show();
            pager.PackStart(page_label, false, false, 3);

            forward_button = StockButton("gtk-go-forward",
                                         Catalog.GetString("Show More Results"));
            forward_button.Show();
            forward_button.Clicked += new EventHandler(PageForwardHandler);
            pager.PackEnd(forward_button, false, false, 3);

            back_button = StockButton("gtk-go-back",
                                      Catalog.GetString("Show Previous Results"));
            back_button.Show();

            back_button.Clicked += new EventHandler(PageBackHandler);
            pager.PackEnd(back_button, false, false, 3);

            pager.Show();

            VBox contents = new VBox(false, 3);

            contents.PackStart(entryLine, false, true, 3);
            contents.PackStart(canvas, true, true, 3);
            contents.PackStart(pager, false, false, 3);

            entryLine.ShowAll();
            canvas.ShowAll();

            return(contents);
        }
Example #40
0
        private void UpdateForArtist(string artist_name, LastfmData<SimilarArtist> similar_artists,
            LastfmData<ArtistTopAlbum> top_albums, LastfmData<ArtistTopTrack> top_tracks)
        {
            ThreadAssist.ProxyToMain (delegate {
                album_box.Title = String.Format (album_title_format, artist);
                track_box.Title = String.Format (track_title_format, artist);

                similar_artists_view.ClearWidgets ();
                ClearBox (album_list);
                ClearBox (track_list);

                // Similar Artists
                var artists = similar_artists.Take (20);

                if (artists.Count () > 0) {
                    int artist_name_max_len = 2 * (int) artists.Select (a => a.Name.Length).Average ();
                    foreach (var similar_artist in artists) {
                        SimilarArtistTile tile = new SimilarArtistTile (similar_artist);

                        tile.PrimaryLabel.WidthChars = artist_name_max_len;
                        tile.PrimaryLabel.Ellipsize = Pango.EllipsizeMode.End;

                        tile.ShowAll ();
                        similar_artists_view.AddWidget (tile);
                    }

                    no_artists_pane.Hide ();
                    similar_artists_view_sw.ShowAll ();
                } else {
                    similar_artists_view_sw.Hide ();
                    no_artists_pane.ShowAll ();
                }

                for (int i = 0; i < Math.Min (5, top_albums.Count); i++) {
                    ArtistTopAlbum album = top_albums[i];
                    Button album_button = new Button ();
                    album_button.Relief = ReliefStyle.None;

                    Label label = new Label ();
                    label.OverrideColor (StateFlags.Normal, StyleContext.GetColor (StateFlags.Normal));
                    label.Ellipsize = Pango.EllipsizeMode.End;
                    label.Xalign = 0;
                    label.Markup = String.Format ("{0}. {1}", i+1, GLib.Markup.EscapeText (album.Name));
                    album_button.Add (label);

                    album_button.Clicked += delegate {
                        Banshee.Web.Browser.Open (album.Url);
                    };
                    album_list.PackStart (album_button, false, true, 0);
                }
                album_box.ShowAll ();

                for (int i = 0; i < Math.Min (5, top_tracks.Count); i++) {
                    ArtistTopTrack track = top_tracks[i];
                    Button track_button = new Button ();
                    track_button.Relief = ReliefStyle.None;

                    HBox box = new HBox ();

                    Label label = new Label ();
                    label.OverrideColor (StateFlags.Normal, StyleContext.GetColor (StateFlags.Normal));
                    label.Ellipsize = Pango.EllipsizeMode.End;
                    label.Xalign = 0;
                    label.Markup = String.Format ("{0}. {1}", i+1, GLib.Markup.EscapeText (track.Name));

                    /*if(node.SelectSingleNode("track_id") != null) {
                        box.PackEnd(new Image(now_playing_arrow), false, false, 0);
                        track_button.Clicked += delegate {
                            //PlayerEngineCore.OpenPlay(Globals.Library.GetTrack(
                                //Convert.ToInt32(node.SelectSingleNode("track_id").InnerText)));
                        };
                    } else {*/
                        track_button.Clicked += delegate {
                            Banshee.Web.Browser.Open (track.Url);
                        };
                    //}

                    box.PackStart (label, true, true, 0);
                    track_button.Add (box);
                    track_list.PackStart (track_button, false, true, 0);
                }
                track_box.ShowAll ();

                ready = true;
                refreshing = false;
                context_page.SetState (Banshee.ContextPane.ContextState.Loaded);
            });
        }
Example #41
0
    public MindFire(string[] args)
    {
        Application.Init();
        Glade.XML gxml = new Glade.XML(null, "gui.glade", "mindFire", null);
        gxml.Autoconnect(this);

        playButtonPixbuf       = new Gdk.Pixbuf(null, "media-play.png");
        playButtonImage        = new Gtk.Image();
        playButtonImage.Pixbuf = playButtonPixbuf;
        startButton.Add(playButtonImage);
        startButton.Sensitive = false;
        startButton.Clicked  += new EventHandler(StartRsvp);
        startButton.ShowAll();

        stopButtonPixbuf       = new Gdk.Pixbuf(null, "media-stop.png");
        stopButtonImage        = new Gtk.Image();
        stopButtonImage.Pixbuf = stopButtonPixbuf;
        stopButton.Add(stopButtonImage);
        stopButton.Sensitive = false;
        stopButton.Clicked  += new EventHandler(StopRsvp);
        stopButton.ShowAll();

        prevButtonPixbuf       = new Gdk.Pixbuf(null, "media-prev.png");
        prevButtonImage        = new Gtk.Image();
        prevButtonImage.Pixbuf = prevButtonPixbuf;
        prevButton.Add(prevButtonImage);
        prevButton.Sensitive = false;
        prevButton.Clicked  += new EventHandler(PreviousWord);
        prevButton.ShowAll();

        nextButtonPixbuf       = new Gdk.Pixbuf(null, "media-next.png");
        nextButtonImage        = new Gtk.Image();
        nextButtonImage.Pixbuf = nextButtonPixbuf;
        nextButton.Add(nextButtonImage);
        nextButton.Sensitive = false;
        nextButton.Clicked  += new EventHandler(NextWord);
        nextButton.ShowAll();

        speedUp.Clicked   += new EventHandler(SpeedUp);
        speedDown.Clicked += new EventHandler(SpeedDown);

        startMenuItem.Sensitive = false;
        stopMenuItem.Sensitive  = false;
        slider.ValueChanged    += new EventHandler(SliderMoved);
        noteBook.SwitchPage    += new SwitchPageHandler(NoteBookChanged);
        icon          = new Gdk.Pixbuf(null, "mindFireMonkey.png");
        mindFire.Icon = icon;

        dateTime = System.DateTime.Now;

        config = new Config();

        noteBook.SetTabLabelPacking(noteBook.GetNthPage(0), true, true, Gtk.PackType.Start);
        ftLabel.ModifyFg(Gtk.StateType.Active, new Gdk.Color(127, 127, 127));
        riLabel.ModifyFg(Gtk.StateType.Active, new Gdk.Color(127, 127, 127));
        sgLabel.ModifyFg(Gtk.StateType.Active, new Gdk.Color(127, 127, 127));
        mlLabel.ModifyFg(Gtk.StateType.Active, new Gdk.Color(127, 127, 127));

        statusBar.Push(0, "Ready");
        ShowWord(curWord);
        Application.Run();
    }
Example #42
0
        public QueryWidget(PhotoQuery query, Db db) : base(new HBox())
        {
            box             = Child as HBox;
            box.Spacing     = 6;
            box.BorderWidth = 2;

            this.query     = query;
            query.Changed += HandleChanged;

            label = new Gtk.Label(Catalog.GetString("Find: "));
            label.Show();
            label.Ypad = 9;
            box.PackStart(label, false, false, 0);

            untagged         = new Gtk.Label(Catalog.GetString("Untagged photos"));
            untagged.Visible = false;
            box.PackStart(untagged, false, false, 0);

            comma1_label         = new Gtk.Label(", ");
            comma1_label.Visible = false;
            box.PackStart(comma1_label, false, false, 0);

            rated         = new Gtk.Label(Catalog.GetString("Rated photos"));
            rated.Visible = false;
            box.PackStart(rated, false, false, 0);

            comma2_label         = new Gtk.Label(", ");
            comma2_label.Visible = false;
            box.PackStart(comma2_label, false, false, 0);

            // Note for translators: 'Import roll' is no command, it means 'Roll that has been imported'
            rollfilter         = new Gtk.Label(Catalog.GetString("Import roll"));
            rollfilter.Visible = false;
            box.PackStart(rollfilter, false, false, 0);

            folder_query_widget         = new FolderQueryWidget(query);
            folder_query_widget.Visible = false;
            box.PackStart(folder_query_widget, false, false, 0);

            logic_widget = new LogicWidget(query, db.Tags);
            logic_widget.Show();
            box.PackStart(logic_widget, true, true, 0);

            warning_box = new Gtk.HBox();
            warning_box.PackStart(new Gtk.Label(System.String.Empty));

            Gtk.Image warning_image = new Gtk.Image("gtk-info", Gtk.IconSize.Button);
            warning_image.Show();
            warning_box.PackStart(warning_image, false, false, 0);

            clear_button = new Gtk.Button();
            clear_button.Add(new Gtk.Image("gtk-close", Gtk.IconSize.Button));
            clear_button.Clicked    += HandleClearButtonClicked;
            clear_button.Relief      = Gtk.ReliefStyle.None;
            clear_button.TooltipText = Catalog.GetString("Clear search");
            box.PackEnd(clear_button, false, false, 0);

            refresh_button = new Gtk.Button();
            refresh_button.Add(new Gtk.Image("gtk-refresh", Gtk.IconSize.Button));
            refresh_button.Clicked    += HandleRefreshButtonClicked;
            refresh_button.Relief      = Gtk.ReliefStyle.None;
            refresh_button.TooltipText = Catalog.GetString("Refresh search");
            box.PackEnd(refresh_button, false, false, 0);

            Gtk.Label warning = new Gtk.Label(Catalog.GetString("No matching photos found"));
            warning_box.PackStart(warning, false, false, 0);
            warning_box.ShowAll();
            warning_box.Spacing = 6;
            warning_box.Visible = false;

            box.PackEnd(warning_box, false, false, 0);

            warning_box.Visible = false;
        }
Example #43
0
		public KeyPad() : base(4, 4, true)
		{
			but1 = new Button();
			but2 = new Button();
			but3 = new Button();
			but4 = new Button();
			but5 = new Button();
			but6 = new Button();
			but7 = new Button();
			but8 = new Button();
			but9 = new Button();
			but0 = new Button();
			but00 = new Button();
			butdot = new Button();
			
			but1.Label="1";
			but1.Clicked += this.OnButton1Clicked;
			but1.CanFocus = false;
			but2.Label="2";
			but2.Clicked += this.OnButton2Clicked;
			but2.CanFocus = false;
			but3.Label="3";
			but3.Clicked += this.OnButton3Clicked;
			but3.CanFocus = false;
			but4.Label="4";
			but4.Clicked += this.OnButton4Clicked;
			but4.CanFocus = false;
			but5.Label="5";
			but5.Clicked += this.OnButton5Clicked;
			but5.CanFocus = false;
			but6.Label="6";
			but6.Clicked += this.OnButton6Clicked;
			but6.CanFocus = false;
			but7.Label="7";
			but7.Clicked += this.OnButton7Clicked;
			but7.CanFocus = false;
			but8.Label="8";
			but8.Clicked += this.OnButton8Clicked;
			but8.CanFocus = false;
			but9.Label="9";
			but9.Clicked += this.OnButton9Clicked;
			but9.CanFocus = false;
			but0.Label="0";
			but0.Clicked += this.OnButton0Clicked;
			but0.CanFocus = false;
			but00.Label="00";
			but00.Clicked += this.OnButton00Clicked;
			but00.CanFocus = false;
			butdot.Label=".";
			butdot.Clicked += this.OnButtonDotClicked;
			butdot.CanFocus = false;

			butok = new Button();
			butok.Add( new Image(Stock.Ok, IconSize.Button) );
			butok.Clicked += this.OnButtonOkClicked;
			butok.CanFocus = false;
			
			butadd = new Button();
			butadd.Add( new Image(Stock.Add, IconSize.Button) );
			butadd.Clicked += this.OnButtonAddClicked;
			butadd.CanFocus = false;
			
			butrem = new Button();
			butrem.Add( new Image(Stock.Remove, IconSize.Button) );
			butrem.Clicked += this.OnButtonRemClicked;
			butrem.CanFocus = false;
			
			Attach(but1, 0, 1, 0, 1);
			Attach(but2, 1, 2, 0, 1);
			Attach(but3, 2, 3, 0, 1);
			Attach(but4, 0, 1, 1, 2);
			Attach(but5, 1, 2, 1, 2);
			Attach(but6, 2, 3, 1, 2);
			Attach(but7, 0, 1, 2, 3);
			Attach(but8, 1, 2, 2, 3);
			Attach(but9, 2, 3, 2, 3);
			Attach(butdot, 0, 1, 3, 4);
			Attach(but0, 1, 2, 3, 4);
			Attach(but00, 2, 3, 3, 4);
			
			Attach(butrem, 3, 4, 0, 1);
			Attach(butadd, 3, 4, 1, 2);
			Attach(butok, 3, 4, 2, 4);
			
			this.ShowAll();
		}
Example #44
0
        public QueryWidget(PhotoQuery query, Db db)
            : base(new HBox())
        {
            box = Child as HBox;
            box.Spacing = 6;
            box.BorderWidth = 2;

            tips.Enable ();

            this.query = query;
            query.Changed += HandleChanged;

            label = new Gtk.Label (Catalog.GetString ("Find: "));
            label.Show ();
            label.Ypad = 9;
            box.PackStart (label, false, false, 0);

            untagged = new Gtk.Label (Catalog.GetString ("Untagged photos"));
            untagged.Visible = false;
            box.PackStart (untagged, false, false, 0);

            comma1_label = new Gtk.Label (", ");
            comma1_label.Visible = false;
            box.PackStart (comma1_label, false, false, 0);

            rated = new Gtk.Label (Catalog.GetString ("Rated photos"));
            rated.Visible = false;
            box.PackStart (rated, false, false, 0);

            comma2_label = new Gtk.Label (", ");
            comma2_label.Visible = false;
            box.PackStart (comma2_label, false, false, 0);

            // Note for translators: 'Import roll' is no command, it means 'Roll that has been imported'
            rollfilter = new Gtk.Label (Catalog.GetString ("Import roll"));
            rollfilter.Visible = false;
            box.PackStart (rollfilter, false, false, 0);

            folder_query_widget = new FolderQueryWidget (query);
            folder_query_widget.Visible = false;
            box.PackStart (folder_query_widget, false, false, 0);

            logic_widget = new LogicWidget (query, db.Tags);
            logic_widget.Show ();
            box.PackStart (logic_widget, true, true, 0);

            warning_box = new Gtk.HBox ();
            warning_box.PackStart (new Gtk.Label (System.String.Empty));

            Gtk.Image warning_image = new Gtk.Image ("gtk-info", Gtk.IconSize.Button);
            warning_image.Show ();
            warning_box.PackStart (warning_image, false, false, 0);

            clear_button = new Gtk.Button ();
            clear_button.Add (new Gtk.Image ("gtk-close", Gtk.IconSize.Button));
            clear_button.Clicked += HandleClearButtonClicked;
            clear_button.Relief = Gtk.ReliefStyle.None;
            box.PackEnd (clear_button, false, false, 0);
            tips.SetTip (clear_button, Catalog.GetString("Clear search"), null);

            refresh_button = new Gtk.Button ();
            refresh_button.Add (new Gtk.Image ("gtk-refresh", Gtk.IconSize.Button));
            refresh_button.Clicked += HandleRefreshButtonClicked;
            refresh_button.Relief = Gtk.ReliefStyle.None;
            box.PackEnd (refresh_button, false, false, 0);
            tips.SetTip (refresh_button, Catalog.GetString("Refresh search"), null);

            Gtk.Label warning = new Gtk.Label (Catalog.GetString ("No matching photos found"));
            warning_box.PackStart (warning, false, false, 0);
            warning_box.ShowAll ();
            warning_box.Spacing = 6;
            warning_box.Visible = false;

            box.PackEnd (warning_box, false, false, 0);

            warning_box.Visible = false;
        }
Example #45
0
        public SearchWindow(ISearch search) : base(WindowType.Toplevel)
        {
            this.search = search;

            base.Title         = Catalog.GetString("Desktop Search");
            base.Icon          = WidgetFu.LoadThemeIcon("system-search", 16);
            base.DefaultWidth  = 700;
            base.DefaultHeight = 550;
            base.DeleteEvent  += OnWindowDelete;

            VBox vbox = new VBox();

            vbox.Spacing = 3;

            uim = new UIManager(this);
            uim.DomainChanged += OnDomainChanged;
            uim.SortChanged   += OnSortChanged;
            uim.ToggleDetails += OnToggleDetails;
            uim.ShowQuickTips += OnShowQuickTips;
            uim.ShowIndexInfo += OnShowIndexInfo;
            uim.StartDaemon   += OnStartDaemon;
            uim.StopDaemon    += OnStopDaemon;
            vbox.PackStart(uim.MenuBar, false, false, 0);

            HBox hbox = new HBox(false, 6);

            Label label = new Label(Catalog.GetString("_Find in:"));

            hbox.PackStart(label, false, false, 0);

            scope_list = ComboBox.NewText();
            foreach (ScopeMapping mapping in scope_mappings)
            {
                scope_list.AppendText(mapping.label);
            }
            scope_list.Active = 0;

            scope_list.Changed += new EventHandler(delegate(object o, EventArgs args) {
                ComboBox combo = o as ComboBox;
                if (o == null)
                {
                    return;
                }
                int active = combo.Active;
                Log.Debug("Scope changed: {0} maps to '{1}'", combo.ActiveText, scope_mappings [active].query_mapping);
                Query(true);
            });
            hbox.PackStart(scope_list, false, false, 0);

            entry            = new Entry();
            entry.Activated += OnEntryActivated;
            hbox.PackStart(entry, true, true, 0);

            label.MnemonicWidget  = entry;
            uim.FocusSearchEntry += delegate() { entry.GrabFocus(); };

            // The auto search after timeout feauture is now optional
            // and can be disabled.

            if (Conf.BeagleSearch.GetOption(Conf.Names.BeagleSearchAutoSearch, true))
            {
                entry.Changed    += OnEntryResetTimeout;
                entry.MoveCursor += OnEntryResetTimeout;
            }

            button = new Gtk.Button();
            Gtk.HBox  button_hbox = new Gtk.HBox(false, 2);
            Gtk.Image icon        = new Gtk.Image(Gtk.Stock.Find, Gtk.IconSize.Button);
            button_hbox.PackStart(icon, false, false, 0);
            label = new Gtk.Label(Catalog.GetString("Find Now"));
            button_hbox.PackStart(label, false, false, 0);
            button.Add(button_hbox);
            button.Clicked += OnButtonClicked;

            Gtk.VBox buttonVBox = new Gtk.VBox(false, 0);
            buttonVBox.PackStart(button, true, false, 0);
            hbox.PackStart(buttonVBox, false, false, 0);

            spinner = new Spinner();
            hbox.PackStart(spinner, false, false, 0);

            HBox padding_hbox = new HBox();

            padding_hbox.PackStart(hbox, true, true, 9);
            vbox.PackStart(padding_hbox, false, true, 6);

            VBox view_box = new VBox(false, 3);

            vbox.PackStart(view_box, true, true, 0);

            HBox na_padding = new HBox();

            view_box.PackStart(na_padding, false, true, 0);

            notification_area = new NotificationArea();
            na_padding.PackStart(notification_area, true, true, 3);

            pages             = new Gtk.Notebook();
            pages.ShowTabs    = false;
            pages.ShowBorder  = false;
            pages.BorderWidth = 3;
            view_box.PackStart(pages, true, true, 0);

            quicktips = new Pages.QuickTips();
            quicktips.Show();
            pages.Add(quicktips);

            indexinfo = new Pages.IndexInfo();
            indexinfo.Show();
            pages.Add(indexinfo);

            rootuser = new Pages.RootUser();
            rootuser.Show();
            pages.Add(rootuser);

            startdaemon = new Pages.StartDaemon();
            startdaemon.DaemonStarted += OnDaemonStarted;
            startdaemon.Show();
            pages.Add(startdaemon);

            panes = new Beagle.Search.Panes();
            panes.Show();
            pages.Add(panes);

            view = new GroupView();
            view.TileSelected += ShowInformation;
            panes.MainContents = view;

            this.statusbar = new Gtk.Statusbar();
            vbox.PackEnd(this.statusbar, false, false, 0);

            Add(vbox);

            tips = new Gtk.Tooltips();
            tips.SetTip(entry, Catalog.GetString("Type in search terms"), "");
            tips.SetTip(button, Catalog.GetString("Start searching"), "");
            tips.Enable();

            if (Environment.UserName == "root" && !Conf.Daemon.GetOption(Conf.Names.AllowRoot, false))
            {
                pages.CurrentPage = pages.PageNum(rootuser);
                entry.Sensitive   = button.Sensitive = uim.Sensitive = false;
            }
            else
            {
                pages.CurrentPage = pages.PageNum(quicktips);
            }

            entry.GrabFocus();
            StartCheckingIndexingStatus();
        }