示例#1
0
        public override bool GetPreferenceTabWidget(PreferencesDialog parent,
                                                    out string tabLabel,
                                                    out Gtk.Widget preferenceWidget)
        {
            Gtk.Label      label;
            Gtk.SpinButton menuNoteCountSpinner;
            Gtk.Alignment  align;
            int            menuNoteCount;

            // Addin's tab caption
            tabLabel = Catalog.GetString("Advanced");

            Gtk.VBox opts_list = new Gtk.VBox(false, 12);
            opts_list.BorderWidth = 12;
            opts_list.Show();

            align = new Gtk.Alignment(0.5f, 0.5f, 0.0f, 1.0f);
            align.Show();
            opts_list.PackStart(align, false, false, 0);

            Gtk.Table table = new Gtk.Table(1, 2, false);
            table.ColumnSpacing = 6;
            table.RowSpacing    = 6;
            table.Show();
            align.Add(table);


            // Menu Note Count option
            label = new Gtk.Label(Catalog.GetString("Minimum number of notes to show in Recent list (maximum 18)"));

            label.UseMarkup = true;
            label.Justify   = Gtk.Justification.Left;
            label.SetAlignment(0.0f, 0.5f);
            label.Show();

            table.Attach(label, 0, 1, 0, 1);

            menuNoteCount = (int)Preferences.Get(Preferences.MENU_NOTE_COUNT);
            // we have a hard limit of 18 set, thus not allowing anything bigger than 18
            menuNoteCountSpinner       = new Gtk.SpinButton(1, 18, 1);
            menuNoteCountSpinner.Value = menuNoteCount <= 18 ? menuNoteCount : 18;

            menuNoteCountSpinner.Show();
            table.Attach(menuNoteCountSpinner, 1, 2, 0, 1);

            menuNoteCountSpinner.ValueChanged += UpdateMenuNoteCountPreference;

            if (opts_list != null)
            {
                preferenceWidget = opts_list;
                return(true);
            }
            else
            {
                preferenceWidget = null;
                return(false);
            }
        }
示例#2
0
		public override bool GetPreferenceTabWidget (	PreferencesDialog parent,
								out string tabLabel,
								out Gtk.Widget preferenceWidget)
		{
			
			Gtk.Label label;
			Gtk.SpinButton menuNoteCountSpinner;
			Gtk.Alignment align;
			int menuNoteCount;

			// Addin's tab caption
			tabLabel = Catalog.GetString ("Advanced");
			
			Gtk.VBox opts_list = new Gtk.VBox (false, 12);
			opts_list.BorderWidth = 12;
			opts_list.Show ();
			
			align = new Gtk.Alignment (0.5f, 0.5f, 0.0f, 1.0f);
			align.Show ();
			opts_list.PackStart (align, false, false, 0);

			Gtk.Table table = new Gtk.Table (1, 2, false);
			table.ColumnSpacing = 6;
			table.RowSpacing = 6;
			table.Show ();
			align.Add (table);


			// Menu Note Count option
			label = new Gtk.Label (Catalog.GetString ("Minimum number of notes to show in Recent list (maximum 18)"));

			label.UseMarkup = true;
			label.Justify = Gtk.Justification.Left;
			label.SetAlignment (0.0f, 0.5f);
			label.Show ();
			
			table.Attach (label, 0, 1, 0, 1);
		
			menuNoteCount = (int) Preferences.Get (Preferences.MENU_NOTE_COUNT);
			// we have a hard limit of 18 set, thus not allowing anything bigger than 18
			menuNoteCountSpinner = new Gtk.SpinButton (1, 18, 1);
			menuNoteCountSpinner.Value = menuNoteCount <= 18 ? menuNoteCount : 18;
			
			menuNoteCountSpinner.Show ();
			table.Attach (menuNoteCountSpinner, 1, 2, 0, 1);
			
			menuNoteCountSpinner.ValueChanged += UpdateMenuNoteCountPreference;
			
			if (opts_list != null) {
				preferenceWidget = opts_list;
				return true;
			} else {
				preferenceWidget = null;
				return false;
			}
		}
