Beispiel #1
0
        private void BuildContactFrame()
        {
            var vbBox = new Gtk.VBox(false, 5);

            // The frame
            this.frmContact = new Gtk.Frame("Main contact info");
            this.frmContact.Add(vbBox);

            // Email
            var hbEmail = new Gtk.HBox(false, 5);

            this.edEmail                 = new Gtk.Entry();
            this.btConnectEmail          = new Gtk.Button(Gtk.Stock.Connect);
            this.btConnectEmail.Clicked += (sender, e) => this.OnConnect(sender);
            hbEmail.PackStart(new Gtk.Label()
            {
                Markup = "<b>E.mail</b>"
            }, false, false, 5);
            hbEmail.PackStart(this.edEmail, true, true, 5);
            hbEmail.PackStart(this.btConnectEmail, false, false, 5);

            // Mobile phone
            var hbMobilePhone = new Gtk.HBox(false, 5);

            this.edMPhone = new Gtk.Entry();
            hbMobilePhone.PackStart(new Gtk.Label()
            {
                Markup = "<b>Mobil phone</b>"
            }, false, false, 5);
            hbMobilePhone.PackStart(this.edMPhone, true, true, 5);

            vbBox.PackStart(hbEmail, true, true, 5);
            vbBox.PackStart(hbMobilePhone, true, true, 5);
            this.vbPage1.PackStart(this.frmContact, true, true, 5);
        }
Beispiel #2
0
        private void BuildNameFrame()
        {
            var vbBox = new Gtk.VBox(false, 5);

            // The frame
            this.frmName = new Gtk.Frame("Name");
            this.frmName.Add(vbBox);

            // Given name
            var hbGivenName = new Gtk.HBox(false, 5);

            this.edName = new Gtk.Entry();
            hbGivenName.PackStart(new Gtk.Label()
            {
                Markup = "<b>Name</b>"
            }, false, false, 5);
            hbGivenName.PackStart(this.edName, true, true, 5);

            // Family name
            var hbFamilyName = new Gtk.HBox(false, 5);

            this.edSurname = new Gtk.Entry();
            hbFamilyName.PackStart(new Gtk.Label()
            {
                Markup = "<b>Surname</b> <i>(or activity)</i>"
            }, false, false, 5);
            hbFamilyName.PackStart(this.edSurname, true, true, 5);

            vbBox.PackStart(hbGivenName, true, true, 5);
            vbBox.PackStart(hbFamilyName, true, true, 5);
            this.vbPage1.PackStart(this.frmName, true, true, 5);
        }
        public override Control CreatePanelWidget()
        {
            var vbox = new Gtk.VBox();

            vbox.Spacing = 6;

            var generalSectionLabel = new Gtk.Label("<b>" + GettextCatalog.GetString("General") + "</b>");

            generalSectionLabel.UseMarkup = true;
            generalSectionLabel.Xalign    = 0;
            vbox.PackStart(generalSectionLabel, false, false, 0);

            var outputDirectoryHBox = new Gtk.HBox();

            outputDirectoryHBox.BorderWidth = 10;
            outputDirectoryHBox.Spacing     = 6;
            var outputDirectoryLabel = new Gtk.Label(GettextCatalog.GetString("Output directory:"));

            outputDirectoryLabel.Xalign = 0;
            outputDirectoryHBox.PackStart(outputDirectoryLabel, false, false, 0);
            folderEntry.Path = Options.OutputPath.Value;
            outputDirectoryHBox.PackStart(folderEntry, true, true, 0);

            vbox.PackStart(outputDirectoryHBox, false, false, 0);
            vbox.ShowAll();
            return(vbox);
        }
Beispiel #4
0
        void CreateControls()
        {
            TypeHint       = Gdk.WindowTypeHint.Menu;
            WindowPosition = Gtk.WindowPosition.CenterOnParent;
            BorderWidth    = 1;
            Resizable      = false;
#if GTK2
            AllowGrow = false;
#else
            Resizable = false;
#endif
            Decorated         = false;
            DestroyWithParent = true;
            SkipPagerHint     = true;
            SkipTaskbarHint   = true;

            var hbox = new Gtk.HBox {
                Spacing     = 5,
                BorderWidth = 3
            };

            if (HasDate)
            {
                hbox.PackStart(CalendarControls(), true, true, 0);
            }

            if (HasTime)
            {
                hbox.PackStart(ClockControls(), true, true, 0);
            }

            Add(hbox);
        }
Beispiel #5
0
 void UpdateButton(DialogButton btn, Gtk.Button b)
 {
     if (!string.IsNullOrEmpty(btn.Label) && btn.Image == null)
     {
         b.Label = btn.Label;
     }
     else if (string.IsNullOrEmpty(btn.Label) && btn.Image != null)
     {
         var pix = btn.Image.ToImageDescription();
         b.Image = new ImageBox(ApplicationContext, pix);
     }
     else if (!string.IsNullOrEmpty(btn.Label))
     {
         Gtk.Box box = new Gtk.HBox(false, 3);
         var     pix = btn.Image.ToImageDescription();
         box.PackStart(new ImageBox(ApplicationContext, pix), false, false, 0);
         box.PackStart(new Gtk.Label(btn.Label), true, true, 0);
         b.Image = box;
     }
     if (btn.Visible)
     {
         b.ShowAll();
     }
     else
     {
         b.Hide();
     }
     b.Sensitive = btn.Sensitive;
     UpdateActionAreaVisibility();
 }
        private void BuildTools()
        {
            var hbBox = new Gtk.HBox(false, 5);
            var vbBox = new Gtk.VBox(false, 5);

            // Widgets
            this.edText = new Gtk.TextView {
                Editable = false
            };

            var btBoxes = new Gtk.Button(new Gtk.Label(this.actViewBoxes.Label));

            btBoxes.Clicked += (sender, e) => this.actViewBoxes.Activate();

            var btFrames = new Gtk.Button(new Gtk.Label(this.actViewFrames.Label));

            btFrames.Clicked += (sender, e) => this.actViewFrames.Activate();

            var btNotebook = new Gtk.Button(new Gtk.Label(this.actViewNotebook.Label));

            btNotebook.Clicked += (sender, e) => this.actViewNotebook.Activate();

            var btDrawing = new Gtk.Button(new Gtk.Label(this.actViewDrawing.Label));

            btDrawing.Clicked += (sender, e) => this.actViewDrawing.Activate();

            // Packing everything
            vbBox.PackStart(btBoxes, false, false, 5);
            vbBox.PackStart(btFrames, false, false, 5);
            vbBox.PackStart(btNotebook, false, false, 5);
            vbBox.PackStart(btDrawing, false, false, 5);
            hbBox.PackStart(this.edText, true, true, 5);
            hbBox.PackStart(vbBox, false, false, 5);
            this.vbMain.PackStart(hbBox, true, true, 5);
        }
Beispiel #7
0
		public void Fill (Extension ext, ITreeNavigator nav)
		{
			labelName.Markup = "<small>Extension</small>\n<big><b>" + GLib.Markup.EscapeText (Util.GetDisplayName (ext)) + "</b></big>";
			object parent = ext.GetExtendedObject ();
			
			if (parent is ExtensionPoint) {
				ExtensionPoint ep = (ExtensionPoint) parent;
				string txt = "<small>Extension Point</small>\n<b>" + GLib.Markup.EscapeText (Util.GetDisplayName (ep)) + "</b>";
				if (!string.IsNullOrEmpty (ep.Description))
					txt += "\n" + GLib.Markup.EscapeText (ep.Description);
				Gtk.Label lab = new Gtk.Label ();
				lab.Xalign = lab.Yalign = 0;
				lab.Markup = txt;
				lab.WidthRequest = 400;
				lab.Wrap = true;
				Gtk.Image img = new Gtk.Image (ImageService.GetPixbuf ("md-extension-point", Gtk.IconSize.Menu));
				img.Yalign = 0;
				Gtk.HBox box = new Gtk.HBox (false, 6);
				box.PackStart (img, false, false, 0);
				box.PackStart (lab, true, true, 0);
				buttonExt.Add (box);
				buttonExt.ShowAll ();
				buttonExt.Clicked += delegate {
					if (nav.MoveToObject (ext)) {
						nav.MoveToParent (typeof(Solution));
						nav.Expanded = true;
						if (nav.MoveToObject (ep.ParentAddinDescription)) {
							nav.Expanded = true;
							if (nav.MoveToObject (ep))
								nav.Selected = true;
						}
					}
				};
			}
		}
