Beispiel #1
0
        public WindowView(Main _view, Controller.Window _ctl)
        {
            View = _view;
            Window = _ctl;
            Homogeneous = false;
            Spacing = 0;
            BorderWidth = 0;
            var topLevelBox = new Gtk.VBox();
            topLevelBox.Homogeneous = false;
            topLevelBox.Spacing = 0;
            topLevelBox.BorderWidth = 0;
            textView = new WindowTextView(Window);
            scroll = new Gtk.ScrolledWindow {
                HscrollbarPolicy = Gtk.PolicyType.Automatic,
                VscrollbarPolicy = Gtk.PolicyType.Automatic
            };
            scroll.Add(textView);
            Window.CursorMovedByCommand.Add(i =>
            {
                textView.ScrollToIter(i.GtkIter, 0, false, 0, 0);
            });
            topLevelBox.PackStart(scroll, true, true, 0);
            status = new Gtk.Statusbar();
            status.HasResizeGrip = false;
            status.Push(StatusbarMode, Window.CurrentMode.GetName());
            Window.CurrentMode.Event.Changed += m =>
            {
                status.Pop(StatusbarMode);
                status.Push(StatusbarMode, Window.CurrentMode.GetName());
            };
            Window.Model.Changed += m =>
            {
                textView.Buffer = m;
            };
            topLevelBox.PackStart(status, false, false, 0);

            // Wrap the topLevelBox with borders on the left and right
            var hlBox = new Gtk.DrawingArea();
            NormalColor = hlBox.Style.Background(Gtk.StateType.Normal);
            hlBox.WidthRequest = 10;
            var borderBox = new Gtk.HBox();
            borderBox.Homogeneous = false;
            borderBox.Spacing = 0;
            borderBox.BorderWidth = 0;
            borderBox.PackStart(hlBox, false, false, 0);
            borderBox.PackStart(topLevelBox, true, true, 0);

            textView.FocusInEvent += (object o, Gtk.FocusInEventArgs args) =>
            {
                Window.Controller.FocusedWindow.Value = Window;
                hlBox.ModifyBg(Gtk.StateType.Normal, HighlightColor);
            };

            textView.FocusOutEvent += (object o, Gtk.FocusOutEventArgs args) =>
            {
                hlBox.ModifyBg(Gtk.StateType.Normal, NormalColor);
            };

            Add(borderBox);
        }
Beispiel #2
0
        private void Build()
        {
            var vBox = new Gtk.VBox( false, 0 );

            this.BuildIcons();
            this.BuildActions();
            this.BuildMenu();
            this.BuildToolbar();
            this.BuildNotebook();
            this.BuildStatusbar();

            vBox.PackStart( this.mbMainMenu, false, false, 0 );
            vBox.PackStart( this.tbToolbar, false, false, 0 );
            vBox.PackStart( this.nbDocPages, true, true, 0 );
            vBox.PackStart( this.sbStatus, false, false, 0 );
            this.Add( vBox );
            this.ShowAll();

            // Prepare
            this.SetGeometryHints(
                this,
                new Gdk.Geometry { MinWidth = 640, MinHeight = 480 },
                Gdk.WindowHints.MinSize
            );
            this.DeleteEvent += (o, args) => this.OnTerminateWindow( args );
            this.Icon = this.iconTesty;
        }
Beispiel #3
0
		protected void SetupUi()
		{
			var box = new Gtk.VBox();

			var menu = new Gtk.MenuBar();
			var fileMenu = new Gtk.Menu();
			var file = new Gtk.MenuItem("File");
			file.Submenu = fileMenu;
			menu.Append(file);

			var save = new Gtk.MenuItem("Save");
			save.Activated += OnSaveMenuActivated;
			var load = new Gtk.MenuItem("Load");
			load.Activated += OnLoadMenuActivated;

			var exit = new Gtk.MenuItem("Exit");
			exit.Activated += (sender, e) => Gtk.Application.Quit();

			fileMenu.Append(save);
			fileMenu.Append(load);
			fileMenu.Append(exit);


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

			nb = new Gtk.Notebook();
			nb.ShowTabs = false;
			nb.AppendPage(SetupOverviewPage(), new Gtk.Label("Overview"));
			nb.AppendPage(SetupNewNotePage(), new Gtk.Label("New"));
			box.PackStart(nb, true, true, 2);

			Add(box);
		}
Beispiel #4
0
        public ActionGroupEditor()
        {
            changedEvent = new ObjectWrapperEventHandler (OnActionChanged);

            Gtk.Fixed fx = new Gtk.Fixed ();
            table = new Gtk.Table (0, 0, false);
            table.RowSpacing = 8;
            table.ColumnSpacing = 8;
            table.BorderWidth = 12;

            Gtk.EventBox ebox = new Gtk.EventBox ();
            ebox.ModifyBg (Gtk.StateType.Normal, this.Style.Backgrounds [0]);
            headerLabel = new EditableLabel ();
            headerLabel.MarkupTemplate = "<b>$TEXT</b>";
            headerLabel.Changed += OnGroupNameChanged;
            Gtk.VBox vbox = new Gtk.VBox ();
            Gtk.Label grpLabel = new Gtk.Label ();
            grpLabel.Xalign = 0;
            grpLabel.Markup = "<small><i>Action Group</i></small>";
            //			vbox.PackStart (grpLabel, false, false, 0);
            vbox.PackStart (headerLabel, false, false, 3);
            vbox.BorderWidth = 12;
            ebox.Add (vbox);

            Gtk.VBox box = new Gtk.VBox ();
            box.Spacing = 6;
            box.PackStart (ebox, false, false, 0);
            box.PackStart (table, false, false, 0);

            fx.Put (box, 0, 0);
            Add (fx);
            ShowAll ();
        }
Beispiel #5
0
        public WindowView(Main _view, Controller.Window _ctl)
        {
            View = _view;
            Window = _ctl;
            Homogeneous = false;
            Spacing = 0;
            BorderWidth = 0;
            var topLevelBox = new Gtk.VBox();
            topLevelBox.Homogeneous = false;
            topLevelBox.Spacing = 0;
            topLevelBox.BorderWidth = 0;
            textView = new WindowTextView(Window);
            scroll = new Gtk.ScrolledWindow {
                HscrollbarPolicy = Gtk.PolicyType.Automatic,
                VscrollbarPolicy = Gtk.PolicyType.Automatic
            };
            scroll.Add(textView);
            Window.CursorMovedByCommand.Add(i =>
            {
                textView.ScrollToIter(i.GtkIter, 0, false, 0, 0);
            });
            topLevelBox.PackStart(scroll, true, true, 0);

            status = new MultiStatusbar();
            status.Add(StatusbarItem.Create(100, () => Window.CurrentMode.GetName(), Window.CurrentMode.Changed));
            status.Add(StatusbarItem.Create(50, Window.Model.Value.HasUnsavedChanges, b => b ? "" : "Saved"));
            status.AddLast(StatusbarItem.Create(400, Window.Model.Value.File.ProjectRelativeFullName()));
            topLevelBox.PackStart(status, false, false, 0);

            Window.Model.Changed += m =>
            {
                textView.Buffer = m;
            };

            // Wrap the topLevelBox with borders on the left and right
            var hlBox = new Gtk.DrawingArea();
            NormalColor = hlBox.Style.Background(Gtk.StateType.Normal);
            hlBox.WidthRequest = 10;
            var borderBox = new Gtk.HBox();
            borderBox.Homogeneous = false;
            borderBox.Spacing = 0;
            borderBox.BorderWidth = 0;
            borderBox.PackStart(hlBox, false, false, 0);
            borderBox.PackStart(topLevelBox, true, true, 0);

            textView.FocusInEvent += (object o, Gtk.FocusInEventArgs args) =>
            {
                Window.Controller.Windows.Current = Window;
                hlBox.ModifyBg(Gtk.StateType.Normal, HighlightColor);
            };

            textView.FocusOutEvent += (object o, Gtk.FocusOutEventArgs args) =>
            {
                hlBox.ModifyBg(Gtk.StateType.Normal, NormalColor);
            };

            Add(borderBox);
        }
Beispiel #6
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();
        }
        // gui elements
        /// <summary>
        /// creates the preferences-view (mostly it shows information, you can't actually set any preferences in this view)
        /// </summary>
        public AddinPreferences()
            : base(false, 12)
        {
            Gtk.VBox container = new Gtk.VBox(false, 12);

            PackStart(container);
            container.PackStart(GtkUtil.newMarkupLabel(Catalog.GetString("<span size=\"x-large\">Info</span>")));
            container.PackStart(new Gtk.Label(Catalog.GetString("You can configure the sync-settings in the \"Synchronization\" tab.")));
            container.PackStart(new Gtk.Label());
            container.PackStart(GtkUtil.newMarkupLabel(Catalog.GetString("For more information, please visit:")));
            container.PackStart(new Gtk.LinkButton("http://privatenotes.dyndns-server.com/", "http://privatenotes.dyndns-server.com/"));

            ShowAll();
        }
        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 #9
0
        public NoteDialog(Gtk.Window parentWindow, ITask task)
            : base()
        {
            this.ParentWindow = parentWindow.GdkWindow;
            this.task = task;
            this.Title = String.Format(Catalog.GetString("Notes for: {0:s}"), task.Text);
            this.HasSeparator = false;
            this.SetSizeRequest(500,320);
            this.Icon = Utilities.GetIcon ("tasque", 16);
            //this.Flags = Gtk.DialogFlags.DestroyWithParent;

            sw.VscrollbarPolicy = Gtk.PolicyType.Automatic;
            sw.HscrollbarPolicy = Gtk.PolicyType.Never;

            sw.BorderWidth = 0;
            sw.CanFocus = true;
            sw.Show ();

            Gtk.EventBox innerEb = new Gtk.EventBox();
            innerEb.BorderWidth = 0;

            targetVBox = new Gtk.VBox();
            targetVBox.BorderWidth = 5;
            targetVBox.Show ();
            innerEb.Add(targetVBox);
            innerEb.Show ();

            if(task.Notes != null) {
                foreach (var note in task.Notes) {
                    NoteWidget noteWidget = new NoteWidget (note);
                    noteWidget.TextChanged += OnNoteTextChanged;
                    noteWidget.DeleteButtonClicked += OnDeleteButtonClicked;
                    noteWidget.EditCanceled += OnEditCanceled;
                    noteWidget.Show ();
                    targetVBox.PackStart (noteWidget, false, false, 0);
                }
            }

            sw.AddWithViewport(innerEb);
            sw.Show ();

            VBox.PackStart (sw, true, true, 0);

            if(task.NoteSupport == NoteSupport.Multiple) {
                addButton = new Gtk.Button(Gtk.Stock.Add);
                addButton.Show();
                this.ActionArea.PackStart(addButton);
                addButton.Clicked += OnAddButtonClicked;
            }

            AddButton (Gtk.Stock.Close, Gtk.ResponseType.Close);

            Response += delegate (object sender, Gtk.ResponseArgs args) {
                // Hide the window.  The TaskWindow watches for when the
                // dialog is hidden and will take care of the rest.
                Hide ();
            };
        }
Beispiel #10
0
		protected virtual Gtk.Widget CreateMainLayout ()
		{
			mainBox = new Gtk.VBox ();
			mainBox.Show ();
			alignment = new RootWindowAlignment (this);
			mainBox.PackStart (alignment, true, true, 0);
			alignment.Show ();
			return mainBox;
		}