示例#3
0
        public TileView(int initialColumnCount) : base(null, null)
        {
            current_column_count = initialColumnCount;

            Table table = new Table(1, 1, true);

            table.Show();
            cached_tables.Add(table);
            Add(table);

            Show ();
        }
		public MenuMinMaxNoteCountPreference ()
		{
			table = new Gtk.Table (2, 2, false);
			table.ColumnSpacing = 6;
			table.RowSpacing = 6;
			table.Show ();

			// Menu Min Note Count option
			menuMinNoteCountLabel = new Gtk.Label (Catalog.GetString ("Minimum number of notes to show in Recent list"));

			menuMinNoteCountLabel.UseMarkup = true;
			menuMinNoteCountLabel.Justify = Gtk.Justification.Left;
			menuMinNoteCountLabel.SetAlignment (0.0f, 0.5f);
			menuMinNoteCountLabel.Show ();
			table.Attach (menuMinNoteCountLabel, 0, 1, 0, 1);

			menuMinNoteCount = (int) Preferences.Get (Preferences.MENU_NOTE_COUNT);
			menuMaxNoteCount = (int) Preferences.Get (Preferences.MENU_MAX_NOTE_COUNT);
			// This is to avoid having Max bigger than absolute maximum if someone changed the setting
			// outside of the Tomboy using e.g. gconf
			menuMaxNoteCount = (menuMaxNoteCount <= int.MaxValue ? menuMaxNoteCount : int.MaxValue);
			// This is to avoid having Min bigger than Max if someone changed the setting
			// outside of the Tomboy using e.g. gconf
			menuMinNoteCount = (menuMinNoteCount <= menuMaxNoteCount ? menuMinNoteCount : menuMaxNoteCount);

			menuMinNoteCountSpinner = new Gtk.SpinButton (1, menuMaxNoteCount, 1);
			menuMinNoteCountSpinner.Value = menuMinNoteCount;
			menuMinNoteCountSpinner.Show ();
			table.Attach (menuMinNoteCountSpinner, 1, 2, 0, 1);
			menuMinNoteCountSpinner.ValueChanged += UpdateMenuMinNoteCountPreference;

			// Menu Max Note Count option
			menuMaxNoteCountLabel = new Gtk.Label (Catalog.GetString ("Maximum number of notes to show in Recent list"));

			menuMaxNoteCountLabel.UseMarkup = true;
			menuMaxNoteCountLabel.Justify = Gtk.Justification.Left;
			menuMaxNoteCountLabel.SetAlignment (0.0f, 0.5f);
			menuMaxNoteCountLabel.Show ();
			table.Attach (menuMaxNoteCountLabel, 0, 1, 1, 2);

			menuMaxNoteCountSpinner = new Gtk.SpinButton (menuMinNoteCount, int.MaxValue, 1);
			menuMaxNoteCountSpinner.Value = menuMaxNoteCount;
			menuMaxNoteCountSpinner.Show ();
			table.Attach (menuMaxNoteCountSpinner, 1, 2, 1, 2);
			menuMaxNoteCountSpinner.ValueChanged += UpdateMenuMaxNoteCountPreference;

			align = new Gtk.Alignment (0.0f, 0.0f, 0.0f, 1.0f);
			align.Show ();
			align.Add (table);
		}
        public MenuMinMaxNoteCountPreference()
        {
            table = new Gtk.Table(2, 2, false);
            table.ColumnSpacing = 6;
            table.RowSpacing    = 6;
            table.Show();

            // Menu Min Note Count option
            menuMinNoteCountLabel = new Gtk.Label(Catalog.GetString("Minimum number of notes to show in Recent list"));

            menuMinNoteCountLabel.UseMarkup = true;
            menuMinNoteCountLabel.Justify   = Gtk.Justification.Left;
            menuMinNoteCountLabel.SetAlignment(0.0f, 0.5f);
            menuMinNoteCountLabel.Show();
            table.Attach(menuMinNoteCountLabel, 0, 1, 0, 1);

            menuMinNoteCount = (int)Preferences.Get(Preferences.MENU_NOTE_COUNT);
            menuMaxNoteCount = (int)Preferences.Get(Preferences.MENU_MAX_NOTE_COUNT);
            // This is to avoid having Max bigger than absolute maximum if someone changed the setting
            // outside of the Tomboy using e.g. gconf
            menuMaxNoteCount = (menuMaxNoteCount <= int.MaxValue ? menuMaxNoteCount : int.MaxValue);
            // This is to avoid having Min bigger than Max if someone changed the setting
            // outside of the Tomboy using e.g. gconf
            menuMinNoteCount = (menuMinNoteCount <= menuMaxNoteCount ? menuMinNoteCount : menuMaxNoteCount);

            menuMinNoteCountSpinner       = new Gtk.SpinButton(1, menuMaxNoteCount, 1);
            menuMinNoteCountSpinner.Value = menuMinNoteCount;
            menuMinNoteCountSpinner.Show();
            table.Attach(menuMinNoteCountSpinner, 1, 2, 0, 1);
            menuMinNoteCountSpinner.ValueChanged += UpdateMenuMinNoteCountPreference;

            // Menu Max Note Count option
            menuMaxNoteCountLabel = new Gtk.Label(Catalog.GetString("Maximum number of notes to show in Recent list"));

            menuMaxNoteCountLabel.UseMarkup = true;
            menuMaxNoteCountLabel.Justify   = Gtk.Justification.Left;
            menuMaxNoteCountLabel.SetAlignment(0.0f, 0.5f);
            menuMaxNoteCountLabel.Show();
            table.Attach(menuMaxNoteCountLabel, 0, 1, 1, 2);

            menuMaxNoteCountSpinner       = new Gtk.SpinButton(menuMinNoteCount, int.MaxValue, 1);
            menuMaxNoteCountSpinner.Value = menuMaxNoteCount;
            menuMaxNoteCountSpinner.Show();
            table.Attach(menuMaxNoteCountSpinner, 1, 2, 1, 2);
            menuMaxNoteCountSpinner.ValueChanged += UpdateMenuMaxNoteCountPreference;

            align = new Gtk.Alignment(0.0f, 0.0f, 0.0f, 1.0f);
            align.Show();
            align.Add(table);
        }
示例#6
0
		public void CreateGui() 
		{
			dialog = new Dialog ();
			
			dialog.AllowGrow = true;
			dialog.Title = "About";
			dialog.BorderWidth = 3;
			dialog.VBox.BorderWidth = 5;
			dialog.HasSeparator = false;
		
			Table table = new Table (4, 1, false);
			table.ColumnSpacing = 4;
			table.RowSpacing = 4;
			Label label = null;
			
			label = new Label ("About Mono SQL# For GTK#");
			table.Attach (label, 0, 1, 0, 1);

			label = new Label ("sqlsharpgtk");
			table.Attach (label, 0, 1, 1, 2);

			label = new Label (VERSION);
			table.Attach (label, 0, 1, 2, 3);

			label = new Label ("(C) Copyright 2002-2006 Daniel Morgan");
			table.Attach (label, 0, 1, 3, 4);

			table.Show();

			dialog.VBox.PackStart (table, false, false, 10);

			Button button = null;
			button = new Button (Stock.Ok);
			button.Clicked += new EventHandler (Ok_Action);
			button.CanDefault = true;
			dialog.ActionArea.PackStart (button, true, true, 0);
			button.GrabDefault ();

			dialog.Modal = true;

			dialog.ShowAll ();
		}
