void showWidgets(Constants.BellModes bellMode, Constants.EncoderVariablesCapture encoderMainVariable, EncoderRhythm encoderRhythm)
    {
        frame_best_and_worst.Hide();
        frame_conditions.Hide();
        hbox_jump_best_worst.Hide();
        hbox_run_best_worst.Hide();
        hbox_jump_conditions.Hide();
        hbox_run_conditions.Hide();
        frame_encoder_automatic_conditions.Hide();
        vbox_encoder_manual.Hide();
        notebook_encoder_conditions.Hide();
        vbox_encoder_stuff.Hide();

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

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

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

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

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

        label_test_sound_result.Text = "";
    }
示例#2
0
        public ViewGui()
            : base("")
        {
            string fullName = "MainView.gui.glade";

            Assembly a = Assembly.GetAssembly(this.GetType());
            Console.WriteLine(a.CodeBase);

            if (!System.IO.File.Exists(a.CodeBase + "/" + fullName))
                fullName = "gui.glade";

            glade = new XML (Assembly.GetCallingAssembly (), fullName, "ViewGui", null);
            glade.Autoconnect (this);

            Window win = (Window) glade ["ViewGui"];
            win.Maximize();

            //Initialisation du menu principal
            MainUIManager uim = new MainUIManager (this);

            vboxMain.PackStart (uim.MenuBar, false, false, 0);
            ((Gtk.Box.BoxChild)(vboxMain[uim.MenuBar])).Position = 0;

            //Pagecontrol des vues
            notebookViews = new Notebook ();
            hpanedMain.Pack2 (notebookViews, true, false);
            notebookViews.Show ();
            //notebookViews.RemovePage(0);
        }
示例#3
0
        public Toolbox()
        {
            _notebook=new Notebook();
            _notebook.TabPos=Gtk.PositionType.Bottom;
            _notebook.TabBorder=0;
            _notebook.ShowTabs=false;
            _notebook.TabVborder=Sugar.Style.TOOLBOX_TAB_VBORDER;
            _notebook.TabHborder=Sugar.Style.TOOLBOX_TAB_VBORDER;
            PackStart(_notebook);
            _notebook.Show();

            // TODO:
            // Creare il package hippo e importare questa routine.
            /*
            # FIXME improve gtk.Notebook and do this in the theme
            self._separator = hippo.Canvas()
            box = hippo.CanvasBox(
                    border_color=style.COLOR_BUTTON_GREY.get_int(),
                    background_color=style.COLOR_PANEL_GREY.get_int(),
                    box_height=style.TOOLBOX_SEPARATOR_HEIGHT,
                    border_bottom=style.LINE_WIDTH)
            self._separator.set_root(box)
            self.pack_start(self._separator, False)

            self._notebook.connect('notify::page', self._notify_page_cb)
            */
        }
示例#4
0
        private void CreateContextNotebook()
        {
            notebook = new Notebook()
            {
                ShowBorder = false,
                ShowTabs   = false
            };

            // 'No active track' and 'Loading' widgets
            no_active = new RoundedFrame();
            no_active.Add(new Label()
            {
                Markup = String.Format("<b>{0}</b>", Catalog.GetString("Waiting for playback to begin..."))
            });
            no_active.ShowAll();
            notebook.Add(no_active);

            loading = new RoundedFrame();
            loading.Add(new Label()
            {
                Markup = String.Format("<b>{0}</b>", Catalog.GetString("Loading..."))
            });
            loading.ShowAll();
            notebook.Add(loading);

            PackStart(notebook, true, true, 0);
            notebook.Show();
        }
示例#5
0
        public CombinedDesignView(IViewContent content)
        {
            this.content = content;
            if (content is IEditableTextBuffer)
            {
                ((IEditableTextBuffer)content).CaretPositionSet += delegate {
                    ShowPage(0);
                };
            }
            content.ContentChanged += new EventHandler(OnTextContentChanged);
            content.DirtyChanged   += new EventHandler(OnTextDirtyChanged);

            notebook = new Gtk.Notebook();

            // Main notebook

            notebook.TabPos     = Gtk.PositionType.Bottom;
            notebook.ShowTabs   = false;
            notebook.ShowBorder = false;
            notebook.Show();
            box = new VBox();

            // Bottom toolbar

            toolbar              = new Toolbar();
            toolbar.IconSize     = IconSize.SmallToolbar;
            toolbar.ToolbarStyle = ToolbarStyle.BothHoriz;
            toolbar.ShowArrow    = false;

            CommandRouterContainer crc = new CommandRouterContainer(content.Control, content, true);

            crc.Show();
            AddButton(GettextCatalog.GetString("Source Code"), crc).Active = true;

            toolbar.ShowAll();

            box.PackStart(notebook, true, true, 0);
            box.PackStart(toolbar, false, false, 0);

            box.Show();

            IdeApp.Workbench.ActiveDocumentChanged += new EventHandler(OnActiveDocumentChanged);
            content.Control.Realized += delegate {
                if (content != null && content.WorkbenchWindow != null)
                {
                    content.WorkbenchWindow.ActiveViewContent = notebook.CurrentPageWidget == content.Control ? content : this;
                }
            };
            notebook.SwitchPage += delegate {
                if (content != null && content.WorkbenchWindow != null)
                {
                    content.WorkbenchWindow.ActiveViewContent = notebook.CurrentPageWidget == content.Control ? content : this;
                }
            };
        }