Beispiel #11
0
 public WindowBackend()
 {
     Window = new Gtk.Window ("");
     mainBox = new Gtk.VBox ();
     Window.Add (mainBox);
     mainBox.Show ();
     alignment = new Gtk.Alignment (0, 0, 1, 1);
     mainBox.PackStart (alignment, true, true, 0);
     alignment.Show ();
 }
		public WelcomePageTipOfTheDaySection (): base (GettextCatalog.GetString ("Did you know?"))
		{
			XmlDocument xmlDocument = new XmlDocument ();
			xmlDocument.Load (System.IO.Path.Combine (System.IO.Path.Combine (PropertyService.DataPath, "options"), "TipsOfTheDay.xml"));

			foreach (XmlNode xmlNode in xmlDocument.DocumentElement.ChildNodes) {
				tips.Add (StringParserService.Parse (xmlNode.InnerText));
			}
			
			if (tips.Count != 0)  
				currentTip = new Random ().Next () % tips.Count;
			else
				currentTip = -1;

			Gtk.VBox box = new Gtk.VBox (false, 12);

			label = new Gtk.Label ();
			label.Xalign = 0;
			label.Wrap = true;
			label.WidthRequest = 200;
			label.ModifyFont (FontService.SansFont.CopyModified (Gui.Styles.FontScale11));
			label.SetPadding (0, 10);

			label.Text = currentTip != -1 ? tips[currentTip] : "";
			box.PackStart (label, true, true, 0);

			var next = new Gtk.Button (GettextCatalog.GetString ("Next Tip"));
			next.Relief = Gtk.ReliefStyle.Normal;
			next.Clicked += delegate {
				if (tips.Count == 0)
					return;
				currentTip = currentTip + 1;
				if (currentTip >= tips.Count)
					currentTip = 0;
				label.Text = tips[currentTip];
			};

			var al = new Gtk.Alignment (0, 0, 0, 0);
			al.Add (next);
			box.PackStart (al, false, false, 0);
			SetContent (box);
		}
        public void createGui()
        {
            basedir_section=new Section("cuesheets-basedir","CueSheet Music Directory:",20);
            source_page.Add (basedir_section);

            string dir=_source.getCueSheetDir();
            Gtk.Label lbl=new Gtk.Label("CueSheet Music Directory:");
            Gtk.FileChooserButton btn=new Gtk.FileChooserButton("CueSheet Music Directory:",Gtk.FileChooserAction.SelectFolder);
            if (dir!=null) {
                btn.SelectFilename (dir);
            }
            Gtk.HBox box=new Gtk.HBox();
            box.Add (lbl);
            box.Add (btn);
            box.ShowAll ();
            btn.CurrentFolderChanged+=delegate(object sender,EventArgs args) {
                string dir1=btn.Filename;
                Hyena.Log.Information ("Folder changed to = "+dir1);
            };
            btn.FileSet+=delegate(object sender,EventArgs args) {
                string dir1=btn.Filename;
                Hyena.Log.Information ("Base directory changed to = "+dir1);
                _source.setCueSheetDir(dir1);
            };

            Console.WriteLine (_source);

            Gtk.VBox vb=new Gtk.VBox();
            vb.PackStart (box,false,false,0);

            Gtk.Image icn_about=new Gtk.Image(Gtk.Stock.About,Gtk.IconSize.Button);
            Gtk.Button about=new Gtk.Button(icn_about);
            about.Clicked+=new EventHandler(handleAbout);
            Gtk.HBox hb=new Gtk.HBox();
            Gtk.Label _about=new Gtk.Label("About the CueSheet extension");
            hb.PackEnd (about,false,false,0);
            hb.PackEnd (_about,false,false,5);
            vb.PackStart (hb,false,false,0);
            Gtk.HBox hb1=new Gtk.HBox();
            Gtk.Label _info=new Gtk.Label("How to use the Cuesheet extension (opens browser)");
            Gtk.Image icn_info=new Gtk.Image(Gtk.Stock.Info,Gtk.IconSize.Button);
            Gtk.Button btn_info=new Gtk.Button(icn_info);
            btn_info.Clicked+=new EventHandler(handleInfo);
            hb1.PackEnd(btn_info,false,false,0);
            hb1.PackEnd(_info,false,false,5);
            vb.PackStart (hb1,false,false,0);

            Gtk.HBox hbX=new Gtk.HBox();
            vb.PackEnd (hbX,true,true,0);

            vb.ShowAll ();

            source_page.DisplayWidget = vb;
        }
Beispiel #14
0
		public MainWindow () : base (Catalog.GetString ("Mono Visual Profiler"))
		{
			history = History.Load ();
			history.LogFiles.Changed += UpdateRecentLogs;
			history.Configs.Changed += UpdateRepeatSessions;
			DefaultSize = new Gdk.Size (800, 600);
			Gtk.Box box = new Gtk.VBox (false, 0);
			Gtk.UIManager uim = BuildUIManager ();
 			box.PackStart (uim.GetWidget ("/Menubar"), false, false, 0);
 			box.PackStart (uim.GetWidget ("/Toolbar"), false, false, 0);
			UpdateRecentLogs (null, null);
			UpdateRepeatSessions (null, null);
			content_area = new Gtk.VBox (false, 0);
			content_area.Show ();
			box.PackStart (content_area, true, true, 0);
			StartPage start_page = new StartPage (history);
			start_page.Activated += OnStartPageActivated;
			start_page.Show ();
			View = start_page;
			box.ShowAll ();
			Add (box);
		}
Beispiel #15
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;
		}
		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 #17
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 Gtk.Widget CreatePanelWidget()
        {
            var vbox = new Gtk.VBox ();
            vbox.Spacing = 6;

            var restoreSectionLabel = new Gtk.Label (GetBoldMarkup ("DNX Restore"));
            restoreSectionLabel.UseMarkup = true;
            restoreSectionLabel.Xalign = 0;
            vbox.PackStart (restoreSectionLabel, false, false, 0);

            restoreCheckBox = new Gtk.CheckButton (GettextCatalog.GetString ("Automatically restore dependencies."));
            restoreCheckBox.Active = originalRestoreDependenciesSetting;
            restoreCheckBox.BorderWidth = 10;
            vbox.PackStart (restoreCheckBox, false, false, 0);

            var outputSectionLabel = new Gtk.Label (GetBoldMarkup ("DNX Output"));
            outputSectionLabel.UseMarkup = true;
            outputSectionLabel.Xalign = 0;
            vbox.PackStart (outputSectionLabel, false, false, 0);

            var outputVerbosityHBox = new Gtk.HBox ();
            outputVerbosityHBox.BorderWidth = 10;
            outputVerbosityHBox.Spacing = 6;
            var outputVerbosityLabel = new Gtk.Label (GettextCatalog.GetString ("Verbosity:"));
            outputVerbosityLabel.Xalign = 0;
            outputVerbosityHBox.PackStart (outputVerbosityLabel, false, false, 0);

            logLevelsComboBox = Gtk.ComboBox.NewText ();
            outputVerbosityHBox.PackStart (logLevelsComboBox, true, true, 0);

            AddLogLevelsToComboBox ();

            vbox.PackStart (outputVerbosityHBox, false, false, 0);
            vbox.ShowAll ();
            return vbox;
        }
Beispiel #19
0
        public PreviewPopup(IconView view)
            : base(Gtk.WindowType.Toplevel)
        {
            Gtk.VBox vbox = new Gtk.VBox ();
            this.Add (vbox);
            this.AddEvents ((int) (Gdk.EventMask.PointerMotionMask |
                           Gdk.EventMask.KeyReleaseMask |
                           Gdk.EventMask.ButtonPressMask));

            this.Decorated = false;
            this.SkipTaskbarHint = true;
            this.SkipPagerHint = true;
            this.SetPosition (Gtk.WindowPosition.None);

            this.KeyReleaseEvent += HandleKeyRelease;
            this.ButtonPressEvent += HandleButtonPress;
            this.Destroyed += HandleDestroyed;

            this.view = view;
            view.MotionNotifyEvent += HandleIconViewMotion;
            view.KeyPressEvent += HandleIconViewKeyPress;
            view.KeyReleaseEvent += HandleKeyRelease;
            view.DestroyEvent += HandleIconViewDestroy;

            this.BorderWidth = 6;

            hist = new FSpot.Histogram ();
            hist.RedColorHint = 127;
            hist.GreenColorHint = 127;
            hist.BlueColorHint = 127;
            hist.BackgroundColorHint = 0xff;

            image = new Gtk.Image ();
            image.CanFocus = false;

            label = new Gtk.Label (String.Empty);
            label.CanFocus = false;
            label.ModifyFg (Gtk.StateType.Normal, new Gdk.Color (127, 127, 127));
            label.ModifyBg (Gtk.StateType.Normal, new Gdk.Color (0, 0, 0));

            this.ModifyFg (Gtk.StateType.Normal, new Gdk.Color (127, 127, 127));
            this.ModifyBg (Gtk.StateType.Normal, new Gdk.Color (0, 0, 0));

            vbox.PackStart (image, true, true, 0);
            vbox.PackStart (label, true, false, 0);
            vbox.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;
        }
        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;
        }
        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 #23
0
        public virtual void Initialize(PropertyDescriptor prop)
        {
            CheckType(prop);

            this.prop = prop;

            mainHBox = new Gtk.HBox(false, 6);
            PackStart(mainHBox, false, false, 0);

            if (!prop.Translatable)
            {
                return;
            }

            button = new Gtk.Button();
            try
            {
                globe     = Gdk.Pixbuf.LoadFromResource("globe.png");
                globe_not = Gdk.Pixbuf.LoadFromResource("globe-not.png");
            }
            catch (Exception e)
            {
                Console.WriteLine("Error while loading pixbuf: " + e);
            }
            image = new Gtk.Image(globe);
            button.Add(image);
            button.ButtonPressEvent += ButtonPressed;
            mainHBox.PackEnd(button, false, false, 0);
            mainHBox.ShowAll();

            menu = new Gtk.Menu();

            markItem          = new Gtk.CheckMenuItem("Mark for Translation");
            markItem.Toggled += ToggleMark;
            markItem.Show();
            menu.Add(markItem);

            addContextItem            = new Gtk.MenuItem("Add Translation Context Hint");
            addContextItem.Activated += AddContext;
            menu.Add(addContextItem);
            remContextItem            = new Gtk.MenuItem("Remove Translation Context Hint");
            remContextItem.Activated += RemoveContext;
            menu.Add(remContextItem);

            addCommentItem            = new Gtk.MenuItem("Add Comment for Translators");
            addCommentItem.Activated += AddComment;
            menu.Add(addCommentItem);
            remCommentItem            = new Gtk.MenuItem("Remove Comment for Translators");
            remCommentItem.Activated += RemoveComment;
            menu.Add(remCommentItem);

            contextBox = new Gtk.HBox(false, 6);
            Gtk.Label contextLabel = new Gtk.Label("Translation context");
            contextLabel.Xalign = 0.0f;
            contextBox.PackStart(contextLabel, false, false, 0);
            contextEntry            = new Gtk.Entry();
            contextEntry.WidthChars = 8;
            contextBox.PackStart(contextEntry, true, true, 0);
            contextBox.ShowAll();
            contextEntry.Changed += ContextChanged;

            commentBox = new Gtk.VBox(false, 3);
            Gtk.Label commentLabel = new Gtk.Label("Comment for Translators:");
            commentLabel.Xalign = 0.0f;
            commentBox.PackStart(commentLabel, false, false, 0);
            commentText = new TextBox(3);
            commentBox.PackStart(commentText, false, false, 0);
            commentBox.ShowAll();
            commentText.Changed += CommentChanged;
        }
        void AddCreatePackageSection(Gtk.VBox vbox, string label, PackagingProject parentProject, bool showCheck)
        {
            Gtk.VBox   vboxNewPacks;
            Gtk.Widget hbox;
            if (showCheck)
            {
                Gtk.CheckButton check = new Gtk.CheckButton(label);
                check.Show();
                vbox.PackStart(check, false, false, 0);

                AddBox(vbox, out hbox, out vboxNewPacks);
                check.Toggled += delegate {
                    hbox.Visible = check.Active;
                    if (!check.Active)
                    {
                        DisableChecks(hbox);
                    }
                };
            }
            else
            {
                Gtk.Label lab = new Gtk.Label(label);
                lab.Show();
                vbox.PackStart(lab, false, false, 0);
                AddBox(vbox, out hbox, out vboxNewPacks);
                hbox.Show();
            }

            ICollection builders;

            if (creatingPackProject)
            {
                builders = DeployService.GetPackageBuilders();
            }
            else
            {
                builders = DeployService.GetSupportedPackageBuilders(entry);
            }

            foreach (PackageBuilder pb in builders)
            {
                if (creatingPackProject)
                {
                    pb.SetSolutionItem(parentFolder.ParentSolution.RootFolder);
                    // Add all compatible projects
                    foreach (SolutionFolderItem e in parentFolder.ParentSolution.GetAllSolutionItems())
                    {
                        if (pb.CanBuild(e))
                        {
                            pb.AddEntry(e);
                        }
                    }
                }
                else
                {
                    pb.SetSolutionItem(parentFolder, new SolutionFolderItem [] { entry });
                }

                PackageBuilder[] defp = pb.CreateDefaultBuilders();
                if (defp.Length == 0)
                {
                    continue;
                }
                if (defp.Length == 1)
                {
                    AddPackageBuilder(vboxNewPacks, parentProject, defp[0]);
                }
                else
                {
                    Gtk.CheckButton checkBuilder = new Gtk.CheckButton(pb.Description);
                    checkBuilder.Show();
                    vboxNewPacks.PackStart(checkBuilder, false, false, 0);
                    Gtk.VBox   vboxDefPacks;
                    Gtk.Widget thbox;
                    AddBox(vboxNewPacks, out thbox, out vboxDefPacks);
                    checkBuilder.Toggled += delegate {
                        thbox.Visible = checkBuilder.Active;
                        if (!checkBuilder.Active)
                        {
                            DisableChecks(thbox);
                        }
                    };
                    foreach (PackageBuilder dp in defp)
                    {
                        AddPackageBuilder(vboxDefPacks, parentProject, dp);
                    }
                }
            }
        }