示例#7
0
        public ProgressBarSample()
        {
            Gtk.HSeparator  separator;
            Gtk.Table       table;
            Gtk.Button      button;
            Gtk.CheckButton check;
            Gtk.VBox        vbox;

            //Application.Init ();

            /* Allocate memory for the data that is passed to the callbacks*/
            pdata = new ProgressData();
            pdata.activity_mode    = false;
            pdata.window           = new Gtk.Window(Gtk.WindowType.Toplevel);
            pdata.window.Resizable = true;

            pdata.window.DeleteEvent += destroy_progress;
            pdata.window.Title        = "GtkProgressBar";
            pdata.window.BorderWidth  = 0;

            vbox             = new Gtk.VBox(false, 5);
            vbox.BorderWidth = 10;
            pdata.window.Add(vbox);
            vbox.Show();

            /* Create a centering alignment object */
            Gtk.Alignment align = new Gtk.Alignment(1, 1, 0, 0);
            vbox.PackStart(align, false, false, 5);
            align.Show();

            /* Create the GtkProgressBar */
            pdata.pbar      = new Gtk.ProgressBar();
            pdata.pbar.Text = "";
            align.Add(pdata.pbar);
            pdata.pbar.Show();

            /* Add a timer callback to update the value of the progress bar*/
            pdata.timer = GLib.Timeout.Add(10000, new GLib.TimeoutHandler(progress_timeout));


            separator = new Gtk.HSeparator();
            vbox.PackStart(separator, false, false, 0);
            separator.Show();

            /* rows, columns, homogeneous */
            table = new Gtk.Table(2, 3, false);
            vbox.PackStart(table, false, true, 0);
            table.Show();

            /* Add a check button to select displaying of the trough text*/
            check = new Gtk.CheckButton("Query cada 1 minuto");
            table.Attach(check, 0, 1, 0, 1,
                         Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill,
                         Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill,
                         5, 5);
            check.Clicked += toggle_show_text;
            check.Show();

            /* Add a check button to toggle activity mode */
            check = new Gtk.CheckButton("Activity mode");
            table.Attach(check, 0, 1, 1, 2,
                         Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill,
                         Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill,
                         5, 5);
            check.Clicked += toggle_activity_mode;
            check.Active   = true;
            check.Show();

            /* Add a check button to toggle orientation */
            check = new Gtk.CheckButton("Right to Left");
            table.Attach(check, 0, 1, 2, 3,
                         Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill,
                         Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill,
                         5, 5);
            check.Clicked += toggle_orientation;
            check.Show();

            /* Add a button to exit the program */
            button          = new Gtk.Button("close");
            button.Clicked += button_click;
            vbox.PackStart(button, false, false, 0);

            /* This makes it so the button is the default. */
            button.CanDefault = true;

            /* This grabs this button to be the default button. Simply hitting
             * the "Enter" key will cause this button to activate. */
            button.GrabDefault();
            button.Show();

            pdata.window.ShowAll();

            //Application.Run ();
        }
        public override void ShowTotals()
        {
            if (!initialized)
            {
                throw new ApplicationException("Visualizer not initialized.");
            }

            if (totalsCalculated)
            {
                grid.FooterVisible = true;
                return;
            }

            Dictionary <int, int> indexes = new Dictionary <int, int> ();
            List <double>         sums    = new List <double> ();

            for (int i = 0; i < model.Columns.Count; i++)
            {
                DbField field = dataQueryResult.Columns [i].Field;
                if (skip.Contains(field))
                {
                    continue;
                }

                switch (ReportProvider.GetDataFieldType(field))
                {
                case DataType.Quantity:
                case DataType.CurrencyIn:
                case DataType.CurrencyOut:
                case DataType.Currency:
                    indexes.Add(i, sums.Count);
                    sums.Add(0);
                    break;
                }
            }

            // If there are many rows to be calculated show progress message else calculate directly
            int total = model.Count;

            try {
                if (total > 10000)
                {
                    SwitchToWidget(tblCalculating);

                    for (int i = 0; i < total; i++)
                    {
                        foreach (KeyValuePair <int, int> pair in indexes)
                        {
                            if (listReset)
                            {
                                return;
                            }
                            sums [pair.Value] += (double)(dataQueryResult.Result [i] [pair.Key] ?? 0d);
                        }

                        if (i % 1000 != 0)
                        {
                            continue;
                        }

                        tblCalculating.Show();
                        double val = Math.Min((double)i / total, 1);
                        val = Math.Max(val, 0d);

                        prgCalculating.Fraction = val;
                        prgCalculating.Text     = string.Format(Translator.GetString("{0} of {1}"), i, total);
                        PresentationDomain.ProcessUIEvents();
                    }

                    ShowDataWidget();
                }
                else
                {
                    for (int i = 0; i < total; i++)
                    {
                        foreach (KeyValuePair <int, int> pair in indexes)
                        {
                            if (listReset)
                            {
                                return;
                            }
                            sums [pair.Value] += (double)(dataQueryResult.Result [i] [pair.Key] ?? 0d);
                        }
                    }
                }
            } catch (ArgumentOutOfRangeException) {
                return;
            }

            for (int i = 0; i < dataQueryResult.Result.Columns.Count; i++)
            {
                int index;
                if (!indexes.TryGetValue(i, out index))
                {
                    continue;
                }

                CellTextFooter footer;
                Column         column = grid.ColumnController [i];
                column.FooterValue = sums [index];

                DbField  field     = dataQueryResult.Columns [i].Field;
                DataType fieldType = ReportProvider.GetDataFieldType(field);
                switch (fieldType)
                {
                case DataType.Quantity:
                    column.FooterText = Quantity.ToString(sums [index]);
                    footer            = (CellTextFooter)column.FooterCell;
                    footer.Alignment  = Pango.Alignment.Right;
                    break;

                case DataType.CurrencyIn:
                    column.FooterText = Currency.ToString(sums [index], PriceType.Purchase);
                    footer            = (CellTextFooter)column.FooterCell;
                    footer.Alignment  = Pango.Alignment.Right;
                    break;

                case DataType.CurrencyOut:
                    column.FooterText = Currency.ToString(sums [index]);
                    footer            = (CellTextFooter)column.FooterCell;
                    footer.Alignment  = Pango.Alignment.Right;
                    break;

                case DataType.Currency:
                    column.FooterText = Currency.ToString(sums [index], PriceType.Unknown);
                    footer            = (CellTextFooter)column.FooterCell;
                    footer.Alignment  = Pango.Alignment.Right;
                    break;
                }
            }

            grid.FooterVisible = true;
            totalsCalculated   = true;
        }