Beispiel #8
0
        //Gtk.CheckButton uiCountersCheck;

        public override Control CreatePanelWidget()
        {
            var vbox = new Gtk.VBox();

            vbox.Spacing = 6;

            var generalSectionLabel = new Gtk.Label("<b>" + GettextCatalog.GetString("General") + "</b>");

            generalSectionLabel.UseMarkup = true;
            generalSectionLabel.Xalign    = 0;
            vbox.PackStart(generalSectionLabel, false, false, 0);

            var outputDirectoryHBox = new Gtk.HBox();

            outputDirectoryHBox.BorderWidth = 10;
            outputDirectoryHBox.Spacing     = 6;
            var outputDirectoryLabel = new Gtk.Label(GettextCatalog.GetString("Output directory:"));

            outputDirectoryLabel.Xalign = 0;
            outputDirectoryHBox.PackStart(outputDirectoryLabel, false, false, 0);
            folderEntry.Path = Options.OutputPath.Value;
            outputDirectoryHBox.PackStart(folderEntry, true, true, 0);

            vbox.PackStart(outputDirectoryHBox, false, false, 0);

            //if (Options.HasMemoryLeakFeature) {
            //	uiCountersCheck = new Gtk.CheckButton (GettextCatalog.GetString ("Show UI Widget counters in the toolbar"));
            //	uiCountersCheck.Active = Options.ShowUICounters.Value;

            //	vbox.PackStart (uiCountersCheck, false, false, 0);
            //}

            vbox.ShowAll();
            return(vbox);
        }
		void InitializeComponents()
		{
			// set up this actual dialog
			this.Modal = true;
			// FIXME: make this a resource in the resource file
			this.Title = String.Format (GettextCatalog.GetString ("{0} Code Group"), titlePrefix);
			
			// set up the dialog fields and add them
			templateExtensionsTextBox = new Gtk.Entry();
			templateExtensionsTextBox.ActivatesDefault = true;
			// FIXME: make this a resource in the resource file
			Gtk.Label label1 = new Gtk.Label("Extensions (; seperated)");
			
			label1.Xalign = 0;			
			templateExtensionsTextBox.Text    = string.Join(";", codeTemplateGroup.ExtensionStrings);
			
			// FIXME: make the labels both part of the same sizing group so they have the same left and right rows.
			Gtk.HBox hBox1 = new Gtk.HBox(false, 6);
			hBox1.PackStart(label1, false, false, 6);
			hBox1.PackStart(templateExtensionsTextBox, false, false, 6);
			
			this.VBox.PackStart(hBox1, false, false, 6);
			
			// set up the buttons and add them
			this.DefaultResponse = Gtk.ResponseType.Ok;
			Gtk.Button cancelButton = new Gtk.Button(Gtk.Stock.Cancel);
			Gtk.Button okButton = new Gtk.Button(Gtk.Stock.Ok);
			okButton.Clicked += new EventHandler(AcceptEvent);
			cancelButton.Clicked += new EventHandler(CancelEvent);
			this.AddActionWidget (cancelButton, Gtk.ResponseType.Cancel);
			this.AddActionWidget (okButton, (int) Gtk.ResponseType.Ok);
		}
Beispiel #10
0
        // TODO: remove the method if gkt supports entry icons
        // on all platforms
        public Gtk.Widget GetFallbackWrapper()
        {
            if (IconsSupported)
            {
                return(this);
            }

            // if the entry does not support embedded icons (old gtk version, e.g. on MS Windows),
            // return a wrapper with the icon left to the entry
            Gtk.HBox hbox = new Gtk.HBox(false, 3);

            Gdk.Pixbuf pb  = Basenji.Icons.Icon.Stock_Find.Render(this, Gtk.IconSize.Menu);
            Gtk.Image  img = new Gtk.Image(pb);

            Gtk.Button btn = new Gtk.Button();
            btn.Relief   = Gtk.ReliefStyle.None;
            btn.Clicked += delegate { ShowPopup(); };
            btn.Image    = img;

            // also disable the button if the Search entry is disabled
            this.StateChanged += delegate { btn.Sensitive = this.Sensitive; };

            hbox.PackStart(btn, false, false, 0);
            hbox.PackStart(this, true, true, 0);

            return(hbox);
        }