Beispiel #25
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 #26
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 #27
0
        public FeedbackDialog(int x, int y) : base(Gtk.WindowType.Toplevel)
        {
            SetDefaultSize(350, 200);
            Move(x - 350, y - 200);
            mainFrame = new Gtk.Frame();

            mainBox                = new Gtk.VBox();
            mainBox.BorderWidth    = 12;
            mainBox.Spacing        = 6;
            headerBox              = new Gtk.HBox();
            mailEntry              = new EntryWithEmptyMessage();
            mailEntry.EmptyMessage = GettextCatalog.GetString("email address");
            Decorated              = false;
            mainFrame.ShadowType   = Gtk.ShadowType.Out;

            // Header

            headerBox.Spacing = 6;
            mailLabel         = new Gtk.Label();
            headerBox.PackStart(mailLabel, false, false, 0);
            Gtk.Button changeButton = new Gtk.Button("(Change)");
            changeButton.Relief = Gtk.ReliefStyle.None;
            headerBox.PackStart(changeButton, false, false, 0);
            changeButton.Clicked += HandleChangeButtonClicked;
            mainBox.PackStart(headerBox, false, false, 0);
            mainBox.PackStart(mailEntry, false, false, 0);
            mailWarningLabel        = new Gtk.Label(GettextCatalog.GetString("Please enter a valid e-mail address"));
            mailWarningLabel.Xalign = 0;
            mainBox.PackStart(mailWarningLabel, false, false, 0);

            // Body

            textEntry = new TextViewWithEmptyMessage();
            textEntry.EmptyMessage = GettextCatalog.GetString("Tell us how we can make MonoDevelop better.");
            textEntry.AcceptsTab   = false;
            textEntry.WrapMode     = Gtk.WrapMode.Word;
            textEntry.WidthRequest = 300;
            var sw = new Gtk.ScrolledWindow();

            sw.ShadowType       = Gtk.ShadowType.In;
            sw.VscrollbarPolicy = Gtk.PolicyType.Automatic;
            sw.HscrollbarPolicy = Gtk.PolicyType.Never;
            sw.Add(textEntry);
            mainBox.PackStart(sw, true, true, 0);
            bodyWarningLabel        = new Gtk.Label(GettextCatalog.GetString("Please enter some feedback"));
            bodyWarningLabel.Xalign = 0;
            mainBox.PackStart(bodyWarningLabel, false, false, 0);

            // Bottom

            Gtk.HBox  bottomBox  = new Gtk.HBox(false, 6);
            Gtk.Label countLabel = new Gtk.Label();
            countLabel.Xalign = 0;
            bottomBox.PackStart(countLabel, false, false, 0);

            Gtk.Button sendButton = new Gtk.Button(GettextCatalog.GetString("Send Feedback"));
            sendButton.Clicked += HandleSendButtonClicked;
            bottomBox.PackEnd(sendButton, false, false, 0);
            mainBox.PackStart(bottomBox, false, false, 0);

            // Init

            mainBox.ShowAll();

            mailWarningLabel.Hide();
            bodyWarningLabel.Hide();

            string mail = FeedbackService.ReporterEMail;

            if (string.IsNullOrEmpty(mail))
            {
                mail = AuthorInformation.Default.Email;
            }

            if (string.IsNullOrEmpty(mail))
            {
                headerBox.Hide();
                mailEntry.GrabFocus();
            }
            else
            {
                mailEntry.Text = mail;
                mailEntry.Hide();
                mailLabel.Text = GettextCatalog.GetString("From: {0}", mail);
                textEntry.GrabFocus();
            }
            if (FeedbackService.FeedbacksSent > 0)
            {
                countLabel.Text = GettextCatalog.GetString("Your feedbacks: {0}", FeedbackService.FeedbacksSent);
            }
            else
            {
                countLabel.Hide();
            }

            mainFrame.Show();
            mainFrame.Add(mainBox);
            Add(mainFrame);
        }
Beispiel #28
0
		protected Gtk.Widget SetupOverviewPage()
		{
			var box = new Gtk.VBox();

			var btnBox = new Gtk.HBox();
			box.PackStart(btnBox, false, true, 2);

			addNoteBtn = new Gtk.Button()
			{
				Label = "Add note",
				HeightRequest = 25,
			};
			addNoteBtn.Clicked += OnAddNoteBtnClicked;
			btnBox.PackStart(addNoteBtn, true, true, 0);

			saveNoteBtn = new Gtk.Button()
			{
				Label = "Save note",
				HeightRequest = 25,
			};
			saveNoteBtn.Clicked += OnSaveNoteBtnClicked;
			btnBox.PackStart(saveNoteBtn, true, true, 0);

			rmNoteBtn = new Gtk.Button()
			{
				Label = "Remove note",
				HeightRequest = 25,
			};
			rmNoteBtn.Clicked += OnRmNoteBtnClicked;
			btnBox.PackStart(rmNoteBtn, true, true, 0);

			listView = new Gtk.NodeView(noteStore);
			listView.AppendColumn("Title", new Gtk.CellRendererText(), "text", 0);
			listView.AppendColumn("Created", new Gtk.CellRendererText(), "text", 1);
			listView.HeadersVisible = true;
			listView.NodeSelection.Changed += OnListViewNodeSelectionChanged;

			var listViewScrollable = new Gtk.ScrolledWindow();
			listViewScrollable.Add(listView);
			box.PackStart(listViewScrollable, true, true, 2);

			var separator = new Gtk.HSeparator();
			box.PackStart(separator, false, false, 2);

			noteView = new Gtk.TextView();

			var noteViewScrollable = new Gtk.ScrolledWindow();
			noteViewScrollable.Add(noteView);
			box.PackStart(noteViewScrollable, true, true, 2);

			return box;
		}
Beispiel #29
0
        private void BuildCard()
        {
            var eventBoxEmail1     = new Gtk.EventBox();
            var eventBoxEmail2     = new Gtk.EventBox();
            var eventBoxAddress    = new Gtk.EventBox();
            var vbCardMain         = new Gtk.VBox(false, 5);
            var hbName             = new Gtk.HBox(false, 0);
            var hbAddress          = new Gtk.HBox(false, 0);
            var hbMainContact      = new Gtk.HBox(false, 0);
            var hbSecondaryContact = new Gtk.HBox(false, 0);

            // Frame
            this.frmCard             = new Gtk.Frame();
            this.frmCard.LabelWidget = new Gtk.Label()
            {
                Markup = "<b>Contact</b>"
            };

            // Name
            this.lblName    = new Gtk.Label(EtqNotAvailable);
            this.lblSurname = new Gtk.Label(EtqNotAvailable);
            vbCardMain.PackStart(hbName, false, false, 0);
            hbName.PackStart(this.lblSurname, false, false, 5);
            hbName.PackStart(this.lblName, false, false, 5);

            // Address
            this.lblAddress = new Gtk.Label(EtqNotAvailable);
            eventBoxAddress.Add(this.lblAddress);
            eventBoxAddress.ButtonPressEvent += (o, args) => this.OnAddressClicked();
            this.lblHomePhone = new Gtk.Label(EtqNotAvailable);
            vbCardMain.PackStart(hbAddress, false, false, 0);
            hbAddress.PackStart(eventBoxAddress, false, false, 5);
            hbAddress.PackStart(new Gtk.VSeparator(), false, false, 5);
            hbAddress.PackStart(this.lblHomePhone, false, false, 5);

            // Main contact
            this.lblMobilePhone = new Gtk.Label(EtqNotAvailable);
            this.lblEmail       = new Gtk.Label(EtqNotAvailable);
            eventBoxEmail1.Add(this.lblEmail);
            eventBoxEmail1.ButtonPressEvent += (o, args) => this.OnLblEmail1Clicked();
            vbCardMain.PackStart(hbMainContact, false, false, 0);
            hbMainContact.PackStart(this.lblMobilePhone, false, false, 5);
            hbMainContact.PackStart(new Gtk.VSeparator(), false, false, 5);
            hbMainContact.PackStart(eventBoxEmail1, false, false, 5);

            // Secondary contact
            this.lblWorkPhone = new Gtk.Label(EtqNotAvailable);
            this.lblEmail2    = new Gtk.Label(EtqNotAvailable);
            eventBoxEmail2.Add(this.lblEmail2);
            eventBoxEmail2.ButtonPressEvent += (o, args) => this.OnLblEmail2Clicked();
            vbCardMain.PackStart(hbSecondaryContact, false, false, 0);
            hbSecondaryContact.PackStart(this.lblWorkPhone, false, false, 5);
            hbSecondaryContact.PackStart(new Gtk.VSeparator(), false, false, 5);
            hbSecondaryContact.PackStart(eventBoxEmail2, false, false, 5);

            this.frmCard.Add(vbCardMain);
            this.vbMain.PackStart(this.frmCard, false, false, 5);

            // Card labels
            this.lblSurname.ModifyFont(
                Pango.FontDescription.FromString("Times 18")
                );

            this.lblName.ModifyFont(
                Pango.FontDescription.FromString("Times 18")
                );

            this.lblMobilePhone.ModifyFont(
                Pango.FontDescription.FromString("Times 14")
                );

            this.lblWorkPhone.ModifyFont(
                Pango.FontDescription.FromString("Times 14")
                );

            this.lblAddress.ModifyFont(
                Pango.FontDescription.FromString("Times 14")
                );

            this.lblMobilePhone.ModifyFont(
                Pango.FontDescription.FromString("Times 14")
                );

            this.lblEmail.ModifyFont(
                Pango.FontDescription.FromString("Mono 14")
                );

            this.lblEmail2.ModifyFont(
                Pango.FontDescription.FromString("Mono 14")
                );
        }