示例#9
0
        void InitializeComponents()
        {
            var stream = Assembly
                .GetExecutingAssembly()
                .GetManifestResourceStream(AppController.Instance.Config.AppWindow);

            var glade = new Glade.XML(stream, AppController.Instance.Config.AppWindowName, null);
            if (stream != null)
            {
                stream.Close();
            }
            glade.Autoconnect(this);

            mNew.Activated += OnNew;
            mOpen.Activated += OnOpen;
            mSave.Activated += OnSave;
            mSaveAs.Activated += OnSaveAs;
            mQuit.Activated += OnQuit;
            mEnvironment.Activated += OnEnvironment;
            mAbout.Activated += OnAbout;
            mExportToPng.Activated += OnExportToPng;

            rbDefault.Clicked += OnVariableRadiobuttonCliecked;
            rbExisting.Clicked += OnVariableRadiobuttonCliecked;
            rbNew.Clicked += OnVariableRadiobuttonCliecked;

            rbDefault1.Clicked += OnVariableRadiobuttonCliecked1;
            rbExisting1.Clicked += OnVariableRadiobuttonCliecked1;
            rbNew1.Clicked += OnVariableRadiobuttonCliecked1;

            rbDefault2.Clicked += OnVariableRadiobuttonCliecked2;
            rbExisting2.Clicked += OnVariableRadiobuttonCliecked2;
            rbNew2.Clicked += OnVariableRadiobuttonCliecked2;

            rbDefault3.Clicked += OnVariableRadiobuttonCliecked3;
            rbExisting3.Clicked += OnVariableRadiobuttonCliecked3;
            rbNew3.Clicked += OnVariableRadiobuttonCliecked3;

            DisableProperties ();

            cbDefaultVar.Changed += OnVariableComboboxChanged;
            cbExistVar.Changed += OnVariableComboboxChanged;
            etNewVar.Changed += OnVariableComboboxChanged;

            cbDefaultVar1.Changed += OnVariableComboboxChanged;
            cbExistVar1.Changed += OnVariableComboboxChanged;
            etNewVar1.Changed += OnVariableComboboxChanged;

            cbDefaultVar2.Changed += OnVariableComboboxChanged;
            cbExistVar2.Changed += OnVariableComboboxChanged;
            etNewVar2.Changed += OnVariableComboboxChanged;

            cbDefaultVar3.Changed += OnVariableComboboxChanged;
            cbExistVar3.Changed += OnVariableComboboxChanged;
            etNewVar3.Changed += OnVariableComboboxChanged;

            cbFunction.Changed += OnFunctionChanged;
            chbOverride.Toggled += OnOverrideToggled;

            IconList = new[]{ new Gdk.Pixbuf (Assembly.GetExecutingAssembly (), AppController.Instance.Config.Icon) };
            Icon = IconList[0];

            var surfaces = AppController.Instance.GetPalette ();

            var count = (uint)surfaces.Sum (s => s.Segments.Count);
            table1 = new Table (2, count / 2, true);

            var index = 0;
            for (uint i = 0; i < count / 2; i++) {
                for (uint j = 0; j < 2; j++) {
                    if (surfaces.Count() <= index) continue;
                    var surf = surfaces [index++];
                    var el = new ElementDrawing(surf, 2, 2 );
                    table1.Attach (el, i, i+1, j, j+(uint)surf.Segments.Count());
                    el.Show ();
                }
            }

            vboxPalette.Add (table1);

            table1.SetSizeRequest (300, 100);
            table1.Show ();

            _grid = new ElementDrawing(AppController.Instance.Surface, 24, 24);

            scrolledwindow1.AddWithViewport (_grid);

            _grid.Show ();

            var arduino = AppController.Instance.GetArduino ();

            var code = new ElementDrawing(arduino[0], 2, 2 );
            tblArdulino.Attach (code, 0, 1, 0, 1);
            code.CreateCode += CController.Instance.CreateCode;
            code.Show ();
            var t = new System.Threading.Thread(() =>
            {
                System.Threading.Thread.Sleep(2000);
                UpdateHelper.CompareVersions(this);
            });
            t.Start();
        }
示例#10
0
        private void Update()
        {
            showRemoteStatus.Sensitive = !remoteStatus;

            if (statuses.Length == 0) {
                if (!remoteStatus)
                    this.status.Text = "No files have local modifications.";
                else
                    this.status.Text = "No files have local or remote modifications.";
                return;
            }

            buttonsShowLog = new Hashtable();
            buttonsShowDiff = new Hashtable();

            box.Remove(this.status);
            this.status = null;

            if (vc.CanCommit(filepath))
                buttonCommit.Sensitive = true;
            checkCommit = new Hashtable();

            table = new Table((uint)statuses.Length+1, (uint)5 + (uint)(remoteStatus ? 2 : 0), false);
            box.Add(table);

            uint row = 0;

            table.Attach(new HeaderLabel("Status"), 0, 3, row, row+1, AttachOptions.Shrink, AttachOptions.Shrink, 2, 2);
            table.Attach(new HeaderLabel("Path"), 3, 4, row, row+1, AttachOptions.Shrink, AttachOptions.Shrink, 2, 2);

            if (remoteStatus)
                table.Attach(new HeaderLabel("Remote Status"), 4, 6, row, row+1, AttachOptions.Shrink, AttachOptions.Shrink, 2, 2);

            for (int i = 0; i < statuses.Length; i++) {
                Node n = statuses[i];

                RevItem item = new RevItem();
                item.Path = n.LocalPath;
                item.BaseRev = n.BaseRevision;

                uint col = 0;
                row++;

                CheckButton check = new CheckButton();
                checkCommit[check] = item;
                table.Attach(check, col, ++col, row, row+1, AttachOptions.Shrink, AttachOptions.Shrink, 2, 2);
                check.Visible = false;

                Gdk.Pixbuf statusicon = VersionControlService.LoadIconForStatus(n.Status);
                if (n.Status == NodeStatus.Modified) {
                    Button b = new Button();
                    if (statusicon != null) {
                        Image img = new Image(statusicon);
                        img.Show();
                        b.Add(img);
                    } else {
                        b.Label = "Diff";
                    }

                    b.Relief = ReliefStyle.Half;
                    buttonsShowDiff[b] = item;
                    table.Attach(b, col, ++col, row, row+1, AttachOptions.Shrink, AttachOptions.Shrink, 2, 2);
                    b.Clicked += new EventHandler(OnShowDiffClicked);
                    b.Show();
                } else if (statusicon != null) {
                    Image img = new Image(statusicon);
                    img.Show();
                    table.Attach(img, col, ++col, row, row+1, AttachOptions.Shrink, AttachOptions.Fill, 2, 2);
                } else {
                    ++col;
                }

                Label status = new Label(n.Status.ToString());
                status.Show();
                table.Attach(status, col, ++col, row, row+1, AttachOptions.Shrink, AttachOptions.Shrink, 2, 2);

                Label name = new Label(); // I can't get this to left align!
                name.Justify = Justification.Left;
                name.Layout.Alignment = Pango.Alignment.Left;
                name.Xalign = 0;

                string localpath = n.LocalPath.Substring(filepath.Length);
                if (localpath.Length > 0 && localpath[0] == Path.DirectorySeparatorChar) localpath = localpath.Substring(1);
                if (localpath == "") { localpath = "."; } // not sure if this happens
                name.Text = localpath;
                name.Show();
                table.Attach(name, col, ++col, row, row+1, AttachOptions.Expand, AttachOptions.Shrink, 2, 2);

                if (remoteStatus) {
                    Label rstatus = new Label(n.RemoteStatus.ToString());
                    rstatus.Show();

                    table.Attach(rstatus, col, ++col, row, row+1, AttachOptions.Shrink, AttachOptions.Shrink, 2, 2);

                    if (n.RemoteStatus == NodeStatus.Modified) {
                        Button b = new Button("View");
                        b.Relief = ReliefStyle.Half;
                        buttonsShowLog[b] = item;
                        table.Attach(b, col, ++col, row, row+1, AttachOptions.Shrink, AttachOptions.Shrink, 2, 2);
                        b.Clicked += new EventHandler(OnShowLogClicked);
                        b.Show();
                    }
                }
            }

            table.Show();
        }
    private void createTable()
    {
        int rows = listConnected.Count;

        Gtk.Label label_device_title = new Gtk.Label("<b>" + Catalog.GetString("Device") + "</b>");
        Gtk.Label label_type_title   = new Gtk.Label("<b>" + Catalog.GetString("Type") + "</b>");

        label_device_title.UseMarkup = true;
        label_type_title.UseMarkup   = true;

        label_device_title.Show();
        label_type_title.Show();

        table_main = new Gtk.Table((uint)rows + 1, 2, false);         //not homogeneous
        table_main.ColumnSpacing = 20;
        table_main.RowSpacing    = 6;

        table_main.Attach(label_device_title, (uint)1, (uint)2, 0, 1);
        table_main.Attach(label_type_title, (uint)2, (uint)3, 0, 1);

        list_buttons_left  = new List <Gtk.Button>();
        list_images        = new List <Gtk.Image>();
        list_labels_type   = new List <Gtk.Label>();
        list_buttons_right = new List <Gtk.Button>();

        for (int count = 1; count <= rows; count++)
        {
            string    deviceStr    = listConnected[count - 1].SerialNumber + "\n\n" + listConnected[count - 1].Port;
            Gtk.Label label_device = new Gtk.Label(deviceStr);
            table_main.Attach(label_device, (uint)1, (uint)2, (uint)count, (uint)count + 1);
            label_device.Show();

            Gtk.HBox hbox_type   = new Gtk.HBox(false, 6);
            Button   button_left = UtilGtk.CreateArrowButton(ArrowType.Left, ShadowType.In, 50, -1);
            button_left.Sensitive = (listConnected[count - 1].Type != TypePixList.l[0].Type);
            button_left.CanFocus  = false;
            button_left.IsFocus   = false;
            button_left.Clicked  += on_button_left_clicked;
            //hbox_type.Add(button_left);
            hbox_type.PackStart(button_left, true, false, 1);

            //create image
            Pixbuf    pixbuf = TypePixList.GetPix(listConnected[count - 1].Type);
            Gtk.Image image  = new Gtk.Image();
            image.Pixbuf = pixbuf;
            hbox_type.Add(image);
            hbox_type.PackStart(image, false, false, 1);

            Button button_right = UtilGtk.CreateArrowButton(ArrowType.Right, ShadowType.In, 50, -1);
            button_right.CanFocus  = false;
            button_right.IsFocus   = false;
            button_right.Clicked  += on_button_right_clicked;
            button_right.Sensitive = (listConnected[count - 1].Type != TypePixList.l[TypePixList.l.Count - 1].Type);
            hbox_type.PackStart(button_right, true, false, 1);

            Gtk.VBox vbox = new Gtk.VBox(false, 2);
            vbox.Add(hbox_type);
            Gtk.Label label_type = new Gtk.Label(ChronopicRegisterPort.TypePrint(listConnected[count - 1].Type));
            vbox.Add(label_type);

            table_main.Attach(vbox, (uint)2, (uint)3, (uint)count, (uint)count + 1);

            list_buttons_left.Add(button_left);
            list_images.Add(image);
            list_labels_type.Add(label_type);
            list_buttons_right.Add(button_right);
        }
        table_main.Show();
    }