示例#6
0
 public void OnShowTextBoxActivate(object o, EventArgs args)
 {
     if (!showTextBox.Active)
     {
         noteBook.Hide();
     }
     else
     {
         noteBook.Show();
     }
 }
示例#7
0
        //        Entry sipServerAddressEntry;
        //        Entry sipUsernameEntry;
        //        Entry sipPasswordEntry;
        public PreferencesDialog()
            : base()
        {
            SetDefaultSize (600, 600);
            WindowPosition = WindowPosition.Center;
            IconName = "rtc";
            HasSeparator = false;
            BorderWidth = 5;
            Resizable = true;
            Title = Catalog.GetString ("Banter Preferences");

            VBox.Spacing = 5;
            ActionArea.Layout = ButtonBoxStyle.End;

            // Notebook Tabs (General, Messages)...
            Gtk.Notebook notebook = new Notebook ();
            notebook.TabPos = PositionType.Top;
            notebook.BorderWidth = 5;
            notebook.Show ();

            //			notebook.AppendPage (MakeGeneralPage (),
            //									new Label (Catalog.GetString ("General")));
            notebook.AppendPage (MakeAccountsPage (),
                                    new Label (Catalog.GetString ("Accounts")));
            notebook.AppendPage (MakeMessagesPage (),
                                    new Label (Catalog.GetString ("Messages")));

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

            // Close button...
            Button button = new Button (Stock.Close);
            button.CanDefault = true;
            button.Show ();

            AccelGroup accelGroup = new AccelGroup ();
            AddAccelGroup (accelGroup);

            button.AddAccelerator ("activate",
                                    accelGroup,
                                    (uint) Gdk.Key.Escape,
                                    0,
                                    0);

            AddActionWidget (button, ResponseType.Close);
            DefaultResponse = ResponseType.Close;

            Realized += DialogRealized;

            Preferences.PreferenceChanged += PreferenceChanged;

            ShowAll ();
        }
示例#8
0
 public DockNotebook()
 {
     Child = new Notebook ();
     Child.Parent = this;
     ((Notebook)Child).TabPos = PositionType.Bottom;
     // FIXME: enable these if we do a DockTabLabel
     //((Notebook)Child).SwitchPage += new SwitchPageHandler (SwitchPageCb);
     //((Notebook)Child).ButtonPressEvent += new ButtonPressEvent (ButtonPressCb);
     //((Notebook)Child).ButtonReleaseEvent += new ButtonReleaseEvent (ButtonReleaseCb);
     ((Notebook)Child).Scrollable = true;
     Child.Show ();
     DockObjectFlags &= ~(DockObjectFlags.Automatic);
 }