Beispiel #30
0
        public HIGMessageDialog(Gtk.Window parent,
                                Gtk.DialogFlags flags,
                                Gtk.MessageType type,
                                Gtk.ButtonsType buttons,
                                string header,
                                string msg)
            : base()
        {
            HasSeparator = false;
            BorderWidth  = 5;
            Resizable    = false;
            Title        = "";

            VBox.Spacing      = 12;
            ActionArea.Layout = Gtk.ButtonBoxStyle.End;

            accel_group = new Gtk.AccelGroup();
            AddAccelGroup(accel_group);

            Gtk.HBox hbox = new Gtk.HBox(false, 12);
            hbox.BorderWidth = 5;
            hbox.Show();
            VBox.PackStart(hbox, false, false, 0);

            switch (type)
            {
            case Gtk.MessageType.Error:
                image = new Gtk.Image(Gtk.Stock.DialogError,
                                      Gtk.IconSize.Dialog);
                break;

            case Gtk.MessageType.Question:
                image = new Gtk.Image(Gtk.Stock.DialogQuestion,
                                      Gtk.IconSize.Dialog);
                break;

            case Gtk.MessageType.Info:
                image = new Gtk.Image(Gtk.Stock.DialogInfo,
                                      Gtk.IconSize.Dialog);
                break;

            case Gtk.MessageType.Warning:
                image = new Gtk.Image(Gtk.Stock.DialogWarning,
                                      Gtk.IconSize.Dialog);
                break;

            default:
                image = new Gtk.Image();
                break;
            }

            if (image != null)
            {
                image.Show();
                image.Yalign = 0;
                hbox.PackStart(image, false, false, 0);
            }

            Gtk.VBox label_vbox = new Gtk.VBox(false, 0);
            label_vbox.Show();
            hbox.PackStart(label_vbox, true, true, 0);

            string title = String.Format("<span weight='bold' size='larger'>{0}" +
                                         "</span>\n",
                                         header);

            Gtk.Label label;

            label              = new Gtk.Label(title);
            label.UseMarkup    = true;
            label.UseUnderline = false;
            label.Justify      = Gtk.Justification.Left;
            label.LineWrap     = true;
            label.SetAlignment(0.0f, 0.5f);
            label.Show();
            label_vbox.PackStart(label, false, false, 0);

            label              = new Gtk.Label(msg);
            label.UseMarkup    = true;
            label.UseUnderline = false;
            label.Justify      = Gtk.Justification.Left;
            label.LineWrap     = true;
            label.SetAlignment(0.0f, 0.5f);
            label.Show();
            label_vbox.PackStart(label, false, false, 0);

            extra_widget_vbox = new Gtk.VBox(false, 0);
            extra_widget_vbox.Show();
            label_vbox.PackStart(extra_widget_vbox, true, true, 12);

            switch (buttons)
            {
            case Gtk.ButtonsType.None:
                break;

            case Gtk.ButtonsType.Ok:
                AddButton(Gtk.Stock.Ok, Gtk.ResponseType.Ok, true);
                break;

            case Gtk.ButtonsType.Close:
                AddButton(Gtk.Stock.Close, Gtk.ResponseType.Close, true);
                break;

            case Gtk.ButtonsType.Cancel:
                AddButton(Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, true);
                break;

            case Gtk.ButtonsType.YesNo:
                AddButton(Gtk.Stock.No, Gtk.ResponseType.No, false);
                AddButton(Gtk.Stock.Yes, Gtk.ResponseType.Yes, true);
                break;

            case Gtk.ButtonsType.OkCancel:
                AddButton(Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, false);
                AddButton(Gtk.Stock.Ok, Gtk.ResponseType.Ok, true);
                break;
            }

            if (parent != null)
            {
                TransientFor = parent;
            }

            if ((int)(flags & Gtk.DialogFlags.Modal) != 0)
            {
                Modal = true;
            }

            if ((int)(flags & Gtk.DialogFlags.DestroyWithParent) != 0)
            {
                DestroyWithParent = true;
            }
        }
Beispiel #31
0
        public NoteDialog(Gtk.Window parentWindow, ITask task)
            : base()
        {
            this.ParentWindow = parentWindow.GdkWindow;
            this.task         = task;
            this.Title        = String.Format(Catalog.GetString("Notes for: {0:s}"), task.Name);
            this.HasSeparator = false;
            this.SetSizeRequest(500, 320);
            this.Icon = Utilities.GetIcon("tasque-16", 16);
            //this.Flags = Gtk.DialogFlags.DestroyWithParent;


            sw.VscrollbarPolicy = Gtk.PolicyType.Automatic;
            sw.HscrollbarPolicy = Gtk.PolicyType.Never;

            sw.BorderWidth = 0;
            sw.CanFocus    = true;
            sw.Show();

            Gtk.EventBox innerEb = new Gtk.EventBox();
            innerEb.BorderWidth = 0;


            targetVBox             = new Gtk.VBox();
            targetVBox.BorderWidth = 5;
            targetVBox.Show();
            innerEb.Add(targetVBox);
            innerEb.Show();

            if (task.Notes != null)
            {
                foreach (INote note in task.Notes)
                {
                    NoteWidget noteWidget = new NoteWidget(note);
                    noteWidget.TextChanged         += OnNoteTextChanged;
                    noteWidget.DeleteButtonClicked += OnDeleteButtonClicked;
                    noteWidget.EditCanceled        += OnEditCanceled;
                    noteWidget.Show();
                    targetVBox.PackStart(noteWidget, false, false, 0);
                }
            }

            sw.AddWithViewport(innerEb);
            sw.Show();

            VBox.PackStart(sw, true, true, 0);

            if (task.SupportsMultipleNotes)
            {
                addButton = new Gtk.Button(Gtk.Stock.Add);
                addButton.Show();
                this.ActionArea.PackStart(addButton);
                addButton.Clicked += OnAddButtonClicked;
            }

            AddButton(Gtk.Stock.Close, Gtk.ResponseType.Close);

            Response += delegate(object sender, Gtk.ResponseArgs args) {
                // Hide the window.  The TaskWindow watches for when the
                // dialog is hidden and will take care of the rest.
                Hide();
            };
        }
Beispiel #32
0
        public EngineManagerDialog(Gtk.Window parent, EngineManager engineManager) :
            base(null, parent, Gtk.DialogFlags.Modal)
        {
            Trace.Call(parent, engineManager);

            if (engineManager == null)
            {
                throw new ArgumentNullException("engineManager");
            }

            Parent         = parent;
            _EngineManager = engineManager;

            Title = "Smuxi - " + _("Engine Manager");
            SetPosition(Gtk.WindowPosition.CenterAlways);

            var connect_button = new Gtk.Button(Gtk.Stock.Connect);

            AddActionWidget(connect_button, 1);

            AddActionWidget(new Gtk.Button(Gtk.Stock.New), 3);

            Gtk.Button edit_button = new Gtk.Button(Gtk.Stock.Edit);
            _EditButton = edit_button;
            AddActionWidget(edit_button, 2);

            _DeleteButton = new Gtk.Button(Gtk.Stock.Delete);
            AddActionWidget(_DeleteButton, 4);
            AddActionWidget(new Gtk.Button(Gtk.Stock.Quit), 5);
            Response += new Gtk.ResponseHandler(_OnResponse);

            Gtk.VBox  vbox  = new Gtk.VBox();
            Gtk.Label label = new Gtk.Label("<b>" +
                                            _("Select which Smuxi engine you want to connect to") +
                                            "</b>");
            label.UseMarkup = true;
            vbox.PackStart(label, false, false, 5);

            Gtk.HBox hbox = new Gtk.HBox();
            hbox.PackStart(new Gtk.Label(_("Engine:")), false, false, 5);

            _ListStore = new Gtk.ListStore(typeof(string));
            _ComboBox  = new Gtk.ComboBox();
            Gtk.CellRendererText cell = new Gtk.CellRendererText();
            _ComboBox.PackStart(cell, false);
            _ComboBox.AddAttribute(cell, "text", 0);
            _ComboBox.Changed += new EventHandler(_OnComboBoxChanged);
            _ComboBox.Model    = _ListStore;
            _InitEngineList();

            var lowBandWidthCheckBox = new Gtk.CheckButton(_("Use Low Bandwidth Mode"));

            lowBandWidthCheckBox.Active   = (bool)Frontend.FrontendConfig["UseLowBandwidthMode"];
            lowBandWidthCheckBox.Clicked += delegate {
                Frontend.FrontendConfig["UseLowBandwidthMode"] =
                    lowBandWidthCheckBox.Active;
                Frontend.FrontendConfig.Save();
            };

            hbox.PackStart(_ComboBox, true, true, 10);

            vbox.PackStart(hbox, false, false, 10);
            vbox.PackStart(lowBandWidthCheckBox);

            VBox.Add(vbox);

            ShowAll();
        }
Beispiel #33
0
        public DocumentationDialog(Documentation _doc)
        {
            ContentArea.PackStart(VBox, true, true, 0);

            documentation = _doc;

            Gtk.Label nameLabel = new Gtk.Label("<b>" + documentation.Name + "</b>");
            nameLabel.Wrap         = true;
            nameLabel.UseUnderline = false;
            nameLabel.UseMarkup    = true;
            nameLabel.Xalign       = 0.5f;
            VBox.PackStart(nameLabel, false, false, 10);

            string desc = documentation.Description;

            if (desc == null)
            {
                desc = "";
            }

            var subidEntries = documentation.Keys;

            Gtk.Label descLabel = new Gtk.Label(desc);
            descLabel.Wrap          = true;
            descLabel.UseUnderline  = false;
            descLabel.Xalign        = 0;
            descLabel.WidthChars    = 50;
            descLabel.MaxWidthChars = 50;
            VBox.PackStart(descLabel, false, false, 0);


            // Create SubID table
            if (subidEntries.Count > 0)
            {
                Gtk.Label valuesLabel = new Gtk.Label("\nValues:");
                valuesLabel.UseUnderline = false;
                valuesLabel.Xalign       = 0;
                VBox.PackStart(valuesLabel, false, false, 0);

                Gtk.Table subidTable = new Gtk.Table(2, (uint)subidEntries.Count * 2, false);

                uint subidX = 0;
                uint subidY = 0;

                foreach (string key in subidEntries)
                {
                    string value = documentation.GetField(key);

                    Gtk.Label l1 = new Gtk.Label(key);
                    l1.UseUnderline = false;
                    l1.Xalign       = 0;
                    l1.Yalign       = 0;

                    Gtk.Label l2 = new Gtk.Label(value);
                    l2.UseUnderline  = false;
                    l2.Wrap          = true;
                    l2.Xalign        = 0;
                    l2.Yalign        = 0;
                    l2.WidthChars    = 50;
                    l2.MaxWidthChars = 50;

                    subidTable.Attach(l1, subidX + 0, subidX + 1, subidY, subidY + 1, Gtk.AttachOptions.Fill, Gtk.AttachOptions.Fill, 4, 0);
                    subidTable.Attach(l2, subidX + 2, subidX + 3, subidY, subidY + 1);

                    subidY++;
                    subidTable.Attach(new Gtk.HSeparator(), subidX + 0, subidX + 3, subidY, subidY + 1, Gtk.AttachOptions.Fill, 0, 0, 0);
                    subidY++;
                }
                subidTable.Attach(new Gtk.VSeparator(), subidX + 1, subidX + 2, 0, subidTable.NRows, 0, Gtk.AttachOptions.Fill, 4, 0);

                Gtk.ScrolledWindow scrolledWindow = new Gtk.ScrolledWindow();
                scrolledWindow.AddWithViewport(subidTable);
                scrolledWindow.ShadowType = Gtk.ShadowType.EtchedIn;
                scrolledWindow.SetPolicy(Gtk.PolicyType.Never, Gtk.PolicyType.Automatic);
                subidTable.ShowAll();

                // Determine width/height to request on scrolledWindow
                Gtk.Requisition subidTableRequest = subidTable.SizeRequest();
                int             width             = Math.Min(subidTableRequest.Width + 20, 700);
                width = Math.Max(width, 400);
                int height = Math.Min(subidTableRequest.Height + 5, 400);
                height = Math.Max(height, 200);
                scrolledWindow.SetSizeRequest(width, height);

                VBox.PackStart(scrolledWindow, true, true, 0);
            }

            AddActionWidget(new Gtk.Button("gtk-ok"), 0);

            ShowAll();
        }