示例#12
0
        private void BuildHeader()
        {
            header_table = new Table (2, 2, false);
            header_table.Show ();
            header_table.Vexpand = false;
            primary_vbox.PackStart (header_table, false, false, 0);

            main_menu = new MainMenu ();

            if (!PlatformDetection.IsMac) {
                main_menu.Show ();
                header_table.Attach (main_menu, 0, 1, 0, 1,
                    AttachOptions.Expand | AttachOptions.Fill,
                    AttachOptions.Shrink, 0, 0);
            }

            Alignment toolbar_alignment = new Alignment (0.0f, 0.0f, 1.0f, 1.0f);
            toolbar_alignment.TopPadding = 3u;
            toolbar_alignment.BottomPadding = 3u;

            header_toolbar = (Toolbar)ActionService.UIManager.GetWidget ("/HeaderToolbar");
            header_toolbar.ShowArrow = false;
            header_toolbar.ToolbarStyle = ToolbarStyle.BothHoriz;
            header_toolbar.Show ();

            toolbar_alignment.Add (header_toolbar);
            toolbar_alignment.Show ();

            header_table.Attach (toolbar_alignment, 0, 2, 1, 2,
                AttachOptions.Expand | AttachOptions.Fill,
                AttachOptions.Shrink, 0, 0);

            var next_button = new NextButton (ActionService);
            next_button.Show ();
            ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/NextArrowButton", next_button);

            seek_slider = new ConnectedSeekSlider () { Resizable = ShowSeekSliderResizer.Get () };
            seek_slider.SeekSlider.WidthRequest = SeekSliderWidth.Get ();
            seek_slider.SeekSlider.SizeAllocated += (o, a) => {
                SeekSliderWidth.Set (seek_slider.SeekSlider.Allocation.Width);
            };
            seek_slider.ShowAll ();
            ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/SeekSlider", seek_slider);

            var track_info_display = new ClassicTrackInfoDisplay ();
            track_info_display.Show ();
            track_info_container = TrackInfoDisplay.GetEditable (track_info_display);
            track_info_container.Show ();
            ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/TrackInfoDisplay", track_info_container, true);

            var volume_button = new ConnectedVolumeButton ();
            volume_button.Show ();
            ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/VolumeButton", volume_button);
        }
		private void BuildInterface() {
			string category = null;
			
			uint count = 0;
			
			foreach (EffectMember i in this.mMembers) {
				if (i.Category != category) {
					category = i.Category;
					count++;
				}
				
				count++;
			}
			
			category = null;
			
			Table table = new Table(count, 2, false);
			
			uint row = 0;
			
			foreach (EffectMember i in this.mMembers) {
				Label l;
				
				if (i.Category != category) {
					category = i.Category;
					
					l = new Label();
					l.Markup = "<b>" + category + "</b>";
					l.Show();
					
					table.Attach(l, 0, 2, row, ++row,
					             AttachOptions.Expand | AttachOptions.Fill,
					             AttachOptions.Shrink, 5, 5);
				}
				
				l = new Label(i.DisplayName);
				l.Show();
				table.Attach(l, 0, 1, row, row + 1, AttachOptions.Fill,
				             AttachOptions.Shrink, 5, 5);
				
				MemberEditor editor = MemberEditor.Create(this.mEffect, i.Item);
				editor.Show();
				
				editor.MadeClean += this.OnEditorMadeClean;
				editor.MadeDirty += this.OnEditorMadeDirty;
				editor.Applied += this.OnEditorApplied;
				this.mEditors.Add(editor);
				
				if (!string.IsNullOrEmpty(i.Description))
					editor.TooltipText = i.Description;
				
				table.Attach(editor, 1, 2, row, ++row,
				             editor.XAttachment, editor.YAttachment, 5, 5);
			}
			
			this.SheetPane.AddWithViewport(table);
			table.Show();
		}