示例#9
0
        public NotebookPage (Page page)
        {
            this.page = page;

            BorderWidth = 5;
            Spacing = 10;

            tab_widget = new Label (page.Name);
            tab_widget.Show ();

            Widget page_widget = page.DisplayWidget as Widget;
            if (page_widget != null) {
                page_widget.Show ();
                PackStart (page_widget, true, true, 0);
            } else {
                foreach (Section section in page) {
                    AddSection (section);
                }

                if (page.ChildPages.Count > 0) {
                    Notebook notebook = new Notebook ();
                    notebook.ShowBorder = false;
                    notebook.ShowTabs = false;
                    notebook.Show ();

                    var hbox = new HBox () { Spacing = 6 };
                    // FIXME this shouldn't be hard-coded to 'Source:', but this is the only
                    // user of this code atm...
                    var page_label = new Label (Mono.Unix.Catalog.GetString ("Source:"));
                    var page_combo = new PageComboBox (page.ChildPages, notebook);
                    hbox.PackStart (page_label, false, false, 0);
                    hbox.PackStart (page_combo, true, true, 0);
                    hbox.ShowAll ();

                    PackStart (hbox, false, false, 0);

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

                    foreach (Page child_page in page.ChildPages) {
                        NotebookPage page_ui = new NotebookPage (child_page);
                        page_ui.BorderWidth = 0;
                        page_ui.Show ();
                        notebook.AppendPage (page_ui, null);
                    }

                    PackStart (notebook, true, true, 0);
                }
            }
        }
    void showWidgets(Constants.BellModes bellMode)
    {
        frame_best_and_worst.Hide();
        frame_conditions.Hide();
        hbox_jump_best_worst.Hide();
        hbox_run_best_worst.Hide();
        hbox_jump_conditions.Hide();
        hbox_run_conditions.Hide();
        frame_encoder_automatic_conditions.Hide();
        vbox_encoder_manual.Hide();
        notebook_encoder_conditions.Hide();

        if (bellMode == Constants.BellModes.JUMPS)
        {
            frame_best_and_worst.Show();
            hbox_jump_best_worst.Show();
            hbox_jump_conditions.Show();
            frame_conditions.Show();
        }
        else if (bellMode == Constants.BellModes.RUNS)
        {
            frame_best_and_worst.Show();
            hbox_run_best_worst.Show();
            hbox_run_conditions.Show();
            frame_conditions.Show();
        }
        else                                             //encoder
        {
            notebook_encoder_conditions.CurrentPage = 3; //power
            frame_encoder_automatic_conditions.Show();
            vbox_encoder_manual.Show();
            if (checkbutton_encoder_show_manual_feedback.Active)
            {
                notebook_encoder_conditions.Show();
            }
        }
    }
		public CombinedDesignView (IViewContent content)
		{
			this.content = content;
			if (content is IEditableTextBuffer) {
				((IEditableTextBuffer)content).CaretPositionSet += delegate {
					ShowPage (0);
				};
			}
			content.ContentChanged += new EventHandler (OnTextContentChanged);
			content.DirtyChanged += new EventHandler (OnTextDirtyChanged);
			
			notebook = new Gtk.Notebook ();
			
			// Main notebook
			
			notebook.TabPos = Gtk.PositionType.Bottom;
			notebook.ShowTabs = false;
			notebook.ShowBorder = false;
			notebook.Show ();
			box = new VBox ();
			
			// Bottom toolbar
			
			toolbar = new Toolbar ();
			toolbar.IconSize = IconSize.SmallToolbar;
			toolbar.ToolbarStyle = ToolbarStyle.BothHoriz;
			toolbar.ShowArrow = false;
			
			CommandRouterContainer crc = new CommandRouterContainer (content.Control, content, true);
			crc.Show ();
			AddButton (GettextCatalog.GetString ("Source Code"), crc).Active = true;
			
			toolbar.ShowAll ();
			
			box.PackStart (notebook, true, true, 0);
			box.PackStart (toolbar, false, false, 0);
			
			box.Show ();
			
			IdeApp.Workbench.ActiveDocumentChanged += new EventHandler (OnActiveDocumentChanged);
			content.Control.Realized += delegate {
				if (content != null && content.WorkbenchWindow != null) 
					content.WorkbenchWindow.ActiveViewContent = notebook.CurrentPageWidget == content.Control ? content : this;
			};
			notebook.SwitchPage += delegate {
				if (content != null && content.WorkbenchWindow != null) 
					content.WorkbenchWindow.ActiveViewContent = notebook.CurrentPageWidget == content.Control ? content : this;
			};
		}
示例#12
0
        public StatusEntry()
        {
            ModifyBg (StateType.Normal, Style.Background (StateType.Active));
            BorderWidth = 0;

            customAvailableMessages = new SerializableDictionary<string,string> ();
            customBusyMessages = new SerializableDictionary<string,string> ();
            customAwayMessages = new SerializableDictionary<string,string> ();

            presence = null;
            potentialPresenceType = PresenceType.Offline;

            notebook = new Notebook ();
            notebook.ModifyBg (StateType.Normal, Style.Background (StateType.Active));
            notebook.ShowTabs = false;
            notebook.ShowBorder = false;

            notebook.AppendPage (CreateViewWidget (), new Label ());
            notebook.AppendPage (CreateEditWidget (), new Label());

            notebook.Show ();

            Add (notebook);
        }