Beispiel #34
0
        public override void ApplyConfig(UserConfig config)
        {
            Trace.Call(config);

            if (config == null)
            {
                throw new ArgumentNullException("config");
            }

            base.ApplyConfig(config);

            // topic
            _TopicTextView.ApplyConfig(config);
            // predict and set useful topic heigth
            Pango.Layout layout = _TopicTextView.CreatePangoLayout("Test Topic");
            int          lineWidth, lineHeigth;

            layout.GetPixelSize(out lineWidth, out lineHeigth);
            // use 2 lines + a bit extra as the topic heigth
            int bestHeigth = (lineHeigth * 2) + 5;

            _TopicTextView.HeightRequest       = bestHeigth;
            _TopicScrolledWindow.HeightRequest = bestHeigth;

            string topic_pos = (string)config["Interface/Notebook/Channel/TopicPosition"];

            if (_TopicScrolledWindow.IsAncestor(_OutputVBox))
            {
                _OutputVBox.Remove(_TopicScrolledWindow);
            }
            if (OutputScrolledWindow.IsAncestor(_OutputVBox))
            {
                _OutputVBox.Remove(OutputScrolledWindow);
            }
            if (topic_pos == "top")
            {
                _OutputVBox.PackStart(_TopicScrolledWindow, false, false, 2);
                _OutputVBox.PackStart(OutputScrolledWindow, true, true, 0);
            }
            else if (topic_pos == "bottom")
            {
                _OutputVBox.PackStart(OutputScrolledWindow, true, true, 0);
                _OutputVBox.PackStart(_TopicScrolledWindow, false, false, 2);
            }
            else if (topic_pos == "none")
            {
                _OutputVBox.PackStart(OutputScrolledWindow, true, true, 0);
            }
            else
            {
#if LOG4NET
                _Logger.Error("ApplyConfig(): unsupported value in Interface/Notebook/Channel/TopicPosition: " + topic_pos);
#endif
            }
            _OutputVBox.ShowAll();

            // person list
            if (ThemeSettings.BackgroundColor == null)
            {
                _PersonTreeView.ModifyBase(Gtk.StateType.Normal);
            }
            else
            {
                _PersonTreeView.ModifyBase(Gtk.StateType.Normal, ThemeSettings.BackgroundColor.Value);
            }
            if (ThemeSettings.ForegroundColor == null)
            {
                _PersonTreeView.ModifyText(Gtk.StateType.Normal);
            }
            else
            {
                _PersonTreeView.ModifyText(Gtk.StateType.Normal, ThemeSettings.ForegroundColor.Value);
            }
            _PersonTreeView.ModifyFont(ThemeSettings.FontDescription);

            string userlist_pos = (string)config["Interface/Notebook/Channel/UserListPosition"];
            if (_PersonTreeViewFrame.IsAncestor(_OutputHPaned))
            {
                _OutputHPaned.Remove(_PersonTreeViewFrame);
            }
            if (_OutputVBox.IsAncestor(_OutputHPaned))
            {
                _OutputHPaned.Remove(_OutputVBox);
            }
            if (userlist_pos == "left")
            {
                _OutputHPaned.Pack1(_PersonTreeViewFrame, false, false);
                _OutputHPaned.Pack2(_OutputVBox, true, true);
            }
            else if (userlist_pos == "right")
            {
                _OutputHPaned.Pack1(_OutputVBox, true, true);
                _OutputHPaned.Pack2(_PersonTreeViewFrame, false, false);
            }
            else if (userlist_pos == "none")
            {
                _OutputHPaned.Pack1(_OutputVBox, true, true);
            }
            else
            {
#if LOG4NET
                _Logger.Error("ApplyConfig(): unsupported value in Interface/Notebook/Channel/UserListPosition: " + userlist_pos);
#endif
            }
            _OutputHPaned.ShowAll();

            NickColors = (bool)config["Interface/Notebook/Channel/NickColors"];
        }
Beispiel #35
0
        public override void ApplyConfig(UserConfig config)
        {
            Trace.Call(config);

            if (config == null)
            {
                throw new ArgumentNullException("config");
            }

            base.ApplyConfig(config);

            // topic
            _TopicTextView.ApplyConfig(config);
            string topic_pos = (string)config["Interface/Notebook/Channel/TopicPosition"];

            if (_TopicScrolledWindow.IsAncestor(_OutputVBox))
            {
                _OutputVBox.Remove(_TopicScrolledWindow);
            }
            if (OutputScrolledWindow.IsAncestor(_OutputVBox))
            {
                _OutputVBox.Remove(OutputScrolledWindow);
            }
            if (topic_pos == "top")
            {
                _OutputVBox.PackStart(_TopicScrolledWindow, false, false, 0);
                _OutputVBox.PackStart(OutputScrolledWindow, true, true, 0);
            }
            else if (topic_pos == "bottom")
            {
                _OutputVBox.PackStart(OutputScrolledWindow, true, true, 0);
                _OutputVBox.PackStart(_TopicScrolledWindow, false, false, 0);
            }
            else if (topic_pos == "none")
            {
                _OutputVBox.PackStart(OutputScrolledWindow, true, true, 0);
            }
            else
            {
#if LOG4NET
                _Logger.Error("ApplyConfig(): unsupported value in Interface/Notebook/Channel/TopicPosition: " + topic_pos);
#endif
            }
            _OutputVBox.ShowAll();

            // person list
            if (ThemeSettings.BackgroundColor == null)
            {
                _PersonTreeView.ModifyBase(Gtk.StateType.Normal);
            }
            else
            {
                _PersonTreeView.ModifyBase(Gtk.StateType.Normal, ThemeSettings.BackgroundColor.Value);
            }
            if (ThemeSettings.ForegroundColor == null)
            {
                _PersonTreeView.ModifyText(Gtk.StateType.Normal);
            }
            else
            {
                _PersonTreeView.ModifyText(Gtk.StateType.Normal, ThemeSettings.ForegroundColor.Value);
            }
            _PersonTreeView.ModifyFont(ThemeSettings.FontDescription);

            string userlist_pos = (string)config["Interface/Notebook/Channel/UserListPosition"];
            if (userlist_pos == "left")
            {
                userlist_pos = "right";
            }
            if (_PersonTreeViewFrame.IsAncestor(_OutputHPaned))
            {
                _OutputHPaned.Remove(_PersonTreeViewFrame);
            }
            if (_OutputVBox.IsAncestor(_OutputHPaned))
            {
                _OutputHPaned.Remove(_OutputVBox);
            }
            if (userlist_pos == "left")
            {
                _OutputHPaned.Pack1(_PersonTreeViewFrame, false, true);
                _OutputHPaned.Pack2(_OutputVBox, true, true);
            }
            else if (userlist_pos == "right")
            {
                _OutputHPaned.Pack1(_OutputVBox, true, false);
                _OutputHPaned.Pack2(_PersonTreeViewFrame, false, false);
            }
            else if (userlist_pos == "none")
            {
                _OutputHPaned.Pack1(_OutputVBox, true, true);
            }
            else
            {
#if LOG4NET
                _Logger.Error("ApplyConfig(): unsupported value in Interface/Notebook/Channel/UserListPosition: " + userlist_pos);
#endif
            }
            _OutputHPaned.ShowAll();

            NickColors = (bool)config["Interface/Notebook/Channel/NickColors"];
        }
Beispiel #36
0
        Gtk.Widget CreateFakeWidget(string typeName)
        {
            Stetic.Custom c = new Stetic.Custom();
            // Give it some default size
            c.WidthRequest  = 20;
            c.HeightRequest = 20;

            Gtk.Container box = null;

            switch (typeClassDescriptor.Name)
            {
            case "Gtk.Alignment":
                box = new Gtk.Alignment(0.5f, 0.5f, 1f, 1f);
                break;

            case "Gtk.Fixed":
                box = new Gtk.Alignment(0.5f, 0.5f, 1f, 1f);
                break;

            case "Gtk.Frame":
                box = new Gtk.Frame();
                break;

            case "Gtk.Box":
            case "Gtk.HBox": {
                Gtk.HBox cc = new Gtk.HBox();
                cc.PackStart(c, true, true, 0);
                return(cc);
            }

            case "Gtk.VBox": {
                Gtk.VBox cc = new Gtk.VBox();
                cc.PackStart(c, true, true, 0);
                return(cc);
            }

            case "Gtk.Paned":
            case "Gtk.VPaned": {
                Gtk.VPaned cc = new Gtk.VPaned();
                cc.Add1(c);
                return(cc);
            }

            case "Gtk.HPaned": {
                Gtk.HPaned cc = new Gtk.HPaned();
                cc.Add1(c);
                return(cc);
            }

            case "Gtk.Notebook": {
                Gtk.Notebook nb = new Gtk.Notebook();
                nb.ShowTabs = false;
                nb.AppendPage(c, null);
                return(nb);
            }

            case "Gtk.ScrolledWindow": {
                Gtk.ScrolledWindow cc = new Gtk.ScrolledWindow();
                cc.VscrollbarPolicy = Gtk.PolicyType.Never;
                cc.HscrollbarPolicy = Gtk.PolicyType.Never;
                cc.Add(c);
                return(cc);
            }

            case "Gtk.Table": {
                Gtk.Table t = new Gtk.Table(1, 1, false);
                t.Attach(c, 0, 1, 0, 1);
                return(t);
            }

            case "Gtk.ButtonBox":
                return(new Gtk.HButtonBox());
            }
            if (box != null)
            {
                box.Add(c);
                return(box);
            }
            else
            {
                Stetic.CustomWidget custom = new Stetic.CustomWidget();
                if (custom.Child != null)
                {
                    custom.Remove(custom.Child);
                }
                custom.Add(c);
                return(custom);
            }
        }
        public CueSheetsView(CueSheetsSource ms)
        {
            MySource=ms;

            basedir=MySource.getCueSheetDir ();

            store = new CS_TrackListModel();
            view  = new CS_TrackListView(this);

            {
                ColumnController colc=view.ColumnController;
                int i,N;
                for(i=0,N=colc.Count;i<N;i++) {
                    CS_Column col=(CS_Column) colc[i];
                    col.WidthChanged+=delegate(object sender,EventArgs args) {
                        Hyena.Log.Information ("set-column-sizes="+_set_column_sizes);
                        if (_set_column_sizes<=0) {
                            _set_column_sizes=0;
                            MySource.setColumnWidth (col.id(),MySource.getSheet ().id (),col.Width);
                        } else {
                            _set_column_sizes-=1;
                        }
                    };
                }
            }

            view.SetModel(store);
            this.setColumnSizes(null);

            Hyena.Log.Information("New albumlist");
            aview=new CS_AlbumListView(this);
            aaview=new CS_ArtistListView();
            ccview=new CS_ComposerListView();
            gview=new CS_GenreListView();
            try {
            plsview=new CS_PlayListsView(this);
            } catch (System.Exception ex) {
                Hyena.Log.Error (ex.ToString ());
            }

            Hyena.Log.Information("init models");
            aview.SetModel (MySource.getAlbumModel ());
            aaview.SetModel (MySource.getArtistModel ());
            gview.SetModel (MySource.getGenreModel ());
            ccview.SetModel (MySource.getComposerModel());
            plsview.SetModel(MySource.getPlayListsModel());

            plsadmin=new CS_PlayListAdmin(plsview,MySource.getPlayListsModel(),MySource.getPlayListCollection());

            MySource.getGenreModel();
            Hyena.Log.Information("model albumlist");
            Hyena.Log.Information("albumlist initialized");

            aview.RowActivated+=new Hyena.Data.Gui.RowActivatedHandler<AlbumInfo>(EvtRowActivated);
            aview.Selection.Changed += HandleAviewSelectionChanged;
            gview.RowActivated+=new Hyena.Data.Gui.RowActivatedHandler<CS_GenreInfo>(EvtGenreActivated);
            aaview.RowActivated+=new Hyena.Data.Gui.RowActivatedHandler<ArtistInfo>(EvtArtistActivated);
            ccview.RowActivated+=new Hyena.Data.Gui.RowActivatedHandler<CS_ComposerInfo>(EvtComposerActivated);
            plsview.RowActivated+=new Hyena.Data.Gui.RowActivatedHandler<CS_PlayList>(EvtPlayListActivated);
            view.RowActivated+=new RowActivatedHandler<CueSheetEntry>(EvtTrackRowActivated);

            bar=new Gtk.Toolbar();
            if (basedir==null) {
                Hyena.Log.Information("basedir="+basedir);
                Gtk.Label lbl=new Gtk.Label();
                lbl.Markup="<b>You need to configure the CueSheets music directory first, using the right mouse button on the extension</b>";
                bar.Add (lbl);
            }
            filling=new Gtk.Label();
            bar.Add (filling);

            ascroll=new Gtk.ScrolledWindow();
            ascroll.Add (aview);
            aascroll=new Gtk.ScrolledWindow();
            aascroll.Add (aaview);
            tscroll=new Gtk.ScrolledWindow();
            tscroll.Add (view);
            gscroll=new Gtk.ScrolledWindow();
            gscroll.Add (gview);
            ccscroll=new Gtk.ScrolledWindow();
            ccscroll.Add(ccview);

            bool view_artist=true;
            Gtk.VBox vac=new Gtk.VBox();
            Gtk.Button vab=new Gtk.Button("Artists");
            vab.Clicked+=delegate(object sender,EventArgs args) {
                if (view_artist) {
                    view_artist=false;
                    vab.Label="Composers";
                    vac.Remove (aascroll);
                    vac.PackEnd (ccscroll);
                    ccscroll.ShowAll ();
                } else {
                    view_artist=true;
                    vab.Label="Artists";
                    vac.Remove (ccscroll);
                    vac.PackEnd (aascroll);
                    aascroll.ShowAll ();
                }
            };
            vac.PackStart (vab,false,false,0);
            vac.PackEnd (aascroll);

            hb=new Gtk.HPaned();
            hb.Add(gscroll);
            hb.Add (vac);
            hb1=new Gtk.HPaned();
            hb1.Add (hb);
            hb1.Add (ascroll);

            vp=new Gtk.VPaned();
            vp.Add (hb1);
            vp.Add (tscroll);

            Gtk.HPaned hppls=new Gtk.HPaned();
            hppls.Add1 (vp);
            hppls.Add2 (plsadmin);
            hbpls=hppls;

            {
                int hb_pls,hb_p,hb1_p,vp_p;
                MySource.getPositions (out hb_pls,out hb_p,out hb1_p,out vp_p);
                hppls.Position=hb_pls;
                hb.Position=hb_p;
                hb1.Position=hb1_p;
                vp.Position=vp_p;
            }

            box   = new Gtk.VBox();
            box.PackStart (bar,false,true,0);
            box.PackStart (hppls);
            box.ShowAll();

            GLib.Timeout.Add ((uint) 1000,(GLib.TimeoutHandler) GardDividers);
            GLib.Timeout.Add ((uint) timeout,(GLib.TimeoutHandler) PositionDisplay);

            fill ();
        }