示例#14
0
		public void CreateGui() 
		{
			dialog = new Dialog ();
			
			dialog.AllowGrow = true;
			dialog.Title = "Login";
			dialog.BorderWidth = 2;
			dialog.VBox.BorderWidth = 2;
			dialog.HasSeparator = false;

			Frame frame = new Frame ("Connection");
			frame.BorderWidth = 2;
		
			Table table = new Table (7, 2, false);
			table.ColumnSpacing = 2;
			table.RowSpacing = 2;
			Label label = null;

			label = new Label ("_Provider");
			label.Xalign = 1.0f;
			label.Ypad = 8;
			table.Attach (label, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Fill, 1, 1);
			LoadProviderCombo();
			if (providerCombo.Model.IterNChildren() > 0)
				providerCombo.Active = 0;
			providerSelected = providerCombo.Active;
			table.Attach (providerCombo, 1, 8, 0, 1, AttachOptions.Fill, AttachOptions.Fill, 10, 1);
						
			label = new Label ("_Connection String");
			label.Xpad = 2;
			label.Ypad = 8;
			label.Xalign = 1.0f;
			table.Attach (label, 0, 1, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 1, 1);
			connection_entry = new Entry ();
			connection_entry.Changed += new EventHandler (OnConnectionEntryChanged);
			table.Attach (connection_entry, 1, 8, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 10, 1);
			
			label = new Label ("_Server");
			label.Xalign = 1.0f;
			label.Ypad = 8;
			table.Attach (label, 0, 1, 2, 3, AttachOptions.Fill, AttachOptions.Fill, 1, 1);
			server_entry = new Entry ();
			server_entry.Changed += new EventHandler (OnParameterChanged);
			table.Attach (server_entry, 1, 8, 2, 3, AttachOptions.Fill, AttachOptions.Fill, 10, 1);

			label = new Label ("_Database");
			label.Xalign = 1.0f;
			label.Ypad = 8;
			table.Attach (label, 0, 1, 3, 4, AttachOptions.Fill, AttachOptions.Fill, 1, 1);
			database_entry = new Entry ();
			database_entry.Changed += new EventHandler (OnParameterChanged);
			table.Attach (database_entry, 1, 8, 3, 4, AttachOptions.Fill, AttachOptions.Fill, 10, 1);

			label = new Label ("_User ID");
			label.Xalign = 1.0f;
			label.Ypad = 8;
			table.Attach (label, 0, 1, 4, 5, AttachOptions.Fill, AttachOptions.Fill, 1, 1);
			userid_entry = new Entry ();
			userid_entry.Changed += new EventHandler (OnParameterChanged);
			table.Attach (userid_entry, 1, 8, 4, 5, AttachOptions.Fill, AttachOptions.Fill, 10, 1);

			label = new Label ("_Password");
			label.Xalign = 1.0f;
			label.Ypad = 8;
			table.Attach (label, 0, 1, 5, 6, AttachOptions.Fill, AttachOptions.Fill, 1, 1);
			password_entry = new Entry ();
			password_entry.Visibility = false;
			password_entry.Changed += new EventHandler (OnParameterChanged);
			table.Attach (password_entry, 1, 8, 5, 6, AttachOptions.Fill, AttachOptions.Fill, 10, 1);

			label = new Label ("_Other");
			label.Xalign = 1.0f;
			label.Ypad = 8;
			table.Attach (label, 0, 1, 6, 7, AttachOptions.Fill, AttachOptions.Fill, 1, 1);
			other_entry = new Entry ();
			other_entry.Changed += new EventHandler (OnParameterChanged);
			table.Attach (other_entry, 1, 8, 6, 7, AttachOptions.Fill, AttachOptions.Fill, 10, 1);

			table.Show();
			frame.Add (table);

			dialog.VBox.PackStart (frame, false, false, 5);
			
			Frame appSettingFrame = new Frame ("App Settings");
			appSettingFrame.Add (grid);
			dialog.VBox.PackStart (appSettingFrame, true, true, 10);

			Button button = null;
			button = new Button (Stock.Ok);
			button.Clicked += new EventHandler (Connect_Action);
			button.CanDefault = true;
			dialog.ActionArea.PackStart (button, true, true, 0);
			button.GrabDefault ();

			button = new Button (Stock.Cancel);
			button.Clicked += new EventHandler (Dialog_Cancel);
			dialog.ActionArea.PackStart (button, true, true, 0);
			dialog.Modal = true;
			dialog.SetDefaultSize (500, 500);

			statusBar = new Statusbar ();
			statusBar.HasResizeGrip = false;
			dialog.VBox.PackEnd (statusBar, false, false, 0);

			SetStatusBarText ("Ready!");

			dialog.ShowAll ();
		}