示例#13
0
		public PreferencesDialog (NoteManager manager) : base(Gtk.WindowType.Toplevel)
		{
			this.addin_manager = manager.AddinManager;
			
			IconName = "tomboy";
			BorderWidth = 5;
			Resizable = true;
			Title = Catalog.GetString ("Tomboy Preferences");
			WindowPosition = WindowPosition.Center;
			
			addin_prefs_dialogs = new Dictionary<string, Gtk.Dialog> ();
			addin_info_dialogs = new Dictionary<string, Gtk.Dialog> ();
			
			// Notebook Tabs (Editing, Hotkeys)...
			
			Gtk.Notebook notebook = new Gtk.Notebook ();
			notebook.TabPos = Gtk.PositionType.Top;
			notebook.Show ();
			
			notebook.AppendPage (MakeEditingPane (), new Gtk.Label (Catalog.GetString ("Editing")));
			
			if (!(Services.Keybinder is NullKeybinder))
				notebook.AppendPage (MakeHotkeysPane (), new Gtk.Label (Catalog.GetString ("Hotkeys")));
			
			notebook.AppendPage (MakeSyncPane (), new Gtk.Label (Catalog.GetString ("Synchronization")));
			notebook.AppendPage (MakeAddinsPane (), new Gtk.Label (Catalog.GetString ("Add-ins")));
			
			// TODO: Figure out a way to have these be placed in a specific order
			foreach (PreferenceTabAddin tabAddin in addin_manager.GetPreferenceTabAddins ()) {
				Logger.Debug ("Adding preference tab addin: {0}", tabAddin.GetType ().Name);
				try {
					string tabName;
					Gtk.Widget tabWidget;
					if (tabAddin.GetPreferenceTabWidget (this, out tabName, out tabWidget) == true) {
						notebook.AppendPage (tabWidget, new Gtk.Label (tabName));
					}
				} catch (Exception e) {
					Logger.Warn ("Problems adding preferences tab addin: {0}", tabAddin.GetType ().Name);
					Logger.Debug ("{0}:\n{1}", e.Message, e.StackTrace);
				}
			}
			Gtk.VBox VBox = new Gtk.VBox ();
			VBox.PackStart (notebook, true, true, 0);
			
			addin_manager.ApplicationAddinListChanged += OnAppAddinListChanged;
			
			// Close Button
			Gtk.Button button = new Gtk.Button (Gtk.Stock.Close);
			button.CanDefault = true;
			button.Label = "Close";
			button.Clicked += OnClickedClose;
			VBox.Add (button);
			button.Show ();
			
			Gtk.AccelGroup accel_group = new Gtk.AccelGroup ();
			AddAccelGroup (accel_group);
			
			button.AddAccelerator ("activate", accel_group, (uint)Gdk.Key.Escape, 0, 0);
			
			this.Add (VBox);
			if ((this.Child != null)) {
				this.Child.ShowAll ();
			}
			this.Show ();
			Preferences.SettingChanged += HandlePreferencesSettingChanged;
		}
		public override Widget CreatePanelWidget ()
		{
			HBox hbox = new HBox (false, 6);
			Label label = new Label ();
			label.MarkupWithMnemonic = GettextCatalog.GetString ("_Policy:");
			hbox.PackStart (label, false, false, 0);
			
			store = new ListStore (typeof (string), typeof (PolicySet));
			policyCombo = new ComboBox (store);
			CellRenderer renderer = new CellRendererText ();
			policyCombo.PackStart (renderer, true);
			policyCombo.AddAttribute (renderer, "text", 0);
			
			label.MnemonicWidget = policyCombo;
			policyCombo.RowSeparatorFunc = (TreeModel model, TreeIter iter) =>
				((string) model.GetValue (iter, 0)) == "--";
			hbox.PackStart (policyCombo, false, false, 0);
			
			VBox vbox = new VBox (false, 6);
			vbox.PackStart (hbox, false, false, 0);
			vbox.ShowAll ();
			
			// Warning message to be shown when the user modifies the default policy
			
			warningMessage = new HBox ();
			warningMessage.Spacing = 6;
			Image img = new Image (Gtk.Stock.DialogWarning, IconSize.LargeToolbar);
			warningMessage.PackStart (img, false, false, 0);
			Label wl = new Label (GettextCatalog.GetString ("Changes done in this section will only be applied to new projects. " +
				"Settings for existing projects can be modified in the project (or solution) options dialog."));
			wl.Xalign = 0;
			wl.Wrap = true;
			wl.WidthRequest = 450;
			warningMessage.PackStart (wl, true, true, 0);
			warningMessage.ShowAll ();
			warningMessage.Visible = false;
			vbox.PackEnd (warningMessage, false, false, 0);
			
			notebook = new Notebook ();

			// Get the panels for all mime types
			
			List<string> types = new List<string> ();
			types.AddRange (DesktopService.GetMimeTypeInheritanceChain (mimeType));
			
			panelData.SectionLoaded = true;
			panels = panelData.Panels;
			foreach (IMimeTypePolicyOptionsPanel panel in panelData.Panels) {
				panel.SetParentSection (this);
				Widget child = panel.CreateMimePanelWidget ();
				
				Label tlabel = new Label (panel.Label);
				label.Show ();
				child.Show ();
				Alignment align = new Alignment (0.5f, 0.5f, 1f, 1f);
				align.BorderWidth = 6;
				align.Add (child);
				align.Show ();
				
				notebook.AppendPage (align, tlabel);
				panel.LoadCurrentPolicy ();
			}
			notebook.SwitchPage += delegate(object o, SwitchPageArgs args) {
				if (notebook.Page >= 0 && notebook.Page < this.panels.Count)
					this.panels[notebook.Page].PanelSelected ();
			};
			notebook.Show ();
			vbox.PackEnd (notebook, true, true, 0);
			
			FillPolicies ();
			policyCombo.Active = 0;
			
			loading = false;
			
			if (!isRoot && panelData.UseParentPolicy) {
				//in this case "parent" is always first in the list
				policyCombo.Active = 0;
				notebook.Sensitive = false;
			} else {
				UpdateSelectedNamedPolicy ();
			}
			
			policyCombo.Changed += HandlePolicyComboChanged;
			
			return vbox;
		}