Beispiel #38
0
		protected Gtk.Widget SetupNewNotePage()
		{
			var box = new Gtk.VBox();

			// Buttons
			var btnBox = new Gtk.HBox();
			box.PackStart(btnBox, false, false, 2);

			var saveBtn = new Gtk.Button()
			{
				Label = "Save note",
			};
			saveBtn.Clicked += OnSaveNewNoteBtnClicked;
			btnBox.PackStart(saveBtn, true, true, 0);

			var cancelBtn = new Gtk.Button()
			{
				Label = "Cancel",
			};
			cancelBtn.Clicked += OnCancelNewNoteBtnClicked;
			btnBox.PackStart(cancelBtn, true, true, 0);

			// Input fields
			var titleLabel = new Gtk.Label("Title:");
			newNoteTitle = new Gtk.Entry();
			var titleBox = new Gtk.HBox();
			titleBox.PackStart(titleLabel, false, false, 0);
			titleBox.PackStart(newNoteTitle, true, true, 0);
			box.PackStart(titleBox, false, false, 2);

			newNoteField = new Gtk.TextView();
			newNoteField.BorderWidth = 1;
			box.PackStart(newNoteField, true, true, 2);

			return box;
		}
Beispiel #39
0
        //FIXME move all this in a standalone class
        void HandleSlideshow(string tagname)
        {
            Tag tag;

            FSpot.Widgets.SlideShow slideshow = null;

            if (!String.IsNullOrEmpty(tagname))
            {
                tag = Database.Tags.GetTagByName(tagname);
            }
            else
            {
                tag = Database.Tags.GetTagById(Preferences.Get <int> (Preferences.SCREENSAVER_TAG));
            }

            IPhoto[] photos;
            if (tag != null)
            {
                photos = Database.Photos.Query(new Tag[] { tag });
            }
            else if (Preferences.Get <int> (Preferences.SCREENSAVER_TAG) == 0)
            {
                photos = Database.Photos.Query(new Tag [] {});
            }
            else
            {
                photos = new IPhoto [0];
            }

            // Minimum delay 1 second; default is 4s
            var delay = Math.Max(1.0, Preferences.Get <double> (Preferences.SCREENSAVER_DELAY));

            var window = new XScreenSaverSlide();

            window.ModifyFg(Gtk.StateType.Normal, new Gdk.Color(127, 127, 127));
            window.ModifyBg(Gtk.StateType.Normal, new Gdk.Color(0, 0, 0));

            if (photos.Length > 0)
            {
                Array.Sort(photos, new IPhotoComparer.RandomSort());
                slideshow = new FSpot.Widgets.SlideShow(new BrowsablePointer(new PhotoList(photos), 0), (uint)(delay * 1000), true);
                window.Add(slideshow);
            }
            else
            {
                Gtk.HBox outer = new Gtk.HBox();
                Gtk.HBox hbox  = new Gtk.HBox();
                Gtk.VBox vbox  = new Gtk.VBox();

                outer.PackStart(new Gtk.Label(String.Empty));
                outer.PackStart(vbox, false, false, 0);
                vbox.PackStart(new Gtk.Label(String.Empty));
                vbox.PackStart(hbox, false, false, 0);
                hbox.PackStart(new Gtk.Image(Gtk.Stock.DialogWarning, Gtk.IconSize.Dialog),
                               false, false, 0);
                outer.PackStart(new Gtk.Label(String.Empty));

                string msg;
                string long_msg;

                if (tag != null)
                {
                    msg      = String.Format(Catalog.GetString("No photos matching {0} found"), tag.Name);
                    long_msg = String.Format(Catalog.GetString("The tag \"{0}\" is not applied to any photos. Try adding\n" +
                                                               "the tag to some photos or selecting a different tag in the\n" +
                                                               "F-Spot preference dialog."), tag.Name);
                }
                else
                {
                    msg      = Catalog.GetString("Search returned no results");
                    long_msg = Catalog.GetString("The tag F-Spot is looking for does not exist. Try\n" +
                                                 "selecting a different tag in the F-Spot preference\n" +
                                                 "dialog.");
                }

                Gtk.Label label = new Gtk.Label(msg);
                hbox.PackStart(label, false, false, 0);

                Gtk.Label long_label = new Gtk.Label(long_msg);
                long_label.Markup = String.Format("<small>{0}</small>", long_msg);

                vbox.PackStart(long_label, false, false, 0);
                vbox.PackStart(new Gtk.Label(String.Empty));

                window.Add(outer);
                label.ModifyFg(Gtk.StateType.Normal, new Gdk.Color(127, 127, 127));
                label.ModifyBg(Gtk.StateType.Normal, new Gdk.Color(0, 0, 0));
                long_label.ModifyFg(Gtk.StateType.Normal, new Gdk.Color(127, 127, 127));
                long_label.ModifyBg(Gtk.StateType.Normal, new Gdk.Color(0, 0, 0));
            }
            window.ShowAll();

            Register(window);
            GLib.Idle.Add(delegate {
                if (slideshow != null)
                {
                    slideshow.Start();
                }
                return(false);
            });
        }