示例#15
0
		private void Init()
		{
			Logger.Debug("Called Init");
			this.Icon = Utilities.GetIcon ("giver-48", 48);
			// Update the window title
			this.Title = string.Format ("Giver Preferences");	
			
			//this.DefaultSize = new Gdk.Size (300, 500); 	
			this.VBox.Spacing = 0;
			this.VBox.BorderWidth = 0;
			this.SetDefaultSize (450, 100);


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


			// Start with an event box to paint the background white
			EventBox eb = new EventBox();
			eb.Show();
			eb.BorderWidth = 0;
            eb.ModifyBg(StateType.Normal, new Gdk.Color(255,255,255));
            eb.ModifyBase(StateType.Normal, new Gdk.Color(255,255,255));

			VBox mainVBox = new VBox();
			mainVBox.BorderWidth = 10;
			mainVBox.Spacing = 5;
			mainVBox.Show ();
			eb.Add(mainVBox);
			this.VBox.PackStart(eb);

			Label label = new Label();
			label.Show();
			label.Justify = Gtk.Justification.Left;
            label.SetAlignment (0.0f, 0.5f);
			label.LineWrap = false;
			label.UseMarkup = true;
			label.UseUnderline = false;
			label.Markup = "<span weight=\"bold\" size=\"large\">Your Name</span>";
			mainVBox.PackStart(label, true, true, 0);

			// Name Box at the top of the Widget
			HBox nameBox = new HBox();
			nameBox.Show();
			nameEntry = new Entry();
			nameEntry.Show();
			nameBox.PackStart(nameEntry, true, true, 0);
			nameBox.Spacing = 10;
			mainVBox.PackStart(nameBox, false, false, 0);
	
			label = new Label();
			label.Show();
			label.Justify = Gtk.Justification.Left;
            label.SetAlignment (0.0f, 0.5f);
			label.LineWrap = false;
			label.UseMarkup = true;
			label.UseUnderline = false;
			label.Markup = "<span weight=\"bold\" size=\"large\">Your Picture</span>";
			mainVBox.PackStart(label, true, true, 0);
		
			Gtk.Table table = new Table(4, 3, false);
			table.Show();
			// None Entry
			noneButton = new RadioButton((Gtk.RadioButton)null);
			noneButton.Show();
			table.Attach(noneButton, 0, 1, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
			VBox vbox = new VBox();
			vbox.Show();
			Gtk.Image image = new Image(Utilities.GetIcon("computer", 48));
			image.Show();
			vbox.PackStart(image, false, false, 0);
			label = new Label("None");
			label.Show();
			vbox.PackStart(label, false, false, 0);
			table.Attach(vbox, 1, 2, 0 ,1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
			vbox = new VBox();
			vbox.Show();
			table.Attach(vbox, 2,3,1,2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0);

			// Local Entry
			localButton = new RadioButton(noneButton);
			localButton.Show();
			table.Attach(localButton, 0, 1, 1, 2, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
			vbox = new VBox();
			vbox.Show();
			localImage = new Image(Utilities.GetIcon("stock_person", 48));
			localImage.Show();
			vbox.PackStart(localImage, false, false, 0);
			label = new Label("File");
			label.Show();
			vbox.PackStart(label, false, false, 0);
			table.Attach(vbox, 1, 2, 1 ,2, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
			photoButton = new Button("Change Photo");
			photoButton.Show();
			table.Attach(photoButton, 2,3,1,2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 0, 0);

			// Web Entry
			webButton = new RadioButton(noneButton);
			webButton.Show();
			table.Attach(webButton, 0, 1, 2, 3, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
			vbox = new VBox();
			vbox.Show();
			image = new Image(Utilities.GetIcon("web-browser", 48));
			image.Show();
			vbox.PackStart(image, false, false, 0);
			label = new Label("Web Link");
			label.Show();
			vbox.PackStart(label, false, false, 0);
			table.Attach(vbox, 1, 2, 2 ,3, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
			webEntry = new Entry();
			webEntry.Show();
			table.Attach(webEntry, 2,3,2,3, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0);

			// Gravatar Entry
			gravatarButton = new RadioButton(noneButton);
			gravatarButton.Show();
			table.Attach(gravatarButton, 0, 1, 3, 4, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
			vbox = new VBox();
			vbox.Show();
			image = new Image(Utilities.GetIcon("gravatar", 48));
			image.Show();
			vbox.PackStart(image, false, false, 0);
			label = new Label("Gravatar");
			label.Show();
			vbox.PackStart(label, false, false, 0);
			table.Attach(vbox, 1, 2, 3 ,4, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
			gravatarEntry = new Entry();
			gravatarEntry.Show();
			table.Attach(gravatarEntry, 2,3,3,4, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0);

			mainVBox.PackStart(table, true, true, 0);


			label = new Label();
			label.Show();
			label.Justify = Gtk.Justification.Left;
            label.SetAlignment (0.0f, 0.5f);
			label.LineWrap = false;
			label.UseMarkup = true;
			label.UseUnderline = false;
			label.Markup = "<span weight=\"bold\" size=\"large\">Your File Location</span>";
			mainVBox.PackStart(label, true, true, 0);
	
			fileLocationButton = new FileChooserButton("Select storage location",
			    FileChooserAction.SelectFolder);
			fileLocationButton.Show();

			mainVBox.PackStart(fileLocationButton, true, true, 0);

			table = new Table(2, 3, false);
			table.Show();

			// Port number section
			label = new Label();
			label.Show();
			label.Justify = Gtk.Justification.Left;
			label.SetAlignment (0.0f, 0.5f);
			label.LineWrap = false;
			label.UseMarkup = true;
			label.UseUnderline = false;
			label.Markup = "<span weight=\"bold\" size=\"large\">Port Number</span>";
			mainVBox.PackStart(label, true, true, 0);

			// any port Entry
			anyPortButton = new RadioButton((Gtk.RadioButton)null);
			anyPortButton.Show();
			table.Attach(anyPortButton, 0, 1, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);

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

			label = new Label ();
			label.Show ();
			label.Justify = Gtk.Justification.Left;
			label.SetAlignment (0.0f, 0.5f);
			label.LineWrap = false;
			label.UseMarkup = true;
			label.UseUnderline = false;
			label.Markup = "Any available port";
			vbox.PackStart(label, false, false, 0);
			table.Attach(vbox, 1, 2, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);

			// fixed port Entry
			fixedPortButton = new RadioButton(anyPortButton);
			fixedPortButton.Show();
			table.Attach(fixedPortButton, 0, 1, 1, 2, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);

			label = new Label ();
			label.Show ();
			label.Justify = Gtk.Justification.Left;
			label.SetAlignment (0.0f, 0.5f);
			label.LineWrap = false;
			label.UseMarkup = true;
			label.UseUnderline = false;
			label.Markup = "Use a fixed port";
			table.Attach(label, 1, 2, 1, 2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0);

			portNumberEntry = new Entry();
			portNumberEntry.Show();
			table.Attach(portNumberEntry, 2, 3, 1, 2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Expand | AttachOptions.Fill, 0, 0);

			mainVBox.PackStart(table, true, true, 0);

			DeleteEvent += WindowDeleted;
		}
示例#16
0
        private void BuildHeader ()
        {
            header_table = new Table (2, 2, false);
            header_table.Show ();
            primary_vbox.PackStart (header_table, false, false, 0);

            main_menu = new MainMenu ();

            if (!PlatformDetection.IsMac && !PlatformDetection.IsMeeGo) {
                main_menu.Show ();
                header_table.Attach (main_menu, 0, 1, 0, 1,
                    AttachOptions.Expand | AttachOptions.Fill,
                    AttachOptions.Shrink, 0, 0);
            }

            Alignment toolbar_alignment = new Alignment (0.0f, 0.0f, 1.0f, 1.0f);
            toolbar_alignment.TopPadding = PlatformDetection.IsMeeGo ? 0u : 3u;
            toolbar_alignment.BottomPadding = PlatformDetection.IsMeeGo ? 0u : 3u;

            header_toolbar = (Toolbar)ActionService.UIManager.GetWidget ("/HeaderToolbar");
            header_toolbar.ShowArrow = false;
            header_toolbar.ToolbarStyle = ToolbarStyle.BothHoriz;
            header_toolbar.Show ();

            if (PlatformDetection.IsMeeGo) {
                header_toolbar.IconSize = IconSize.LargeToolbar;
                header_toolbar.Name = "meego-toolbar";
            }

            toolbar_alignment.Add (header_toolbar);
            toolbar_alignment.Show ();

            header_table.Attach (toolbar_alignment, 0, 2, 1, 2,
                AttachOptions.Expand | AttachOptions.Fill,
                AttachOptions.Shrink, 0, 0);

            var next_button = new NextButton (ActionService, PlatformDetection.IsMeeGo);
            next_button.Show ();
            ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/NextArrowButton", next_button);

            seek_slider = new ConnectedSeekSlider () { Resizable = ShowSeekSliderResizer.Get () };
            seek_slider.SeekSlider.WidthRequest = SeekSliderWidth.Get ();
            seek_slider.SeekSlider.SizeAllocated += (o, a) => {
                SeekSliderWidth.Set (seek_slider.SeekSlider.Allocation.Width);
            };
            seek_slider.ShowAll ();
            ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/SeekSlider", seek_slider);

            var track_info_display = new ClassicTrackInfoDisplay ();
            track_info_display.Show ();
            track_info_container = TrackInfoDisplay.GetEditable (track_info_display);
            track_info_container.Show ();
            ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/TrackInfoDisplay", track_info_container, true);

            if (PlatformDetection.IsMeeGo) {
                track_info_display.ArtworkSpacing = 5;
                seek_slider.LeftPadding = 20;
                seek_slider.RightPadding = 20;

                var menu = (Menu)(ActionService.UIManager.GetWidget ("/ToolbarMenu"));
                var menu_button = new Hyena.Widgets.MenuButton (new Image (Stock.Preferences, IconSize.LargeToolbar), menu, true);
                menu_button.Show ();
                ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/ToolbarMenuPlaceholder", menu_button);

                var close_button = new Button (Image.NewFromIconName ("window-close", IconSize.LargeToolbar)) {
                    TooltipText = Catalog.GetString ("Close")
                };

                close_button.Clicked += (o, e) => Hide ();
                close_button.ShowAll ();
                ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/ClosePlaceholder", close_button);
            } else {
                var volume_button = new ConnectedVolumeButton ();
                volume_button.Show ();
                ActionService.PopulateToolbarPlaceholder (header_toolbar, "/HeaderToolbar/VolumeButton", volume_button);
            }
        }
示例#17
0
		// Page 2
		// List of Hotkey options
		public Gtk.Widget MakeHotkeysPane ()
		{
			Gtk.Label label;
			Gtk.CheckButton check;
			Gtk.Alignment align;
			Gtk.Entry entry;
			IPropertyEditorBool keybind_peditor;
			IPropertyEditor peditor;

			Gtk.VBox hotkeys_list = new Gtk.VBox (false, 12);
			hotkeys_list.BorderWidth = 12;
			hotkeys_list.Show ();


			// Hotkeys...

			check = MakeCheckButton (Catalog.GetString ("Listen for _Hotkeys"));
			hotkeys_list.PackStart (check, false, false, 0);

			keybind_peditor =
			        Services.Factory.CreatePropertyEditorToggleButton (Preferences.ENABLE_KEYBINDINGS,
			                                        check);
			SetupPropertyEditor (keybind_peditor);

			label = MakeTipLabel (
			                Catalog.GetString ("Hotkeys allow you to quickly access " +
			                                   "your notes from anywhere with a keypress. " +
			                                   "Example Hotkeys: " +
			                                   "<b>&lt;ALT&gt;F11</b>, " +
			                                   "<b>&lt;ALT&gt;N</b>"));
			hotkeys_list.PackStart (label, false, false, 0);

			align = new Gtk.Alignment (0.5f, 0.5f, 0.0f, 1.0f);
			align.Show ();
			hotkeys_list.PackStart (align, false, false, 0);

			Gtk.Table table = new Gtk.Table (4, 2, false);
			table.ColumnSpacing = 6;
			table.RowSpacing = 6;
			table.Show ();
			align.Add (table);


			// Show notes menu keybinding...

			label = MakeLabel (Catalog.GetString ("Show notes _menu"));
			table.Attach (label, 0, 1, 0, 1);

			entry = new Gtk.Entry ();
			label.MnemonicWidget = entry;
			entry.Show ();
			table.Attach (entry, 1, 2, 0, 1);

			peditor = Services.Factory.CreatePropertyEditorEntry (Preferences.KEYBINDING_SHOW_NOTE_MENU,
			                                   entry);
			SetupPropertyEditor (peditor);

			keybind_peditor.AddGuard (entry);


			// Open Start Here keybinding...

			label = MakeLabel (Catalog.GetString ("Open \"_Start Here\""));
			table.Attach (label, 0, 1, 1, 2);

			entry = new Gtk.Entry ();
			label.MnemonicWidget = entry;
			entry.Show ();
			table.Attach (entry, 1, 2, 1, 2);

			peditor = Services.Factory.CreatePropertyEditorEntry (Preferences.KEYBINDING_OPEN_START_HERE,
			                                   entry);
			SetupPropertyEditor (peditor);

			keybind_peditor.AddGuard (entry);


			// Create new note keybinding...

			label = MakeLabel (Catalog.GetString ("Create _new note"));
			table.Attach (label, 0, 1, 2, 3);

			entry = new Gtk.Entry ();
			label.MnemonicWidget = entry;
			entry.Show ();
			table.Attach (entry, 1, 2, 2, 3);

			peditor = Services.Factory.CreatePropertyEditorEntry (Preferences.KEYBINDING_CREATE_NEW_NOTE,
			                                   entry);
			SetupPropertyEditor (peditor);

			keybind_peditor.AddGuard (entry);


			// Open Search All Notes window keybinding...

			label = MakeLabel (Catalog.GetString ("Open \"Search _All Notes\""));
			table.Attach (label, 0, 1, 3, 4);

			entry = new Gtk.Entry ();
			label.MnemonicWidget = entry;
			entry.Show ();
			table.Attach (entry, 1, 2, 3, 4);

			peditor = Services.Factory.CreatePropertyEditorEntry (
			        Preferences.KEYBINDING_OPEN_RECENT_CHANGES,
			        entry);
			SetupPropertyEditor (peditor);

			keybind_peditor.AddGuard (entry);


			return hotkeys_list;
		}