Exemplo n.º 1
0
		void GroupsChanged ()
		{
			if (combo != null) {
				combo.Changed -= combo_Changed;
				Remove (combo);
			}

			combo = Gtk.ComboBox.NewText ();
			combo.Changed += combo_Changed;
#if GTK_SHARP_2_6
			combo.RowSeparatorFunc = RowSeparatorFunc;
#endif
			combo.Show ();
			PackStart (combo, true, true, 0);

			values = new ArrayList ();
			int i = 0;
			foreach (string name in manager.GroupNames) {
				values.Add (name);
				combo.AppendText (name);
				if (name == group)
					combo.Active = i;
				i++;
			}

#if GTK_SHARP_2_6
			combo.AppendText ("");
#endif

			combo.AppendText (Catalog.GetString ("Rename Group..."));
			combo.AppendText (Catalog.GetString ("New Group..."));
		}
Exemplo n.º 2
0
        /// <summary>
        /// Fills the combo box.
        /// </summary>
        /// <param name='combo'>
        /// Combo.
        /// </param>
        /// <param name='items'>
        /// Items.
        /// </param>
        /// <param name='editable'>
        /// Editable.
        /// </param>
        /// <param name='currentValue'>
        /// Current value.
        /// </param>
        public static void FillComboBox(Gtk.ComboBox combo, List <string> items, bool editable, string currentValue)
        {
            // clear combo
            combo.Model = new ListStore(typeof(string));

            // adding all items
            var index = 0;

            if (editable)
            {
                foreach (var item in items)
                {
                    combo.AppendText(item);
                    if (item == currentValue)
                    {
                        combo.Active = index;
                    }

                    index++;
                }
            }
            else
            {
                combo.AppendText(currentValue);
                combo.Active = 0;
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Replaces Windows Form Designer code
        /// </summary>
        private void InitializeComponent()
        {
            SetSizeRequest(192, 240);           // Define MenuForm size
            //
            // Define an 8x6 table on which to lay out the test buttons, etc
            //
            Gtk.Table layout = new Gtk.Table(8, 6, true);
            layout.BorderWidth   = 8;
            layout.ColumnSpacing = 2;
            layout.RowSpacing    = 2;
            Add(layout);

            // Create menu components, then add to layout
            //
            // DemosLabel
            //
            demosLabel = new Gtk.Label("Demos");
            layout.Attach(demosLabel, 0, 2, 0, 1);
            //
            // plotSurface2DDemoButton
            //
            plotSurface2DDemoButton          = new Gtk.Button("PlotSurface2D Demo");
            plotSurface2DDemoButton.Clicked += new System.EventHandler(this.plotSurface2DDemoButton_Click);
            layout.Attach(plotSurface2DDemoButton, 0, 6, 1, 2);
            //
            // multiPlotDemoButton
            //
            multiPlotDemoButton          = new Gtk.Button("Multi Plot Demo");
            multiPlotDemoButton.Clicked += new System.EventHandler(this.runDemoButton_Click);
            layout.Attach(multiPlotDemoButton, 0, 6, 2, 3);
            //
            // testsLabel
            //
            testsLabel = new Gtk.Label("Tests");
            layout.Attach(testsLabel, 0, 2, 3, 4);
            //
            // TestSelectComboBox
            //
            //
            TestSelectComboBox = ComboBox.NewText();
            TestSelectComboBox.AppendText("Axis Test");
            TestSelectComboBox.AppendText("PlotSurface2D");
            layout.Attach(TestSelectComboBox, 0, 6, 4, 5);
            //
            // RunTestButton
            //
            RunTestButton          = new Gtk.Button("Run Selected Test");
            RunTestButton.Clicked += new System.EventHandler(this.RunTestButton_Click);
            layout.Attach(RunTestButton, 0, 6, 5, 6);
            //
            // quitButton
            //
            quitButton          = new Gtk.Button("Quit");
            quitButton.Clicked += new System.EventHandler(this.quitButton_Click);
            layout.Attach(quitButton, 2, 4, 7, 8, 0, 0, 0, 0);
            //
            // Gtk.Window events
            //
            this.Destroyed += new EventHandler(MenuForm_Destroyed);
        }
Exemplo n.º 4
0
        public static void ComboAccrualYearsFill(ComboBox combo, params string[] firstItems)
        {
            try {
                logger.Info ("Запрос лет для начислений...");
                TreeIter iter;
                string sql = "SELECT DISTINCT year FROM accrual ORDER BY year DESC";
                MySqlCommand cmd = new MySqlCommand (sql, QSMain.connectionDB);
                MySqlDataReader rdr = cmd.ExecuteReader ();

                ((ListStore)combo.Model).Clear ();

                foreach(var item in firstItems)
                {
                    combo.AppendText (item);
                }

                combo.AppendText (Convert.ToString (DateTime.Now.AddYears (1).Year));
                combo.AppendText (Convert.ToString (DateTime.Now.Year));
                while (rdr.Read ()) {
                    if (rdr.GetUInt32 ("year") == DateTime.Now.Year || rdr.GetUInt32 ("year") == DateTime.Now.AddYears (1).Year)
                        continue;
                    combo.AppendText (rdr ["year"].ToString ());
                }
                rdr.Close ();
                ((ListStore)combo.Model).SetSortColumnId (0, SortType.Descending);
                ListStoreWorks.SearchListStore ((ListStore)combo.Model, Convert.ToString (DateTime.Now.Year), out iter);
                combo.SetActiveIter (iter);
                logger.Info ("Ok");
            } catch (Exception ex) {
                logger.Warn (ex, "Ошибка получения списка лет!");
            }
        }
Exemplo n.º 5
0
        void FillViewers()
        {
            ((Gtk.ListStore)viewerSelector.Model).Clear();
            currentViewers.Clear();

            if (Filenames.Length == 0 || Filename.Length == 0 || System.IO.Directory.Exists(Filename))
            {
                return;
            }

            if (IdeApp.Services.ProjectService.IsWorkspaceItemFile(Filename) || IdeApp.Services.ProjectService.IsSolutionItemFile(Filename))
            {
                viewerSelector.AppendText(GettextCatalog.GetString("Solution Workbench"));
                currentViewers.Add(null);
            }
            FileViewer[] vs = IdeApp.Workbench.GetFileViewers(Filename);
            foreach (FileViewer vw in vs)
            {
                if (!vw.IsExternal)
                {
                    viewerSelector.AppendText(vw.Title);
                    currentViewers.Add(vw);
                }
            }
            viewerSelector.Active = 0;
            viewerLabel.Sensitive = viewerSelector.Sensitive = currentViewers.Count > 1;
        }
        void FillViewers()
        {
            ((Gtk.ListStore)viewerSelector.Model).Clear();
            currentViewers.Clear();

            if (Filenames.Length == 0 || Filename.Length == 0 || System.IO.Directory.Exists(Filename))
            {
                return;
            }

            int selected = -1;
            int i        = 0;

            if (IdeApp.Services.ProjectService.IsWorkspaceItemFile(Filename) || IdeApp.Services.ProjectService.IsSolutionItemFile(Filename))
            {
                viewerSelector.AppendText(GettextCatalog.GetString("Solution Workbench"));
                currentViewers.Add(null);

                if (closeWorkspaceCheck.Visible)
                {
                    closeWorkspaceCheck.Active = true;
                }

                // Default exe/dll to AssemblyBrowser, solutions/projects to Solution Workbench.
                // HACK: Couldn't make it a generic SolutionItemFile based conditional, .csproj fits under this category also.
                if (!(Filename.EndsWith(".exe", StringComparison.OrdinalIgnoreCase) || Filename.EndsWith(".dll", StringComparison.OrdinalIgnoreCase)))
                {
                    selected = 0;
                }
                i++;
            }

            foreach (FileViewer vw in DisplayBindingService.GetFileViewers(Filename, null))
            {
                if (!vw.IsExternal)
                {
                    viewerSelector.AppendText(vw.Title);
                    currentViewers.Add(vw);

                    if (vw.CanUseAsDefault && selected == -1)
                    {
                        selected = i;
                    }

                    i++;
                }
            }

            if (selected == -1)
            {
                selected = 0;
            }

            viewerSelector.Active = selected;
            viewerLabel.Sensitive = viewerSelector.Sensitive = currentViewers.Count > 1;
        }
Exemplo n.º 7
0
		public FormDatabasePreferences() : base(7, 3, false)
		{	
			typeLabel = new Gtk.Label("Type :");
			serverLabel = new Gtk.Label("Server :");
			portLabel = new Gtk.Label("Port :");
			userLabel = new Gtk.Label("Username :"******"Password :"******"Database :");
			mediaLabel = new Gtk.Label("Medias path :");
			typeCombo = ComboBox.NewText();
			serverEntry = new Entry();
			portSpinButton = new SpinButton(0f,65536f,1f);
			userEntry = new Entry();
			passEntry = new Entry();
			dbEntry = new Entry();
			passCheck = new CheckButton("Save password");
			dbButton= new Button(Stock.Open);
			mediaButton= new FileChooserButton("Choose the media directory", FileChooserAction.SelectFolder);
						
			typeLabel.SetAlignment(0, (float)0.5);
			serverLabel.SetAlignment(0, (float)0.5);
			portLabel.SetAlignment(0, (float)0.5);
			userLabel.SetAlignment(0, (float)0.5);
			passLabel.SetAlignment(0, (float)0.5);
			dbLabel.SetAlignment(0, (float)0.5);
			mediaLabel.SetAlignment(0, (float)0.5);
			
			typeCombo.AppendText("SQLite");
			typeCombo.AppendText("PostgreSQL");
			typeCombo.Changed += OnTypeComboChanged;
			
			passEntry.Visibility = false;
			dbButton.Clicked += OnDbButton; 
			
			this.Attach(typeLabel, 0, 1, 0, 1);
			this.Attach(serverLabel, 0, 1, 1, 2);
			this.Attach(portLabel, 0, 1, 2, 3);
			this.Attach(userLabel, 0, 1, 3, 4);
			this.Attach(passLabel, 0, 1, 4, 5);
			this.Attach(dbLabel, 0, 1, 5, 6);
			this.Attach(mediaLabel, 0, 1, 6, 7);
			
			this.Attach(typeCombo, 1, 3, 0, 1);
			
			this.Attach(serverEntry, 1, 3, 1, 2);
			this.Attach(portSpinButton, 1, 3, 2, 3);
			this.Attach(userEntry, 1, 3, 3, 4);
			this.Attach(passEntry, 1, 2, 4, 5);
			this.Attach(dbEntry, 1, 2, 5, 6);
			
			this.Attach(passCheck, 2, 3, 4, 5);			
			this.Attach(dbButton, 2, 3, 5, 6);		
			this.Attach(mediaButton, 1, 3, 6, 7);
			
		}
Exemplo n.º 8
0
        bool pbIsReadOnly = false;                      //wether current phone book is no editable.

        public GfaxPhonebook()
        {
            myPhoneBooks = Phonetools.get_phonebooks();

            Application.Init();
            gxml = new Glade.XML(null, "send-druid.glade", "PhbookWindow", null);
            gxml.Autoconnect(this);

            ItemStore = new ListStore(typeof(string), typeof(string), typeof(string));
            ItemView  = new G_ListView(ItemTreeview, ItemStore);
            ItemView.AddColumnTitle(Catalog.GetString("Organization"), 0, COLUMN_0);
            ItemView.AddColumnTitle(Catalog.GetString("Phone Number"), 1, COLUMN_1);
            ItemView.AddColumnTitle(Catalog.GetString("Contact"), 2, COLUMN_2);
            ItemTreeview.HeadersVisible = true;
            //ItemTreeview.Selection.Mode = SelectionMode.Multiple;
            ItemTreeview.Selection.Changed +=
                new EventHandler(on_ItemTreeview_selection);

            // Populate the drop down combo box with phonebooks and populate
            // the list with the first phonebook.
            // TODO sort these alphabetically
            if (myPhoneBooks.Length > 0)
            {
                string[] list = new string[myPhoneBooks.Length];

                if (myPhoneBooks != null)
                {
                    // populate the list
                    int i = 0;
                    PhonebookComboBox.RemoveText(0);
                    foreach (Phonebook p in myPhoneBooks)
                    {
                        list[i++] = p.Name;
                        PhonebookComboBox.AppendText(p.Name);
                    }
                    PhonebookComboBox.Active = 0;
                }

                //Console.WriteLine(list[PhonebookComboBox.Active]);
                DeletePhonebookButton.Sensitive = true;
            }
            else
            {
                DeletePhonebookButton.Sensitive = false;
            }

            SaveCloseButton.Sensitive = false;
            UpdateButton.Sensitive    = false;
            ClearButton.Sensitive     = false;
            AddButton.Sensitive       = false;

            Application.Run();
        }
        void FillViewers()
        {
            ((Gtk.ListStore)viewerSelector.Model).Clear();
            currentViewers.Clear();

            if (Filenames.Length == 0 || Filename.Length == 0 || System.IO.Directory.Exists(Filename))
            {
                return;
            }

            int selected = -1;
            int i        = 0;

            if (IdeApp.Services.ProjectService.IsWorkspaceItemFile(Filename) || IdeApp.Services.ProjectService.IsSolutionItemFile(Filename))
            {
                viewerSelector.AppendText(GettextCatalog.GetString("Solution Workbench"));
                currentViewers.Add(null);

                if (closeWorkspaceCheck.Visible)
                {
                    closeWorkspaceCheck.Active = true;
                }

                selected = 0;
                i++;
            }

            foreach (FileViewer vw in DisplayBindingService.GetFileViewers(Filename, null))
            {
                if (!vw.IsExternal)
                {
                    viewerSelector.AppendText(vw.Title);
                    currentViewers.Add(vw);

                    if (vw.CanUseAsDefault && selected == -1)
                    {
                        selected = i;
                    }

                    i++;
                }
            }

            if (selected == -1)
            {
                selected = 0;
            }

            viewerSelector.Active = selected;
            viewerLabel.Sensitive = viewerSelector.Sensitive = currentViewers.Count > 1;
        }
Exemplo n.º 10
0
		public TasksPanelWidget ()
		{
			Build ();
			
			comboPriority = ComboBox.NewText ();
			foreach (TaskPriority priority in Enum.GetValues (typeof (TaskPriority)))
				comboPriority.AppendText (Enum.GetName (typeof (TaskPriority), priority));
			comboPriority.Changed += new EventHandler (Validate);
			comboPriority.Show ();
			vboxPriority.PackEnd (comboPriority, false, false, 0);
			
			tokensStore = new ListStore (typeof (string), typeof (int));
			tokensTreeView.AppendColumn (String.Empty, new CellRendererText (), "text", 0);
			tokensTreeView.Selection.Changed += new EventHandler (OnTokenSelectionChanged);
			tokensTreeView.Model = tokensStore;
			
			OnTokenSelectionChanged (null, null);
			
			buttonAdd.Clicked += new EventHandler (AddToken);
			buttonChange.Clicked += new EventHandler (ChangeToken);
			buttonRemove.Clicked += new EventHandler (RemoveToken);
			entryToken.Changed += new EventHandler (Validate);

			Styles.Changed += HandleUserInterfaceSkinChanged;
		}
Exemplo n.º 11
0
        public static void ComboPlaceNoFill(ComboBox combo, int Type_id)
        {
            //Заполняем комбобокс Номерами мест
            try {
                logger.Info ("Запрос номеров мест...");
                int count = 0;
                string sql = "SELECT place_no FROM places " +
                             "WHERE type_id = @type_id";
                MySqlCommand cmd = new MySqlCommand (sql, QSMain.connectionDB);
                cmd.Parameters.AddWithValue ("@type_id", Type_id);
                MySqlDataReader rdr = cmd.ExecuteReader ();

                while (rdr.Read ()) {
                    combo.AppendText (rdr ["place_no"].ToString ());
                    count++;
                }
                rdr.Close ();
                if (count == 1)
                    combo.Active = 0;

                logger.Info ("Ok");
            } catch (Exception ex) {
                logger.Error (ex, "Ошибка получения номеров мест!");
            }
        }
Exemplo n.º 12
0
        private void Initialize()
        {
            // Pressing enter should save and close the dialog
            //Dialog.DefaultResponse = Gtk.ResponseType.Ok;
            ok_button.HasDefault = true;

            Gdk.Geometry limits = new Gdk.Geometry();
            limits.MinWidth  = Dialog.SizeRequest().Width;
            limits.MaxWidth  = Gdk.Screen.Default.Width;
            limits.MinHeight = -1;
            limits.MaxHeight = -1;
            Dialog.SetGeometryHints(Dialog, limits, Gdk.WindowHints.MaxSize | Gdk.WindowHints.MinSize);

            type_combo.RemoveText(0);
            int active_type = 0;
            int i           = 0;

            foreach (StationType type in StationType.Types)
            {
                if (!type.SubscribersOnly || lastfm.Account.Subscriber)
                {
                    type_combo.AppendText(type.Label);
                    if (source != null && type == source.Type)
                    {
                        active_type = i;
                    }
                    i++;
                }
            }

            type_combo.Changed += HandleTypeChanged;
            type_combo.Active   = active_type;
            ok_button.Sensitive = true;
            type_combo.GrabFocus();
        }
Exemplo n.º 13
0
        /// <summary>
        /// Fills the combo box.
        /// </summary>
        /// <param name='combo'>
        /// Combo.
        /// </param>
        /// <param name='items'>
        /// Items.
        /// </param>
        /// <param name='editable'>
        /// Editable.
        /// </param>
        /// <param name='currentValue'>
        /// Current value.
        /// </param>
        public static void FillComboBox(Gtk.ComboBox combo, Type enumType, bool editable, int currentValue)
        {
            // clear combo
            combo.Model = new ListStore(typeof(string));

            // adding all items
            var index = 0;

            foreach (var item in Enum.GetNames(enumType))
            {
                if (editable || (index == currentValue))
                {
                    combo.AppendText(item);

                    if (!editable)
                    {
                        combo.Active = 0;
                    }
                    else
                    if (index == currentValue)
                    {
                        combo.Active = index;
                    }
                }
                index++;
            }
        }
Exemplo n.º 14
0
 private void PopulateCombo()
 {
     foreach (string c in colors)
     {
         background_color.AppendText(c);
     }
     background_color.Active = 0;
 }
Exemplo n.º 15
0
        public QueryLimitBox (QueryOrder [] orders, QueryLimit [] limits) : base ()
        {
            this.orders = orders;
            this.limits = limits;

            Spacing = 5;

            enabled_checkbox = new CheckButton (Catalog.GetString ("_Limit to"));
            enabled_checkbox.Toggled += OnEnabledToggled;

            count_spin = new SpinButton (0, Double.MaxValue, 1);
            count_spin.Numeric = true;
            count_spin.Digits = 0;
            count_spin.Value = 25;
            count_spin.SetSizeRequest (60, -1);

            limit_combo = ComboBox.NewText ();
            foreach (QueryLimit limit in limits) {
                limit_combo.AppendText (limit.Label);
            }

            order_combo = ComboBox.NewText ();
            order_combo.RowSeparatorFunc = IsRowSeparator;
            foreach (QueryOrder order in orders) {
                if (order == null) {
                    order_combo.AppendText (String.Empty);
                } else {
                    order_combo.AppendText (order.Label);
                }
            }

            PackStart (enabled_checkbox, false, false, 0);
            PackStart (count_spin, false, false, 0);
            PackStart (limit_combo, false, false, 0);
            PackStart (new Label (Catalog.GetString ("selected by")), false, false, 0);
            PackStart (order_combo, false, false, 0);

            enabled_checkbox.Active = false;
            limit_combo.Active = 0;
            order_combo.Active = 0;

            OnEnabledToggled (null, null);

            ShowAll ();
        }
Exemplo n.º 16
0
        public CopyOffsetPreferencesWidget()
        {
            // Use a hbox inside an vbox to avoid expanding vertically.
            Gtk.HBox  hbox  = new Gtk.HBox();
            Gtk.Label label = new Gtk.Label(Catalog.GetString("Number base:"));
            numberBaseCombo = Gtk.ComboBox.NewText();
            numberBaseCombo.AppendText("2");
            numberBaseCombo.AppendText("8");
            numberBaseCombo.AppendText("10");
            numberBaseCombo.AppendText("16");

            hbox.PackStart(label, false, false, 6);
            hbox.PackStart(numberBaseCombo, false, false, 6);

            this.PackStart(hbox, true, false, 6);

            this.ShowAll();
        }
			public WidgetBuilderOptionPanelWidget (Project project) : base (false, 6)
			{
				this.project = project as DotNetProject;

				Gtk.HBox box = new Gtk.HBox (false, 3);
				Gtk.Label lbl = new Gtk.Label (GettextCatalog.GetString ("Target Gtk# version:"));
				box.PackStart (lbl, false, false, 0);
				comboVersions = ComboBox.NewText ();
				ReferenceManager refmgr = new ReferenceManager (project as DotNetProject);
				foreach (string v in refmgr.SupportedGtkVersions)
					comboVersions.AppendText (v);
				comboVersions.Active = refmgr.SupportedGtkVersions.IndexOf (refmgr.GtkPackageVersion);
				refmgr.Dispose ();
				box.PackStart (comboVersions, false, false, 0);
				box.ShowAll ();
				PackStart (box, false, false, 0);

				HSeparator sep = new HSeparator ();
				sep.Show ();
				PackStart (sep, false, false, 0);
				
				if (!GtkDesignInfo.HasDesignedObjects (project))
					return;

				GtkDesignInfo designInfo = GtkDesignInfo.FromProject (project);
				checkGettext = new CheckButton (GettextCatalog.GetString ("Enable gettext support"));
				checkGettext.Active = designInfo.GenerateGettext;
				checkGettext.Show ();
				PackStart (checkGettext, false, false, 0);
				box = new Gtk.HBox (false, 3);
				box.PackStart (new Label (GettextCatalog.GetString ("Gettext class:")), false, false, 0);
				entryGettext = new Gtk.Entry ();
				entryGettext.Text = designInfo.GettextClass;
				entryGettext.Sensitive = checkGettext.Active;
				box.PackStart (entryGettext, false, false, 0);
				box.ShowAll ();
				PackStart (box, false, false, 0);
				
				sep= new HSeparator ();
				sep.Show ();
				PackStart (sep, false, false, 0);
				
				box = new Gtk.HBox (false, 3);
				box.PackStart (new Label (GettextCatalog.GetString ("Stetic folder name :")), false, false, 0);
				entryFolderName = new Gtk.Entry ();
				entryFolderName.Text = designInfo.SteticFolderName;
				entryFolderName.Sensitive = false;
				box.PackStart (entryFolderName, false, false, 0);
				box.ShowAll ();
				PackStart (box, false, false, 0);
				
				checkHideFiles = new CheckButton (GettextCatalog.GetString ("Hide designer files"));
				checkHideFiles.Active = designInfo.HideGtkxFiles;
				checkHideFiles.Show ();
				PackStart (checkHideFiles, false, false, 0);
			}
Exemplo n.º 18
0
        // Relative: [<|>] [num] [minutes|hours] ago
        // TODO: Absolute: [>|>=|=|<|<=] [date/time]
        public FileSizeQueryValueEntry () : base ()
        {
            spin_button = new SpinButton (0.0, 1.0, 1.0);
            spin_button.Digits = 1;
            spin_button.WidthChars = 4;
            spin_button.SetRange (0.0, Double.MaxValue);
            Add (spin_button);

            combo = ComboBox.NewText ();
            combo.AppendText (Catalog.GetString ("bytes"));
            combo.AppendText (Catalog.GetString ("KB"));
            combo.AppendText (Catalog.GetString ("MB"));
            combo.AppendText (Catalog.GetString ("GB"));
            combo.Realized += delegate { if (!combo_set) { combo.Active = 2; } };
            Add (combo);

            spin_button.ValueChanged += HandleValueChanged;
            combo.Changed += HandleValueChanged;
        }
Exemplo n.º 19
0
 private void FillComboboxWithStrings(Gtk.ComboBox box, string[] strings)
 {
     ((Gtk.ListStore)(box.Model)).Clear();
     for (int i = 0; i < strings.Length; i++)
     {
         box.AppendText(strings[i]);
     }
     box.Active    = 0;
     box.Sensitive = (strings.Length > 1);
 }
Exemplo n.º 20
0
			public WidgetBuilderOptionPanelWidget (Project project) : base (false, 6)
			{
				this.project = project as DotNetProject;

				Gtk.HBox box = new Gtk.HBox (false, 3);
				Gtk.Label lbl = new Gtk.Label (GettextCatalog.GetString ("Target Gtk# version:"));
				box.PackStart (lbl, false, false, 0);
				comboVersions = ComboBox.NewText ();
				ReferenceManager refmgr = new ReferenceManager (project as DotNetProject);
				foreach (string v in refmgr.SupportedGtkVersions)
					comboVersions.AppendText (v);
				comboVersions.Active = refmgr.SupportedGtkVersions.IndexOf (refmgr.GtkPackageVersion);
				refmgr.Dispose ();
				box.PackStart (comboVersions, false, false, 0);
				box.ShowAll ();
				PackStart (box, false, false, 0);

				HSeparator sep = new HSeparator ();
				sep.Show ();
				PackStart (sep, false, false, 0);
				
				if (!GtkDesignInfo.HasDesignedObjects (project))
					return;

				GtkDesignInfo designInfo = GtkDesignInfo.FromProject (project);
				checkGettext = new CheckButton (GettextCatalog.GetString ("Enable gettext support"));
				checkGettext.Active = designInfo.GenerateGettext;
				checkGettext.Show ();
				PackStart (checkGettext, false, false, 0);

				box = new Gtk.HBox (false, 3);
				box.PackStart (new Label (GettextCatalog.GetString ("Gettext class:")), false, false, 0);
				entryGettext = new Gtk.Entry ();
				entryGettext.Text = designInfo.GettextClass;
				entryGettext.Sensitive = checkGettext.Active;
				box.PackStart (entryGettext, false, false, 0);
				box.ShowAll ();
				PackStart (box, false, false, 0);

				box = new Gtk.HBox (false, 3);
				box.PackStart (new Label (GettextCatalog.GetString ("Resource loader class:")), false, false, 0);
				entryResourceLoader = new Gtk.Entry ();
				entryResourceLoader.Text = designInfo.ImageResourceLoaderClass;
				entryResourceLoader.Sensitive = checkGettext.Active;
				box.PackStart (entryResourceLoader, false, false, 0);
				box.ShowAll ();
				PackStart (box, false, false, 0);

				checkGettext.Clicked += delegate {
					box.Sensitive = checkGettext.Active;
					if (checkGettext.Active)
						entryGettext.Text = "Mono.Unix.Catalog";
				};
			}
            public WidgetBuilderOptionPanelWidget(Project project) : base(false, 6)
            {
                this.project = project as DotNetProject;

                Gtk.HBox  box = new Gtk.HBox(false, 3);
                Gtk.Label lbl = new Gtk.Label(GettextCatalog.GetString("Target Gtk# version:"));
                box.PackStart(lbl, false, false, 0);
                comboVersions = ComboBox.NewText();
                ReferenceManager refmgr = new ReferenceManager(project as DotNetProject);

                foreach (string v in refmgr.SupportedGtkVersions)
                {
                    comboVersions.AppendText(v);
                }
                comboVersions.Active = refmgr.SupportedGtkVersions.IndexOf(refmgr.GtkPackageVersion);
                refmgr.Dispose();
                box.PackStart(comboVersions, false, false, 0);
                box.ShowAll();
                PackStart(box, false, false, 0);

                HSeparator sep = new HSeparator();

                sep.Show();
                PackStart(sep, false, false, 0);

                if (!GtkDesignInfo.HasDesignedObjects(project))
                {
                    return;
                }

                GtkDesignInfo designInfo = GtkDesignInfo.FromProject(project);

                checkGettext        = new CheckButton(GettextCatalog.GetString("Enable gettext support"));
                checkGettext.Active = designInfo.GenerateGettext;
                checkGettext.Show();
                PackStart(checkGettext, false, false, 0);
                box = new Gtk.HBox(false, 3);
                box.PackStart(new Label(GettextCatalog.GetString("Gettext class:")), false, false, 0);
                entryGettext           = new Gtk.Entry();
                entryGettext.Text      = designInfo.GettextClass;
                entryGettext.Sensitive = checkGettext.Active;
                box.PackStart(entryGettext, false, false, 0);
                box.ShowAll();
                PackStart(box, false, false, 0);

                checkGettext.Clicked += delegate
                {
                    box.Sensitive = checkGettext.Active;
                    if (checkGettext.Active)
                    {
                        entryGettext.Text = "Mono.Unix.Catalog";
                    }
                };
            }
Exemplo n.º 22
0
        public static void AppendColumns(TreeView treeView, IDataReader dataReader)
        {
            tv = treeView;
            for (int index = 0; index < dataReader.FieldCount; index++)
            {
                Console.WriteLine("el indice es: {0}", index);
                treeView.AppendColumn (dataReader.GetName (index), new CellRendererText(), "text", index);

            }

            //Gtk.EditedArgs args = new Gtk.EditedArgs();
            Gtk.ListStore treeModel = new ListStore(typeof(string));

            treeView.Model = treeModel;

            // Values to be chosen in the ComboBox
            Gtk.ListStore comboModel = new ListStore(typeof(string));
            Gtk.ComboBox comboBox = new ComboBox(comboModel);
            comboBox.AppendText("Selecciona una cantidad");
            comboBox.AppendText("1");
            comboBox.AppendText("2");
            comboBox.AppendText("3");
            comboBox.Active = 0;

            Gtk.TreeViewColumn comboCol = new TreeViewColumn();
            Gtk.CellRendererCombo comboCell = new CellRendererCombo();
            comboCol.Title = "Combo Column";
            comboCol.PackStart(comboCell, true);
            comboCol.AddAttribute(comboCell, "text", 4);
            comboCell.Editable = true;
            comboCell.Edited += OnEdited;
            comboCell.TextColumn = 0;
            comboCell.Text = comboBox.ActiveText;
            comboCell.Model = comboModel;
            comboCell.WidthChars = 20;

            treeView.AppendColumn(comboCol);
        }
Exemplo n.º 23
0
        public override CellEditable StartEditing(Gdk.Event ev, Widget widget, string path, Gdk.Rectangle background_area, Gdk.Rectangle cell_area, CellRendererState flags)
        {
            this.path = path;

            Gtk.ComboBox combo = Gtk.ComboBox.NewText();
            foreach (string s in values)
            {
                combo.AppendText(s);
            }

            combo.Active   = Array.IndexOf(values, Text);
            combo.Changed += new EventHandler(SelectionChanged);
            return(new TreeViewCellContainer(combo));
        }
Exemplo n.º 24
0
    protected void generateTittleLists(Gtk.ComboBox cb)
    {
        string defaultVal = cb.ActiveText;

        ClearCombo(cb);

        cb.AppendText(defaultVal);

        for (char c = 'A'; c <= 'Z'; c++)
        {
            cb.AppendText("" + c);
        }

        for (char c = 'A'; c <= 'Z'; c++)
        {
            for (char d = 'A'; d <= 'Z'; d++)
            {
                cb.AppendText("" + c + d);
            }
        }

        cb.Active = 0;
    }
Exemplo n.º 25
0
        void GroupsChanged()
        {
            if (combo != null)
            {
                combo.Changed -= combo_Changed;
                Remove(combo);
            }

            combo          = Gtk.ComboBox.NewText();
            combo.Changed += combo_Changed;
#if GTK_SHARP_2_6
            combo.RowSeparatorFunc = RowSeparatorFunc;
#endif
            combo.Show();
            PackStart(combo, true, true, 0);

            values = new ArrayList();
            int i = 0;
            foreach (string name in manager.GroupNames)
            {
                values.Add(name);
                combo.AppendText(name);
                if (name == group)
                {
                    combo.Active = i;
                }
                i++;
            }

#if GTK_SHARP_2_6
            combo.AppendText("");
#endif

            combo.AppendText(Catalog.GetString("Rename Group..."));
            combo.AppendText(Catalog.GetString("New Group..."));
        }
Exemplo n.º 26
0
        /// <summary>
        /// Regenera un dropdown segun una lista pasada
        /// </summary>
        /// <param name="cb">ComboBox.</param>
        /// <param name="valores">Lista.</param>
        private void RepopulateComboBox(Gtk.ComboBox cb, List <string> valores)
        {
            cb.Clear();
            CellRendererText cell = new CellRendererText();

            cb.PackStart(cell, false);
            cb.AddAttribute(cell, "text", 0);
            ListStore store = new ListStore(typeof(string));

            cb.Model = store;

            foreach (string str in valores)
            {
                cb.AppendText(str);
            }
        }
		public GtkFeatureWidget (DotNetProject project)
		{
			Spacing = 6;
			
			versionCombo = Gtk.ComboBox.NewText ();
			ReferenceManager refmgr = new ReferenceManager (project);
			foreach (string v in refmgr.SupportedGtkVersions)
				versionCombo.AppendText (v);
			versionCombo.Active = 0;
			refmgr.Dispose ();
			
			// GTK# version selector
			HBox box = new HBox (false, 6);
			Gtk.Label vlab = new Label (GettextCatalog.GetString ("Target GTK# version:"));
			box.PackStart (vlab, false, false, 0);
			box.PackStart (versionCombo, false, false, 0);
			box.PackStart (new Label (GettextCatalog.GetString ("(or upper)")), false, false, 0);
			PackStart (box, false, false, 0);
			
			ShowAll ();
		}
        public SmartPlaylistQueryValueEntry () : base ()
        {
            combo = ComboBox.NewText();
            combo.WidthRequest = DefaultWidth;

            int count = 0;
            SmartPlaylistSource playlist;
            foreach (Source child in ServiceManager.SourceManager.DefaultSource.Children) {
                playlist = child as SmartPlaylistSource;
                if (playlist != null && playlist.DbId != null) {
                    if (Editor.CurrentlyEditing == null || (Editor.CurrentlyEditing != playlist && !playlist.DependsOn (Editor.CurrentlyEditing))) {
                        combo.AppendText (playlist.Name);
                        playlist_id_combo_map [(int)playlist.DbId] = count;
                        combo_playlist_id_map [count++] = (int) playlist.DbId;
                    }
                }
            }

            Add (combo);
            combo.Active = 0;

            combo.Changed += HandleValueChanged;
        }
Exemplo n.º 29
0
        public TimeSpanQueryValueEntry () : base ()
        {
            spin_button = new SpinButton (0.0, 1.0, 1.0);
            spin_button.Digits = 1;
            spin_button.WidthChars = 4;
            spin_button.SetRange (0.0, Double.MaxValue);
            Add (spin_button);

            combo = ComboBox.NewText ();
            combo.AppendText (Catalog.GetString ("seconds"));
            combo.AppendText (Catalog.GetString ("minutes"));
            combo.AppendText (Catalog.GetString ("hours"));
            combo.AppendText (Catalog.GetString ("days"));
            combo.AppendText (Catalog.GetString ("weeks"));
            combo.AppendText (Catalog.GetString ("months"));
            combo.AppendText (Catalog.GetString ("years"));
            combo.Realized += delegate { combo.Active = set_combo; };
            Add (combo);

            spin_button.ValueChanged += HandleValueChanged;
            combo.Changed += HandleValueChanged;
        }
Exemplo n.º 30
0
 private Widget CreateMoreOptionsExpander(string defaultDomainID)
 {
     optionsExpander = new Expander(Util.GS("More options"));
        optionsExpander.Activated += new EventHandler(OnOptionsExpanded);
        optionsExpander.Activate();
        Table optionsTable = new Table(2, 3, false);
        optionsExpander.Add(optionsTable);
        optionsTable.ColumnSpacing = 10;
        optionsTable.RowSpacing = 10;
        optionsTable.SetColSpacing(0, 30);
        Label l = new Label(Util.GS("iFolder account"));
        l.Xalign = 0;
        optionsTable.Attach(l, 1,2,0,1,
     AttachOptions.Shrink | AttachOptions.Fill, 0,0,0);
        Encryption = new RadioButton(Util.GS("Passphrase Encryption"));
        optionsTable.Attach(Encryption, 2,3,1,2, AttachOptions.Shrink | AttachOptions.Fill, 0,0,0);
        Regular = new RadioButton(Encryption, Util.GS("Regular"));
        optionsTable.Attach(Regular, 3,4,1,2, AttachOptions.Shrink | AttachOptions.Fill, 0,0,0);
        SecureSync = new CheckButton(Util.GS("Secure Sync"));
                 optionsTable.Attach(SecureSync, 4,5,1,2, AttachOptions.Shrink | AttachOptions.Fill, 0,0,0);
        l = new Label(Util.GS("Security"));
        l.Xalign = 0;
        optionsTable.Attach(l, 1,2,1,2,
     AttachOptions.Shrink | AttachOptions.Fill, 0,0,0);
        domainComboBox = ComboBox.NewText();
        optionsTable.Attach(domainComboBox, 2,3,0,1,
     AttachOptions.Expand | AttachOptions.Fill, 0,0,0);
        int defaultDomain = 0;
        for (int x = 0; x < domains.Length; x++)
        {
     domainComboBox.AppendText(string.Format(domains[x].Name + " - " + domains[x].Host));
     if (defaultDomainID != null)
     {
      if (defaultDomainID == domains[x].ID)
       defaultDomain = x;
     }
     else
      defaultDomain = x;
        }
        domainComboBox.Active = defaultDomain;
        int SecurityPolicy = ifws.GetSecurityPolicy(this.DomainID);
        ChangeStatus(SecurityPolicy);
        optionsTable.ShowAll();
        return optionsExpander;
 }
Exemplo n.º 31
0
 private void InitializeWidgets()
 {
     this.Spacing = Util.SectionSpacing;
        this.BorderWidth = Util.DefaultBorderWidth;
        VBox appSectionBox = new VBox();
        appSectionBox.Spacing = Util.SectionTitleSpacing;
        this.PackStart(appSectionBox, false, true, 0);
        Label appSectionLabel = new Label("<span weight=\"bold\">" +
     Util.GS("Application") +
     "</span>");
        appSectionLabel.UseMarkup = true;
        appSectionLabel.Xalign = 0;
        appSectionBox.PackStart(appSectionLabel, false, true, 0);
        HBox appSpacerBox = new HBox();
        appSectionBox.PackStart(appSpacerBox, false, true, 0);
        Label appSpaceLabel = new Label("    ");
        appSpacerBox.PackStart(appSpaceLabel, false, true, 0);
        VBox appWidgetBox = new VBox();
        appSpacerBox.PackStart(appWidgetBox, false, true, 0);
        appWidgetBox.Spacing = Util.SectionTitleSpacing;
        ShowConfirmationButton =
     new CheckButton(Util.GS(
      "_Show Confirmation dialog when creating iFolders"));
        appWidgetBox.PackStart(ShowConfirmationButton, false, true, 0);
        ShowConfirmationButton.Toggled +=
       new EventHandler(OnShowConfButton);
        Label strtlabel = new Label("<span style=\"italic\">" + Util.GS("To start up iFolder at login, leave iFolder running when you log out and save your current setup.") + "</span>");
        strtlabel.UseMarkup = true;
        strtlabel.LineWrap = true;
        appWidgetBox.PackStart(strtlabel, false, true, 0);
        VBox notifySectionBox = new VBox();
        notifySectionBox.Spacing = Util.SectionTitleSpacing;
        this.PackStart(notifySectionBox, false, true, 0);
        Label notifySectionLabel = new Label("<span weight=\"bold\">" +
     Util.GS("Notification") +
     "</span>");
        notifySectionLabel.UseMarkup = true;
        notifySectionLabel.Xalign = 0;
        notifySectionBox.PackStart(notifySectionLabel, false, true, 0);
        HBox notifySpacerBox = new HBox();
        notifySectionBox.PackStart(notifySpacerBox, false, true, 0);
        Label notifySpaceLabel = new Label("    ");
        notifySpacerBox.PackStart(notifySpaceLabel, false, true, 0);
        VBox notifyWidgetBox = new VBox();
        notifySpacerBox.PackStart(notifyWidgetBox, true, true, 0);
        notifyWidgetBox.Spacing = 5;
        NotifyiFoldersButton =
     new CheckButton(Util.GS("Notify of share_d iFolders"));
        notifyWidgetBox.PackStart(NotifyiFoldersButton, false, true, 0);
        NotifyiFoldersButton.Toggled +=
       new EventHandler(OnNotifyiFoldersButton);
        NotifyCollisionsButton =
     new CheckButton(Util.GS("Notify of conflic_ts"));
        notifyWidgetBox.PackStart(NotifyCollisionsButton, false, true, 0);
        NotifyCollisionsButton.Toggled +=
       new EventHandler(OnNotifyCollisionsButton);
        NotifyUsersButton =
     new CheckButton(Util.GS("Notify when a _user joins"));
        notifyWidgetBox.PackStart(NotifyUsersButton, false, true, 0);
        NotifyUsersButton.Toggled +=
       new EventHandler(OnNotifyUsersButton);
        VBox syncSectionBox = new VBox();
        syncSectionBox.Spacing = Util.SectionTitleSpacing;
        this.PackStart(syncSectionBox, false, true, 0);
        Label syncSectionLabel = new Label("<span weight=\"bold\">" +
     Util.GS("Synchronization") +
     "</span>");
        syncSectionLabel.UseMarkup = true;
        syncSectionLabel.Xalign = 0;
        syncSectionBox.PackStart(syncSectionLabel, false, true, 0);
        HBox syncSpacerBox = new HBox();
        syncSectionBox.PackStart(syncSpacerBox, false, true, 0);
        Label syncSpaceLabel = new Label("    ");
        syncSpacerBox.PackStart(syncSpaceLabel, false, true, 0);
        VBox syncWidgetBox = new VBox();
        syncSpacerBox.PackStart(syncWidgetBox, false, true, 0);
        syncWidgetBox.Spacing = 10;
        HBox syncHBox0 = new HBox();
        syncWidgetBox.PackStart(syncHBox0, false, true, 0);
        syncHBox0.Spacing = 10;
        AutoSyncCheckButton =
     new CheckButton(Util.GS("Automatically S_ynchronize iFolders"));
        syncHBox0.PackStart(AutoSyncCheckButton, false, false, 0);
        HBox syncHBox = new HBox();
        syncHBox.Spacing = 10;
        syncWidgetBox.PackStart(syncHBox, true, true, 0);
        Label spacerLabel = new Label("  ");
        syncHBox.PackStart(spacerLabel, true, true, 0);
        Label syncEveryLabel = new Label(Util.GS("Synchronize iFolders Every"));
        syncEveryLabel.Xalign = 1;
        syncHBox.PackStart(syncEveryLabel, false, false, 0);
        SyncSpinButton = new SpinButton(1, Int32.MaxValue, 1);
        syncHBox.PackStart(SyncSpinButton, false, false, 0);
        SyncUnitsComboBox = ComboBox.NewText();
        syncHBox.PackStart(SyncUnitsComboBox, false, false, 0);
        SyncUnitsComboBox.AppendText(Util.GS("seconds"));
        SyncUnitsComboBox.AppendText(Util.GS("minutes"));
        SyncUnitsComboBox.AppendText(Util.GS("hours"));
        SyncUnitsComboBox.AppendText(Util.GS("days"));
        SyncUnitsComboBox.Active = (int)SyncUnit.Minutes;
        currentSyncUnit = SyncUnit.Minutes;
 }
Exemplo n.º 32
0
        /// <summary>
        /// Replaces Windows Form Designer code
        /// </summary>
        private void InitializeComponent()
        {
            SetSizeRequest(192, 240);		// Define MenuForm size
            //
            // Define an 8x6 table on which to lay out the test buttons, etc
            //
            Gtk.Table layout = new Gtk.Table(8, 6, true);
            layout.BorderWidth = 8;
            layout.ColumnSpacing = 2;
            layout.RowSpacing = 2;
            Add(layout);

            // Create menu components, then add to layout
            //
            // DemosLabel
            //
            demosLabel = new Gtk.Label("Demos");
            layout.Attach(demosLabel, 0, 2, 0, 1);
            //
            // plotSurface2DDemoButton
            //
            plotSurface2DDemoButton = new Gtk.Button("PlotSurface2D Demo");
            plotSurface2DDemoButton.Clicked += new System.EventHandler(this.plotSurface2DDemoButton_Click);
            layout.Attach(plotSurface2DDemoButton, 0, 6, 1, 2);
            //
            // multiPlotDemoButton
            //
            multiPlotDemoButton = new Gtk.Button("Multi Plot Demo");
            multiPlotDemoButton.Clicked += new System.EventHandler(this.runDemoButton_Click);
            layout.Attach(multiPlotDemoButton, 0, 6, 2, 3);
            //
            // testsLabel
            //
            testsLabel = new Gtk.Label("Tests");
            layout.Attach(testsLabel, 0, 2, 3, 4);
            //
            // TestSelectComboBox
            //
            //
            TestSelectComboBox = ComboBox.NewText();
            TestSelectComboBox.AppendText("Axis Test");
            TestSelectComboBox.AppendText("PlotSurface2D");
            layout.Attach(TestSelectComboBox, 0, 6, 4, 5);
            //
            // RunTestButton
            //
            RunTestButton = new Gtk.Button("Run Selected Test");
            RunTestButton.Clicked += new System.EventHandler(this.RunTestButton_Click);
            layout.Attach(RunTestButton, 0, 6, 5, 6);
            //
            // quitButton
            //
            quitButton = new Gtk.Button("Quit");
            quitButton.Clicked += new System.EventHandler(this.quitButton_Click);
            layout.Attach(quitButton, 2, 4, 7, 8, 0, 0, 0, 0);
            //
            // Gtk.Window events
            //
            this.Destroyed += new EventHandler(MenuForm_Destroyed);
        }
Exemplo n.º 33
0
        private void BuildInterface ()
        {
            field_chooser = ComboBox.NewText ();
            field_chooser.Changed += HandleFieldChanged;

            op_chooser = ComboBox.NewText ();
            op_chooser.RowSeparatorFunc = IsRowSeparator;
            op_chooser.Changed += HandleOperatorChanged;

            value_box = new HBox ();

            remove_button = new Button (new Image ("gtk-remove", IconSize.Button));
            remove_button.Relief = ReliefStyle.None;
            remove_button.Clicked += OnButtonRemoveClicked;

            add_button = new Button (new Image ("gtk-add", IconSize.Button));
            add_button.Relief = ReliefStyle.None;
            add_button.Clicked += OnButtonAddClicked;

            button_box = new HBox ();
            button_box.PackStart (remove_button, false, false, 0);
            button_box.PackStart (add_button, false, false, 0);

            foreach (QueryField field in sorted_fields) {
                field_chooser.AppendText (field.Label);
            }

            Show ();
            field_chooser.Active = 0;
        }
Exemplo n.º 34
0
        void createCombos()
        {
            // class
            actionComboBox = ComboBox.NewText ();
            actionComboBox.AppendText ("Add");
            actionComboBox.AppendText ("Delete");
            actionComboBox.AppendText ("Replace");

            actionComboBox.Active = 0;
            actionComboBox.Show ();

            actionHBox.PackStart (actionComboBox, true, true, 5);

            connComboBox = Util.CreateServerCombo ();
            hbox452.PackEnd (connComboBox, true, true, 5);
        }
		void PopulateBox (ComboBox box, string category, List<Type> types)
		{
			var mapping = Options.CollectionMappings.FirstOrDefault (m => m.Category == category);
			
			Type current = null;
			if (mapping != null)
				current = GetType (mapping.TypeName);
			if (current == null)
				current = types [0];
			
			if (!types.Contains (current))
				types.Add (current);
			
			foreach (var type in types)
				box.AppendText (GetTypeName (type));
			
			box.Active = types.IndexOf (current);
		}
Exemplo n.º 36
0
        private Gtk.Widget MakeGeneralPage()
        {
            VBox vbox = new VBox(false, 6);

            vbox.BorderWidth = 10;

            //
            // ITask Management System
            //
            VBox  sectionVBox = new VBox(false, 4);
            Label l           = new Label();

            l.Markup = string.Format("<span size=\"large\" weight=\"bold\">{0}</span>",
                                     Catalog.GetString("Task Management System"));
            l.UseUnderline = false;
            l.UseMarkup    = true;
            l.Wrap         = false;
            l.Xalign       = 0;

            l.Show();
            sectionVBox.PackStart(l, false, false, 0);

            backendComboBox = ComboBox.NewText();
            backendComboMap = new Dictionary <int, string> ();
            // Fill out the ComboBox
            int i = 0;

            selectedBackend = -1;
            foreach (var backend in application.BackendManager.AvailableBackends)
            {
                backendComboBox.AppendText(backend.Value);
                backendComboMap [i] = backend.Key;
                if (backend.Key == application.BackendManager.CurrentBackend)
                {
                    selectedBackend = i;
                }
                i++;
            }
            if (selectedBackend >= 0)
            {
                backendComboBox.Active = selectedBackend;
            }
            backendComboBox.Changed += OnBackendComboBoxChanged;
            backendComboBox.Show();

            HBox hbox = new HBox(false, 6);

            l = new Label(string.Empty);              // spacer
            l.Show();
            hbox.PackStart(l, false, false, 0);
            hbox.PackStart(backendComboBox, false, false, 0);
            hbox.Show();
            sectionVBox.PackStart(hbox, false, false, 0);
            sectionVBox.Show();
            vbox.PackStart(sectionVBox, false, false, 0);

            //
            // ITask Filtering
            //
            sectionVBox = new VBox(false, 4);
            l           = new Label();
            l.Markup    = string.Format("<span size=\"large\" weight=\"bold\">{0}</span>",
                                        Catalog.GetString("Task Filtering"));
            l.UseUnderline = false;
            l.UseMarkup    = true;
            l.Wrap         = false;
            l.Xalign       = 0;

            l.Show();
            sectionVBox.PackStart(l, false, false, 0);

            HBox sectionHBox = new HBox(false, 6);

            l = new Label(string.Empty);              // spacer
            l.Show();
            sectionHBox.PackStart(l, false, false, 0);
            VBox innerSectionVBox = new VBox(false, 6);

            hbox = new HBox(false, 6);

            bool showCompletedTasks = application.Preferences.GetBool(
                PreferencesKeys.ShowCompletedTasksKey);

            showCompletedTasksCheckButton =
                new CheckButton(Catalog.GetString("Sh_ow completed tasks"));
            showCompletedTasksCheckButton.UseUnderline = true;
            showCompletedTasksCheckButton.Active       = showCompletedTasks;
            showCompletedTasksCheckButton.Show();
            hbox.PackStart(showCompletedTasksCheckButton, true, true, 0);
            hbox.Show();
            innerSectionVBox.PackStart(hbox, false, false, 0);

            // TaskLists TreeView
            l = new Label(Catalog.GetString("Only _show these lists when \"All\" is selected:"));
            l.UseUnderline = true;
            l.Xalign       = 0;
            l.Show();
            innerSectionVBox.PackStart(l, false, false, 0);

            ScrolledWindow sw = new ScrolledWindow();

            sw.HscrollbarPolicy = PolicyType.Automatic;
            sw.VscrollbarPolicy = PolicyType.Automatic;
            sw.ShadowType       = ShadowType.EtchedIn;

            taskListsTree = new TreeView();
            taskListsTree.Selection.Mode = SelectionMode.None;
            taskListsTree.RulesHint      = false;
            taskListsTree.HeadersVisible = false;
            l.MnemonicWidget             = taskListsTree;

            Gtk.TreeViewColumn column = new Gtk.TreeViewColumn();
            column.Title     = Catalog.GetString("Task List");
            column.Sizing    = Gtk.TreeViewColumnSizing.Autosize;
            column.Resizable = false;

            Gtk.CellRendererToggle toggleCr = new CellRendererToggle();
            toggleCr.Toggled += OnTaskListToggled;
            column.PackStart(toggleCr, false);
            column.SetCellDataFunc(toggleCr,
                                   new Gtk.TreeCellDataFunc(ToggleCellDataFunc));

            Gtk.CellRendererText textCr = new CellRendererText();
            column.PackStart(textCr, true);
            column.SetCellDataFunc(textCr,
                                   new Gtk.TreeCellDataFunc(TextCellDataFunc));

            taskListsTree.AppendColumn(column);

            taskListsTree.Show();
            sw.Add(taskListsTree);
            sw.Show();
            innerSectionVBox.PackStart(sw, true, true, 0);
            innerSectionVBox.Show();

            sectionHBox.PackStart(innerSectionVBox, true, true, 0);
            sectionHBox.Show();
            sectionVBox.PackStart(sectionHBox, true, true, 0);
            sectionVBox.Show();
            vbox.PackStart(sectionVBox, true, true, 0);

            return(vbox);
        }
Exemplo n.º 37
0
 private Widget CreateMoreOptionsExpander(string filteredDomainID)
 {
     Expander moreOptionsExpander = new Expander(Util.GS("More options"));
        Table optionsTable = new Table(2, 3, false);
        moreOptionsExpander.Add(optionsTable);
        optionsTable.ColumnSpacing = 10;
        optionsTable.RowSpacing = 10;
        optionsTable.SetColSpacing(0, 30);
        Label l = new Label(Util.GS("iFolder Server:"));
        l.Xalign = 0;
        optionsTable.Attach(l, 1,2,0,1,
     AttachOptions.Shrink | AttachOptions.Fill, 0,0,0);
        domainComboBox = ComboBox.NewText();
        optionsTable.Attach(domainComboBox, 2,3,0,1,
     AttachOptions.Expand | AttachOptions.Fill, 0,0,0);
        int defaultDomain = 0;
        for (int x = 0; x < domains.Length; x++)
        {
     domainComboBox.AppendText(domains[x].Name);
     if (filteredDomainID != null)
     {
      if (filteredDomainID == domains[x].ID)
       defaultDomain = x;
     }
     else
      defaultDomain = x;
        }
        domainComboBox.Active = defaultDomain;
        l = new Label(Util.GS("Description:"));
        l.Xalign = 0;
        optionsTable.Attach(l, 1,2,1,2,
     AttachOptions.Shrink | AttachOptions.Fill, 0,0,0);
        descriptionTextView = new TextView();
        descriptionTextView.LeftMargin = 4;
        descriptionTextView.RightMargin = 4;
        descriptionTextView.Editable = true;
        descriptionTextView.CursorVisible = true;
        descriptionTextView.AcceptsTab = false;
        descriptionTextView.WrapMode = WrapMode.WordChar;
        ScrolledWindow sw = new ScrolledWindow();
        sw.ShadowType = ShadowType.EtchedIn;
        sw.Add(descriptionTextView);
        optionsTable.Attach(sw, 2,3,1,2,
     AttachOptions.Expand | AttachOptions.Fill, 0,0,0);
        optionsTable.ShowAll();
        return moreOptionsExpander;
 }
Exemplo n.º 38
0
        private HBox BuildMatchHeader ()
        {
            HBox header = new HBox ();
            header.Show ();

            terms_enabled_checkbox = new CheckButton (Catalog.GetString ("_Match"));
            terms_enabled_checkbox.Show ();
            terms_enabled_checkbox.Active = true;
            terms_enabled_checkbox.Toggled += OnMatchCheckBoxToggled;
            header.PackStart (terms_enabled_checkbox, false, false, 0);

            terms_logic_combo = ComboBox.NewText ();
            terms_logic_combo.AppendText (Catalog.GetString ("all"));
            terms_logic_combo.AppendText (Catalog.GetString ("any"));
            terms_logic_combo.Show ();
            terms_logic_combo.Active = 0;
            header.PackStart (terms_logic_combo, false, false, 0);

            terms_label = new Label (Catalog.GetString ("of the following:"));
            terms_label.Show ();
            terms_label.Xalign = 0.0f;
            header.PackStart (terms_label, true, true, 0);

            header.Spacing = 5;

            return header;
        }
Exemplo n.º 39
0
        /// <summary>
        /// Initializes all GUI components.
        /// </summary>
        /// <history>
        /// [Curtis_Beard]      11/03/2006  Created
        /// </history>
        private void InitializeComponent()
        {
            this.SetDefaultSize (Core.GeneralSettings.WindowWidth, Core.GeneralSettings.WindowHeight);
             if (Core.GeneralSettings.WindowLeft == -1 && Core.GeneralSettings.WindowTop == -1)
            this.SetPosition(WindowPosition.Center);
             else
            this.Move(Core.GeneralSettings.WindowLeft, Core.GeneralSettings.WindowTop);

             this.DeleteEvent += new DeleteEventHandler(OnWindowDelete);
             this.Title = Constants.ProductName;
             this.Icon = Images.GetPixbuf("AstroGrep_Icon.ico");

             MainTooltips = new Tooltips();

             VBox vbox = new VBox();
             vbox.BorderWidth = 0;

             Frame leftFrame = new Frame();
             leftFrame.Shadow = ShadowType.In;
             leftFrame.WidthRequest = 200;

             VBox searchBox = new VBox();
             VBox searchOptionsBox = new VBox();
             searchBox.BorderWidth = 3;
             searchOptionsBox.BorderWidth = 3;
             lblSearchStart = new Label("Search Path");
             lblSearchStart.SetAlignment(0,0);

             btnBrowse = new Button();
             btnBrowse.SetSizeRequest(32, 20);
             Gtk.Image img = new Image();
             img.Pixbuf = Images.GetPixbuf("folder-open.png");
             VBox browseBox = new VBox();
             browseBox.PackStart(img, false, false, 0);
             MainTooltips.SetTip(btnBrowse, "Select the folder to start the search", "");
             btnBrowse.Clicked += new EventHandler(btnBrowse_Clicked);
             btnBrowse.Add(browseBox);

             cboSearchStart = ComboBoxEntry.NewText();
             cboSearchFilter = ComboBoxEntry.NewText();
             cboSearchText = ComboBoxEntry.NewText();

             LoadComboBoxEntry(cboSearchStart, Core.GeneralSettings.SearchStarts, true);
             LoadComboBoxEntry(cboSearchFilter, Core.GeneralSettings.SearchFilters, false);
             LoadComboBoxEntry(cboSearchText, Core.GeneralSettings.SearchTexts, false);

             cboSearchStart.Changed += new EventHandler(cboSearchStart_Changed);
             lblSearchFilter = new Label("File Types");
             lblSearchFilter.SetAlignment(0,0);
             lblSearchText = new Label("Search Text");
             lblSearchText.SetAlignment(0,0);

             // search path
             VBox startVBox = new VBox();
             startVBox.BorderWidth = 0;
             cboSearchStart.WidthRequest = 100;
             SetActiveComboBoxEntry(cboSearchStart);

             HBox startHBox = new HBox();
             startHBox.BorderWidth = 0;
             startHBox.PackStart(cboSearchStart, true, true, 0);
             startHBox.PackEnd(btnBrowse, false, false, 0);

             startVBox.PackStart(lblSearchStart, false, false, 0);
             startVBox.PackStart(startHBox, true, false, 0);
             searchBox.PackStart(startVBox, true, false, 0);

             // search filter
             VBox filterVBox = new VBox();
             cboSearchFilter.Active = 0;
             filterVBox.BorderWidth = 0;
             filterVBox.PackStart(lblSearchFilter, false, false, 0);
             filterVBox.PackStart(cboSearchFilter, true, false, 0);
             searchBox.PackStart(filterVBox, true, false, 0);

             // search text
             VBox textVBox = new VBox();
             cboSearchText.Active = 0;
             textVBox.BorderWidth = 0;
             textVBox.PackStart(lblSearchText, false, false, 0);
             textVBox.PackStart(cboSearchText, true, false, 0);
             searchBox.PackStart(textVBox, true, false, 0);

             // Search/Cancel buttons
             searchBox.PackStart(CreateButtons(), false, false, 0);

             // Search Options
             chkRegularExpressions = new CheckButton("Regular Expressions");
             chkCaseSensitive = new CheckButton("Case Sensitive");
             chkWholeWord = new CheckButton("Whole Word");
             chkRecurse = new CheckButton("Recurse");
             chkFileNamesOnly = new CheckButton("Show File Names Only");
             chkFileNamesOnly.Clicked += new EventHandler(chkFileNamesOnly_Clicked);
             chkNegation = new CheckButton("Negation");
             chkNegation.Clicked += new EventHandler(chkNegation_Clicked);
             chkLineNumbers = new CheckButton("Line Numbers");
             cboContextLines = ComboBox.NewText();
             cboContextLines.WidthRequest = 100;
             cboContextLines.WrapWidth = 3;
             for (int i = 0; i <= Constants.MAX_CONTEXT_LINES; i++)
            cboContextLines.AppendText(i.ToString());
             lblContextLines = new Label("Context Lines");
             HBox cxtBox = new HBox();
             cxtBox.BorderWidth = 0;
             cxtBox.PackStart(cboContextLines, false, false, 3);
             cxtBox.PackStart(lblContextLines, false, false, 3);

             searchOptionsBox.PackStart(chkRegularExpressions, true, false, 0);
             searchOptionsBox.PackStart(chkCaseSensitive, true, false, 0);
             searchOptionsBox.PackStart(chkWholeWord, true, false, 0);
             searchOptionsBox.PackStart(chkRecurse, true, false, 0);
             searchOptionsBox.PackStart(chkFileNamesOnly, true, false, 0);
             searchOptionsBox.PackStart(chkNegation, true, false, 0);
             searchOptionsBox.PackStart(chkLineNumbers, true, false, 0);
             searchOptionsBox.PackStart(cxtBox, true, false, 0);
             searchBox.PackEnd(searchOptionsBox, true, true, 0);

             leftFrame.Add(searchBox);

             panelLeft = new HPaned();
             panelLeft.BorderWidth = 0;
             panelRight = new VPaned();
             panelRight.BorderWidth = 0;

             // File List
             Gtk.Frame treeFrame = new Gtk.Frame();
             treeFrame.Shadow = ShadowType.In;
             Gtk.ScrolledWindow treeWin = new Gtk.ScrolledWindow();
             tvFiles = new Gtk.TreeView ();
             SetColumnsText();

             tvFiles.Model = new ListStore(typeof (string), typeof (string), typeof (string), typeof (string), typeof (int));
             (tvFiles.Model as ListStore).DefaultSortFunc = new TreeIterCompareFunc(DefaultTreeIterCompareFunc);
             tvFiles.Selection.Changed += new EventHandler(Tree_OnSelectionChanged);
             tvFiles.RowActivated += new RowActivatedHandler(tvFiles_RowActivated);

             tvFiles.RulesHint = true;
             tvFiles.HeadersClickable = true;
             tvFiles.HeadersVisible = true;
             tvFiles.Selection.Mode = SelectionMode.Multiple;

             SetSortingFunctions();

             treeWin.Add(tvFiles);
             treeFrame.BorderWidth = 0;
             treeFrame.Add(treeWin);

             // txtHits
             Gtk.Frame ScrolledWindowFrm = new Gtk.Frame();
             ScrolledWindowFrm.Shadow = ShadowType.In;
             Gtk.ScrolledWindow TxtViewWin = new Gtk.ScrolledWindow();
             txtViewer = new Gtk.TextView();
             txtViewer.Buffer.Text = "";
             txtViewer.Editable = false;
             TxtViewWin.Add(txtViewer);
             ScrolledWindowFrm.BorderWidth = 0;
             ScrolledWindowFrm.Add(TxtViewWin);

             // Add file list and txtHits to right panel
             panelRight.Pack1(treeFrame, true, true);
             panelRight.Pack2(ScrolledWindowFrm, true, true);

            // TLW

            //Notebook notebook = new Notebook();
            //    Table table = new Table(3, 6);

            // Create a new notebook, place the position of the tabs
              //  table.attach(notebook, 0, 6, 0, 1);

             // Status Bar
             sbStatus = new Statusbar();

             #region Menu bar

             agMenuAccel = new AccelGroup();
             this.AddAccelGroup(agMenuAccel);

             mbMain = new Gtk.MenuBar();

             // File menu
             mnuFile = new Menu();
             MenuItem mnuFileItem = new MenuItem("_File");
             mnuFileItem.Submenu = mnuFile;
             mnuFile.AccelGroup = agMenuAccel;
             mnuFile.Shown += new EventHandler(mnuFile_Shown);

             // Edit menu
             mnuEdit = new Menu();
             MenuItem mnuEditItem = new MenuItem("_Edit");
             mnuEditItem.Submenu = mnuEdit;
             mnuEdit.AccelGroup = agMenuAccel;
             mnuEdit.Shown += new EventHandler(mnuEdit_Shown);

             // Tools menu
             mnuTools = new Menu();
             MenuItem mnuToolsItem = new MenuItem("_Tools");
             mnuToolsItem.Submenu = mnuTools;
             mnuTools.AccelGroup = agMenuAccel;

             // Help menu
             mnuHelp = new Menu();
             MenuItem mnuHelpItem = new MenuItem("_Help");
             mnuHelpItem.Submenu = mnuHelp;
             mnuHelp.AccelGroup = agMenuAccel;

             // File Save menu item
             SaveMenuItem = new ImageMenuItem(Stock.Save, agMenuAccel);
             SaveMenuItem.Activated += new EventHandler(SaveMenuItem_Activated);
             mnuFile.Append(SaveMenuItem);

             // File Print menu item
             PrintMenuItem = new ImageMenuItem(Stock.Print, agMenuAccel);
             PrintMenuItem.Activated += new EventHandler(PrintMenuItem_Activated);
             mnuFile.Append(PrintMenuItem);

             // File Separator menu item
             SeparatorMenuItem Separator1MenuItem = new SeparatorMenuItem();
             mnuFile.Append(Separator1MenuItem);

             // File Exit menu item
             ExitMenuItem = new ImageMenuItem(Stock.Quit, agMenuAccel);
             ExitMenuItem.Activated += new EventHandler(ExitMenuItem_Activated);
             mnuFile.Append(ExitMenuItem);

             // Edit Select All menu item
             SelectAllMenuItem = new ImageMenuItem("_Select All Files", agMenuAccel);
             SelectAllMenuItem.Activated += new EventHandler(SelectAllMenuItem_Activated);
             mnuEdit.Append(SelectAllMenuItem);

             // Edit Open Selected menu item
             OpenSelectedMenuItem = new ImageMenuItem("_Open Selected Files", agMenuAccel);
             OpenSelectedMenuItem.Activated += new EventHandler(OpenSelectedMenuItem_Activated);
             mnuEdit.Append(OpenSelectedMenuItem);

             // Create preferences for every other os except windows
             if (!Common.IsWindows)
             {
            Separator1MenuItem = new SeparatorMenuItem();
            mnuEdit.Append(Separator1MenuItem);

            // Preferences
            Gtk.ImageMenuItem OptionsMenuItem = new ImageMenuItem(Stock.Preferences, agMenuAccel);
            OptionsMenuItem.Activated += new EventHandler(OptionsMenuItem_Activated);
            mnuEdit.Append(OptionsMenuItem);
             }

             // Clear MRU List
             Gtk.ImageMenuItem ClearMRUsMenuItem = new ImageMenuItem("_Clear Most Recently Used Lists", agMenuAccel);
             ClearMRUsMenuItem.Activated += new EventHandler(ClearMRUsMenuItem_Activated);
             mnuTools.Append(ClearMRUsMenuItem);

             Separator1MenuItem = new SeparatorMenuItem();
             mnuTools.Append(Separator1MenuItem);

             // Save Search Options
             Gtk.ImageMenuItem SaveOptionsMenuItem = new ImageMenuItem("_Save Search Options", agMenuAccel);
             SaveOptionsMenuItem.Activated += new EventHandler(SaveOptionsMenuItem_Activated);
             mnuTools.Append(SaveOptionsMenuItem);

             // Create Options menu for windows
             if (Common.IsWindows)
             {
            // Options menu item
            Gtk.ImageMenuItem OptionsMenuItem = new ImageMenuItem("_Options...", agMenuAccel);
            OptionsMenuItem.Activated += new EventHandler(OptionsMenuItem_Activated);
            OptionsMenuItem.Image = new Gtk.Image(Stock.Preferences, IconSize.Menu);
            mnuTools.Append(OptionsMenuItem);
             }

             // Help About menu item
             MenuItem AboutMenuItem = new ImageMenuItem(Stock.About, agMenuAccel);
             AboutMenuItem.Activated += new EventHandler(AboutMenuItem_Activated);
             mnuHelp.Append(AboutMenuItem);

             // Add the menus to the menubar
             mbMain.Append(mnuFileItem);
             mbMain.Append(mnuEditItem);
             mbMain.Append(mnuToolsItem);
             mbMain.Append(mnuHelpItem);

             // Add the menubar to the Menu panel
             vbox.PackStart(mbMain, false, false, 0);

             #endregion

             // add items to container
             panelLeft.Pack1(leftFrame, true, false);

             // TLW
             //panelLeft.Pack2(tabControl, true, false);
             panelLeft.Pack2(panelRight, true, false);

             // set starting position of splitter
             panelLeft.Position = Core.GeneralSettings.WindowSearchPanelWidth;
             panelRight.Position = Core.GeneralSettings.WindowFilePanelHeight;

             vbox.PackStart(panelLeft, true, true, 0);
             vbox.PackEnd(sbStatus, false, true, 3);

             this.Add (vbox);

             this.ShowAll ();
        }
Exemplo n.º 40
0
        private Gtk.VBox GenerateGeneral()

        {
            VBox box = new VBox();



            // Max mru listings

            HBox mruBox = new HBox();

            mruBox.BorderWidth = 3;

            Label lblMRU = new Label("Number of most recently used paths to store");

            lblMRU.SetAlignment(0, .5F);

            cboMRU = ComboBox.NewText();

            cboMRU.WidthRequest = 100;

            cboMRU.WrapWidth = 5;

            for (int i = 1; i < 26; i++)
            {
                cboMRU.AppendText(i.ToString());
            }



            cboMRU.Active = 9;

            mruBox.PackStart(cboMRU, false, false, 3);

            mruBox.PackStart(lblMRU, true, true, 3);



            // language

            Frame langFrame = new Frame("Language");

            langFrame.BorderWidth = 5;

            HBox langBox = new HBox();

            langBox.BorderWidth = 5;

            cboLanguage = ComboBox.NewText();

            cboLanguage.AppendText("Deutsch");

            cboLanguage.AppendText("English");

            cboLanguage.AppendText("Español");

            cboLanguage.AppendText("Italiano");



            // set language index

            int index = FindComboBoxEntry(cboLanguage, Core.GeneralSettings.Language);

            if (index == -1)
            {
                index = 1; // English
            }
            cboLanguage.Active = index;



            langBox.PackStart(cboLanguage, true, true, 5);

            langFrame.Add(langBox);



            // Exclusion list

            Frame excludeFrame = new Frame("Exclude File Extensions");

            excludeFrame.BorderWidth = 5;

            HBox frameBox = new HBox();

            frameBox.BorderWidth = 5;

            txtExcludeExtensions = new Entry();

            frameBox.PackStart(txtExcludeExtensions, true, true, 5);

            excludeFrame.Add(frameBox);



            box.PackStart(mruBox, false, true, 3);

            box.PackStart(langFrame, false, true, 3);

            box.PackStart(excludeFrame, false, true, 3);

            return(box);
        }
Exemplo n.º 41
0
 private modelKeyPage CreateDomainSelectionPage()
 {
     DomainSelectionPage = new modelKeyPage(Util.GS("Select account"),KeyRecoveryPixbuf,null);
        DomainSelectionPage.CancelClicked += new Gnome.CancelClickedHandler(OnCancelClicked);
        DomainSelectionPage.Prepared += new Gnome.PreparedHandler(OnDomainSelectionPagePrepared);
        DomainSelectionPage.ValidateClicked += new KRValidateClickedHandler(OnDomainSelectionPageValidated);
        Table table = new Table(4, 3, false);
              DomainSelectionPage.VBox.PackStart(table,false,false, 0);
                 table.ColumnSpacing = 6;
                 table.RowSpacing = 6;
                 table.BorderWidth = 12;
     Label l1 = new Label(Util.GS("Select the account for which the passphrase must to be reset."));
                 table.Attach(l1, 0,1, 0,1,
                         AttachOptions.Fill | AttachOptions.Expand, 0,0,0);
                 l1.LineWrap = true;
                 l1.Xalign = 0.0F;
        Label l2 = new Label(Util.GS("_iFolder Account")+":");
        table.Attach(l2, 0,1,5,6,
                         AttachOptions.Fill | AttachOptions.Expand, 0,0,0);
                 l2.LineWrap = true;
                 l2.Xalign = 0.0F;
                 domainComboBox = ComboBox.NewText();
        DomainController domainController = DomainController.GetDomainController();
                 domains= domainController.GetLoggedInDomains();
                 string defaultDomainID = simws.GetDefaultDomainID();
                  int defaultDomain = 0 ;
                  for (int x = 0; x < domains.Length; x++)
                 {
                         domainComboBox.AppendText(domains[x].Name+"-"+domains[x].Host);
                          if(defaultDomainID != null && defaultDomainID == domains[x].ID)
                                        defaultDomain = x;
                 }
                 if( domains.Length > 0)
                         domainComboBox.Active = defaultDomain;
                 table.Attach(domainComboBox, 1,2,5,6, AttachOptions.Fill, 0,0,0);
        l2.MnemonicWidget = domainComboBox;
                 Label l3 = new Label(Util.GS("Click Forward to proceed."));
                 table.Attach(l3, 0, 1, 7, 8,
                         AttachOptions.Fill | AttachOptions.Expand, 0, 0, 0);
                 l3.LineWrap = true;
                 l3.Xalign = 0.0F;
       return DomainSelectionPage;
 }
Exemplo n.º 42
0
        void createCombo()
        {
            serverTypeComboBox = ComboBox.NewText ();
            serverTypeComboBox.AppendText ("OpenLDAP");
            serverTypeComboBox.AppendText ("Microsoft Active Directory");
            serverTypeComboBox.AppendText ("Fedora Directory Server");
            serverTypeComboBox.AppendText ("Generic LDAP server");

            serverTypeComboBox.Active = 0;
            serverTypeComboBox.Show ();

            stHBox.PackStart (serverTypeComboBox, true, true, 5);
        }
Exemplo n.º 43
0
		public AssemblyBrowserWidget ()
		{
			this.Build ();

			comboboxVisibilty = ComboBox.NewText ();
			comboboxVisibilty.InsertText (0, GettextCatalog.GetString ("Only public members"));
			comboboxVisibilty.InsertText (1, GettextCatalog.GetString ("All members"));
			comboboxVisibilty.Active = Math.Min (1, Math.Max (0, PropertyService.Get ("AssemblyBrowser.MemberSelection", 0)));
			comboboxVisibilty.Changed += delegate {
				TreeView.PublicApiOnly = comboboxVisibilty.Active == 0;
				PropertyService.Set ("AssemblyBrowser.MemberSelection", comboboxVisibilty.Active);
				FillInspectLabel (); 
			};

			searchentry1 = new MonoDevelop.Components.SearchEntry ();
			searchentry1.Ready = true;
			searchentry1.HasFrame = true;
			searchentry1.WidthRequest = 200;
			searchentry1.Visible = true;
			UpdateSearchEntryMessage ();
			searchentry1.InnerEntry.Changed += SearchEntryhandleChanged;

			CheckMenuItem checkMenuItem = this.searchentry1.AddFilterOption (0, GettextCatalog.GetString ("Types and Members"));
			checkMenuItem.Active = PropertyService.Get ("AssemblyBrowser.SearchMemberState", SearchMemberState.TypesAndMembers) == SearchMemberState.TypesAndMembers;
			checkMenuItem.Toggled += delegate {
				if (checkMenuItem.Active) {
					searchMode = AssemblyBrowserWidget.SearchMode.TypeAndMembers;
					CreateColumns ();
					StartSearch ();
				}
				if (checkMenuItem.Active)
					PropertyService.Set ("AssemblyBrowser.SearchMemberState", SearchMemberState.TypesAndMembers);
				UpdateSearchEntryMessage ();
			};

			CheckMenuItem checkMenuItem2 = this.searchentry1.AddFilterOption (0, GettextCatalog.GetString ("Types"));
			checkMenuItem2.Active = PropertyService.Get ("AssemblyBrowser.SearchMemberState", SearchMemberState.TypesAndMembers) == SearchMemberState.Types;
			checkMenuItem2.Toggled += delegate {
				if (checkMenuItem2.Active) {
					searchMode = AssemblyBrowserWidget.SearchMode.Type;
					CreateColumns ();
					StartSearch ();
				}
				if (checkMenuItem.Active)
					PropertyService.Set ("AssemblyBrowser.SearchMemberState", SearchMemberState.Types);
				UpdateSearchEntryMessage ();
			};
			
			CheckMenuItem checkMenuItem1 = this.searchentry1.AddFilterOption (1, GettextCatalog.GetString ("Members"));
			checkMenuItem.Active = PropertyService.Get ("AssemblyBrowser.SearchMemberState", SearchMemberState.TypesAndMembers) == SearchMemberState.Members;
			checkMenuItem1.Toggled += delegate {
				if (checkMenuItem1.Active) {
					searchMode = AssemblyBrowserWidget.SearchMode.Member;
					CreateColumns ();
					StartSearch ();
				}
				if (checkMenuItem.Active)
					PropertyService.Set ("AssemblyBrowser.SearchMemberState", SearchMemberState.Members);
				UpdateSearchEntryMessage ();

			};

			languageCombobox = Gtk.ComboBox.NewText ();
			languageCombobox.AppendText (GettextCatalog.GetString ("Summary"));
			languageCombobox.AppendText (GettextCatalog.GetString ("IL"));
			languageCombobox.AppendText (GettextCatalog.GetString ("C#"));
			languageCombobox.Active = Math.Min (2, Math.Max (0, PropertyService.Get ("AssemblyBrowser.Language", 0)));
			languageCombobox.Changed += LanguageComboboxhandleChanged;
#pragma warning disable 618
			TreeView = new AssemblyBrowserTreeView (new NodeBuilder[] { 
				new ErrorNodeBuilder (),
				new ProjectNodeBuilder (this),
				new AssemblyNodeBuilder (this),
				new ModuleReferenceNodeBuilder (),
				new AssemblyReferenceNodeBuilder (this),
				//new AssemblyReferenceFolderNodeBuilder (this),
				new AssemblyResourceFolderNodeBuilder (),
				new ResourceNodeBuilder (),
				new NamespaceBuilder (this),
				new DomTypeNodeBuilder (this),
				new DomMethodNodeBuilder (this),
				new DomFieldNodeBuilder (this),
				new DomEventNodeBuilder (this),
				new DomPropertyNodeBuilder (this),
				new BaseTypeFolderNodeBuilder (this),
				new BaseTypeNodeBuilder (this)
				}, new TreePadOption [0]);
			TreeView.PublicApiOnly = comboboxVisibilty.Active == 0;
			TreeView.AllowsMultipleSelection = false;
			TreeView.SelectionChanged += HandleCursorChanged;

			treeViewPlaceholder.Add (TreeView);

//			this.descriptionLabel.ModifyFont (Pango.FontDescription.FromString ("Sans 9"));
//			this.documentationLabel.ModifyFont (Pango.FontDescription.FromString ("Sans 12"));
//			this.documentationLabel.ModifyBg (Gtk.StateType.Normal, new Gdk.Color (255, 255, 225));
//			this.documentationLabel.Wrap = true;
			

			inspectEditor = TextEditorFactory.CreateNewEditor ();
			inspectEditor.ContextMenuPath = "/MonoDevelop/AssemblyBrowser/EditorContextMenu";
			inspectEditor.Options = DefaultSourceEditorOptions.PlainEditor;

			//inspectEditor.ButtonPressEvent += HandleInspectEditorButtonPressEvent;
			
			this.inspectEditor.IsReadOnly = true;
//			this.inspectEditor.Document.SyntaxMode = new Mono.TextEditor.Highlighting.MarkupSyntaxMode ();
//			this.inspectEditor.LinkRequest += InspectEditorhandleLinkRequest;

			documentationScrolledWindow.PackStart (inspectEditor, true, true, 0);

			this.hpaned1.ExposeEvent += HPaneExpose;
			hpaned1 = hpaned1.ReplaceWithWidget (new HPanedThin (), true);
			hpaned1.Position = 271;

			this.notebook1.SetTabLabel (this.documentationScrolledWindow, new Label (GettextCatalog.GetString ("Documentation")));
			this.notebook1.SetTabLabel (this.searchWidget, new Label (GettextCatalog.GetString ("Search")));
			notebook1.Page = 0;
			//this.searchWidget.Visible = false;
				
			typeListStore = new Gtk.ListStore (typeof(Xwt.Drawing.Image), // type image
			                                   typeof(string), // name
			                                   typeof(string), // namespace
			                                   typeof(string), // assembly
				                               typeof(IMember)
			                                  );
			
			memberListStore = new Gtk.ListStore (typeof(Xwt.Drawing.Image), // member image
			                                   typeof(string), // name
			                                   typeof(string), // Declaring type full name
			                                   typeof(string), // assembly
				                               typeof(IMember)
			                                  );
			CreateColumns ();
//			this.searchEntry.Changed += SearchEntryhandleChanged;
			this.searchTreeview.RowActivated += SearchTreeviewhandleRowActivated;
			this.notebook1.ShowTabs = false;
			this.ShowAll ();
		}
Exemplo n.º 44
0
		public AssemblyBrowserWidget ()
		{
			this.Build ();

			buttonBack = new Gtk.Button (ImageService.GetImage ("md-breadcrumb-prev", Gtk.IconSize.Menu));
			buttonBack.Clicked += OnNavigateBackwardActionActivated;

			buttonForeward = new Gtk.Button (ImageService.GetImage ("md-breadcrumb-next", Gtk.IconSize.Menu));
			buttonForeward.Clicked += OnNavigateForwardActionActivated;

			comboboxVisibilty = ComboBox.NewText ();
			comboboxVisibilty.InsertText (0, GettextCatalog.GetString ("Only public members"));
			comboboxVisibilty.InsertText (1, GettextCatalog.GetString ("All members"));
			comboboxVisibilty.Active = 0;
			comboboxVisibilty.Changed += delegate {
				TreeView.PublicApiOnly = comboboxVisibilty.Active == 0;
				FillInspectLabel ();
			};

			searchentry1 = new MonoDevelop.Components.SearchEntry ();
			searchentry1.Ready = true;
			searchentry1.HasFrame = true;
			searchentry1.WidthRequest = 200;
			searchentry1.Visible = true;
			searchentry1.EmptyMessage = GettextCatalog.GetString ("Search for types or members");
			searchentry1.InnerEntry.Changed += SearchEntryhandleChanged;

			CheckMenuItem checkMenuItem = this.searchentry1.AddFilterOption (0, GettextCatalog.GetString ("Types"));
			checkMenuItem.Active = true;
			checkMenuItem.Toggled += delegate {
				if (checkMenuItem.Active) {
					searchMode = AssemblyBrowserWidget.SearchMode.Type;
					CreateColumns ();
					StartSearch ();
				}
			};
			
			CheckMenuItem checkMenuItem1 = this.searchentry1.AddFilterOption (1, GettextCatalog.GetString ("Members"));
			checkMenuItem1.Toggled += delegate {
				if (checkMenuItem1.Active) {
					searchMode = AssemblyBrowserWidget.SearchMode.Member;
					CreateColumns ();
					StartSearch ();
				}
			};

			languageCombobox = Gtk.ComboBox.NewText ();
			//languageCombobox.AppendText (GettextCatalog.GetString ("Summary"));
			languageCombobox.AppendText (GettextCatalog.GetString ("IL"));
			languageCombobox.AppendText (GettextCatalog.GetString ("C#"));
			languageCombobox.Active = Math.Min (1, PropertyService.Get ("AssemblyBrowser.InspectLanguage", 1));
			languageCombobox.Changed += LanguageComboboxhandleChanged;

			loader = new CecilLoader (true);
			loader.IncludeInternalMembers = true;
			TreeView = new AssemblyBrowserTreeView (new NodeBuilder[] { 
				new ErrorNodeBuilder (),
				new ProjectNodeBuilder (this),
				new AssemblyNodeBuilder (this),
				new ModuleReferenceNodeBuilder (),
				new AssemblyReferenceNodeBuilder (this),
				//new AssemblyReferenceFolderNodeBuilder (this),
				new AssemblyResourceFolderNodeBuilder (),
				new ResourceNodeBuilder (),
				new NamespaceBuilder (this),
				new DomTypeNodeBuilder (this),
				new DomMethodNodeBuilder (this),
				new DomFieldNodeBuilder (this),
				new DomEventNodeBuilder (this),
				new DomPropertyNodeBuilder (this),
				new BaseTypeFolderNodeBuilder (this),
				new BaseTypeNodeBuilder (this)
				}, new TreePadOption [0]);
			TreeView.Tree.Selection.Mode = Gtk.SelectionMode.Single;
			TreeView.Tree.CursorChanged += HandleCursorChanged;
			TreeView.ShadowType = ShadowType.None;
			TreeView.BorderWidth = 1;
			TreeView.ShowBorderLine = false;
			TreeView.Zoom = 1.0;
			treeViewPlaceholder.Add (TreeView);

//			this.descriptionLabel.ModifyFont (Pango.FontDescription.FromString ("Sans 9"));
//			this.documentationLabel.ModifyFont (Pango.FontDescription.FromString ("Sans 12"));
//			this.documentationLabel.ModifyBg (Gtk.StateType.Normal, new Gdk.Color (255, 255, 225));
//			this.documentationLabel.Wrap = true;
			
			var options = new MonoDevelop.Ide.Gui.CommonTextEditorOptions () {
				ShowFoldMargin = false,
				ShowIconMargin = false,
				ShowLineNumberMargin = false,
				HighlightCaretLine = true,
			};
			inspectEditor = new TextEditor (new TextDocument (), options);
			inspectEditor.ButtonPressEvent += HandleInspectEditorButtonPressEvent;
			
			this.inspectEditor.Document.ReadOnly = true;
//			this.inspectEditor.Document.SyntaxMode = new Mono.TextEditor.Highlighting.MarkupSyntaxMode ();
			this.inspectEditor.TextViewMargin.GetLink = delegate(Mono.TextEditor.MarginMouseEventArgs arg) {
				var loc = inspectEditor.PointToLocation (arg.X, arg.Y);
				int offset = inspectEditor.LocationToOffset (loc);
				var referencedSegment = ReferencedSegments != null ? ReferencedSegments.FirstOrDefault (seg => seg.Segment.Contains (offset)) : null;
				if (referencedSegment == null)
					return null;
				if (referencedSegment.Reference is TypeDefinition)
					return new XmlDocIdGenerator ().GetXmlDocPath ((TypeDefinition)referencedSegment.Reference);
				
				if (referencedSegment.Reference is MethodDefinition)
					return new XmlDocIdGenerator ().GetXmlDocPath ((MethodDefinition)referencedSegment.Reference);
				
				if (referencedSegment.Reference is PropertyDefinition)
					return new XmlDocIdGenerator ().GetXmlDocPath ((PropertyDefinition)referencedSegment.Reference);
				
				if (referencedSegment.Reference is FieldDefinition)
					return new XmlDocIdGenerator ().GetXmlDocPath ((FieldDefinition)referencedSegment.Reference);
				
				if (referencedSegment.Reference is EventDefinition)
					return new XmlDocIdGenerator ().GetXmlDocPath ((EventDefinition)referencedSegment.Reference);
				
				if (referencedSegment.Reference is FieldDefinition)
					return new XmlDocIdGenerator ().GetXmlDocPath ((FieldDefinition)referencedSegment.Reference);

				if (referencedSegment.Reference is TypeReference) {
					return new XmlDocIdGenerator ().GetXmlDocPath ((TypeReference)referencedSegment.Reference);
				}
				return referencedSegment.Reference.ToString ();
			};
			this.inspectEditor.LinkRequest += InspectEditorhandleLinkRequest;
			documentationScrolledWindow.Add (inspectEditor);

			this.hpaned1.ExposeEvent += HPaneExpose;
			hpaned1 = hpaned1.ReplaceWithWidget (new HPanedThin (), true);
			hpaned1.Position = 271;

			this.notebook1.SetTabLabel (this.documentationScrolledWindow, new Label (GettextCatalog.GetString ("Documentation")));
			this.notebook1.SetTabLabel (this.searchWidget, new Label (GettextCatalog.GetString ("Search")));
			notebook1.Page = 0;
			//this.searchWidget.Visible = false;
				
			typeListStore = new Gtk.ListStore (typeof(Xwt.Drawing.Image), // type image
			                                   typeof(string), // name
			                                   typeof(string), // namespace
			                                   typeof(string), // assembly
				                               typeof(IMember)
			                                  );
			
			memberListStore = new Gtk.ListStore (typeof(Xwt.Drawing.Image), // member image
			                                   typeof(string), // name
			                                   typeof(string), // Declaring type full name
			                                   typeof(string), // assembly
				                               typeof(IMember)
			                                  );
			CreateColumns ();
//			this.searchEntry.Changed += SearchEntryhandleChanged;
			this.searchTreeview.RowActivated += SearchTreeviewhandleRowActivated;
			this.notebook1.ShowTabs = false;
			this.ShowAll ();
		}
Exemplo n.º 45
0
        private Gtk.Widget MakeGeneralPage()
        {
            VBox vbox = new VBox (false, 6);
            vbox.BorderWidth = 10;

            //
            // ITask Management System
            //
            VBox sectionVBox = new VBox (false, 4);
            Label l = new Label ();
            l.Markup = string.Format ("<span size=\"large\" weight=\"bold\">{0}</span>",
                                      Catalog.GetString ("Task Management System"));
            l.UseUnderline = false;
            l.UseMarkup = true;
            l.Wrap = false;
            l.Xalign = 0;

            l.Show ();
            sectionVBox.PackStart (l, false, false, 0);

            backendComboBox = ComboBox.NewText ();
            backendComboMap = new Dictionary<int, string> ();
            // Fill out the ComboBox
            int i = 0;
            selectedBackend = -1;
            foreach (var backend in application.BackendManager.AvailableBackends) {
                backendComboBox.AppendText (backend.Value);
                backendComboMap [i] = backend.Key;
                if (backend.Key == application.BackendManager.CurrentBackend)
                    selectedBackend = i;
                i++;
            }
            if (selectedBackend >= 0)
                backendComboBox.Active = selectedBackend;
            backendComboBox.Changed += OnBackendComboBoxChanged;
            backendComboBox.Show ();

            HBox hbox = new HBox (false, 6);
            l = new Label (string.Empty); // spacer
            l.Show ();
            hbox.PackStart (l, false, false, 0);
            hbox.PackStart (backendComboBox, false, false, 0);
            hbox.Show ();
            sectionVBox.PackStart (hbox, false, false, 0);
            sectionVBox.Show ();
            vbox.PackStart (sectionVBox, false, false, 0);

            //
            // ITask Filtering
            //
            sectionVBox = new VBox (false, 4);
            l = new Label ();
            l.Markup = string.Format ("<span size=\"large\" weight=\"bold\">{0}</span>",
                                      Catalog.GetString ("Task Filtering"));
            l.UseUnderline = false;
            l.UseMarkup = true;
            l.Wrap = false;
            l.Xalign = 0;

            l.Show ();
            sectionVBox.PackStart (l, false, false, 0);

            HBox sectionHBox = new HBox (false, 6);
            l = new Label (string.Empty); // spacer
            l.Show ();
            sectionHBox.PackStart (l, false, false, 0);
            VBox innerSectionVBox = new VBox (false, 6);
            hbox = new HBox (false, 6);

            bool showCompletedTasks = application.Preferences.GetBool (
                PreferencesKeys.ShowCompletedTasksKey);
            showCompletedTasksCheckButton =
                new CheckButton (Catalog.GetString ("Sh_ow completed tasks"));
            showCompletedTasksCheckButton.UseUnderline = true;
            showCompletedTasksCheckButton.Active = showCompletedTasks;
            showCompletedTasksCheckButton.Show ();
            hbox.PackStart (showCompletedTasksCheckButton, true, true, 0);
            hbox.Show ();
            innerSectionVBox.PackStart (hbox, false, false, 0);

            // TaskLists TreeView
            l = new Label (Catalog.GetString ("Only _show these lists when \"All\" is selected:"));
            l.UseUnderline = true;
            l.Xalign = 0;
            l.Show ();
            innerSectionVBox.PackStart (l, false, false, 0);

            ScrolledWindow sw = new ScrolledWindow ();
            sw.HscrollbarPolicy = PolicyType.Automatic;
            sw.VscrollbarPolicy = PolicyType.Automatic;
            sw.ShadowType = ShadowType.EtchedIn;

            taskListsTree = new TreeView ();
            taskListsTree.Selection.Mode = SelectionMode.None;
            taskListsTree.RulesHint = false;
            taskListsTree.HeadersVisible = false;
            l.MnemonicWidget = taskListsTree;

            Gtk.TreeViewColumn column = new Gtk.TreeViewColumn ();
            column.Title = Catalog.GetString ("Task List");
            column.Sizing = Gtk.TreeViewColumnSizing.Autosize;
            column.Resizable = false;

            Gtk.CellRendererToggle toggleCr = new CellRendererToggle ();
            toggleCr.Toggled += OnTaskListToggled;
            column.PackStart (toggleCr, false);
            column.SetCellDataFunc (toggleCr,
                        new Gtk.TreeCellDataFunc (ToggleCellDataFunc));

            Gtk.CellRendererText textCr = new CellRendererText ();
            column.PackStart (textCr, true);
            column.SetCellDataFunc (textCr,
                        new Gtk.TreeCellDataFunc (TextCellDataFunc));

            taskListsTree.AppendColumn (column);

            taskListsTree.Show ();
            sw.Add (taskListsTree);
            sw.Show ();
            innerSectionVBox.PackStart (sw, true, true, 0);
            innerSectionVBox.Show ();

            sectionHBox.PackStart (innerSectionVBox, true, true, 0);
            sectionHBox.Show ();
            sectionVBox.PackStart (sectionHBox, true, true, 0);
            sectionVBox.Show ();
            vbox.PackStart (sectionVBox, true, true, 0);

            return vbox;
        }
Exemplo n.º 46
0
        public SelectImageDialog(Gtk.Window parent, Stetic.IProject project)
        {
            this.parent  = parent;
            this.project = project;
            Glade.XML xml = new Glade.XML(null, "stetic.glade", "SelectImageDialog", null);
            xml.Autoconnect(this);

            // Stock icon list

            iconList = new ThemedIconList();
            iconList.SelectionChanged += new EventHandler(OnIconSelectionChanged);
            iconScrolledwindow.AddWithViewport(iconList);

            // Icon Sizes

            foreach (IconSize s in Enum.GetValues(typeof(Gtk.IconSize)))
            {
                if (s != IconSize.Invalid)
                {
                    iconSizeCombo.AppendText(s.ToString());
                }
            }
            iconSizeCombo.Active = 0;

            // Resource list

            resourceListStore  = new Gtk.ListStore(typeof(Gdk.Pixbuf), typeof(string), typeof(string));
            resourceList.Model = resourceListStore;

            Gtk.TreeViewColumn col = new Gtk.TreeViewColumn();

            Gtk.CellRendererPixbuf pr = new Gtk.CellRendererPixbuf();
            pr.Xpad = 3;
            col.PackStart(pr, false);
            col.AddAttribute(pr, "pixbuf", 0);

            Gtk.CellRendererText crt = new Gtk.CellRendererText();
            col.PackStart(crt, true);
            col.AddAttribute(crt, "markup", 1);

            resourceList.AppendColumn(col);
            resourceProvider = project.ResourceProvider;
            if (resourceProvider == null)
            {
                buttonAdd.Sensitive    = false;
                buttonRemove.Sensitive = false;
            }
            FillResources();
            resourceList.Selection.Changed += OnResourceSelectionChanged;

            if (project.FolderName != null)
            {
                fileChooser.SetCurrentFolder(project.ImagesRootPath);
            }

            fileChooser.SelectionChanged += delegate(object s, EventArgs a) {
                UpdateButtons();
            };

            fileChooser.FileActivated += delegate(object s, EventArgs a) {
                if (Icon != null)
                {
                    if (Validate())
                    {
                        dialog.Respond(Gtk.ResponseType.Ok);
                    }
                }
            };

            okButton.Clicked += OnOkClicked;

            UpdateButtons();
        }
Exemplo n.º 47
0
        public SearchWindow(ISearch search) : base(WindowType.Toplevel)
        {
            this.search = search;

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

            VBox vbox = new VBox();

            vbox.Spacing = 3;

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

            HBox hbox = new HBox(false, 6);

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

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

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

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

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

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

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

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

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

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

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

            HBox padding_hbox = new HBox();

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

            VBox view_box = new VBox(false, 3);

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

            HBox na_padding = new HBox();

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

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

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

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

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

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

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

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

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

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

            Add(vbox);

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

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

            entry.GrabFocus();
            StartCheckingIndexingStatus();
        }
Exemplo n.º 48
0
 private void InitializeWidgets()
 {
     this.SetDefaultSize (500, 400);
        this.Icon = new Gdk.Pixbuf(Util.ImagesPath("ifolderuser.png"));
        VBox dialogBox = new VBox();
        dialogBox.Spacing = 10;
        dialogBox.BorderWidth = 10;
        this.VBox.PackStart(dialogBox, true, true, 0);
        Table findTable = new Table(2, 3, false);
        dialogBox.PackStart(findTable, false, false, 0);
        findTable.ColumnSpacing = 20;
        findTable.RowSpacing = 5;
        Label findLabel = new Label(Util.GS("Find:"));
        findLabel.Xalign = 0;
        findTable.Attach(findLabel, 0, 1, 0, 1,
     AttachOptions.Shrink, 0, 0, 0);
        SearchAttribComboBox = ComboBox.NewText();
        SearchAttribComboBox.AppendText(Util.GS("First Name"));
        SearchAttribComboBox.AppendText(Util.GS("Last Name"));
        SearchAttribComboBox.AppendText(Util.GS("Full Name"));
        SearchAttribComboBox.Active = 2;
        SearchAttribComboBox.Changed += new EventHandler(OnSearchAttribComboBoxChanged);
        findTable.Attach(SearchAttribComboBox, 1, 2, 0, 1,
     AttachOptions.Shrink, 0, 0, 0);
        SearchEntry = new Gtk.Entry(Util.GS("<Enter text to find a user>"));
        SearchEntry.SelectRegion(0, -1);
        SearchEntry.CanFocus = true;
        SearchEntry.Changed += new EventHandler(OnSearchEntryChanged);
        findTable.Attach(SearchEntry, 2, 3, 0, 1,
     AttachOptions.Expand | AttachOptions.Fill, 0, 0, 0);
        Label findHelpTextLabel = new Label(Util.GS("(Full or partial name)"));
        findHelpTextLabel.Xalign = 0;
        findTable.Attach(findHelpTextLabel, 2,3,1,2,
     AttachOptions.Expand | AttachOptions.Fill, 0, 0, 0);
        HBox selBox = new HBox();
        selBox.Spacing = 10;
        dialogBox.PackStart(selBox, true, true, 0);
        memberListModel = new MemberListModel(domainID, simws);
        memberList = new BigList(memberListModel);
        ScrolledWindow sw = new ScrolledWindow(memberList.HAdjustment, memberList.VAdjustment);
        sw.ShadowType = Gtk.ShadowType.EtchedIn;
        sw.Add(memberList);
        selBox.PackStart(sw, true, true, 0);
        memberList.ItemSelected += new ItemSelected(OnMemberIndexSelected);
        memberList.ItemActivated += new ItemActivated(OnMemberIndexActivated);
        VBox btnBox = new VBox();
        btnBox.Spacing = 10;
        selBox.PackStart(btnBox, false, true, 0);
        UserAddButton = new Button(Util.GS("_Add >>"));
        btnBox.PackStart(UserAddButton, false, true, 0);
        UserAddButton.Clicked += new EventHandler(OnAddButtonClicked);
        UserDelButton = new Button(Util.GS("_Remove"));
        btnBox.PackStart(UserDelButton, false, true, 0);
        UserDelButton.Clicked += new EventHandler(OnRemoveButtonClicked);
        SelTreeView = new TreeView();
        ScrolledWindow ssw = new ScrolledWindow();
        ssw.ShadowType = Gtk.ShadowType.EtchedIn;
        ssw.Add(SelTreeView);
        selBox.PackStart(ssw, true, true, 0);
        SelTreeStore = new ListStore(typeof(MemberInfo));
        SelTreeView.Model = SelTreeStore;
        CellRendererPixbuf smcrp = new CellRendererPixbuf();
        TreeViewColumn selmemberColumn = new TreeViewColumn();
        selmemberColumn.PackStart(smcrp, false);
        selmemberColumn.SetCellDataFunc(smcrp, new TreeCellDataFunc(
       UserCellPixbufDataFunc));
        CellRendererText smcrt = new CellRendererText();
        selmemberColumn.PackStart(smcrt, false);
        selmemberColumn.SetCellDataFunc(smcrt, new TreeCellDataFunc(
       UserCellTextDataFunc));
        selmemberColumn.Title = Util.GS("Selected Users");
        selmemberColumn.Resizable = true;
        SelTreeView.AppendColumn(selmemberColumn);
        SelTreeView.Selection.Mode = SelectionMode.Multiple;
        SelTreeView.Selection.Changed += new EventHandler(
       OnSelUserSelectionChanged);
        UserPixBuf =
     new Gdk.Pixbuf(Util.ImagesPath("ifolderuser.png"));
        this.AddButton(Stock.Cancel, ResponseType.Cancel);
        this.AddButton(Stock.Ok, ResponseType.Ok);
        this.AddButton(Stock.Help, ResponseType.Help);
        SearchiFolderUsers();
 }
Exemplo n.º 49
0
        private void Initialize()
        {
            DefaultResponse = Gtk.ResponseType.Ok;
            AddStockButton(Stock.Cancel, ResponseType.Cancel);
            AddStockButton(Stock.Ok, ResponseType.Ok, true);

            SetGeometryHints(this, new Gdk.Geometry()
            {
                MinWidth  = SizeRequest().Width,
                MaxWidth  = Gdk.Screen.Default.Width,
                MinHeight = -1,
                MaxHeight = -1
            }, Gdk.WindowHints.MaxSize | Gdk.WindowHints.MinSize);

            var table = new Table(2, 2, false)
            {
                RowSpacing    = 12,
                ColumnSpacing = 6
            };

            table.Attach(new Label()
            {
                Text         = Catalog.GetString("Station _Type:"),
                UseUnderline = true,
                Xalign       = 0.0f
            }, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);

            table.Attach(arg_label = new Label()
            {
                Xalign = 0.0f
            }, 0, 1, 1, 2, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);

            table.Attach(type_combo = ComboBox.NewText(),
                         1, 2, 0, 1, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Shrink, 0, 0);

            table.Attach(arg_entry = new Entry(),
                         1, 2, 1, 2, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Shrink, 0, 0);

            VBox.PackStart(table, true, true, 0);
            VBox.Spacing = 12;
            VBox.ShowAll();

            type_combo.RemoveText(0);
            int active_type = 0;
            int i           = 0;

            foreach (StationType type in StationType.Types)
            {
                if (!type.SubscribersOnly || lastfm.Account.Subscriber)
                {
                    type_combo.AppendText(type.Label);
                    if (source != null && type == source.Type)
                    {
                        active_type = i;
                    }
                    i++;
                }
            }

            type_combo.Changed += HandleTypeChanged;
            type_combo.Active   = active_type;
            type_combo.GrabFocus();
        }
Exemplo n.º 50
0
 private void SetupDialog()
 {
     this.Title = Util.GS("Export Encrypted Keys");
        this.Icon = new Gdk.Pixbuf(Util.ImagesPath("ifolder16.png"));
        this.HasSeparator = false;
        this.SetDefaultSize (450, 100);
        this.Modal = true;
        this.DefaultResponse = ResponseType.Ok;
        HBox imagebox = new HBox();
        imagebox.Spacing = 0;
        iFolderBanner = new Image(
      new Gdk.Pixbuf(Util.ImagesPath("ifolder-banner.png")));
        imagebox.PackStart(iFolderBanner, false, false, 0);
        ScaledPixbuf =
     new Gdk.Pixbuf(Util.ImagesPath("ifolder-banner-scaler.png"));
        iFolderScaledBanner = new Image(ScaledPixbuf);
        iFolderScaledBanner.ExposeEvent +=
      new ExposeEventHandler(OnBannerExposed);
        imagebox.PackStart(iFolderScaledBanner, true, true, 0);
        this.VBox.PackStart (imagebox, false, true, 0);
                 Table table = new Table(4, 3, false);
                 table.ColumnSpacing = 6;
                 table.RowSpacing = 6;
                 table.BorderWidth = 12;
                 Label l = new Label(Util.GS("iFolder account")+":");
                 table.Attach(l, 0,1, 0,1,
                         AttachOptions.Fill | AttachOptions.Expand, 0,0,0);
                 l.LineWrap = true;
        l.Xalign = 0.0F;
                 domainCombo = ComboBox.NewText();
        DomainController domainController = DomainController.GetDomainController();
        domains = domainController.GetDomains();
        for (int x = 0; x < domains.Length; x++)
        {
     domainCombo.AppendText(domains[x].Name);
        }
        if( domains.Length > 0)
     domainCombo.Active = 0;
                 table.Attach(domainCombo, 1,2,0,1, AttachOptions.Fill|AttachOptions.Expand, 0,0,0);
                 l = new Label(Util.GS("File path")+":");
        l.Xalign = 0.0F;
                 table.Attach(l, 0,1, 1,2,
                         AttachOptions.Fill, 0,0,0);
                 location = new Entry();
        this.location.Changed += new EventHandler(OnFieldsChanged);
                 table.Attach(location, 1,2, 1,2,
                         AttachOptions.Expand | AttachOptions.Fill, 0,0,0);
                 l.MnemonicWidget = location;
                 BrowseButton = new Button(Util.GS("_Browse"));
                 table.Attach(BrowseButton, 2,3, 1,2, AttachOptions.Fill, 0,0,0);
                 BrowseButton.Sensitive = true;
        BrowseButton.Clicked += new EventHandler(OnBrowseButtonClicked);
                 l = new Label(Util.GS("Recovery agent")+":");
        l.Xalign = 0.0F;
                 table.Attach(l, 0,1, 2,3,
                         AttachOptions.Fill | AttachOptions.Expand, 0,0,0);
        recoveryAgentCombo = new Entry();
        recoveryAgentCombo.Sensitive = false;
     table.Attach(recoveryAgentCombo, 1,2,2,3, AttachOptions.Fill|AttachOptions.Expand, 0,0,0);
     l = new Label(Util.GS("E-Mail ID")+":");
        l.Xalign = 0.0F;
                 table.Attach(l, 0,1, 3,4,
                         AttachOptions.Fill | AttachOptions.Expand, 0,0,0);
                 email = new Entry();
        email.Sensitive = false;
                 table.Attach(email, 1,2,3,4, AttachOptions.Fill|AttachOptions.Expand, 0,0,0);
        this.VBox.PackStart(table, false, false, 0);
        this.VBox.ShowAll();
        this.AddButton(Stock.Help, ResponseType.Help);
        this.AddButton(Stock.Cancel, ResponseType.Cancel);
        this.AddButton(Stock.Ok, ResponseType.Ok);
        this.SetResponseSensitive(ResponseType.Ok, false);
        this.DefaultResponse = ResponseType.Ok;
        domainCombo.Changed += new EventHandler(OnDomainChangedEvent);
        UpdateUI();
        DisplayRAName();
 }
Exemplo n.º 51
0
        /// <summary>
        /// Set up the widgets
        /// </summary>
        /// <returns>
        /// Widget to display
        /// </returns>
        private void InitializeWidgets()
        {
            this.Spacing     = Util.SectionSpacing;
            this.BorderWidth = Util.DefaultBorderWidth;

            //------------------------------
            // Application Settings
            //------------------------------
            // create a section box
            VBox appSectionBox = new VBox();

            appSectionBox.Spacing = Util.SectionTitleSpacing;
            this.PackStart(appSectionBox, false, true, 0);
            Label appSectionLabel = new Label("<span weight=\"bold\">" +
                                              Util.GS("Application") +
                                              "</span>");

            appSectionLabel.UseMarkup = true;
            appSectionLabel.Xalign    = 0;
            appSectionBox.PackStart(appSectionLabel, false, true, 0);

            // create a hbox to provide spacing
            HBox appSpacerBox = new HBox();

            appSectionBox.PackStart(appSpacerBox, false, true, 0);
            Label appSpaceLabel = new Label("    ");             // four spaces

            appSpacerBox.PackStart(appSpaceLabel, false, true, 0);

            // create a vbox to actually place the widgets in for section
            VBox appWidgetBox = new VBox();

            appSpacerBox.PackStart(appWidgetBox, false, true, 0);
            appWidgetBox.Spacing = Util.SectionTitleSpacing;


            ShowConfirmationButton =
                new CheckButton(Util.GS(
                                    "_Display confirmation dialog on successful creation of iFolder"));
            appWidgetBox.PackStart(ShowConfirmationButton, false, true, 0);
            ShowConfirmationButton.Toggled +=
                new EventHandler(OnShowConfButton);


/*			ShowNetworkstatusButton =
 *                              new CheckButton(Util.GS(
 *                                      "Show _Network Events  messages when iFolder is started"));
 *                      appWidgetBox.PackStart(ShowNetworkstatusButton, false, true, 0);
 *                      ShowNetworkstatusButton.Toggled +=
 *                                              new EventHandler(OnShowNetworkButton); */


            Label strtlabel = new Label("<span style=\"italic\">" + Util.GS("To start up iFolder at login, leave iFolder running when you log out and save your current setup.") + "</span>");

            strtlabel.UseMarkup = true;
            strtlabel.LineWrap  = true;
            appWidgetBox.PackStart(strtlabel, false, true, 0);

            HideMainWindowButton =
                new CheckButton(Util.GS("Hide ifolder _main window at startup"));
            appWidgetBox.PackStart(HideMainWindowButton, false, true, 0);
            HideMainWindowButton.Toggled +=
                new EventHandler(OnHideMainWindowButton);

            HideSyncLogButton =
                new CheckButton(Util.GS("Display synchronization _logs"));
            appWidgetBox.PackStart(HideSyncLogButton, false, true, 0);

            HideSyncLogButton.Toggled +=
                new EventHandler(OnHideSyncLogButton);


            //------------------------------
            // Notifications
            //------------------------------
            // create a section box
            VBox notifySectionBox = new VBox();

            notifySectionBox.Spacing = Util.SectionTitleSpacing;
            this.PackStart(notifySectionBox, true, true, 0);
            Label notifySectionLabel = new Label("<span weight=\"bold\">" +
                                                 Util.GS("Notification") +
                                                 "</span>");

            notifySectionLabel.UseMarkup = true;
            notifySectionLabel.Xalign    = 0;
            notifySectionBox.PackStart(notifySectionLabel, false, true, 0);

            // create a hbox to provide spacing
            HBox notifySpacerBox = new HBox();

            notifySectionBox.PackStart(notifySpacerBox, true, true, 0);
            Label notifySpaceLabel = new Label("    ");             // four spaces

            notifySpacerBox.PackStart(notifySpaceLabel, false, true, 0);

            // create a vbox to actually place the widgets in for section
            VBox notifyWidgetBox = new VBox();

            notifySpacerBox.PackStart(notifyWidgetBox, true, true, 0);
            notifyWidgetBox.Spacing = 5;

            VBox notificationPreferences = new NotificationPrefsBox(this.topLevelWindow);

            notifyWidgetBox.PackStart(notificationPreferences, true, true, 0);

            //------------------------------
            // Sync Settings
            //------------------------------
            // create a section box
            VBox syncSectionBox = new VBox();

            syncSectionBox.Spacing = Util.SectionTitleSpacing;
            this.PackStart(syncSectionBox, false, true, 0);
            Label syncSectionLabel = new Label("<span weight=\"bold\">" +
                                               Util.GS("Synchronization") +
                                               "</span>");

            syncSectionLabel.UseMarkup = true;
            syncSectionLabel.Xalign    = 0;
            syncSectionBox.PackStart(syncSectionLabel, false, true, 0);

            // create a hbox to provide spacing
            HBox syncSpacerBox = new HBox();

            syncSectionBox.PackStart(syncSpacerBox, false, true, 0);
            Label syncSpaceLabel = new Label("    ");             // four spaces

            syncSpacerBox.PackStart(syncSpaceLabel, false, true, 0);

            // create a vbox to actually place the widgets in for section
            VBox syncWidgetBox = new VBox();

            syncSpacerBox.PackStart(syncWidgetBox, false, true, 0);
            syncWidgetBox.Spacing = 10;

            HBox syncHBox0 = new HBox();

            syncWidgetBox.PackStart(syncHBox0, false, true, 0);
            syncHBox0.Spacing   = 10;
            AutoSyncCheckButton =
                new CheckButton(Util.GS("Automatically S_ynchronize iFolders"));
            syncHBox0.PackStart(AutoSyncCheckButton, false, false, 0);

            HBox syncHBox = new HBox();

            syncHBox.Spacing = 10;
            syncWidgetBox.PackStart(syncHBox, true, true, 0);

            Label spacerLabel = new Label("  ");

            syncHBox.PackStart(spacerLabel, true, true, 0);

            Label syncEveryLabel = new Label(Util.GS("Synchronize iFolders Every"));

            syncEveryLabel.Xalign = 1;
            syncHBox.PackStart(syncEveryLabel, false, false, 0);

            SyncSpinButton = new SpinButton(1, Int32.MaxValue, 1);

            syncHBox.PackStart(SyncSpinButton, false, false, 0);

            SyncUnitsComboBox = ComboBox.NewText();
            syncHBox.PackStart(SyncUnitsComboBox, false, false, 0);

            SyncUnitsComboBox.AppendText(Util.GS("seconds"));
            SyncUnitsComboBox.AppendText(Util.GS("minutes"));
            SyncUnitsComboBox.AppendText(Util.GS("hours"));
            SyncUnitsComboBox.AppendText(Util.GS("days"));

            SyncUnitsComboBox.Active = (int)SyncUnit.Minutes;
            currentSyncUnit          = SyncUnit.Minutes;
        }
Exemplo n.º 52
0
		public TaskOptionsDialog(Gtk.Window parent,
		                         Gtk.DialogFlags flags,
		                         Task task)
: base (Catalog.GetString ("Task Options"), parent, flags)
		{
			HasSeparator = false;
			//BorderWidth = 0;
			Resizable = false;
			//Decorated = false;
			this.SetDefaultSize (400, 300);
			this.task = task;

//   Frame frame = new Frame();
//   frame.Shadow = ShadowType.Out;
//   frame.Show();
//   VBox.PackStart (frame, true, true, 0);

			VBox vbox = new VBox (false, 6);
			vbox.BorderWidth = 6;
			vbox.Show ();
			VBox.PackStart (vbox, true, true, 0);
//   frame.Add (vbox);

			ActionArea.Layout = Gtk.ButtonBoxStyle.End;

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

//   Gtk.Label l = new Gtk.Label (
//     string.Format (
//      "<span weight=\"bold\">{0}</span>",
//      Catalog.GetString ("Task Options")));
//   l.UseMarkup = true;
//   l.Show ();
//   vbox.PackStart (l, false, false, 0);

			///
			/// Summary
			///
			Gtk.Label l = new Label (Catalog.GetString ("_Summary:"));
			l.Xalign = 0;
			l.Show ();
			vbox.PackStart (l, false, false, 0);

			summary_entry = new Gtk.Entry ();
			l.MnemonicWidget = summary_entry;
			summary_entry.Text = task.Summary;
			summary_entry.Show ();
			vbox.PackStart (summary_entry, false, false, 0);

			///
			/// Details
			///
			l = new Label (Catalog.GetString ("_Details:"));
			l.Xalign = 0;
			l.Show ();
			vbox.PackStart (l, false, false, 0);

			details_text_view = new TextView ();
			l.MnemonicWidget = details_text_view;
			details_text_view.WrapMode = WrapMode.Word;
			details_text_view.Show ();

			ScrolledWindow sw = new ScrolledWindow ();
			sw.ShadowType = Gtk.ShadowType.EtchedIn;
			sw.Add (details_text_view);
			sw.Show ();

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

			///
			/// Completion Checkbox
			///
			HBox hbox = new Gtk.HBox (false, 4);

			completed_check_button = new Gtk.CheckButton (
			        task.IsComplete ?
			        Catalog.GetString ("_Completed:") :
			        Catalog.GetString ("_Complete"));
			if (task.IsComplete)
				completed_check_button.Active = true;
			completed_check_button.UseUnderline = true;
			completed_check_button.Toggled += OnCompletedCheckButtonToggled;
			completed_check_button.Show ();
			hbox.PackStart (completed_check_button, false, false, 0);

			completed_label = new Gtk.Label (
			        task.IsComplete ?
			        GuiUtils.GetPrettyPrintDate (task.CompletionDate, true) :
			        string.Empty);
			completed_label.Xalign = 0;
			completed_label.Show ();
			hbox.PackStart (completed_label, true, true, 0);

			hbox.Show ();
			vbox.PackStart (hbox, false, false, 0);

			///
			/// Due Date
			///
			hbox = new HBox (false, 4);
			due_date_check_button = new CheckButton (Catalog.GetString ("Due Date:"));
			if (task.DueDate != DateTime.MinValue)
				due_date_check_button.Active = true;
			due_date_check_button.Toggled += OnDueDateCheckButtonToggled;
			due_date_check_button.Show ();
			hbox.PackStart (due_date_check_button, false, false, 0);

			due_date_button =
			        new Gtk.Extras.DateButton (task.DueDate, false);
			if (task.DueDate == DateTime.MinValue)
				due_date_button.Sensitive = false;
			due_date_button.Show ();
			hbox.PackStart (due_date_button, false, false, 0);

			// Spacer
			hbox.PackStart (new Gtk.Label (string.Empty), true, true, 0);

			hbox.Show ();
			vbox.PackStart (hbox, false, false, 0);

			///
			/// Priority
			///
			hbox = new HBox (false, 4);
			priority_check_button = new CheckButton (Catalog.GetString ("Priority:"));
			if (task.Priority != TaskPriority.Undefined)
				priority_check_button.Active = true;
			priority_check_button.Toggled += OnPriorityCheckButtonToggled;
			priority_check_button.Show ();
			hbox.PackStart (priority_check_button, false, false, 0);

			priority_combo_box = ComboBox.NewText ();
			priority_combo_box.AppendText (Catalog.GetString ("None"));
			priority_combo_box.AppendText (Catalog.GetString ("Low"));
			priority_combo_box.AppendText (Catalog.GetString ("Normal"));
			priority_combo_box.AppendText (Catalog.GetString ("High"));
			if (task.Priority == TaskPriority.Undefined)
				priority_combo_box.Sensitive = false;
			priority_combo_box.Active = (int) task.Priority;
			priority_combo_box.Changed += OnPriorityComboBoxChanged;
			priority_combo_box.Show ();
			hbox.PackStart (priority_combo_box, false, false, 0);

			// Spacer
			hbox.PackStart (new Gtk.Label (string.Empty), true, true, 0);
			hbox.Show ();
			vbox.PackStart (hbox, false, false, 0);

			AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, false);
			AddButton (Gtk.Stock.Save, Gtk.ResponseType.Ok, true);

//   if (parent != null)
//    TransientFor = parent;

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

//   if ((int) (flags & Gtk.DialogFlags.DestroyWithParent) != 0)
//    DestroyWithParent = true;
		}