Beispiel #40
0
        public MainWindow() : base("Smuxi")
        {
            // restore window size / position
            int width, heigth;

            if (Frontend.FrontendConfig[Frontend.UIName + "/Interface/Width"] != null)
            {
                width = (int)Frontend.FrontendConfig[Frontend.UIName + "/Interface/Width"];
            }
            else
            {
                width = 800;
            }
            if (Frontend.FrontendConfig[Frontend.UIName + "/Interface/Heigth"] != null)
            {
                heigth = (int)Frontend.FrontendConfig[Frontend.UIName + "/Interface/Heigth"];
            }
            else
            {
                heigth = 600;
            }
            if (width < -1 || heigth < -1)
            {
                width  = -1;
                heigth = -1;
            }
            if (width == -1 && heigth == -1)
            {
                SetDefaultSize(800, 600);
                Maximize();
            }
            else if (width == 0 && heigth == 0)
            {
                // HACK: map 0/0 to default size as it crashes on Windows :/
                SetDefaultSize(800, 600);
            }
            else
            {
                SetDefaultSize(width, heigth);
            }

            int x, y;

            if (Frontend.FrontendConfig[Frontend.UIName + "/Interface/XPosition"] != null)
            {
                x = (int)Frontend.FrontendConfig[Frontend.UIName + "/Interface/XPosition"];
            }
            else
            {
                x = 0;
            }
            if (Frontend.FrontendConfig[Frontend.UIName + "/Interface/YPosition"] != null)
            {
                y = (int)Frontend.FrontendConfig[Frontend.UIName + "/Interface/YPosition"];
            }
            else
            {
                y = 0;
            }
            if (x < 0 || y < 0)
            {
                x = 0;
                y = 0;
            }
            if (x == 0 && y == 0)
            {
                SetPosition(Gtk.WindowPosition.Center);
            }
            else
            {
                Move(x, y);
            }

            DeleteEvent      += OnDeleteEvent;
            FocusInEvent     += OnFocusInEvent;
            FocusOutEvent    += OnFocusOutEvent;
            WindowStateEvent += OnWindowStateEvent;

            Gtk.AccelGroup agrp = new Gtk.AccelGroup();
            Gtk.AccelKey   akey;
            AddAccelGroup(agrp);

            // Menu
            _MenuBar = new Gtk.MenuBar();
            Gtk.Menu          menu;
            Gtk.MenuItem      item;
            Gtk.ImageMenuItem image_item;

            // Menu - File
            menu         = new Gtk.Menu();
            item         = new Gtk.MenuItem(_("_File"));
            item.Submenu = menu;
            _MenuBar.Append(item);

            item            = new Gtk.ImageMenuItem(Gtk.Stock.Preferences, agrp);
            item.Activated += new EventHandler(_OnPreferencesButtonClicked);
            menu.Append(item);

            menu.Append(new Gtk.SeparatorMenuItem());

            item            = new Gtk.ImageMenuItem(Gtk.Stock.Quit, agrp);
            item.Activated += new EventHandler(_OnQuitButtonClicked);
            menu.Append(item);

            // Menu - Server
            menu         = new Gtk.Menu();
            item         = new Gtk.MenuItem(_("_Server"));
            item.Submenu = menu;
            _MenuBar.Append(item);

            image_item            = new Gtk.ImageMenuItem(_("_Quick Connect"));
            image_item.Image      = new Gtk.Image(Gtk.Stock.Connect, Gtk.IconSize.Menu);
            image_item.Activated += OnServerQuickConnectButtonClicked;
            menu.Append(image_item);

            menu.Append(new Gtk.SeparatorMenuItem());

            image_item            = new Gtk.ImageMenuItem(Gtk.Stock.Add, agrp);
            image_item.Activated += OnServerAddButtonClicked;
            menu.Append(image_item);

            image_item            = new Gtk.ImageMenuItem(_("_Manage"));
            image_item.Image      = new Gtk.Image(Gtk.Stock.Edit, Gtk.IconSize.Menu);
            image_item.Activated += OnServerManageServersButtonClicked;
            menu.Append(image_item);

            // Menu - Chat
            menu         = new Gtk.Menu();
            item         = new Gtk.MenuItem(_("_Chat"));
            item.Submenu = menu;
            _MenuBar.Append(item);

            _OpenChatMenuItem            = new Gtk.ImageMenuItem(_("Open / Join Chat"));
            _OpenChatMenuItem.Image      = new Gtk.Image(Gtk.Stock.Open, Gtk.IconSize.Menu);
            _OpenChatMenuItem.Activated += OnChatOpenChatButtonClicked;
            _OpenChatMenuItem.Sensitive  = false;
            menu.Append(_OpenChatMenuItem);

            _FindGroupChatMenuItem            = new Gtk.ImageMenuItem(_("_Find Group Chat"));
            _FindGroupChatMenuItem.Image      = new Gtk.Image(Gtk.Stock.Find, Gtk.IconSize.Menu);
            _FindGroupChatMenuItem.Activated += OnChatFindGroupChatButtonClicked;
            _FindGroupChatMenuItem.Sensitive  = false;
            menu.Append(_FindGroupChatMenuItem);

            image_item            = new Gtk.ImageMenuItem(_("C_lear All Activity"));
            image_item.Image      = new Gtk.Image(Gtk.Stock.Clear, Gtk.IconSize.Menu);
            image_item.Activated += OnChatClearAllActivityButtonClicked;
            menu.Append(image_item);

            menu.Append(new Gtk.SeparatorMenuItem());

            image_item            = new Gtk.ImageMenuItem(_("_Next Chat"));
            image_item.Image      = new Gtk.Image(Gtk.Stock.GoForward, Gtk.IconSize.Menu);
            image_item.Activated += OnNextChatMenuItemActivated;
            akey            = new Gtk.AccelKey();
            akey.AccelFlags = Gtk.AccelFlags.Visible;
            akey.AccelMods  = Gdk.ModifierType.ControlMask;
            akey.Key        = Gdk.Key.Page_Down;
            image_item.AddAccelerator("activate", agrp, akey);
            menu.Append(image_item);

            image_item            = new Gtk.ImageMenuItem(_("_Previous Chat"));
            image_item.Image      = new Gtk.Image(Gtk.Stock.GoBack, Gtk.IconSize.Menu);
            image_item.Activated += OnPreviousChatMenuItemActivated;
            akey            = new Gtk.AccelKey();
            akey.AccelFlags = Gtk.AccelFlags.Visible;
            akey.AccelMods  = Gdk.ModifierType.ControlMask;
            akey.Key        = Gdk.Key.Page_Up;
            image_item.AddAccelerator("activate", agrp, akey);
            menu.Append(image_item);

            menu.Append(new Gtk.SeparatorMenuItem());

            /*
             * // TODO: make a radio item for each chat hotkey
             * Gtk.RadioMenuItem radio_item;
             * radio_item = new Gtk.RadioMenuItem();
             * radio_item = new Gtk.RadioMenuItem(radio_item);
             * radio_item = new Gtk.RadioMenuItem(radio_item);
             *
             * menu.Append(new Gtk.SeparatorMenuItem());
             */

            /*
             * image_item = new Gtk.ImageMenuItem(Gtk.Stock.Find, agrp);
             * image_item.Activated += OnFindChatMenuItemActivated;
             * menu.Append(image_item);
             *
             * item = new Gtk.MenuItem(_("Find _Next"));
             * item.Activated += OnFindNextChatMenuItemActivated;
             * akey = new Gtk.AccelKey();
             * akey.AccelFlags = Gtk.AccelFlags.Visible;
             * akey.AccelMods = Gdk.ModifierType.ControlMask;
             * akey.Key = Gdk.Key.G;
             * item.AddAccelerator("activate", agrp, akey);
             * menu.Append(item);
             *
             * item = new Gtk.MenuItem(_("Find _Previous"));
             * item.Activated += OnFindPreviousChatMenuItemActivated;
             * akey = new Gtk.AccelKey();
             * akey.AccelFlags = Gtk.AccelFlags.Visible;
             * akey.AccelMods = Gdk.ModifierType.ControlMask | Gdk.ModifierType.ShiftMask;
             * akey.Key = Gdk.Key.G;
             * item.AddAccelerator("activate", agrp, akey);
             * menu.Append(item);
             */

            // ROFL: the empty code statement below is needed to keep stupid
            // gettext away from using all the commented code from above as
            // translator comment
            ;
            _OpenLogChatMenuItem       = new Gtk.ImageMenuItem(_("Open Log"));
            _OpenLogChatMenuItem.Image = new Gtk.Image(Gtk.Stock.Open,
                                                       Gtk.IconSize.Menu);
            _OpenLogChatMenuItem.Activated += OnOpenLogChatMenuItemActivated;
            _OpenLogChatMenuItem.Sensitive  = false;
            _OpenLogChatMenuItem.NoShowAll  = true;
            menu.Append(_OpenLogChatMenuItem);

            _CloseChatMenuItem            = new Gtk.ImageMenuItem(Gtk.Stock.Close, agrp);
            _CloseChatMenuItem.Activated += OnCloseChatMenuItemActivated;
            menu.Append(_CloseChatMenuItem);

            // Menu - Engine
            menu         = new Gtk.Menu();
            item         = new Gtk.MenuItem(_("_Engine"));
            item.Submenu = menu;
            _MenuBar.Append(item);

            item            = new Gtk.MenuItem(_("_Use Local Engine"));
            item.Activated += new EventHandler(_OnUseLocalEngineButtonClicked);
            menu.Append(item);

            menu.Append(new Gtk.SeparatorMenuItem());

            image_item            = new Gtk.ImageMenuItem(_("_Add Remote Engine"));
            image_item.Image      = new Gtk.Image(Gtk.Stock.Add, Gtk.IconSize.Menu);
            image_item.Activated += new EventHandler(_OnAddRemoteEngineButtonClicked);
            menu.Append(image_item);

            image_item            = new Gtk.ImageMenuItem(_("_Switch Remote Engine"));
            image_item.Image      = new Gtk.Image(Gtk.Stock.Refresh, Gtk.IconSize.Menu);
            image_item.Activated += new EventHandler(_OnSwitchRemoteEngineButtonClicked);
            menu.Append(image_item);

            // Menu - View
            menu         = new Gtk.Menu();
            item         = new Gtk.MenuItem(_("_View"));
            item.Submenu = menu;
            _MenuBar.Append(item);

            item            = new Gtk.CheckMenuItem(_("_Caret Mode"));
            item.Activated += new EventHandler(_OnCaretModeButtonClicked);
            akey            = new Gtk.AccelKey();
            akey.AccelFlags = Gtk.AccelFlags.Visible;
            akey.Key        = Gdk.Key.F7;
            item.AddAccelerator("activate", agrp, akey);
            menu.Append(item);

            item            = new Gtk.CheckMenuItem(_("_Browse Mode"));
            item.Activated += delegate {
                try {
                    _Notebook.IsBrowseModeEnabled = !_Notebook.IsBrowseModeEnabled;
                } catch (Exception ex) {
                    Frontend.ShowException(this, ex);
                }
            };
            akey            = new Gtk.AccelKey();
            akey.AccelFlags = Gtk.AccelFlags.Visible;
            akey.Key        = Gdk.Key.F8;
            item.AddAccelerator("activate", agrp, akey);
            menu.Append(item);

            _ShowMenuBarItem            = new Gtk.CheckMenuItem(_("Show _Menubar"));
            _ShowMenuBarItem.Active     = true;
            _ShowMenuBarItem.Activated += delegate {
                try {
                    _MenuBar.Visible = !_MenuBar.Visible;
                } catch (Exception ex) {
                    Frontend.ShowException(this, ex);
                }
            };
            menu.Append(_ShowMenuBarItem);

            item            = new Gtk.ImageMenuItem(Gtk.Stock.Fullscreen, agrp);
            item.Activated += delegate {
                try {
                    IsFullscreen = !IsFullscreen;
                } catch (Exception ex) {
                    Frontend.ShowException(this, ex);
                }
            };
            akey            = new Gtk.AccelKey();
            akey.AccelFlags = Gtk.AccelFlags.Visible;
            akey.Key        = Gdk.Key.F11;
            item.AddAccelerator("activate", agrp, akey);
            menu.Append(item);

            // Menu - Help
            menu         = new Gtk.Menu();
            item         = new Gtk.MenuItem(_("_Help"));
            item.Submenu = menu;
            _MenuBar.Append(item);

            image_item            = new Gtk.ImageMenuItem(Gtk.Stock.About, agrp);
            image_item.Activated += new EventHandler(_OnAboutButtonClicked);
            menu.Append(image_item);

            // TODO: network treeview
            _Notebook             = new Notebook();
            _Notebook.SwitchPage += OnNotebookSwitchPage;

            _ChatViewManager = new ChatViewManager(_Notebook, null);
            Assembly asm = Assembly.GetExecutingAssembly();

            _ChatViewManager.Load(asm);
            _ChatViewManager.LoadAll(System.IO.Path.GetDirectoryName(asm.Location),
                                     "smuxi-frontend-gnome-*.dll");
            _ChatViewManager.ChatAdded   += OnChatViewManagerChatAdded;
            _ChatViewManager.ChatSynced  += OnChatViewManagerChatSynced;
            _ChatViewManager.ChatRemoved += OnChatViewManagerChatRemoved;

#if GTK_SHARP_2_10
            _StatusIconManager = new StatusIconManager(this, _ChatViewManager);
#endif
#if INDICATE_SHARP
            _IndicateManager = new IndicateManager(this, _ChatViewManager);
#endif
#if NOTIFY_SHARP
            _NotifyManager = new NotifyManager(this, _ChatViewManager);
#endif
#if IPC_DBUS
            _NetworkManager = new NetworkManager(_ChatViewManager);
#endif

            _UI = new GnomeUI(_ChatViewManager);

            // HACK: Frontend.FrontendConfig out of scope
            _EngineManager = new EngineManager(Frontend.FrontendConfig, _UI);

            _Entry = new Entry(_ChatViewManager);

            _ProgressBar          = new Gtk.ProgressBar();
            _ProgressBar.BarStyle = Gtk.ProgressBarStyle.Continuous;

            Gtk.VBox vbox = new Gtk.VBox();
            vbox.PackStart(_MenuBar, false, false, 0);
            vbox.PackStart(_Notebook, true, true, 0);
            vbox.PackStart(_Entry, false, false, 0);

            _NetworkStatusbar = new Gtk.Statusbar();
            _NetworkStatusbar.WidthRequest  = 300;
            _NetworkStatusbar.HasResizeGrip = false;

            _Statusbar = new Gtk.Statusbar();
            _Statusbar.HasResizeGrip = false;

            Gtk.HBox status_bar_hbox = new Gtk.HBox();
            status_bar_hbox.Homogeneous = true;
            status_bar_hbox.PackStart(_NetworkStatusbar, false, true, 0);
            status_bar_hbox.PackStart(_Statusbar, true, true, 0);

            Gtk.HBox status_hbox = new Gtk.HBox();
            status_hbox.PackStart(status_bar_hbox);
            status_hbox.PackStart(_ProgressBar, false, false, 0);

            vbox.PackStart(status_hbox, false, false, 0);
            Add(vbox);
        }
        void CreateControls()
        {
            Gtk.Widget icon  = null;
            Gtk.Widget label = null;
            dropButton = null;

            if (Child != null)
            {
                Gtk.Widget w = Child;
                Remove(w);
                w.Destroy();
            }

            if (node.Type == Gtk.UIManagerItemType.Separator)
            {
                Gtk.Widget sep;
                if (parentToolbar.Orientation == Gtk.Orientation.Horizontal)
                {
                    sep = new Gtk.VSeparator();
                }
                else
                {
                    sep = new Gtk.HSeparator();
                }
                Gtk.HBox box = new Gtk.HBox();
                box.BorderWidth = 6;
                box.PackStart(sep, true, true, 0);
                Add(box);
                return;
            }

            if (node.Action == null)
            {
                return;
            }

            Gtk.Action gaction = node.Action.GtkAction;

            bool showText = parentToolbar.ToolbarStyle == Gtk.ToolbarStyle.Text;
            bool showIcon = parentToolbar.ToolbarStyle == Gtk.ToolbarStyle.Icons;

            if (parentToolbar.ToolbarStyle == Gtk.ToolbarStyle.Both)
            {
                showText = showIcon = true;
            }
            else if (parentToolbar.ToolbarStyle == Gtk.ToolbarStyle.BothHoriz)
            {
                showText = parentToolbar.Orientation == Gtk.Orientation.Vertical || gaction.IsImportant;
                showIcon = true;
            }

            string text = node.Action.ToolLabel;

            showingText = showText;

            if (showIcon)
            {
                if (gaction.StockId != null)
                {
                    icon = node.Action.CreateIcon(parentToolbar.IconSize);
                }
                else if (!gaction.IsImportant)
                {
                    icon = CreateFakeItem();
                }
            }

            if (editing)
            {
                Gtk.HBox bbox = new Gtk.HBox();
                bbox.Spacing = 3;
                if (icon != null)
                {
                    bbox.PackStart(icon, false, false, 0);
                }
                bbox.PackStart(new Gtk.Arrow(Gtk.ArrowType.Down, Gtk.ShadowType.In), false, false, 0);
                Gtk.Button b = new Gtk.Button(bbox);
                b.TooltipText       = Catalog.GetString("Select action type");
                b.Relief            = Gtk.ReliefStyle.None;
                b.ButtonPressEvent += OnSelectIcon;
                dropButton          = b;
                icon = b;

                if (showText)
                {
                    Gtk.Entry entry = new Gtk.Entry();
                    entry.Text        = text;
                    entry.Changed    += OnLabelChanged;
                    entry.Activated  += OnLabelActivated;
                    entry.HasFrame    = false;
                    label             = entry;
                    entry.TooltipText = Catalog.GetString("Action label");
                }
            }
            else if (showText && text != null && text.Length > 0)
            {
                label           = new Gtk.Label(text);
                label.Sensitive = editing || node.Action == null || node.Action.GtkAction.Sensitive;
            }

            if (icon != null && label != null)
            {
                if (parentToolbar.ToolbarStyle == Gtk.ToolbarStyle.BothHoriz)
                {
                    Gtk.HBox box = new Gtk.HBox();
                    box.PackStart(icon, false, false, 0);
                    box.PackStart(label, true, true, 0);
                    icon = box;
                }
                else if (parentToolbar.ToolbarStyle == Gtk.ToolbarStyle.Both)
                {
                    Gtk.VBox      box = new Gtk.VBox();
                    Gtk.Alignment al  = new Gtk.Alignment(0.5f, 0f, 0f, 0f);
                    al.Add(icon);
                    box.PackStart(al, false, false, 0);
                    box.PackStart(label, true, true, 0);
                    icon = box;
                }
            }
            else if (label != null)
            {
                icon = label;
            }

            if (icon == null)
            {
                icon = CreateFakeItem();
            }

            icon.Sensitive = editing || node.Action == null || node.Action.GtkAction.Sensitive;

            if (!editing)
            {
                Gtk.Button but = new Gtk.Button(icon);
                but.Relief              = Gtk.ReliefStyle.None;
                but.ButtonPressEvent   += OnToolItemPress;
                but.ButtonReleaseEvent += OnMemuItemRelease;
                but.MotionNotifyEvent  += OnMotionNotify;
                but.Events             |= Gdk.EventMask.PointerMotionMask;
                icon = but;
            }

            Add(icon);

            ShowAll();
        }