Beispiel #11
0
        void InitializeComponents()
        {
            // set up this actual dialog
            this.Modal = true;
            // FIXME: make this a resource in the resource file
            this.Title = String.Format(GettextCatalog.GetString("{0} Code Group"), titlePrefix);

            // set up the dialog fields and add them
            templateExtensionsTextBox = new Gtk.Entry();
            templateExtensionsTextBox.ActivatesDefault = true;
            // FIXME: make this a resource in the resource file
            Gtk.Label label1 = new Gtk.Label("Extensions (; seperated)");

            label1.Xalign = 0;
            templateExtensionsTextBox.Text = string.Join(";", codeTemplateGroup.ExtensionStrings);

            // FIXME: make the labels both part of the same sizing group so they have the same left and right rows.
            Gtk.HBox hBox1 = new Gtk.HBox(false, 6);
            hBox1.PackStart(label1, false, false, 6);
            hBox1.PackStart(templateExtensionsTextBox, false, false, 6);

            this.VBox.PackStart(hBox1, false, false, 6);

            // set up the buttons and add them
            this.DefaultResponse = Gtk.ResponseType.Ok;
            Gtk.Button cancelButton = new Gtk.Button(Gtk.Stock.Cancel);
            Gtk.Button okButton     = new Gtk.Button(Gtk.Stock.Ok);
            okButton.Clicked     += new EventHandler(AcceptEvent);
            cancelButton.Clicked += new EventHandler(CancelEvent);
            this.AddActionWidget(cancelButton, Gtk.ResponseType.Cancel);
            this.AddActionWidget(okButton, (int)Gtk.ResponseType.Ok);
        }
        private static void AddFileProperty(Gtk.VBox vbox, string labelText, FileEntry fileEntry, ConfigurationProperty <string> property)
        {
            var alignment = new Gtk.Alignment(0f, 0f, 1f, 1f)
            {
                LeftPadding = 24
            };

            var innerVBox = new Gtk.VBox();

            alignment.Add(innerVBox);

            var hbox = new Gtk.HBox(false, 6);

            var label = new Gtk.Label
            {
                Text   = GettextCatalog.GetString(labelText),
                Xalign = 0
            };

            hbox.PackStart(label, false, false, 0);
            fileEntry.Path = property.Value;
            hbox.PackStart(fileEntry, true, true, 0);

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

            vbox.PackStart(alignment, false, false, 0);
        }
 public ImageButton(string stock, string label)
 {
     Gtk.HBox hbox1 = new Gtk.HBox(false,0);
     hbox1.PackStart(new Gtk.Image(stock, Gtk.IconSize.Button), false, true, 0);
     hbox1.PackStart(new Gtk.Label(label), true, true, 0);
     this.Add(hbox1);
 }
        /// <summary>
        /// Builds the login page.
        /// </summary>
        /// <returns>The login page, as a Gtk.VBox</returns>
        Gtk.VBox BuildLoginPage()
        {
            var toret   = new Gtk.VBox();
            var hbLogin = new Gtk.HBox();
            var hbUsr   = new Gtk.HBox();
            var hbPsw   = new Gtk.HBox();
            var edUsr   = new Gtk.Entry();
            var edPsw   = new Gtk.Entry();
            var lblUsr  = new Gtk.Label("User");
            var lblPsw  = new Gtk.Label("Password");

            this.BtLogin = new Gtk.Button("Login");
            hbLogin.PackEnd(BtLogin, false, false, 5);

            hbUsr.PackStart(lblUsr, false, false, 5);
            hbUsr.PackStart(edUsr, true, true, 5);

            hbPsw.PackStart(lblPsw, false, false, 5);
            hbPsw.PackStart(edPsw, true, true, 5);

            toret.PackStart(hbUsr, false, true, 5);
            toret.PackStart(hbPsw, false, true, 5);
            toret.PackStart(hbLogin, false, false, 10);

            toret.ShowAll();
            return(toret);
        }
		public QueryWidget (PhotoQuery query, Db db, TagSelectionWidget selector)
		{
			tips.Enable ();

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

			Gtk.HSeparator sep = new Gtk.HSeparator ();
			sep.Show ();
			this.PackStart (sep, false, false, 0);
			
			Gtk.HBox hbox = new Gtk.HBox ();
			hbox.Show ();
			this.PackStart (hbox, false, false, 0);
			
			label = new Gtk.Label (Catalog.GetString ("Find: "));
			label.Show ();
			label.Ypad = 9;
			hbox.PackStart (label, false, false, 0);

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

			comma_label = new Gtk.Label (", ");
			comma_label.Visible = false;
			hbox.PackStart (comma_label, false, false, 0);

			rollfilter = new Gtk.Label (Catalog.GetString ("Import roll"));	
			rollfilter.Visible = false;
			hbox.PackStart (rollfilter, false, false, 0);

			logic_widget = new LogicWidget (query, db.Tags, selector);
			logic_widget.Show ();
			hbox.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;
			hbox.PackEnd (clear_button, false, false, 0);
			tips.SetTip (clear_button, Catalog.GetString("Clear 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;

			hbox.PackEnd (warning_box, false, false, 0);
			
			warning_box.Visible = false;
		}
        public QueryWidget(PhotoQuery query, Db db, TagSelectionWidget selector)
        {
            tips.Enable();

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

            Gtk.HSeparator sep = new Gtk.HSeparator();
            sep.Show();
            this.PackStart(sep, false, false, 0);

            Gtk.HBox hbox = new Gtk.HBox();
            hbox.Show();
            this.PackStart(hbox, false, false, 0);

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

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

            comma_label         = new Gtk.Label(", ");
            comma_label.Visible = false;
            hbox.PackStart(comma_label, false, false, 0);

            rollfilter         = new Gtk.Label(Catalog.GetString("Import roll"));
            rollfilter.Visible = false;
            hbox.PackStart(rollfilter, false, false, 0);

            logic_widget = new LogicWidget(query, db.Tags, selector);
            logic_widget.Show();
            hbox.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;
            hbox.PackEnd(clear_button, false, false, 0);
            tips.SetTip(clear_button, Catalog.GetString("Clear 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;

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

            warning_box.Visible = false;
        }
Beispiel #17
0
 void UpdateButton(DialogButton btn, Gtk.Button b)
 {
     if (!string.IsNullOrEmpty(btn.Label) && btn.Image == null)
     {
         b.Label = btn.Label;
     }
     else if (string.IsNullOrEmpty(btn.Label) && btn.Image != null)
     {
         var pix = (Gdk.Pixbuf)WidgetRegistry.GetBackend(btn.Image);
         b.Image = new Gtk.Image(pix);
     }
     else if (!string.IsNullOrEmpty(btn.Label))
     {
         Gtk.Box box = new Gtk.HBox(false, 3);
         var     pix = (Gdk.Pixbuf)WidgetRegistry.GetBackend(btn.Image);
         box.PackStart(new Gtk.Image(pix), false, false, 0);
         box.PackStart(new Gtk.Label(btn.Label), true, true, 0);
         b.Image = box;
     }
     if (btn.Visible)
     {
         b.ShowAll();
     }
     else
     {
         b.Hide();
     }
     b.Sensitive = btn.Sensitive;
 }
Beispiel #18
0
        private void Build()
        {
            var hBox      = new Gtk.HBox(false, 5);
            var vbButtons = new Gtk.VBox(false, 5);
            var swView    = new Gtk.ScrolledWindow();

            this.tvCategories = new Gtk.TreeView();
            swView.AddWithViewport(this.tvCategories);
            this.BuildButtons(vbButtons);

            hBox.PackStart(swView, true, true, 5);
            hBox.PackStart(vbButtons, false, false, 5);

            this.AddButton(Gtk.Stock.Close, Gtk.ResponseType.Close);
            this.VBox.PackStart(hBox, true, true, 5);

            this.SetGeometryHints(
                this,
                new Gdk.Geometry()
            {
                MinHeight = 200,
                MinWidth  = 320,
            },
                Gdk.WindowHints.MinSize
                );
            this.WindowPosition = Gtk.WindowPosition.CenterOnParent;
            this.Shown         += (object sender, EventArgs e) => this.OnShow();
            this.Modal          = true;
        }
Beispiel #19
0
        Gtk.Widget IOptionsPanel.CreatePanelWidget()
        {
            Gtk.VBox cbox      = new Gtk.VBox(false, 6);
            Gtk.HBox combosBox = new Gtk.HBox(false, 6);
            cbox.PackStart(combosBox, false, false, 0);
            combosBox.PackStart(new Gtk.Label(GettextCatalog.GetString("Configuration:")), false, false, 0);
            configCombo = Gtk.ComboBox.NewText();
            combosBox.PackStart(configCombo, false, false, 0);
            combosBox.PackStart(new Gtk.Label(GettextCatalog.GetString("Platform:")), false, false, 0);
            platformCombo = Gtk.ComboBox.NewText();
            combosBox.PackStart(platformCombo, false, false, 0);
            cbox.PackStart(new Gtk.HSeparator(), false, false, 0);
            cbox.ShowAll();

            cbox.Hidden += OnPageHidden;
            cbox.Shown  += OnPageShown;

            lastConfigSelection   = -1;
            lastPlatformSelection = -1;

            FillConfigurations();
            UpdateSelection();

            configCombo.Changed   += OnConfigChanged;
            platformCombo.Changed += OnConfigChanged;

            bool oldMixed = allowMixedConfigurations;

            Gtk.Widget child = CreatePanelWidget();

            //HACK: work around bug 469427 - broken themes match on widget names
            if (child.Name.IndexOf("Panel") > 0)
            {
                child.Name = child.Name.Replace("Panel", "_");
            }

            cbox.PackStart(child, true, true, 0);

            if (allowMixedConfigurations != oldMixed)
            {
                // If mixed mode has changed, update the configuration list
                FillConfigurations();
                UpdateSelection();
            }
            widgetCreated = true;
            panelWidget   = child;

            if (currentConfigs.Count > 0)
            {
                panelWidget.Sensitive = true;
                LoadConfigData();
            }
            else
            {
                panelWidget.Sensitive = false;
            }

            return(cbox);
        }
Beispiel #20
0
        private void Build()
        {
            this.BuildActions();
            var swScroll = new Gtk.ScrolledWindow();
            var hBox     = new Gtk.HBox(false, 5);
            var vBox     = new Gtk.VBox(false, 5);


            //var hBoxButton = new Gtk.HBox(false, 5); to eliminate
            // Drawing area
            this.drawingArea              = new Gtk.DrawingArea();
            this.drawingArea.ExposeEvent += (o, args) => this.OnExposeDrawingArea();

            //Menu
            var btPeso                  = new Gtk.Button(new Gtk.Label(this.actPeso.Label));
            var btAbdomen               = new Gtk.Button(new Gtk.Label(this.actAbdomen.Label));
            var btEjerciciosTiempo      = new Gtk.Button(new Gtk.Label(this.actEjerTime.Label));
            var btEjerciciosActividades = new Gtk.Button(new Gtk.Label(this.actEjerActivities.Label));
            var btEjerciciosDistancia   = new Gtk.Button(new Gtk.Label(this.actEjerDistance.Label));

            btPeso.Clicked                  += (sender, e) => this.actPeso.Activate();
            btAbdomen.Clicked               += (sender, e) => this.actAbdomen.Activate();
            btEjerciciosTiempo.Clicked      += (sender, e) => this.actEjerTime.Activate();
            btEjerciciosDistancia.Clicked   += (sender, e) => this.actEjerDistance.Activate();
            btEjerciciosActividades.Clicked += (sender, e) => this.actEjerActivities.Activate();


            // Layout
            swScroll.AddWithViewport(this.drawingArea);

            vBox.PackStart(btPeso, false, true, 2);
            vBox.PackStart(btAbdomen, false, true, 2);
            vBox.PackStart(btEjerciciosTiempo, false, true, 2);
            vBox.PackStart(btEjerciciosActividades, false, true, 2);
            vBox.PackStart(btEjerciciosDistancia, false, true, 2);
            hBox.PackStart(drawingArea, true, true, 10);
            hBox.PackStart(swScroll, true, true, 5);
            hBox.PackStart(vBox, false, true, 5);
            //this.VBox.PackStart( swScroll, true, true, 5 ); to eliminate
            this.VBox.PackStart(hBox, true, true, 5);
            this.AddButton(Gtk.Stock.Close, Gtk.ResponseType.Close);

            // Polish
            this.WindowPosition = Gtk.WindowPosition.CenterOnParent;


            this.Resize(400, 200);
            this.SetGeometryHints(
                this,
                new Gdk.Geometry()
            {
                MinWidth  = 400,
                MinHeight = 200
            },
                Gdk.WindowHints.MinSize
                );
        }
Beispiel #21
0
        public CrashDialog(Gtk.Window parent, Exception e)
            : base(null, parent, Gtk.DialogFlags.Modal)
        {
            SetDefaultSize(640, 480);
            Title = "Smuxi - " + _("Oops, I did it again...");

            Gtk.HBox hbox = new Gtk.HBox();

            Gtk.Image image = new Gtk.Image(Gtk.Stock.DialogError, Gtk.IconSize.Dialog);
            hbox.PackStart(image, false, false, 2);

            Gtk.VBox label_vbox = new Gtk.VBox();
            Gtk.Label label1 = new Gtk.Label();
            Gtk.Label label2 = new Gtk.Label();
            label1.Markup = String.Format(
                "<b>{0}</b>",
                GLib.Markup.EscapeText(
                    _("Smuxi crashed because an unhandled exception was thrown!")
                )
            );
            label2.Markup = GLib.Markup.EscapeText(
                _("Here is the stacktrace, please report this bug!")
            );
            label_vbox.PackStart(label1, false, false, 0);
            label_vbox.PackStart(new Gtk.Fixed(), true, true, 0);
            label_vbox.PackStart(label2, false, false, 0);
            hbox.PackStart(label_vbox, true, true, 0);

            Gtk.VBox vbox = new Gtk.VBox();
            vbox.PackStart(hbox, false, false, 2);

            Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow();
            sw.ShadowType = Gtk.ShadowType.In;
            Gtk.TextView tv = new Gtk.TextView();
            tv.Editable = false;
            tv.CursorVisible = false;
            sw.Add(tv);
            vbox.PackStart(sw, true, true, 2);

            // add to the dialog
            VBox.PackStart(vbox, true, true, 2);
            AddButton(_("_Report Bug"), -1);
            AddButton(Gtk.Stock.Quit, 0);

            string message = String.Empty;
            if (e.InnerException != null) {
                message = "Inner-Exception Type:\n"+e.InnerException.GetType()+"\n\n"+
                          "Inner-Exception Message:\n"+e.InnerException.Message+"\n\n"+
                          "Inner-Exception StackTrace:\n"+e.InnerException.StackTrace+"\n";
            }
            message += "Exception Type:\n"+e.GetType()+"\n\n"+
                       "Exception Message:\n"+e.Message+"\n\n"+
                       "Exception StackTrace:\n"+e.StackTrace;
            tv.Buffer.Text = message;

            ShowAll();
        }
Beispiel #22
0
        /// <summary>
        /// Create component stockImage and Label
        /// </summary>
        /// <param name="stockId">Image stock id.</param>
        /// <param name="lab">Label.</param>
        /// <returns>Return HBox widget</returns>
        public Gtk.HBox CreatePicLabelWidget(string stockId, string lab)
        {
            Gtk.HBox hb = new Gtk.HBox();

            hb.PackStart(new Gtk.Image(stockId, Gtk.IconSize.Button), false, false, 0);
            hb.PackStart(new Gtk.Label(lab), true, true, 5);

            return(hb);
        }
        private void BuildFileNameGroup(Gtk.HBox hbFileName)
        {
            this.btOpen     = new Gtk.Button(Gtk.Stock.Open);
            this.edFileName = new Gtk.Entry();

            this.edFileName.IsEditable = false;
            this.btOpen.Clicked       += (sender, e) => this.OnOpen();

            hbFileName.PackStart(this.edFileName, true, true, 5);
            hbFileName.PackStart(this.btOpen, false, false, 5);
        }
 protected MultipleObjectViewer(IBroadcaster hub, string caption)
     : base(false, 0)
 {
     _hub = hub;
     // --- first line: caption and buttons
     Gtk.HBox hbxFirstLine = new Gtk.HBox(false, 2);
     // Caption label
     Gtk.Alignment labelAlign = new Gtk.Alignment(0F, 0F, 1F, 1F);
     labelAlign.Add(new Gtk.Label(caption));
     hbxFirstLine.PackStart(labelAlign, false, false, 0);
     hbxFirstLine.PackStart(new Gtk.Label(String.Empty), true, true, 0);
     // "Add" button
     Gtk.Image image = new Gtk.Image();
     image.Stock = Gtk.Stock.Add;
     _btnAdd = new Gtk.Button();
     _btnAdd.Add(image);
     _btnAdd.Relief = Gtk.ReliefStyle.None;
     _btnAdd.Clicked += new EventHandler(OnAddButtonClicked);
     _btnAdd.Sensitive = false;
     hbxFirstLine.PackStart(_btnAdd, false, false, 0);
     // "Edit" button
     image = new Gtk.Image();
     image.Stock = Gtk.Stock.JumpTo;
     _btnEdit = new Gtk.Button();
     _btnEdit.Add(image);
     _btnEdit.Relief = Gtk.ReliefStyle.None;
     _btnEdit.Clicked += new EventHandler(OnEditButtonClicked);
     _btnEdit.Sensitive = false;
     hbxFirstLine.PackStart(_btnEdit, false, false, 0);
     // "Delete" button
     image = new Gtk.Image();
     image.Stock = Gtk.Stock.Remove;
     _btnDelete = new Gtk.Button();
     _btnDelete.Add(image);
     _btnDelete.Relief = Gtk.ReliefStyle.None;
     _btnDelete.Clicked += new EventHandler(OnDeleteButtonClicked);
     _btnDelete.Sensitive = false;
     hbxFirstLine.PackStart(_btnDelete, false, false, 0);
     base.PackStart(hbxFirstLine, false, false, 0);
     // --- second line: element list
     _store = new Gtk.TreeStore(typeof(string));
     _tvList = new Gtk.TreeView();
     _tvList.HeadersVisible = false;
     _tvList.AppendColumn("", new Gtk.CellRendererText(), "text", 0);
     _tvList.Model = _store;
     _tvList.FocusInEvent += new Gtk.FocusInEventHandler(EnableButtons);
     _tvList.ButtonPressEvent += new Gtk.ButtonPressEventHandler(ListClickedHandler);
     Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow();
     sw.ShadowType = Gtk.ShadowType.In;
     sw.Add(_tvList);
     base.PackStart(sw, true, true, 0);
     sw.Show();
 }
        public PreferenceView()
        {
            vbox1 = new Gtk.VBox()
            {
                Spacing = 6
            };
            table1 = new Gtk.Table(3, 2, true)
            {
                RowSpacing = 6, ColumnSpacing = 6
            };
            entPassword = new Gtk.Entry()
            {
                CanFocus      = true,
                IsEditable    = true,
                Visibility    = false,
                InvisibleChar = '●'
            };
            table1.Attach(entPassword, 1, 2, 2, 3);
            entUrl = new Gtk.Entry()
            {
                CanFocus = true, IsEditable = true
            };
            table1.Attach(entUrl, 1, 2, 0, 1);
            entUser = new Gtk.Entry()
            {
                CanFocus = true, IsEditable = true
            };
            table1.Attach(entUser, 1, 2, 1, 2);
            lblPassword = new Gtk.Label("Password:"******"Ampache Server Name:");
            table1.Attach(lblUrl, 0, 1, 0, 1);
            lblUser = new Gtk.Label("User Name:");
            table1.Attach(lblUser, 0, 1, 1, 2);
            vbox1.PackStart(table1, true, false, 0);

            hbox1            = new Gtk.HBox();
            btnSave          = new Gtk.Button();
            btnSave.Label    = "Save";
            btnSave.Clicked += Save_OnClicked;
            hbox1.PackStart(btnSave, false, false, 0);
            btnClear          = new Gtk.Button();
            btnClear.Label    = "Clear";
            btnClear.Clicked += Clean_OnClicked;
            hbox1.PackStart(btnClear, true, false, 0);
            vbox1.PackStart(hbox1, false, false, 0);
            this.Add(vbox1);
            ShowAll();

            entUrl.Text      = AmpacheSource.AmpacheRootAddress.Get(AmpacheSource.AmpacheRootAddress.DefaultValue);
            entUser.Text     = AmpacheSource.UserName.Get(AmpacheSource.UserName.DefaultValue);
            entPassword.Text = AmpacheSource.UserPassword.Get(AmpacheSource.UserPassword.DefaultValue);
        }
        protected AbstractEditView()
        {
            saveButton   = new Gtk.Button("Speichern");
            cancelButton = new Gtk.Button("Zurücksetzen");

            saveButton.Clicked   += delegate { OnSave(); };
            cancelButton.Clicked += OnCancel;

            var buttonBox = new Gtk.HBox();

            buttonBox.PackStart(saveButton, false, true, 5);
            buttonBox.PackStart(cancelButton, false, true, 2);
            this.PackEnd(buttonBox, false, false, 5);
        }
Beispiel #27
0
        public InternalMenuButton()
            : base()
        {
            Gtk.HBox box = new Gtk.HBox();
            box.Spacing = 6;
            Add(box);

            image = new Gtk.Image();
            box.PackStart(image, false, false, 0);
            label = new Gtk.Label();
            box.PackStart(label, false, false, 0);
            ArrowType  = Gtk.ArrowType.Down;
            base.Label = null;
        }
Beispiel #28
0
        private void BuildUI()
        {
            Gtk.HBox hbox = new Gtk.HBox(false, 3);
            Add(hbox);

            d_removeButton = new Gtk.Button();
            d_removeButton.Add(new Gtk.Image(Gtk.Stock.Remove, Gtk.IconSize.Menu));
            hbox.PackStart(d_removeButton, false, false, 0);

            d_addButton = new Gtk.Button();
            d_addButton.Add(new Gtk.Image(Gtk.Stock.Add, Gtk.IconSize.Menu));
            hbox.PackStart(d_addButton, false, false, 0);

            hbox.ShowAll();
        }
Beispiel #29
0
 // Drag function for automatic sources, called from DragBegin
 public static void Drag(Gtk.Widget source, Gdk.DragContext ctx, WidgetDropCallback dropCallback, string label)
 {
     Gtk.Frame fr = new Gtk.Frame();
     fr.ShadowType = Gtk.ShadowType.Out;
     Gtk.HBox box = new Gtk.HBox();
     box.Spacing     = 3;
     box.BorderWidth = 3;
     box.PackStart(new Gtk.Image(widgetIcon), false, false, 0);
     Gtk.Label lab = new Gtk.Label(label);
     lab.Xalign = 0;
     box.PackStart(lab, true, true, 0);
     fr.Add(box);
     fr.ShowAll();
     Drag(source, ctx, dropCallback, fr);
 }
		// Drag function for automatic sources, called from DragBegin
		public static void Drag (Gtk.Widget source, Gdk.DragContext ctx, WidgetDropCallback dropCallback, string label)
		{
			Gtk.Frame fr = new Gtk.Frame ();
			fr.ShadowType = Gtk.ShadowType.Out;
			Gtk.HBox box = new Gtk.HBox ();
			box.Spacing = 3;
			box.BorderWidth = 3;
			box.PackStart (new Gtk.Image (widgetIcon), false, false, 0);
			Gtk.Label lab = new Gtk.Label (label);
			lab.Xalign = 0;
			box.PackStart (lab, true, true, 0);
			fr.Add (box);
			fr.ShowAll ();
			Drag (source, ctx, dropCallback, fr);
		}
        public override Gtk.Widget CreatePanelWidget ()
        {
            Gtk.VBox box = new Gtk.VBox ();
            box.Spacing = 6;

            Gtk.HBox labelBox = new Gtk.HBox ();

            Gtk.Label label = CreateLabel ("Android studio executable location:");

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

            entry = new FileEntry ();
            entry.Path = AddInPreferences.AndroidStudioLocation;


            Gtk.HBox sdkVersions = new Gtk.HBox ();
            Gtk.Label minSdkLabel = CreateLabel ("Min SDK version:");
            MinSdkEntry = new Gtk.Entry (AddInPreferences.MinSdkVersion);
            Gtk.Label targetSdkLabel = CreateLabel ("Target/Compile SDK version:");
            TargetSdkEntry = new Gtk.Entry (AddInPreferences.CompileSdkVersion);


            sdkVersions.PackStart (minSdkLabel, false, false, 0);
            sdkVersions.PackStart (MinSdkEntry, true, false, 0);
            sdkVersions.PackStart (targetSdkLabel, false, false, 0);
            sdkVersions.PackStart (TargetSdkEntry, true, false, 0);


            Gtk.HBox otherVersions = new Gtk.HBox ();
            Gtk.Label supportVersionLabel = CreateLabel ("Support library versions:");
            SupportVersionEntry = new Gtk.Entry (AddInPreferences.SupportVersion);
            Gtk.Label buildToolsVersionLabel = CreateLabel ("Build tools version:");
            BuildToolsVersionEntry = new Gtk.Entry (AddInPreferences.BuildToolsVersion);


            otherVersions.PackStart (supportVersionLabel, false, false, 0);
            otherVersions.PackStart (SupportVersionEntry, true, false, 0);
            otherVersions.PackStart (buildToolsVersionLabel, false, false, 0);
            otherVersions.PackStart (BuildToolsVersionEntry, true, false, 0);

            box.PackStart (labelBox, false, false, 0);
            box.PackStart (entry, false, false, 0);
            box.PackStart (sdkVersions, false, false, 0);
            box.PackStart (otherVersions, false, false, 0);
            box.ShowAll ();
            return box;

        }
Beispiel #32
0
        void Build()
        {
            Spacing = 6;

            //var heading = new Gtk.Label("<b>Rhino Options</b>");
            //heading.UseMarkup = true;
            //heading.Xalign = 0;



            pluginTypeCombo = new Gtk.ComboBox(typeEntries);

            launcherCombo = new Gtk.ComboBox(currentLauncherEntries);

            customLauncherEntry          = new Gtk.Entry();
            customLauncherEntry.Changed += (sender, e) => SetBundleVersionLabel();

            var optionsBox = new Gtk.HBox();

            autodetectedTypeLabel = new Gtk.Label();

            bundleInformationLabel = new Gtk.Label();

            // layout

            //PackStart(heading, false, false, 0);


            var table = new Gtk.Table(4, 2, false);

            table.RowSpacing    = 6;
            table.ColumnSpacing = 6;

            AddRow(table, 0, "Plugin Type:", AutoSized(6, pluginTypeCombo, autodetectedTypeLabel));
            AddRow(table, 1, "Launcher:", AutoSized(6, launcherCombo));
            AddRow(table, 2, "", customLauncherEntry); // add browse button?
            AddRow(table, 3, "", AutoSized(0, bundleInformationLabel));

            // indent
            optionsBox.PackStart(new Gtk.Label {
                WidthRequest = 18
            }, false, false, 0);
            optionsBox.PackStart(table, true, true, 0);

            PackStart(optionsBox, true, true, 0);

            ShowAll();
        }
Beispiel #33
0
        private void BuildSaveAsFrame()
        {
            var exSaveAsExpand = new Gtk.Expander("Save as...");
            var hbSaveAs       = new Gtk.HBox(false, 5);

            exSaveAsExpand.Expanded = false;
            this.BuildFormatCombo();
            this.btSaveAs          = new Gtk.Button(Gtk.Stock.SaveAs);
            this.btSaveAs.Clicked += (sender, e) => this.OnSaveAs();

            hbSaveAs.PackStart(this.cbOutputFormat, true, true, 5);
            hbSaveAs.PackStart(this.btSaveAs, false, false, 5);

            exSaveAsExpand.Add(hbSaveAs);
            this.vbPage1.PackStart(exSaveAsExpand, true, true, 5);
        }
        void AddBox(Gtk.VBox parent, out Gtk.Widget box, out Gtk.VBox vbox)
        {
            Gtk.HBox  hbox = new Gtk.HBox();
            Gtk.Label sep  = new Gtk.Label("");
            sep.WidthRequest = 24;
            sep.Show();
            hbox.PackStart(sep, false, false, 0);

            vbox         = new Gtk.VBox();
            vbox.Spacing = 6;
            vbox.Show();
            hbox.PackStart(vbox, true, true, 0);

            parent.PackStart(hbox, false, false, 0);
            box = hbox;
        }
Beispiel #35
0
            public FloatingQuickFixIconWidget(
                CodeActionEditorExtension codeActionEditorExtension,
                LanguageItemWindow window,
                SourceEditorView sourceEditorView,
                CodeActionContainer fixes,
                Cairo.Point point) : base(Gtk.WindowType.Popup)
            {
                this.ext              = codeActionEditorExtension;
                this.window           = window;
                this.sourceEditorView = sourceEditorView;
                this.fixes            = fixes;
                this.point            = point;
                this.Decorated        = false;
                this.Events          |= EventMask.ButtonPressMask | EventMask.LeaveNotifyMask | EventMask.EnterNotifyMask;
                TypeHint              = Gdk.WindowTypeHint.Utility;
                var fr = new Gtk.HBox();

                fr.BorderWidth = 2;
                var view = new ImageView(SmartTagMarginMarker.GetIconId(fixes.GetSmartTagSeverity()), Gtk.IconSize.Menu);

                fr.PackStart(view, false, false, 0);
                fr.PackEnd(new RectangleMarker(), false, false, 0);
                Add(fr);
                ext.FixesMenuClosed += Ext_FixesMenuClosed;

                ShowAll();
            }
Beispiel #36
0
        internal virtual void AttachMainToolbar(Gtk.VBox parent, IMainToolbarView toolbar)
        {
            var toolbarBox = new Gtk.HBox();

            parent.PackStart(toolbarBox, false, false, 0);
            toolbarBox.PackStart((MainToolbar)toolbar, true, true, 0);
        }
        void Initialize(ActionGroupDesignerFrontend frontend, Wrapper.ActionGroupCollection actionGroups, bool singleGroupMode)
        {
            this.frontend        = frontend;
            this.singleGroupMode = singleGroupMode;
            IconSize             = Gtk.IconSize.SmallToolbar;
            Orientation          = Gtk.Orientation.Horizontal;
            ToolbarStyle         = Gtk.ToolbarStyle.BothHoriz;

            combo = Gtk.ComboBox.NewText();

            if (!singleGroupMode)
            {
                combo.Changed += OnActiveChanged;

                Gtk.ToolItem comboItem = new Gtk.ToolItem();
                Gtk.HBox     cbox      = new Gtk.HBox();
                cbox.PackStart(new Gtk.Label(Catalog.GetString("Action Group:") + " "), false, false, 3);
                cbox.PackStart(combo, true, true, 3);
                comboItem.Add(cbox);
                comboItem.ShowAll();
                Insert(comboItem, -1);
                internalButtons.Add(comboItem);

                addButton          = new Gtk.ToolButton(Gtk.Stock.Add);
                addButton.Clicked += OnAddGroup;
                Insert(addButton, -1);
                internalButtons.Add(addButton);

                removeButton          = new Gtk.ToolButton(Gtk.Stock.Remove);
                removeButton.Clicked += OnRemoveGroup;
                Insert(removeButton, -1);
                internalButtons.Add(removeButton);

                ActionGroups = actionGroups;

                if (actionGroups != null && actionGroups.Count > 0)
                {
                    combo.Active = 0;
                }
            }
            else
            {
                UpdateActionCommands(null);
            }

            ShowAll();
        }
        public override Gtk.Widget CreatePanelWidget()
        {
            var vbox = new Gtk.VBox ();
            var hbox = new Gtk.HBox ();
            var label = new Gtk.Label (GettextCatalog.GetString ("DNX Runtime Version:"));
            label.Xalign = 0;
            hbox.PackStart (label, false, false, 5);

            dnxRuntimeVersionComboBox = Gtk.ComboBox.NewText ();
            hbox.PackStart (dnxRuntimeVersionComboBox, true, true, 5);

            PopulateOptionsPanel ();

            vbox.PackStart (hbox);
            vbox.ShowAll ();
            return vbox;
        }
        private static void AddCheckProperty(Gtk.VBox vbox, string labelText, Gtk.CheckButton checkButton, ConfigurationProperty <bool> property)
        {
            var hbox = new Gtk.HBox();

            checkButton.Active = property.Value;
            hbox.PackStart(checkButton, false, false, 0);

            var label = new Gtk.Label
            {
                Text   = GettextCatalog.GetString(labelText),
                Xalign = 0
            };

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

            vbox.PackStart(hbox, false, false, 0);
        }
        public override Gtk.Widget CreatePanelWidget()
        {
            var vbox = new Gtk.VBox ();
            var hbox = new Gtk.HBox ();
            var label = new Gtk.Label (GettextCatalog.GetString ("DNX Output Verbosity:"));
            label.Xalign = 0;
            hbox.PackStart (label, false, false, 5);

            logLevelsComboBox = Gtk.ComboBox.NewText ();
            hbox.PackStart (logLevelsComboBox, true, true, 5);

            AddLogLevelsToComboBox ();

            vbox.PackStart (hbox, false, false, 0);
            vbox.ShowAll ();
            return vbox;
        }
		void Initialize (ActionGroupDesignerFrontend frontend, Wrapper.ActionGroupCollection actionGroups, bool singleGroupMode)
		{
			this.frontend = frontend;
			this.singleGroupMode = singleGroupMode;
			IconSize = Gtk.IconSize.SmallToolbar;
			Orientation = Gtk.Orientation.Horizontal;
			ToolbarStyle = Gtk.ToolbarStyle.BothHoriz;
			
			combo = Gtk.ComboBox.NewText ();
			
			if (!singleGroupMode) {
				combo.Changed += OnActiveChanged;

				Gtk.ToolItem comboItem = new Gtk.ToolItem ();
				Gtk.HBox cbox = new Gtk.HBox ();
				cbox.PackStart (new Gtk.Label (Catalog.GetString ("Action Group:") + " "), false, false, 3);
				cbox.PackStart (combo, true, true, 3);
				comboItem.Add (cbox);
				comboItem.ShowAll ();
				Insert (comboItem, -1);
				internalButtons.Add (comboItem);
				
				addButton = new Gtk.ToolButton (Gtk.Stock.Add);
				addButton.Clicked += OnAddGroup;
				Insert (addButton, -1);
				internalButtons.Add (addButton);
				
				removeButton = new Gtk.ToolButton (Gtk.Stock.Remove);
				removeButton.Clicked += OnRemoveGroup;
				Insert (removeButton, -1);
				internalButtons.Add (removeButton);
				
				ActionGroups = actionGroups;
				
				if (actionGroups != null && actionGroups.Count > 0)
					combo.Active = 0;
			} else {
				UpdateActionCommands (null);
			}

			ShowAll ();
		}
Beispiel #42
0
 public static Gtk.Widget CreateCellRenderer(ICollection<CellView> views)
 {
     if (views.Count == 1) {
         Gtk.HBox box = new Gtk.HBox ();
         foreach (var v in views)
             box.PackStart (CreateCellRenderer (v), false, false, 0);
         box.ShowAll ();
         return box;
     }
     else
         return CreateCellRenderer (views.First ());
 }
Beispiel #43
0
		public NoteMenuItem (Note note, bool show_pin)
			: base (GetDisplayName(note))
		{
			this.note = note;
			Image = new Gtk.Image (note_icon);
#if HAS_GTK_2_16
			this.SetAlwaysShowImage (true);
#endif
			if (show_pin) {
				Gtk.HBox box = new Gtk.HBox (false, 0);
				Gtk.Widget child = Child;
				Remove (child);
				box.PackStart (child, true, true, 0);
				Add (box);
				box.Show();

				pinned = note.IsPinned;
				pin_img = new Gtk.Image(pinned ? pindown : pinup);
				pin_img.Show();
				box.PackStart (pin_img, false, false, 0);
			}
		}
Beispiel #44
0
		public MessageDialog ()
		{
			Resizable = false;
			HasSeparator = false;
			BorderWidth = 12;

			label = new Gtk.Label ();
			label.LineWrap = true;
			label.Selectable = true;
			label.UseMarkup = true;
			label.SetAlignment (0.0f, 0.0f);

			secondaryLabel = new Gtk.Label ();
			secondaryLabel.LineWrap = true;
			secondaryLabel.Selectable = true;
			secondaryLabel.UseMarkup = true;
			secondaryLabel.SetAlignment (0.0f, 0.0f);

			icon = new Gtk.Image (Gtk.Stock.DialogInfo, Gtk.IconSize.Dialog);
			icon.SetAlignment (0.5f, 0.0f);

			Gtk.StockItem item = Gtk.Stock.Lookup (icon.Stock);
			Title = item.Label;

			Gtk.HBox hbox = new Gtk.HBox (false, 12);
			Gtk.VBox vbox = new Gtk.VBox (false, 12);

			vbox.PackStart (label, false, false, 0);
			vbox.PackStart (secondaryLabel, true, true, 0);

			hbox.PackStart (icon, false, false, 0);
			hbox.PackStart (vbox, true, true, 0);

			VBox.PackStart (hbox, false, false, 0);
			hbox.ShowAll ();

			Buttons = Gtk.ButtonsType.OkCancel;
		}
Beispiel #45
0
        void Build()
        {
            Gtk.VBox mainBox = new Gtk.VBox ();
            mainBox.BorderWidth = 10;

            picker = new PickerWidget ();
            mainBox.PackStart (picker);

            Gtk.HBox hbox = new Gtk.HBox ();
            hbox.PackStart (new Gtk.Label ("S:"), false, false, 0);
            saturationScale = new Gtk.HScale (0, 1, 0.01);
            saturationScale.Value = 1;
            saturationScale.ShowFillLevel = false;
            saturationScale.CanFocus = false;
            saturationScale.DrawValue = false;
            saturationScale.ValueChanged += (sender, e) => picker.Saturation = saturationScale.Value;

            hbox.PackStart (saturationScale, true, true, 0);
            mainBox.PackStart (hbox);

            Add (mainBox);
            ShowAll ();
        }
		public override Control CreatePanelWidget()
		{
			var vbox = new Gtk.VBox();
			vbox.Spacing = 6;

			var generalSectionLabel = new Gtk.Label("<b>" + GettextCatalog.GetString("General") + "</b>");
			generalSectionLabel.UseMarkup = true;
			generalSectionLabel.Xalign = 0;
			vbox.PackStart(generalSectionLabel, false, false, 0);

			var outputDirectoryHBox = new Gtk.HBox();
			outputDirectoryHBox.BorderWidth = 10;
			outputDirectoryHBox.Spacing = 6;
			var outputDirectoryLabel = new Gtk.Label(GettextCatalog.GetString("Output directory:"));
			outputDirectoryLabel.Xalign = 0;
			outputDirectoryHBox.PackStart(outputDirectoryLabel, false, false, 0);
			folderEntry.Path = Options.OutputPath.Value;
			outputDirectoryHBox.PackStart(folderEntry, true, true, 0);

			vbox.PackStart(outputDirectoryHBox, false, false, 0);
			vbox.ShowAll();
			return vbox;
		}
Beispiel #47
0
		public static Gtk.Button MakeImageButton (Gtk.Image image, string label)
		{
			Gtk.HBox box = new Gtk.HBox (false, 2);
			box.PackStart (image, false, false, 0);
			box.PackEnd (new Gtk.Label (label), false, false, 0);
			box.ShowAll ();

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

			Gtk.Alignment align = new Gtk.Alignment (0.5f, 0.5f, 0.0f, 0.0f);
			align.Add (box);
			align.Show ();

			button.Add (align);
			return button;
		}			
        public PreferenceView()
        {
            vbox1 = new Gtk.VBox () { Spacing = 6 };
            table1 = new Gtk.Table (3, 2, true) { RowSpacing = 6, ColumnSpacing = 6 };
            entPassword = new Gtk.Entry () {
                CanFocus = true,
                IsEditable = true,
                Visibility = false,
                InvisibleChar = '●'
            };
            table1.Attach (entPassword, 1, 2, 2, 3);
            entUrl = new Gtk.Entry () { CanFocus = true, IsEditable = true };
            table1.Attach (entUrl, 1, 2, 0, 1);
            entUser = new Gtk.Entry () { CanFocus = true, IsEditable = true };
            table1.Attach (entUser, 1, 2, 1, 2);
            lblPassword = new Gtk.Label ("Password:"******"Ampache Server Name:");
            table1.Attach (lblUrl, 0, 1, 0 ,1);
            lblUser = new Gtk.Label ("User Name:");
            table1.Attach (lblUser, 0, 1, 1, 2);
            vbox1.PackStart (table1, true, false, 0);

            hbox1 = new Gtk.HBox ();
            btnSave = new Gtk.Button ();
            btnSave.Label = "Save";
            btnSave.Clicked += Save_OnClicked;
            hbox1.PackStart (btnSave, false, false, 0);
            btnClear = new Gtk.Button ();
            btnClear.Label = "Clear";
            btnClear.Clicked += Clean_OnClicked;
            hbox1.PackStart (btnClear, true, false, 0);
            vbox1.PackStart (hbox1, false, false, 0);
            this.Add (vbox1);
            ShowAll ();

            entUrl.Text = AmpacheSource.AmpacheRootAddress.Get(AmpacheSource.AmpacheRootAddress.DefaultValue);
            entUser.Text = AmpacheSource.UserName.Get(AmpacheSource.UserName.DefaultValue);
            entPassword.Text = AmpacheSource.UserPassword.Get(AmpacheSource.UserPassword.DefaultValue);
        }
Beispiel #49
0
        public Header(string text)
            : base()
        {
            base.SetSizeRequest (-1, 30);

            Gtk.Alignment alignment = new Gtk.Alignment (0, 0, 1, 1);
            alignment.TopPadding = 1;
            alignment.LeftPadding = 5;
            alignment.RightPadding = 0;
            alignment.BottomPadding = 1;
            base.Add (alignment);

            //Select ();

            Gtk.HBox box = new Gtk.HBox ();
            alignment.Add (box);

            label = new Gtk.Label ();
            label.Ypad = 3;
            //	label.Xpad = 3;
            //base.Add (label);
            box.PackStart (label, true, true, 0);
            label.SetAlignment (0f, 0.5f);
            label.Justify = Gtk.Justification.Left;

            label.Markup = "<b>" + text + "</b>";

            closeButton = new Gtk.Button ();
            closeButton.Add (new Gtk.Image ("gtk-close", Gtk.IconSize.Menu));
            closeButton.Relief = Gtk.ReliefStyle.None;
            box.PackEnd (closeButton, false, false, 0);
            closeButton.ShowAll ();

            label.Show ();
            box.Show ();
            alignment.Show ();

            closeButton.Clicked += closeButton_Clicked;
        }
		Control IOptionsPanel.CreatePanelWidget ()
		{
			Gtk.VBox cbox = new Gtk.VBox (false, 6);
			Gtk.HBox combosBox = new Gtk.HBox (false, 6);
			cbox.PackStart (combosBox, false, false, 0);
			combosBox.PackStart (new Gtk.Label (GettextCatalog.GetString ("Configuration:")), false, false, 0);
			configListStore = new Gtk.ListStore (typeof(string), typeof(string));
			configCombo = new Gtk.ComboBox (configListStore);
			var cell = new Gtk.CellRendererText ();
			configCombo.PackStart (cell, true);
			configCombo.AddAttribute (cell, "text", 0);
			combosBox.PackStart (configCombo, false, false, 0);
			combosBox.PackStart (new Gtk.Label (GettextCatalog.GetString ("Platform:")), false, false, 0);
			platformCombo = Gtk.ComboBox.NewText ();
			combosBox.PackStart (platformCombo, false, false, 0);
			cbox.PackStart (new Gtk.HSeparator (), false, false, 0);
			cbox.ShowAll ();

			cbox.Hidden += OnPageHidden;
			cbox.Shown += OnPageShown;
			
			lastConfigSelection = -1;
			lastPlatformSelection = -1;
			
			FillConfigurations ();
			UpdateSelection ();
			
			configCombo.Changed += OnConfigChanged;
			platformCombo.Changed += OnConfigChanged;
			
			bool oldMixed = allowMixedConfigurations;
			Gtk.Widget child = CreatePanelWidget ();
			
			//HACK: work around bug 469427 - broken themes match on widget names
			if (child.Name.IndexOf ("Panel") > 0)
				child.Name = child.Name.Replace ("Panel", "_");
			
			cbox.PackStart (child, true, true, 0);
			
			if (allowMixedConfigurations != oldMixed) {
				// If mixed mode has changed, update the configuration list
				FillConfigurations ();
				UpdateSelection ();
			}
			widgetCreated = true;
			panelWidget = child;
			
			if (currentConfigs.Count > 0) {
				panelWidget.Sensitive = true;
				LoadConfigData ();
			}
			else
				panelWidget.Sensitive = false;
			
			return cbox;
		}
		public InsertTimestampPreferences () : base (false, 12)
		{	
			// Get current values
			String dateFormat = (string) Preferences.Get (
				Preferences.INSERT_TIMESTAMP_FORMAT);

			DateTime now = DateTime.Now;

			// Label
			Gtk.Label label = new Gtk.Label (Catalog.GetString (
				"Choose one of the predefined formats " +
				"or use your own."));
			label.Wrap = true;
			label.Xalign = 0;
			PackStart (label);

			// Use Selected Format
			selected_radio = new Gtk.RadioButton (Catalog.GetString (
				"Use _Selected Format"));
			PackStart (selected_radio);

			// 1st column (visible): formatted date
			// 2nd column (not visible): date format
			store = new Gtk.ListStore (typeof (string),
				typeof (string));
			foreach (String format in formats)
				store.AppendValues (now.ToString (format), format);

			scroll = new Gtk.ScrolledWindow();
			scroll.ShadowType = Gtk.ShadowType.In;
			PackStart (scroll);

			tv = new Gtk.TreeView (store);
			tv.HeadersVisible = false;
			tv.AppendColumn ("Format", new Gtk.CellRendererText (),
				"text", 0);
			scroll.Add (tv);

			// Use Custom Format
			Gtk.HBox customBox = new Gtk.HBox (false, 12);
			PackStart (customBox);

			custom_radio = new Gtk.RadioButton (
				selected_radio, Catalog.GetString ("_Use Custom Format"));
			customBox.PackStart (custom_radio);

			custom_entry = new Gtk.Entry ();
			customBox.PackStart (custom_entry);

			IPropertyEditor entryEditor = Services.Factory.CreatePropertyEditorEntry (
				Preferences.INSERT_TIMESTAMP_FORMAT, custom_entry);
			entryEditor.Setup ();

			// Activate/deactivate widgets
			bool useCustom = true;
			Gtk.TreeIter iter;
			store.GetIterFirst (out iter);

			foreach (object[] row in store) {
				if (dateFormat.Equals (row[1])) {
					// Found format in list
					useCustom = false;
					break;
				}	
				store.IterNext (ref iter);
			}

			if (useCustom) {
				custom_radio.Active = true;
				scroll.Sensitive = false;
			} else {
				selected_radio.Active = true;
				custom_entry.Sensitive = false;
				tv.Selection.SelectIter (iter);
				Gtk.TreePath path = store.GetPath (iter);				
				tv.ScrollToCell (path, null, false, 0, 0);
			}

			// Register Toggled event for one radio button only
			selected_radio.Toggled += OnSelectedRadioToggled;
			tv.Selection.Changed += OnSelectionChanged;

			ShowAll ();
		}
Beispiel #52
0
        private void BuildCategoriesFrame()
        {
            var vbBox = new Gtk.VBox( false, 5 );
            var vbExpandedBox = new Gtk.VBox( false, 5 );
            var hbAvailableCategories = new Gtk.HBox( false, 5 );
            var hbCurrentCategories = new Gtk.HBox( false, 5 );
            var exExpandCategories = new Gtk.Expander( "Categories" );

            // The frame
            this.frmCategories = new Gtk.Frame( "Manage categories" );
            this.frmCategories.Add( vbBox );

            // The expander
            exExpandCategories.Expanded = false;
            exExpandCategories.Add( vbExpandedBox );
            this.btAddCategory = new Gtk.Button( Gtk.Stock.Add );
            this.btAddCategory.Clicked += (sender, e) => this.OnAddCategory();
            this.btRemoveCategory = new Gtk.Button( Gtk.Stock.Add );
            this.btRemoveCategory.Clicked += (sender, e) => this.OnRemoveCategory();
            this.btRemoveCategory = new Gtk.Button( Gtk.Stock.Remove );
            this.cbAvailableCategories = new Gtk.ComboBox( new string[] { "" } );
            this.cbCurrentCategories = new Gtk.ComboBox( new string[] { "" } );
            hbAvailableCategories.PackStart( new Gtk.Label( "Available:" ), false, false, 5 );
            hbAvailableCategories.PackStart( this.cbAvailableCategories, true, true, 5 );
            hbAvailableCategories.PackStart( this.btAddCategory, false, false, 5 );
            hbCurrentCategories.PackStart( new Gtk.Label( "Current:" ), false, false, 5 );
            hbCurrentCategories.PackStart( this.cbCurrentCategories, true, true, 5 );
            hbCurrentCategories.PackStart( this.btRemoveCategory, false, false, 5 );
            vbExpandedBox.PackStart( hbCurrentCategories, true, true, 5 );
            vbExpandedBox.PackStart( hbAvailableCategories, true, true, 5 );

            // Categories
            this.lblCategories = new Gtk.Label() {  Markup = "<i>Current categories</i>:" };

            vbBox.PackStart( this.lblCategories, true, true, 5 );
            vbBox.PackStart( exExpandCategories, true, true, 5 );
            this.vbPage1.PackStart( this.frmCategories, true, true, 5 );
        }
Beispiel #53
0
 public Main(Controller.Main c)
     : base(Gtk.WindowType.Toplevel)
 {
     ctl = c;
     Name = "di";
     Title = "di";
     DefaultWidth = 800;
     DefaultHeight = 600;
     DeleteEvent += OnDeleteEvent;
     topLevelBox = new Gtk.HBox();
     topLevelBox.Homogeneous = false;
     topLevelBox.Spacing = 20;
     Add(topLevelBox);
     windowsBox = new Gtk.HBox();
     windowsBox.Homogeneous = true;
     windowsBox.Spacing = 10;
     foreach (var window in ctl.Windows)
     {
         var view = new WindowView(this, window);
         windowsBox.Add(view);
     }
     topLevelBox.PackStart(windowsBox, true, true, 0);
     ctl.Windows.Added.Add((index, window) =>
     {
         var view = new WindowView(this, window);
         windowsBox.Add(view);
         windowsBox.ShowAll();
     });
     ctl.Windows.Removed.Add((index, window) =>
     {
         var view = windowsBox.Children[index];
         bool hadFocus = view.ContainsFocus();
         windowsBox.Remove(view);
         if (hadFocus && windowsBox.Children.Length > 0)
         {
             windowsBox.Children[0].GiveFocus();
         }
     });
     ctl.Windows.Cleared.Add(() =>
     {
         foreach (var view in windowsBox.Children)
         {
             windowsBox.Remove(view);
         }
     });
     ctl.Windows.CurrentChanged.Add((idx, win) => ApplyControllerFocus(win));
     ctl.BeginTask.Add(task =>
     {
         var sidebar = Sidebar.Create(task);
         topLevelBox.PackEnd(sidebar, false, false, 20);
         task.End.Add(() =>
         {
             bool hadFocus = sidebar.ContainsFocus();
             topLevelBox.Remove(sidebar);
             if (hadFocus)
             {
                 ApplyControllerFocus(ctl.Windows.Current);
             }
         });
         sidebar.ShowAll();
     });
 }
Beispiel #54
0
        private void BuildSaveAsFrame()
        {
            var exSaveAsExpand = new Gtk.Expander( "Save as..." );
            var hbSaveAs = new Gtk.HBox( false, 5 );

            exSaveAsExpand.Expanded = false;
            this.BuildFormatCombo();
            this.btSaveAs = new Gtk.Button( Gtk.Stock.SaveAs );
            this.btSaveAs.Clicked += (sender, e) => this.OnSaveAs();

            hbSaveAs.PackStart( this.cbOutputFormat, true, true, 5 );
            hbSaveAs.PackStart( this.btSaveAs, false, false, 5 );

            exSaveAsExpand.Add( hbSaveAs );
            this.vbPage1.PackStart( exSaveAsExpand, true, true, 5 );
        }
Beispiel #55
0
        private void BuildSecondAddresses()
        {
            var hbEmail2 = new Gtk.HBox( false, 5 );
            var hbWeb = new Gtk.HBox( false, 5 );
            var hbWPhone = new Gtk.HBox( false, 5 );
            var hbHPhone = new Gtk.HBox( false, 5 );
            var hbAddress = new Gtk.HBox( false, 5 );
            var hbId = new Gtk.HBox( false, 5 );
            var hbComments = new Gtk.HBox( false, 5 );

            // Email2
            this.edEmail2 = new Gtk.Entry();
            this.btConnectEmail2 = new Gtk.Button( Gtk.Stock.Connect );
            this.btConnectEmail2.Clicked += (sender, e) => this.OnConnect( sender );
            hbEmail2.PackStart( new Gtk.Label( "Email(2):" ), false, false, 5 );
            hbEmail2.PackStart( this.edEmail2, true, true, 5 );
            hbEmail2.PackStart( this.btConnectEmail2, false, false, 5 );

            // Web
            this.edWeb = new Gtk.Entry( "http://" );
            this.btConnectWeb = new Gtk.Button( Gtk.Stock.Connect );
            this.btConnectWeb.Clicked += (sender, e) => this.OnConnectWeb();
            hbWeb.PackStart( new Gtk.Label( "Web:" ), false, false, 5 );
            hbWeb.PackStart( this.edWeb, true, true, 5 );
            hbWeb.PackStart( this.btConnectWeb, false, false, 5 );

            // Work phone
            this.edWPhone = new Gtk.Entry( "0" );
            hbWPhone.PackStart( new Gtk.Label( "Work phone:" ), false, false, 5 );
            hbWPhone.PackStart( this.edWPhone, true, true, 5 );

            // Home phone
            this.edHPhone = new Gtk.Entry();
            hbHPhone.PackStart( new Gtk.Label( "Home phone:" ), false, false, 5 );
            hbHPhone.PackStart( this.edHPhone, true, true, 5 );

            // Address
            this.edAddress = new Gtk.Entry();
            this.btConnectMap = new Gtk.Button( Gtk.Stock.Connect );
            this.btConnectMap.Clicked += (sender, ed) => this.OnConnectMap();
            hbAddress.PackStart( new Gtk.Label( "Address:" ), false, false, 5 );
            hbAddress.PackStart( this.edAddress, true, true, 5 );
            hbAddress.PackStart( this.btConnectMap, false, false, 5 );

            // Id
            this.edId = new Gtk.Entry();
            hbId.PackStart( new Gtk.Label( "Id:" ), false, false, 5 );
            hbId.PackStart( this.edId, true, true, 5 );

            // Comments
            this.edComments = new Gtk.Entry();
            hbComments.PackStart( new Gtk.Label( "Comments:" ), false, false, 5 );
            hbComments.PackStart( this.edComments, true, true, 5 );

            this.vbPage2.PackStart( hbEmail2, true, true, 5 );
            this.vbPage2.PackStart( hbWeb, true, true, 5 );
            this.vbPage2.PackStart( hbWPhone, true, true, 5 );
            this.vbPage2.PackStart( hbHPhone, true, true, 5 );
            this.vbPage2.PackStart( hbAddress, true, true, 5 );
            this.vbPage2.PackStart( hbId, true, true, 5 );
            this.vbPage2.PackStart( hbComments, true, true, 5 );
        }
Beispiel #56
0
        private void BuildNameFrame()
        {
            var vbBox = new Gtk.VBox( false, 5 );

            // The frame
            this.frmName = new Gtk.Frame( "Name" );
            this.frmName.Add( vbBox );

            // Given name
            var hbGivenName = new Gtk.HBox( false, 5 );
            this.edName = new Gtk.Entry();
            hbGivenName.PackStart( new Gtk.Label(){ Markup = "<b>Name</b>" }, false, false, 5 );
            hbGivenName.PackStart( this.edName, true, true, 5 );

            // Family name
            var hbFamilyName = new Gtk.HBox( false, 5 );
            this.edSurname = new Gtk.Entry();
            hbFamilyName.PackStart( new Gtk.Label() { Markup = "<b>Surname</b> <i>(or activity)</i>" }, false, false, 5 );
            hbFamilyName.PackStart( this.edSurname, true, true, 5 );

            vbBox.PackStart( hbGivenName, true, true, 5 );
            vbBox.PackStart( hbFamilyName, true, true, 5 );
            this.vbPage1.PackStart( this.frmName, true, true, 5 );
        }
Beispiel #57
0
        private void BuildContactFrame()
        {
            var vbBox = new Gtk.VBox( false, 5 );

            // The frame
            this.frmContact = new Gtk.Frame( "Main contact info" );
            this.frmContact.Add( vbBox );

            // Email
            var hbEmail = new Gtk.HBox( false, 5 );
            this.edEmail = new Gtk.Entry();
            this.btConnectEmail = new Gtk.Button( Gtk.Stock.Connect );
            this.btConnectEmail.Clicked += (sender, e) => this.OnConnect( sender );
            hbEmail.PackStart( new Gtk.Label(){ Markup = "<b>E.mail</b>" }, false, false, 5 );
            hbEmail.PackStart( this.edEmail, true, true, 5 );
            hbEmail.PackStart( this.btConnectEmail, false, false, 5 );

            // Mobile phone
            var hbMobilePhone = new Gtk.HBox( false, 5 );
            this.edMPhone = new Gtk.Entry();
            hbMobilePhone.PackStart( new Gtk.Label(){ Markup = "<b>Mobil phone</b>" }, false, false, 5 );
            hbMobilePhone.PackStart( this.edMPhone, true, true, 5 );

            vbBox.PackStart( hbEmail, true, true, 5 );
            vbBox.PackStart( hbMobilePhone, true, true, 5 );
            this.vbPage1.PackStart( this.frmContact, true, true, 5 );
        }
Beispiel #58
0
        public ChatView(ChatModel chat)
        {
            Trace.Call(chat);

            _ChatModel = chat;

            IsAutoScrolling = true;
            MessageTextView tv = new MessageTextView();
            _EndMark = tv.Buffer.CreateMark("end", tv.Buffer.EndIter, false);
            tv.ShowTimestamps = true;
            tv.ShowMarkerline = true;
            tv.Editable = false;
            tv.CursorVisible = true;
            tv.WrapMode = Gtk.WrapMode.Char;
            tv.MessageAdded += OnMessageTextViewMessageAdded;
            tv.MessageHighlighted += OnMessageTextViewMessageHighlighted;
            tv.PopulatePopup += OnMessageTextViewPopulatePopup;
            tv.SizeRequested += delegate {
                AutoScroll();
            };
            tv.PersonClicked += OnMessageTextViewPersonClicked;
            _OutputMessageTextView = tv;

            Gtk.ScrolledWindow sw = new Gtk.ScrolledWindow();
            _OutputScrolledWindow = sw;
            //sw.HscrollbarPolicy = Gtk.PolicyType.Never;
            sw.HscrollbarPolicy = Gtk.PolicyType.Automatic;
            sw.VscrollbarPolicy = Gtk.PolicyType.Always;
            sw.ShadowType = Gtk.ShadowType.In;
            sw.Vadjustment.ValueChanged += OnVadjustmentValueChanged;
            sw.Add(_OutputMessageTextView);

            // popup menu
            _TabMenu = new Gtk.Menu();
            _TabMenu.Shown += OnTabMenuShown;

            //FocusChild = _OutputTextView;
            //CanFocus = false;

            _TabLabel = new Gtk.Label();

            TabImage = DefaultTabImage;
            _TabHBox = new Gtk.HBox();
            _TabHBox.PackEnd(new Gtk.Fixed(), true, true, 0);
            _TabHBox.PackEnd(_TabLabel, false, false, 0);
            _TabHBox.PackStart(TabImage, false, false, 2);
            _TabHBox.ShowAll();

            _TabEventBox = new Gtk.EventBox();
            _TabEventBox.VisibleWindow = false;
            _TabEventBox.ButtonPressEvent += new Gtk.ButtonPressEventHandler(OnTabButtonPress);
            _TabEventBox.Add(_TabHBox);
            _TabEventBox.ShowAll();

            _ThemeSettings = new ThemeSettings();

            // OPT-TODO: this should use a TaskStack instead of TaskQueue
            _LastSeenHighlightQueue = new TaskQueue("LastSeenHighlightQueue("+ID+")");
            _LastSeenHighlightQueue.AbortedEvent += OnLastSeenHighlightQueueAbortedEvent;
            _LastSeenHighlightQueue.ExceptionEvent += OnLastSeenHighlightQueueExceptionEvent;
        }
        private void BuildWidget()
        {
            alignment = new Gtk.Alignment (0.5f, 0.5f, 1f, 0f);
            alignment.SetPadding (1, 1, 3, 3);
            VisibleWindow = false;

            box = new Gtk.HBox ();
            entry = new FramelessEntry (this);
            filter_button = new HoverImageButton (searchImage);
            clear_button = new HoverImageButton (clearImage);

            entryAlignment = new Gtk.Alignment (0.5f, 0.5f, 1f, 1f);
            alignment.SetPadding (0, 0, 3, 3);
            entryAlignment.Add (entry);
            box.PackStart (filter_button, false, false, 0);
            box.PackStart (entryAlignment, true, true, 0);
            box.PackStart (clear_button, false, false, 0);
            alignment.Add (box);
            Add (alignment);
            alignment.ShowAll ();

            entry.StyleSet += OnInnerEntryStyleSet;
            entry.StateChanged += OnInnerEntryStateChanged;
            entry.FocusInEvent += OnInnerEntryFocusEvent;
            entry.FocusOutEvent += OnInnerEntryFocusEvent;
            entry.Changed += OnInnerEntryChanged;
            entry.Activated += delegate {
                NotifyActivated ();
            };

            filter_button.CanFocus = false;
            clear_button.CanFocus = false;

            filter_button.ButtonReleaseEvent += OnButtonReleaseEvent;
            clear_button.ButtonReleaseEvent += OnButtonReleaseEvent;
            clear_button.Clicked += OnClearButtonClicked;

            ShowHideButtons ();
        }
Beispiel #60
0
        public void SetContent(string label, bool useMnemonic, ImageDescription image, ContentPosition position)
        {
            Widget.UseUnderline = useMnemonic;
            this.image = image;

            if (label != null && label.Length == 0)
                label = null;

            Button b = (Button) Frontend;
            if (label != null && image.Backend == null && b.Type == ButtonType.Normal) {
                Widget.Label = label;
                return;
            }

            if (b.Type == ButtonType.Disclosure) {
                Widget.Label = null;
                Widget.Image = new Gtk.Arrow (Gtk.ArrowType.Down, Gtk.ShadowType.Out);
                Widget.Image.ShowAll ();
                return;
            }

            Gtk.Widget contentWidget = null;

            Gtk.Widget imageWidget = null;
            if (image.Backend != null)
                imageWidget = new ImageBox (ApplicationContext, image.WithDefaultSize (Gtk.IconSize.Button));

            labelWidget = null;

            if (label != null && imageWidget == null) {
                contentWidget = labelWidget = new Gtk.Label (label);
            }
            else if (label == null && imageWidget != null) {
                contentWidget = imageWidget;
            }
            else if (label != null && imageWidget != null) {
                Gtk.Box box = position == ContentPosition.Left || position == ContentPosition.Right ? (Gtk.Box) new Gtk.HBox (false, 3) : (Gtk.Box) new Gtk.VBox (false, 3);
                labelWidget = new Gtk.Label (label) { UseUnderline = useMnemonic };

                if (position == ContentPosition.Left || position == ContentPosition.Top) {
                    box.PackStart (imageWidget, false, false, 0);
                    box.PackStart (labelWidget, false, false, 0);
                } else {
                    box.PackStart (labelWidget, false, false, 0);
                    box.PackStart (imageWidget, false, false, 0);
                }

                contentWidget = box;
            }
            var expandButtonContent = false;
            if (b.Type == ButtonType.DropDown) {
                if (contentWidget != null) {
                    Gtk.HBox box = new Gtk.HBox (false, 3);
                    box.PackStart (contentWidget, true, true, 3);
                    box.PackStart (new Gtk.Arrow (Gtk.ArrowType.Down, Gtk.ShadowType.Out), false, false, 0);
                    contentWidget = box;
                    expandButtonContent = true;
                } else
                    contentWidget = new Gtk.Arrow (Gtk.ArrowType.Down, Gtk.ShadowType.Out);
            }
            if (contentWidget != null) {
                contentWidget.ShowAll ();
                Widget.Label = null;
                Widget.Image = contentWidget;
                var alignment = Widget.Child as Gtk.Alignment;
                if (alignment != null) {
                    if (expandButtonContent) {
                        var box = alignment.Child as Gtk.Box;
                        if (box != null) {
                            alignment.Xscale = 1;
                            box.SetChildPacking (box.Children [0], true, true, 0, Gtk.PackType.Start);
                            if (labelWidget != null)
                                labelWidget.Xalign = 0;
                        }
                    } else if (position == ContentPosition.Left && (contentWidget is Gtk.Box)) {
                        // in case the button is wider than its natural size and has text and an image on the left,
                        // optimize its alignment to make the text more centered.
                        // FIXME: more sophisticated size calculation
                        alignment.Xalign = 0.475f;
                    }
                }
                if (labelWidget != null) {
                    labelWidget.UseUnderline = useMnemonic;
                    if (customFont != null)
                        labelWidget.ModifyFont (customFont);
                    if (customLabelColor.HasValue) {
                        labelWidget.SetForegroundColor (customLabelColor.Value);
                        labelWidget.SetForegroundColor (Gtk.StateType.Prelight, customLabelColor.Value);
                    }
                }
            } else
                Widget.Label = null;
        }