示例#15
0
		void CreatePageWidget (SectionPage page)
		{
			List<PanelInstance> boxPanels = new List<PanelInstance> ();
			List<PanelInstance> tabPanels = new List<PanelInstance> ();
			
			foreach (PanelInstance pi in page.Panels) {
				if (pi.Widget == null) {
					pi.Widget = pi.Panel.CreatePanelWidget ();
					//HACK: work around bug 469427 - broken themes match on widget names
					if (pi.Widget.Name.IndexOf ("Panel") > 0)
						pi.Widget.Name = pi.Widget.Name.Replace ("Panel", "_");
				}
				else if (pi.Widget.Parent != null)
					((Gtk.Container) pi.Widget.Parent).Remove (pi.Widget);
					
				if (pi.Node.Grouping == PanelGrouping.Tab)
					tabPanels.Add (pi);
				else
					boxPanels.Add (pi);
			}
			
			// Try to fit panels with grouping=box or auto in the main page.
			// If they don't fit. Move auto panels to its own tab page.
			
			int mainPageSize;
			bool fits;
			do {
				PanelInstance lastAuto = null;
				mainPageSize = 0;
				foreach (PanelInstance pi in boxPanels) {
					if (pi.Node.Grouping == PanelGrouping.Auto)
						lastAuto = pi;
					// HACK: This we are parenting/unparenting the widget here as a workaround
					// for a layout issue. To properly calculate the size of the widget, the widget
					// needs to have the style that it will have when added to the window.
					pi.Widget.Parent = this;
					mainPageSize += pi.Widget.SizeRequest ().Height + 6;
					pi.Widget.Unparent ();
				}
				fits = mainPageSize <= pageFrame.Allocation.Height;
				if (!fits) {
					if (lastAuto != null && boxPanels.Count > 1) {
						boxPanels.Remove (lastAuto);
						tabPanels.Insert (0, lastAuto);
					} else {
						fits = true;
					}
				}
			} while (!fits);
			
			Gtk.VBox box = new VBox (false, 12);
			box.Show ();
			for (int n=0; n<boxPanels.Count; n++) {
				if (n != 0) {
					HSeparator sep = new HSeparator ();
					sep.Show ();
					box.PackStart (sep, false, false, 0);
				}
				PanelInstance pi = boxPanels [n];
				box.PackStart (pi.Widget, pi.Node.Fill, pi.Node.Fill, 0);
				pi.Widget.Show ();
			}
			
			box.BorderWidth = 12;

			if (tabPanels.Count > 0) {
				/*				SquaredNotebook nb = new SquaredNotebook ();
				nb.Show ();
				nb.AddTab (box, GettextCatalog.GetString ("General"));
				foreach (PanelInstance pi in tabPanels) {
					Gtk.Alignment a = new Alignment (0, 0, 1, 1);
					a.BorderWidth = 9;
					a.Show ();
					a.Add (pi.Widget);
					nb.AddTab (a, GettextCatalog.GetString (pi.Node.Label));
					pi.Widget.Show ();
				}*/
				Gtk.Notebook nb = new Notebook ();
				nb.Show ();
				Gtk.Label blab = new Gtk.Label (GettextCatalog.GetString ("General"));
				blab.Show ();
				box.BorderWidth = 9;
				nb.InsertPage (box, blab, -1);
				foreach (PanelInstance pi in tabPanels) {
					Gtk.Label lab = new Gtk.Label (GettextCatalog.GetString (pi.Node.Label));
					lab.Show ();
					Gtk.Alignment a = new Alignment (0, 0, 1, 1);
					a.BorderWidth = 9;
					a.Show ();
					a.Add (pi.Widget);
					nb.InsertPage (a, lab, -1);
					pi.Widget.Show ();
				}
				page.Widget = nb;
				nb.BorderWidth = 12;
			} else {
				page.Widget = box;
			}
		}
		public override Widget CreatePanelWidget ()
		{
			HBox hbox = new HBox (false, 6);
			Label label = new Label ();
			label.MarkupWithMnemonic = GettextCatalog.GetString ("_Policy:");
			hbox.PackStart (label, false, false, 0);
			
			store = new ListStore (typeof (string), typeof (PolicySet));
			policyCombo = new ComboBox (store);
			CellRenderer renderer = new CellRendererText ();
			policyCombo.PackStart (renderer, true);
			policyCombo.AddAttribute (renderer, "text", 0);
			
			label.MnemonicWidget = policyCombo;
			policyCombo.RowSeparatorFunc = (TreeModel model, TreeIter iter) =>
				((string) model.GetValue (iter, 0)) == "--";
			hbox.PackStart (policyCombo, false, false, 0);
			
			VBox vbox = new VBox (false, 6);
			vbox.PackStart (hbox, false, false, 0);
			vbox.ShowAll ();
			
			notebook = new Notebook ();

			// Get the panels for all mime types
			
			List<string> types = new List<string> ();
			types.AddRange (DesktopService.GetMimeTypeInheritanceChain (mimeType));
			
			panelData.SectionLoaded = true;
			panels = panelData.Panels;
			foreach (IMimeTypePolicyOptionsPanel panel in panelData.Panels) {
				panel.SetParentSection (this);
				Widget child = panel.CreateMimePanelWidget ();
				
				Label tlabel = new Label (panel.Label);
				label.Show ();
				child.Show ();
				Alignment align = new Alignment (0.5f, 0.5f, 1f, 1f);
				align.BorderWidth = 6;
				align.Add (child);
				align.Show ();
				
				notebook.AppendPage (align, tlabel);
				panel.LoadCurrentPolicy ();
			}
			
			notebook.Show ();
			vbox.PackEnd (notebook, true, true, 0);
			
			FillPolicies ();
			policyCombo.Active = 0;
			
			loading = false;
			
			if (!isRoot && panelData.UseParentPolicy) {
				//in this case "parent" is always first in the list
				policyCombo.Active = 0;
				notebook.Sensitive = false;
			} else {
				UpdateSelectedNamedPolicy ();
			}
			
			policyCombo.Changed += HandlePolicyComboChanged;
			
			return vbox;
		}
		public FullScreenView (IBrowsableCollection collection) : base ("Full Screen Mode")
		{
			Name = "FullscreenContainer";
			try {
				//scroll = new Gtk.ScrolledWindow (null, null);
				actions = new ActionGroup ("joe");
				
				actions.Add (new ActionEntry [] {
					new ActionEntry (HideToolbar, Stock.Close, 
							 Catalog.GetString ("Hide"), 
							 null, 
							 Catalog.GetString ("Hide Toolbar"), 
							 HideToolbarAction),
					new ActionEntry (ExitFullScreen, 
							 "f-spot-view-restore", 
							 Catalog.GetString ("Exit fullscreen"), 
							 null, 
							 null, 
							 ExitAction),
					new ActionEntry (SlideShow,
							 "f-spot-slideshow",
							 Catalog.GetString ("Slideshow"),
							 null,
							 Catalog.GetString ("Start slideshow"),
							 SlideShowAction),
						});

				actions.Add (new ToggleActionEntry [] {
					new ToggleActionEntry (Info,
							       Stock.Info,
							       Catalog.GetString ("Info"),
							       null,
							       Catalog.GetString ("Image Information"),
							       InfoAction,
							       false)
						});
				
				new Fader (this, 1.0, 3);
				notebook = new Notebook ();
				notebook.ShowBorder = false;
				notebook.ShowTabs = false;
				notebook.Show ();

				scroll = new ScrolledView ();
				view = new PhotoImageView (collection);
				// FIXME this should be handled by the new style setting code
				view.ModifyBg (Gtk.StateType.Normal, this.Style.Black);
				view.PointerMode = ImageView.PointerModeType.Scroll;
				this.Add (notebook);
				view.Show ();
				view.MotionNotifyEvent += HandleViewMotion;
				
				Action rotate_left = new RotateLeftAction (view.Item);
				actions.Add (rotate_left);
				
				Action rotate_right = new RotateRightAction (view.Item);
				actions.Add (rotate_right);

				scroll.ScrolledWindow.Add (view);
				HBox hhbox = new HBox ();
				hhbox.PackEnd (GetButton (HideToolbar), false, true, 0);
				hhbox.PackEnd (GetButton (Info), false, true, 0);
				hhbox.PackStart (GetButton (ExitFullScreen, true), false, false, 0);
				hhbox.PackStart (Add (new PreviousPictureAction (view.Item)), false, false, 0);
				hhbox.PackStart (GetButton (SlideShow), false, true, 0);
				hhbox.PackStart (Add (new NextPictureAction (view.Item)), false, false, 0);
				//hhbox.PackStart (Add (new AutoColor (view.Item)), false, false, 0);

				display = new TextureDisplay (view.Item);
				display.AddEvents ((int) (Gdk.EventMask.PointerMotionMask));
				display.ModifyBg (Gtk.StateType.Normal, this.Style.Black);
				display.MotionNotifyEvent += HandleViewMotion;
				Label effect = new Label (Catalog.GetString ("Slide transition: "));
				hhbox.PackStart (effect, false, false, 5);
				hhbox.PackStart (display.GetCombo (), false, false, 0);
				display.Show ();

				hhbox.PackStart (Add (new RotateLeftAction (view.Item)), false, false, 0);
				hhbox.PackStart (Add (new RotateRightAction (view.Item)), false, false, 0);
				hhbox.BorderWidth = 15;

				tag_view = new TagView ();
				hhbox.PackStart (tag_view, false, false, 0);

				//display = new ImageDisplay (view.Item);

				notebook.AppendPage (scroll, null);
				notebook.AppendPage (display, null);

				hhbox.ShowAll ();
				//scroll.ShowControls ();
				
				scroll.Show ();
				this.Decorated = false;
				this.Fullscreen ();
				this.ButtonPressEvent += HandleButtonPressEvent;
				
				view.Item.Changed += HandleItemChanged;
				view.GrabFocus ();
				
				controls = new ControlOverlay (this);
				controls.Add (hhbox);
				controls.Dismiss ();

				notebook.CurrentPage = 0;
			} catch (System.Exception e) {
				System.Console.WriteLine (e);
			}	

		}