Beispiel #42
0
		internal void SetFloatMode (Gdk.Rectangle rect)
		{
			if (floatingWindow == null) {
				ResetMode ();
				SetRegionStyle (frame.GetRegionStyleForItem (this));

				floatingWindow = new DockFloatingWindow ((Gtk.Window)frame.Toplevel, GetWindowTitle ());
				Ide.IdeApp.CommandService.RegisterTopWindow (floatingWindow);

				Gtk.VBox box = new Gtk.VBox ();
				box.Show ();
				box.PackStart (TitleTab, false, false, 0);
				box.PackStart (Widget, true, true, 0);
				floatingWindow.Add (box);
				floatingWindow.DeleteEvent += delegate (object o, Gtk.DeleteEventArgs a) {
					if (behavior == DockItemBehavior.CantClose)
						Status = DockItemStatus.Dockable;
					else
						Visible = false;
					a.RetVal = true;
				};
			}
			floatingWindow.Move (rect.X, rect.Y);
			floatingWindow.Resize (rect.Width, rect.Height);
			floatingWindow.Show ();
			if (titleTab != null)
				titleTab.UpdateBehavior ();
			Widget.Show ();
		}
Beispiel #43
0
        void SetImagePosition()
        {
            if (Control.Child != null)
            {
                Control.Remove(Control.Child);
            }
            (label.Parent as Gtk.Container)?.Remove(label);
            (gtkimage?.Parent as Gtk.Container)?.Remove(gtkimage);

            Gtk.Widget child     = null;
            var        showImage = Image != null;
            var        showLabel = !string.IsNullOrEmpty(label.Text);

            if (showImage && showLabel)
            {
                Gtk.VBox vbox;
                Gtk.HBox hbox;
                switch (ImagePosition)
                {
                case ButtonImagePosition.Above:
                    child = vbox = new Gtk.VBox(false, 2);
                    vbox.PackStart(gtkimage, true, true, 0);
                    vbox.PackEnd(label, false, true, 0);
                    break;

                case ButtonImagePosition.Below:
                    child = vbox = new Gtk.VBox(false, 2);
                    vbox.PackStart(label, false, true, 0);
                    vbox.PackEnd(gtkimage, true, true, 0);
                    break;

                case ButtonImagePosition.Left:
                    child = hbox = new Gtk.HBox(false, 2);
                    hbox.PackStart(gtkimage, false, true, 0);
                    hbox.PackStart(label, true, true, 0);
                    break;

                case ButtonImagePosition.Right:
                    child = hbox = new Gtk.HBox(false, 2);
                    hbox.PackStart(label, true, true, 0);
                    hbox.PackEnd(gtkimage, false, true, 0);
                    break;

                case ButtonImagePosition.Overlay:
#if GTK2
                    var table = new Gtk.Table(1, 1, false);
                    child = table;
                    table.Attach(label, 0, 0, 1, 1, Gtk.AttachOptions.Expand, Gtk.AttachOptions.Expand, 0, 0);
                    table.Attach(gtkimage, 0, 0, 1, 1, Gtk.AttachOptions.Expand, Gtk.AttachOptions.Expand, 0, 0);
#else
                    var grid = new Gtk.Grid();
                    child            = grid;
                    label.Hexpand    = label.Vexpand = true;
                    gtkimage.Hexpand = gtkimage.Vexpand = true;
                    grid.Attach(label, 0, 0, 1, 1);
                    grid.Attach(gtkimage, 0, 0, 1, 1);
#endif
                    break;

                default:
                    throw new NotSupportedException();
                }
            }
            else if (showLabel)
            {
                child = label;
            }
            else if (showImage)
            {
                child = gtkimage;
            }

            if (child != null)
            {
                child.Show();
                Control.Child = child;
            }

            Control.QueueResize();
        }
Beispiel #44
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 #45
0
        public MainWindow() : base("Smuxi")
        {
            // restore window size / position
            int width, heigth;

            if (Frontend.FrontendConfig[Frontend.UIName + "/Interface/Width"] != null)
            {
                width = (int)Frontend.FrontendConfig[Frontend.UIName + "/Interface/Width"];
            }
            else
            {
                width = 800;
            }
            if (Frontend.FrontendConfig[Frontend.UIName + "/Interface/Heigth"] != null)
            {
                heigth = (int)Frontend.FrontendConfig[Frontend.UIName + "/Interface/Heigth"];
            }
            else
            {
                heigth = 600;
            }
            if (width < -1 || heigth < -1)
            {
                width  = -1;
                heigth = -1;
            }
            if (width == -1 && heigth == -1)
            {
                SetDefaultSize(800, 600);
                Maximize();
            }
            else if (width == 0 && heigth == 0)
            {
                // HACK: map 0/0 to default size as it crashes on Windows :/
                SetDefaultSize(800, 600);
            }
            else
            {
                SetDefaultSize(width, heigth);
            }

            int x, y;

            if (Frontend.FrontendConfig[Frontend.UIName + "/Interface/XPosition"] != null)
            {
                x = (int)Frontend.FrontendConfig[Frontend.UIName + "/Interface/XPosition"];
            }
            else
            {
                x = 0;
            }
            if (Frontend.FrontendConfig[Frontend.UIName + "/Interface/YPosition"] != null)
            {
                y = (int)Frontend.FrontendConfig[Frontend.UIName + "/Interface/YPosition"];
            }
            else
            {
                y = 0;
            }
            if (x < 0 || y < 0)
            {
                x = 0;
                y = 0;
            }
            if (x == 0 && y == 0)
            {
                SetPosition(Gtk.WindowPosition.Center);
            }
            else
            {
                Move(x, y);
            }

            DeleteEvent      += OnDeleteEvent;
            FocusInEvent     += OnFocusInEvent;
            FocusOutEvent    += OnFocusOutEvent;
            WindowStateEvent += OnWindowStateEvent;

            ChatTreeView = new ChatTreeView();

            Notebook               = new Notebook();
            Notebook.SwitchPage   += OnNotebookSwitchPage;
            Notebook.FocusInEvent += OnNotebookFocusInEvent;

            ChatViewManager = new ChatViewManager(Notebook, ChatTreeView);
            Assembly asm = Assembly.GetExecutingAssembly();

            ChatViewManager.Load(asm);
            ChatViewManager.LoadAll(System.IO.Path.GetDirectoryName(asm.Location),
                                    "smuxi-frontend-gnome-*.dll");
            ChatViewManager.ChatAdded   += OnChatViewManagerChatAdded;
            ChatViewManager.ChatSynced  += OnChatViewManagerChatSynced;
            ChatViewManager.ChatRemoved += OnChatViewManagerChatRemoved;

#if GTK_SHARP_2_10
            StatusIconManager = new StatusIconManager(this, ChatViewManager);
#endif
#if INDICATE_SHARP || MESSAGING_MENU_SHARP
            IndicateManager = new IndicateManager(this, ChatViewManager);
#endif
#if NOTIFY_SHARP
            NotifyManager = new NotifyManager(this, ChatViewManager);
#endif
#if IPC_DBUS
            NetworkManager = new NetworkManager(ChatViewManager);
#endif

            UI = new GnomeUI(ChatViewManager);

            // HACK: Frontend.FrontendConfig out of scope
            EngineManager = new EngineManager(Frontend.FrontendConfig, UI);

            Entry = new Entry(ChatViewManager);
            var entryScrolledWindow = new Gtk.ScrolledWindow();
            entryScrolledWindow.ShadowType       = Gtk.ShadowType.EtchedIn;
            entryScrolledWindow.HscrollbarPolicy = Gtk.PolicyType.Never;
            entryScrolledWindow.SizeRequested   += delegate(object o, Gtk.SizeRequestedArgs args) {
                // predict and set useful heigth
                int lineWidth, lineHeigth;
                using (var layout = Entry.CreatePangoLayout("Qp")) {
                    layout.GetPixelSize(out lineHeigth, out lineHeigth);
                }
                var it       = Entry.Buffer.StartIter;
                int newLines = 1;
                // move to end of next visual line
                while (Entry.ForwardDisplayLineEnd(ref it))
                {
                    newLines++;
                    // calling ForwardDisplayLineEnd repeatedly stays on the same position
                    // therefor we move one cursor position further
                    it.ForwardCursorPosition();
                }
                newLines = Math.Min(newLines, 3);
                // use text heigth + a bit extra
                var bestSize = new Gtk.Requisition()
                {
                    Height = (lineHeigth * newLines) + 5
                };
                args.Requisition = bestSize;
            };
            entryScrolledWindow.Add(Entry);

            ProgressBar = new Gtk.ProgressBar();
            StatusHBox  = new Gtk.HBox();

            MenuWidget = new MenuWidget(this, ChatViewManager);

            var treeviewScrolledWindow = new Gtk.ScrolledWindow()
            {
                ShadowType       = Gtk.ShadowType.EtchedIn,
                HscrollbarPolicy = Gtk.PolicyType.Never,
                VscrollbarPolicy = Gtk.PolicyType.Automatic
            };
            treeviewScrolledWindow.Add(ChatTreeView);
            ChatViewManager.ChatAdded += (sender, e) => {
                treeviewScrolledWindow.CheckResize();
            };

            var treeviewPaned = new Gtk.HPaned();
            treeviewPaned.Pack1(treeviewScrolledWindow, false, false);
            treeviewPaned.Pack2(Notebook, true, false);
            TreeViewHPaned = treeviewPaned;

            var entryPaned = new Gtk.VPaned();
            entryPaned.ButtonPressEvent += (sender, e) => {
                // reset entry size on double click
                if (e.Event.Type == Gdk.EventType.TwoButtonPress &&
                    e.Event.Button == 1)
                {
                    GLib.Timeout.Add(100, delegate {
                        entryPaned.Position = -1;
                        return(false);
                    });
                }
            };
            entryPaned.Pack1(treeviewPaned, true, false);
            entryPaned.Pack2(entryScrolledWindow, false, false);

            Gtk.VBox vbox = new Gtk.VBox();
            vbox.PackStart(MenuWidget, false, false, 0);
            vbox.PackStart(entryPaned, true, true, 0);

            NetworkStatusbar = new Gtk.Statusbar();
            NetworkStatusbar.WidthRequest  = 300;
            NetworkStatusbar.HasResizeGrip = false;

            Statusbar = new Gtk.Statusbar();
            Statusbar.HasResizeGrip = false;

            Gtk.HBox status_bar_hbox = new Gtk.HBox();
            status_bar_hbox.Homogeneous = true;
            status_bar_hbox.PackStart(NetworkStatusbar, false, true, 0);
            status_bar_hbox.PackStart(Statusbar, true, true, 0);

            StatusHBox.PackStart(status_bar_hbox);
            StatusHBox.PackStart(ProgressBar, false, false, 0);
            StatusHBox.ShowAll();
            StatusHBox.NoShowAll = true;
            StatusHBox.Visible   = (bool)Frontend.FrontendConfig["ShowStatusBar"];

            vbox.PackStart(StatusHBox, false, false, 0);
            Add(vbox);
        }
		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;
		}
        Control IOptionsPanel.CreatePanelWidget()
        {
            Gtk.VBox cbox      = new Gtk.VBox(false, 6);
            Gtk.HBox combosBox = new Gtk.HBox(false, 6)
            {
                Name = "panelWidgetCombosBox"
            };
            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)
            {
                Name = "panelWidgetConfigurationCombo"
            };
            SemanticModelAttribute modelAttr = new SemanticModelAttribute("configListStore__DisplayName", "configListStore__ConfigName");

            TypeDescriptor.AddAttributes(configListStore, modelAttr);
            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();
            platformCombo.Name = "panelWidgetPlatformCombo";
            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);
        }