示例#18
0
		void CheckCreateSubViewContents ()
		{
			if (subViewContents != null)
				return;
			
			subViewContents = new List<IAttachableViewContent> ();
			
			box.Remove (this.ViewContent.Control);
			
			subViewNotebook = new Notebook ();
			subViewNotebook.TabPos = PositionType.Bottom;
			subViewNotebook.ShowTabs = false;
			subViewNotebook.ShowBorder = false;
			subViewNotebook.Show ();
			subViewNotebook.SwitchPage += subViewNotebookIndexChanged;
			
			//add existing ViewContent
			AddButton (this.ViewContent.TabPageLabel, this.ViewContent.Control).Active = true;
			
			//pack them in a box
			box.PackStart (subViewNotebook, true, true, 0);
			box.ShowAll ();
		}
示例#19
0
        private void Init()
        {
            Logger.Debug("Called Preferences Init");
            this.Icon = Utilities.GetIcon("tasque", 16);
            // Update the window title
            this.Title = string.Format(Catalog.GetString("Tasque Preferences"));

            this.VBox.Spacing     = 0;
            this.VBox.BorderWidth = 0;
            this.Resizable        = false;

            this.AddButton(Stock.Close, Gtk.ResponseType.Ok);
            this.DefaultResponse = ResponseType.Ok;

            notebook          = new Gtk.Notebook();
            notebook.ShowTabs = true;

            //
            // General Page
            //
            generalPage = MakeGeneralPage();
            generalPage.Show();
            generalPageId =
                notebook.AppendPage(generalPage,
                                    new Label(Catalog.GetString("General")));

            //
            // Appearance Page
            //
            appearancePage = MakeAppearancePage();
            appearancePage.Show();
            notebook.AppendPage(appearancePage,
                                new Label(Catalog.GetString("Appearance")));

            //
            // Backend Page
            //
            backendPage   = null;
            backendPageId = -1;

            var backendType = application.BackendManager.CurrentBackend;

            if (backendType != null)
            {
                backendPage = (Widget)application.BackendManager.GetBackendPreferencesWidget();
                if (backendPage != null)
                {
                    backendPage.Show();
                    var l = new Label(GLib.Markup.EscapeText(
                                          application.BackendManager.AvailableBackends [backendType]));
                    l.UseMarkup    = false;
                    l.UseUnderline = false;
                    l.Show();
                    backendPageId = notebook.AppendPage(backendPage, l);
                }
            }

            notebook.Show();
            this.VBox.PackStart(notebook, true, true, 0);

            DeleteEvent += WindowDeleted;
        }
        public FullScreenView(IBrowsableCollection collection, Gtk.Window parent)
            : base("Full Screen Mode")
        {
            //going fullscreen on the same screen the parent window
            Gdk.Screen screen = Screen;
            int monitor = screen.GetMonitorAtWindow (parent.GdkWindow);
            Gdk.Rectangle bounds = screen.GetMonitorGeometry (monitor);
            Move (bounds.X, bounds.Y);

            string style = "style \"test\" {\n" +
                "GtkToolbar::shadow_type = GTK_SHADOW_NONE\n" +
                "}\n" +
                "class \"GtkToolbar\" style \"test\"";

            Gtk.Rc.ParseString (style);

            Name = "FullscreenContainer";
            try {
                //scroll = new Gtk.ScrolledWindow (null, null);
                actions = new ActionGroup ("joe");

                actions.Add (new ActionEntry [] {
                    new ActionEntry (HideToolbar, Stock.Close,
                             Catalog.GetString ("Hide"),
                             null,
                             Catalog.GetString ("Hide toolbar"),
                             HideToolbarAction)});

                actions.Add (new ToggleActionEntry [] {
                    new ToggleActionEntry (Info,
                                   Stock.Info,
                                   Catalog.GetString ("Info"),
                                   null,
                                   Catalog.GetString ("Image information"),
                                   InfoAction,
                                   false)});

                Gtk.Action exit_full_screen = new Gtk.Action (ExitFullScreen,
                    Catalog.GetString ("Exit fullscreen"),
                    null,
                    null);
                exit_full_screen.IconName = "view-restore";
                exit_full_screen.Activated += ExitAction;
                actions.Add (exit_full_screen);

                Gtk.Action slide_show = new Gtk.Action (SlideShow,
                    Catalog.GetString ("Slideshow"),
                    Catalog.GetString ("Start slideshow"),
                    null);
                slide_show.IconName = "media-playback-start";
                slide_show.Activated += SlideShowAction;
                actions.Add (slide_show);

                new WindowOpacityFader (this, 1.0, 600);
                notebook = new Notebook ();
                notebook.ShowBorder = false;
                notebook.ShowTabs = false;
                notebook.Show ();

                scroll = new ScrolledView ();
                scroll.ScrolledWindow.SetPolicy (PolicyType.Never, PolicyType.Never);
                view = new PhotoImageView (collection);
                // FIXME this should be handled by the new style setting code
                view.ModifyBg (Gtk.StateType.Normal, this.Style.Black);
                this.Add (notebook);
                view.Show ();
                view.MotionNotifyEvent += HandleViewMotion;
                view.PointerMode = PointerMode.Scroll;

                scroll.ScrolledWindow.Add (view);

                Toolbar tbar = new Toolbar ();
                tbar.ToolbarStyle = Gtk.ToolbarStyle.BothHoriz;

                tbar.ShowArrow = false;
                tbar.BorderWidth = 15;

                ToolItem t_item = (actions [ExitFullScreen]).CreateToolItem () as ToolItem;
                t_item.IsImportant = true;
                tbar.Insert (t_item, -1);

                Gtk.Action action = new PreviousPictureAction (view.Item);
                actions.Add (action);
                tbar.Insert (action.CreateToolItem () as ToolItem, -1);

                play_pause_button = (actions [SlideShow]).CreateToolItem () as ToolButton;
                tbar.Insert (play_pause_button, -1);

                action = new NextPictureAction (view.Item);
                actions.Add (action);
                tbar.Insert (action.CreateToolItem () as ToolItem, -1);

                t_item = new ToolItem ();
                t_item.Child = new Label (Catalog.GetString ("Slide transition:"));
                tbar.Insert (t_item, -1);

                display = new SlideShow (view.Item);
                display.AddEvents ((int) (Gdk.EventMask.PointerMotionMask));
                display.ModifyBg (Gtk.StateType.Normal, this.Style.Black);
                display.MotionNotifyEvent += HandleViewMotion;
                display.Show ();

                t_item = new ToolItem ();
                ComboBox combo = ComboBox.NewText ();
                foreach (var transition in display.Transitions)
                    combo.AppendText (transition.Name);
                combo.Active = 0;
                combo.Changed += HandleTransitionChanged;
                t_item.Child = combo;
                tbar.Insert (t_item, -1);

                action = new RotateLeftAction (view.Item);
                actions.Add (action);
                tbar.Insert (action.CreateToolItem () as ToolItem, -1);

                action = new RotateRightAction (view.Item);
                actions.Add (action);
                tbar.Insert (action.CreateToolItem () as ToolItem, -1);

                info_button = (ToggleToolButton) ((actions [Info]).CreateToolItem () as ToolItem);
                tbar.Insert (info_button, -1);

                tbar.Insert ((actions [HideToolbar]).CreateToolItem () as ToolItem, -1);

                notebook.AppendPage (scroll, null);
                notebook.AppendPage (display, null);

                tbar.ShowAll ();

                scroll.Show ();
                this.Decorated = false;
                this.Fullscreen ();
                this.ButtonPressEvent += HandleButtonPressEvent;

                view.Item.Changed += HandleItemChanged;
                view.GrabFocus ();

                hide_cursor_delay = new DelayedOperation (3000, new GLib.IdleHandler (HideCursor));
                hide_cursor_delay.Start ();

                controls = new ControlOverlay (this);
                controls.Add (tbar);
                controls.Dismiss ();

                notebook.CurrentPage = 0;
            } catch (System.Exception e) {
                Log.Exception (e);
            }
        }
示例#21
0
        private void BuildDialog()
        {
            SetDefaultSize (-1, 400);

            AddDefaultCloseButton ();

            if (service.Count > 1) {
                notebook = new Notebook ();
                notebook.Show ();

                VBox.PackStart (notebook, true, true, 0);
            }
        }
示例#22
0
        Notebook ConstructUI()
        {
            Notebook notebook = new Notebook ();
            notebook.Show ();

            Widget child;

            child = ConstructItemsUI ();
            if (child != null)
                notebook.AppendPage (child, new Label ("Items"));

            child = ConstructLayoutsUI ();
            if (child != null)
                notebook.AppendPage (child, new Label ("Layouts"));

            notebook.CurrentPage = 0;
            return notebook;
        }
示例#23
0
        private void Init()
        {
            Logger.Debug("Called Preferences Init");
            this.Icon = Utilities.GetIcon ("tasque", 16);
            // Update the window title
            this.Title = string.Format (Catalog.GetString ("Tasque Preferences"));

            this.VBox.Spacing = 0;
            this.VBox.BorderWidth = 0;
            this.Resizable = false;

            this.AddButton(Stock.Close, Gtk.ResponseType.Ok);
            this.DefaultResponse = ResponseType.Ok;

            notebook = new Gtk.Notebook ();
            notebook.ShowTabs = true;

            //
            // General Page
            //
            generalPage = MakeGeneralPage ();
            generalPage.Show ();
            generalPageId =
                notebook.AppendPage (generalPage,
                                     new Label (Catalog.GetString ("General")));

            //
            // Appearance Page
            //
            appearancePage = MakeAppearancePage ();
            appearancePage.Show ();
            notebook.AppendPage (appearancePage,
                                 new Label (Catalog.GetString ("Appearance")));

            //
            // Backend Page
            //
            backendPage = null;
            backendPageId = -1;

            var backendType = application.BackendManager.CurrentBackend;
            if (backendType != null) {
                backendPage = (Widget)application.BackendManager.GetBackendPreferencesWidget ();
                if (backendPage != null) {
                    backendPage.Show ();
                    var l = new Label (GLib.Markup.EscapeText (
                        application.BackendManager.AvailableBackends [backendType]));
                    l.UseMarkup = false;
                    l.UseUnderline = false;
                    l.Show ();
                    backendPageId = notebook.AppendPage (backendPage, l);
                }
            }

            notebook.Show ();
            this.VBox.PackStart (notebook, true, true, 0);

            DeleteEvent += WindowDeleted;
        }
示例#24
0
        private void CreateContextNotebook ()
        {
            notebook = new Notebook () {
                ShowBorder = false,
                ShowTabs = false
            };

            // 'No active track' and 'Loading' widgets
            no_active = new RoundedFrame ();
            no_active.Add (new Label () {
                Markup = String.Format ("<b>{0}</b>", Catalog.GetString ("Waiting for playback to begin..."))
            });
            no_active.ShowAll ();
            notebook.Add (no_active);

            loading = new RoundedFrame ();
            loading.Add (new Label () { Markup = String.Format ("<b>{0}</b>", Catalog.GetString ("Loading...")) });
            loading.ShowAll ();
            notebook.Add (loading);

            PackStart (notebook, true, true, 0);
            notebook.Show ();

        }