Exemple #1
0
		public IndexInfo ()
		{
			HeaderIcon = Beagle.Util.WidgetFu.LoadThemeIcon ("dialog-information", 48);
			Header = Catalog.GetString ("Index Information");

			Gtk.Label description = new Gtk.Label ();
			description.Markup = Catalog.GetString ("Number of items currently indexed:");
			description.LineWrap = true;
			description.Justify = Justification.Left;
			description.SetAlignment (0.0f, 0.5f);

			Append (description, Gtk.AttachOptions.Fill, 0);

			label = new Gtk.Label ();
			label.LineWrap = true;
			label.SetAlignment (0.0f, 0.5f);
			label.Justify = Justification.Fill;
			
			Append (label, Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill, 0);

			note = new Gtk.Label ();
			note.Markup = Catalog.GetString ("<i>NOTE: The search service is still indexing new data.</i>");
			note.LineWrap = true;
			note.Justify = Justification.Fill;
			note.SetAlignment (0.0f, 0.5f);
			note.NoShowAll = true;
			
			Append (note, Gtk.AttachOptions.Fill, 0);
		}
Exemple #2
0
        public TextCell(
            string text,
            Gdk.Color textColor,
            string detail,
            Gdk.Color detailColor)
        {
            _root = new VBox();

            var span = new Span()
            {
                FontSize = 12,
                Text     = text ?? string.Empty
            };

            _textLabel = new Gtk.Label();
            _textLabel.SetAlignment(0, 0);
            _textLabel.ModifyFg(StateType.Normal, textColor);
            _textLabel.SetTextFromSpan(span);

            _root.PackStart(_textLabel, false, false, 0);

            _detailLabel = new Gtk.Label();
            _detailLabel.SetAlignment(0, 0);
            _detailLabel.ModifyFg(StateType.Normal, detailColor);
            _detailLabel.Text = detail ?? string.Empty;

            _root.PackStart(_detailLabel, true, true, 0);

            Add(_root);
        }
Exemple #3
0
        public EntryCell(
            string label,
            Gdk.Color labelColor,
            string text,
            string placeholder)
        {
            _root = new VBox();
            Add(_root);

            _textLabel = new Gtk.Label();
            _textLabel.SetAlignment(0, 0);
            _textLabel.Text = label ?? string.Empty;
            _textLabel.ModifyFg(StateType.Normal, labelColor);

            _root.PackStart(_textLabel, false, false, 0);

            _entryWrapper                    = new EntryWrapper();
            _entryWrapper.Sensitive          = true;
            _entryWrapper.Entry.Text         = text ?? string.Empty;
            _entryWrapper.PlaceholderText    = placeholder ?? string.Empty;
            _entryWrapper.Entry.Changed     += OnEntryChanged;
            _entryWrapper.Entry.EditingDone += OnEditingDone;

            _root.PackStart(_entryWrapper, false, false, 0);
        }
Exemple #4
0
		public DialogError(string message, Exception e, Window parent) : base("Error", parent, DialogFlags.Modal, Stock.Ok, ResponseType.Ok)
		{
			HBox hbox = new HBox();
			Image icon = new Image(Stock.DialogError,IconSize.Dialog);
			Label label = new Label(message);
			Expander exp = new Expander("Details");
			ScrolledWindow sw = new ScrolledWindow();
			TextView tview = new TextView();
			
			hbox.BorderWidth = 6;
			hbox.Spacing = 6;
			label.SetAlignment(0f, 0.5f);
			exp.BorderWidth = 6;
			tview.Buffer.Text = e.Message;
			tview.Buffer.Text += "\n";
			tview.Buffer.Text += e.StackTrace;
			
			sw.Add(tview);
			exp.Add(sw);
			hbox.PackStart(icon, false, false, 0);
			hbox.PackStart(label, true, true, 0);
			this.VBox.PackStart(hbox, false, false, 0);
			this.VBox.PackStart(exp, true, true, 0);
			this.ShowAll();
			
		}
        public EnableStartupNotesPreference()
        {
            IPropertyEditorBool enableStartupNotes_peditor;

            Gtk.CheckButton enableStartupNotesCheckbox;
            Gtk.Label       enableStartupNotesLabel;

            // Enable Startup Notes option
            enableStartupNotesLabel           = new Gtk.Label(Catalog.GetString("Enable startup notes"));
            enableStartupNotesLabel.UseMarkup = true;
            enableStartupNotesLabel.Justify   = Gtk.Justification.Left;
            enableStartupNotesLabel.SetAlignment(0.0f, 0.5f);
            enableStartupNotesLabel.Show();

            enableStartupNotesCheckbox = new Gtk.CheckButton();
            enableStartupNotesCheckbox.Add(enableStartupNotesLabel);
            enableStartupNotesCheckbox.Show();

            enableStartupNotes_peditor =
                Services.Factory.CreatePropertyEditorToggleButton(Preferences.ENABLE_STARTUP_NOTES, enableStartupNotesCheckbox);
            Preferences.Get(enableStartupNotes_peditor.Key);
            enableStartupNotes_peditor.Setup();

            align = new Gtk.Alignment(0.0f, 0.0f, 0.0f, 1.0f);
            align.Show();
            align.Add(enableStartupNotesCheckbox);
        }
		public NotificationMessage (string t, string m) : base (false, 5)
		{
			this.Style = style;

			BorderWidth = 5;

			icon = new Image (Stock.DialogInfo, IconSize.Dialog);
			this.PackStart (icon, false, true, 5);

			VBox vbox = new VBox (false, 5);
			this.PackStart (vbox, true, true, 0);

			title = new Label ();
			title.SetAlignment (0.0f, 0.5f);
			this.Title = t;
			vbox.PackStart (title, false, true, 0);

			message = new Label ();
			message.LineWrap = true;
			message.SetSizeRequest (500, -1); // ugh, no way to sanely reflow a gtk label
			message.SetAlignment (0.0f, 0.0f);
			this.Message = m;			
			vbox.PackStart (message, true, true, 0);

			action_box = new HBox (false, 3);

			Button hide_button = new Button (Catalog.GetString ("Hide"));
			hide_button.Clicked += OnHideClicked;
			action_box.PackEnd (hide_button, false, true, 0);

			Alignment action_align = new Alignment (1.0f, 0.5f, 0.0f, 0.0f);
			action_align.Add (action_box);
			vbox.PackStart (action_align, false, true, 0);
		}
        public SdStatusBar(IStatusBarService manager)
        {
            Spacing = 3;
            BorderWidth = 1;

            progress = new ProgressBar ();
            this.PackStart (progress, false, false, 0);

            this.PackStart (txtStatusBarPanel, true, true, 0);
            statusBox = new HBox ();
            statusLabel = new Label ();
            statusLabel.SetAlignment (0, 0.5f);
            statusLabel.Wrap = false;
            statusBox.PackEnd (statusLabel, true, true, 0);
            txtStatusBarPanel.Add (statusBox);

            this.PackStart (cursorStatusBarPanel, false, false, 0);
            cursorLabel = new Label ("  ");
            cursorStatusBarPanel.Add (cursorLabel);

            this.PackStart (modeStatusBarPanel, false, false, 0);
            modeLabel = new Label ("  ");
            modeStatusBarPanel.Add (modeLabel);

            this.PackStart (iconsStatusBarPanel, false, false, 0);
            txtStatusBarPanel.ShowAll ();

            Progress.Hide ();
            Progress.PulseStep = 0.3;
        }
Exemple #8
0
        public IndexInfo()
        {
            HeaderIcon = Beagle.Util.WidgetFu.LoadThemeIcon("dialog-information", 48);
            Header     = Catalog.GetString("Index Information");

            Gtk.Label description = new Gtk.Label();
            description.Markup   = Catalog.GetString("Number of items currently indexed:");
            description.LineWrap = true;
            description.Justify  = Justification.Left;
            description.SetAlignment(0.0f, 0.5f);

            Append(description, Gtk.AttachOptions.Fill, 0);

            label          = new Gtk.Label();
            label.LineWrap = true;
            label.SetAlignment(0.0f, 0.5f);
            label.Justify = Justification.Fill;

            Append(label, Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill, 0);

            note          = new Gtk.Label();
            note.Markup   = Catalog.GetString("<i>NOTE: The search service is still indexing new data.</i>");
            note.LineWrap = true;
            note.Justify  = Justification.Fill;
            note.SetAlignment(0.0f, 0.5f);
            note.NoShowAll = true;

            Append(note, Gtk.AttachOptions.Fill, 0);
        }
		public EnableStartupNotesPreference ()
		{
			IPropertyEditorBool enableStartupNotes_peditor;
			Gtk.CheckButton enableStartupNotesCheckbox;
			Gtk.Label enableStartupNotesLabel;

			// Enable Startup Notes option
			enableStartupNotesLabel = new Gtk.Label (Catalog.GetString ("Enable startup notes"));
			enableStartupNotesLabel.UseMarkup = true;
			enableStartupNotesLabel.Justify = Gtk.Justification.Left;
			enableStartupNotesLabel.SetAlignment (0.0f, 0.5f);
			enableStartupNotesLabel.Show ();

			enableStartupNotesCheckbox = new Gtk.CheckButton ();
			enableStartupNotesCheckbox.Add (enableStartupNotesLabel);
			enableStartupNotesCheckbox.Show ();

			enableStartupNotes_peditor =
				Services.Factory.CreatePropertyEditorToggleButton (Preferences.ENABLE_STARTUP_NOTES, enableStartupNotesCheckbox);
			Preferences.Get (enableStartupNotes_peditor.Key);
			enableStartupNotes_peditor.Setup ();

			align = new Gtk.Alignment (0.0f, 0.0f, 0.0f, 1.0f);
			align.Show ();
			align.Add (enableStartupNotesCheckbox);
		}
Exemple #10
0
		public FormOrder() : base(4,2, false)
		{
			labelid = new Label("Id :");
			labelid.SetAlignment(0, (float)0.5);
			labelcust = new Label("Customer :");
			labelcust.SetAlignment(0, (float)0.5);
			labelpay = new Label("Payment :");
			labelpay.SetAlignment(0, (float)0.5);
			labeltax = new Label("Tax :");
			labeltax.SetAlignment(0, (float)0.5);
			
			entryid = new Entry();
			entryid.Sensitive = false;
			
			combocust = new ComboBoxCustomers();
			combopay = new ComboBoxPayments();
			combopay.NoneRow = true;
			combotax = new ComboBoxTaxes();
			combotax.NoneRow = true;
			
			this.ColumnSpacing = 6;
			Attach(labelid, 0, 1, 0, 1);
			Attach(labelcust, 0, 1, 1, 2);
			Attach(labelpay, 0, 1, 2, 3);
			Attach(labeltax, 0, 1, 3, 4);

			Attach(entryid, 1, 2, 0, 1);
			Attach(combocust, 1, 2, 1, 2);
			Attach(combopay, 1, 2, 2, 3);
			Attach(combotax, 1, 2, 3, 4);
			
			this.ShowAll();
		}
Exemple #11
0
        public override bool GetPreferenceTabWidget(PreferencesDialog parent,
                                                    out string tabLabel,
                                                    out Gtk.Widget preferenceWidget)
        {
            Gtk.Label      label;
            Gtk.SpinButton menuNoteCountSpinner;
            Gtk.Alignment  align;
            int            menuNoteCount;

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

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

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

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


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

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

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

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

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

            menuNoteCountSpinner.ValueChanged += UpdateMenuNoteCountPreference;

            if (opts_list != null)
            {
                preferenceWidget = opts_list;
                return(true);
            }
            else
            {
                preferenceWidget = null;
                return(false);
            }
        }
Exemple #12
0
 public MainWindow()
     : base("Katahdin Debugger")
 {
     SetDefaultSize(500, 400);
     
     try
     {
         PathResolver pathResolver = new PathResolver();
         SetIconFromFile(pathResolver.Resolve("katahdin.svg"));
     }
     catch
     {
     }
     
     Destroyed += delegate
     {
         if (runtimeThread != null)
             runtimeThread.Shutdown();
     };
     
     VBox vertical = new VBox();
     Add(vertical);
     
     MenuBuilder menuBuilder = new MenuBuilder();
     
     MenuBar menuBar = menuBuilder.StartMenuBar();
     vertical.PackStart(menuBar, false, false, 0);
     
     menuBuilder.StartMenu("Debug");
     debugRun = menuBuilder.Add("Run", OnDebugRun);
     menuBuilder.End();
     
     menuBuilder.StartMenu("View");
     viewGrammar = menuBuilder.AddCheck("Grammar", OnViewGrammarToggled);
     viewParseTrace = menuBuilder.AddCheck("Parse Trace", OnViewParseTraceToggled);
     viewParseTree = menuBuilder.AddCheck("Parse Tree", OnViewParseTreeToggled);
     menuBuilder.Separate();
     menuBuilder.Add("View runtime object", OnViewRuntimeModule);
     menuBuilder.End();
     
     menuBuilder.End();
     
     console = new ConsoleWidget();
     vertical.PackStart(console, true, true, 0);
     
     vertical.PackStart(new HSeparator(), false, false, 0);
     
     HBox statusBar = new HBox();
     vertical.PackStart(statusBar, false, false, 1);
     
     progress = new ProgressBar();
     statusBar.PackStart(progress, false, false, 1);
     
     statusLabel = new Label();
     statusLabel.SetAlignment(0, (float) 0.5);
     statusLabel.LineWrap = true;
     statusBar.PackStart(statusLabel, true, true, 0);
 }
Exemple #13
0
        public PreferencesDialog(Settings set, Window parent,
				 string argsOver)
        {
            settings = set;
            argsOverride = argsOver;

            dialog = new Dialog("Preferences", parent,
            DialogFlags.Modal | DialogFlags.DestroyWithParent,
            new object[]{Gtk.Stock.Close, -1});

            var table = new Table(4, 3, false);

            sUseBundledDebugger = new CheckButton("Use bundled MSPDebug");
            sUseBundledDebugger.Clicked += OnBundledState;
            table.Attach(sUseBundledDebugger, 0, 3, 0, 1,
             AttachOptions.Expand | AttachOptions.Fill,
             0, 4, 4);

            Label lbl;

            lbl = new Label("MSPDebug path:");
            lbl.SetAlignment(0.0f, 0.5f);
            table.Attach(lbl, 0, 1, 1, 2, AttachOptions.Fill, 0, 4, 4);
            sMSPDebugPath = new Entry();
            table.Attach(sMSPDebugPath, 1, 2, 1, 2,
             AttachOptions.Expand | AttachOptions.Fill,
             0, 4, 4);
            chooseMSPDebug = new Button("Choose...");
            chooseMSPDebug.Clicked += OnChoose;
            table.Attach(chooseMSPDebug, 2, 3, 1, 2,
             AttachOptions.Fill, 0, 4, 4);

            lbl = new Label("MSPDebug arguments:");
            lbl.SetAlignment(0.0f, 0.5f);
            table.Attach(lbl, 0, 1, 2, 3, AttachOptions.Fill, 0, 4, 4);
            sMSPDebugArgs = new Entry();
            sMSPDebugArgs.Sensitive = (argsOverride == null);
            table.Attach(sMSPDebugArgs, 1, 3, 2, 3,
             AttachOptions.Expand | AttachOptions.Fill,
             0, 4, 4);

            lbl = new Label("Console font:");
            lbl.SetAlignment(0.0f, 0.5f);
            table.Attach(lbl, 0, 1, 3, 4, AttachOptions.Fill, 0, 4, 4);
            sConsoleFont = new FontButton();
            table.Attach(sConsoleFont, 1, 3, 3, 4,
             AttachOptions.Expand | AttachOptions.Fill,
             0, 4, 4);

            table.ShowAll();
            ((Container)dialog.Child).Add(table);

            chooseDialog = new FileChooserDialog("Choose MSPDebug binary",
            dialog, FileChooserAction.Open,
            new object[]{Stock.Cancel, ResponseType.Cancel,
                 Stock.Ok, ResponseType.Ok});
            chooseDialog.DefaultResponse = ResponseType.Ok;
        }
Exemple #14
0
 public void AddSubcatHeading(ControlSubcategory Subcat)
 {
     Label Heading = new Label(string.Format("<b>{0}</b>", Subcat.Name));
     Heading.UseMarkup = true;
     Heading.SetAlignment(0, 0.5f);
     Attach(Heading, 0, 2, CurrentRow, CurrentRow+1, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);
     CurrentRow++;
     HasHeading = true;
 }
		public override bool GetPreferenceTabWidget (	PreferencesDialog parent,
								out string tabLabel,
								out Gtk.Widget preferenceWidget)
		{
			
			Gtk.Label label;
			Gtk.SpinButton menuNoteCountSpinner;
			Gtk.Alignment align;
			int menuNoteCount;

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

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


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

			label.UseMarkup = true;
			label.Justify = Gtk.Justification.Left;
			label.SetAlignment (0.0f, 0.5f);
			label.Show ();
			
			table.Attach (label, 0, 1, 0, 1);
		
			menuNoteCount = (int) Preferences.Get (Preferences.MENU_NOTE_COUNT);
			// we have a hard limit of 18 set, thus not allowing anything bigger than 18
			menuNoteCountSpinner = new Gtk.SpinButton (1, 18, 1);
			menuNoteCountSpinner.Value = menuNoteCount <= 18 ? menuNoteCount : 18;
			
			menuNoteCountSpinner.Show ();
			table.Attach (menuNoteCountSpinner, 1, 2, 0, 1);
			
			menuNoteCountSpinner.ValueChanged += UpdateMenuNoteCountPreference;
			
			if (opts_list != null) {
				preferenceWidget = opts_list;
				return true;
			} else {
				preferenceWidget = null;
				return false;
			}
		}
		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);
			
		}
Exemple #17
0
/*
 *              private Widget MakeSipPreferences ()
 *              {
 *                      PropertyEditor peditor;
 *
 *                      VBox vbox = new VBox (false, 4);
 *
 *                      Label label = MakeLabel (
 *                                      string.Format (
 *                                              "<span size=\"larger\" weight=\"bold\">{0}</span>",
 *                                              Catalog.GetString ("SIP Account Settings")));
 *                      label.Xalign = 0;
 *                      vbox.PackStart (label, false, false, 0);
 *                      label = MakeLabel (
 *                                      string.Format (
 *                                              "<span size=\"smaller\">{0}</span>",
 *                                              Catalog.GetString (
 *                                                      "In this alpha-phase of the project, we only support " +
 *                                                      "one SIP account.")));
 *                      label.Xalign = 0;
 *                      label.Wrap = true;
 *                      vbox.PackStart (label, false, true, 0);
 *
 *                      Table table = new Table (3, 2, false);
 *                      table.BorderWidth = 8;
 *                      table.RowSpacing = 4;
 *                      table.ColumnSpacing = 8;
 *                      vbox.PackStart (table, true, true, 0);
 *
 *                      // Server address
 *                      label = MakeLabel (Catalog.GetString ("Server Address:"));
 *                      label.Xalign = 1;
 *                      label.Yalign = 0;
 *                      table.Attach (label, 0, 1, 0, 1, AttachOptions.Fill, 0, 0, 0);
 *
 *                      sipServerAddressEntry = new Entry ();
 *                      label.MnemonicWidget = sipServerAddressEntry;
 *                      sipServerAddressEntry.Show ();
 *                      peditor = new PropertyEditorEntry (
 *                                      Preferences.SipServer, sipServerAddressEntry);
 *                      SetupPropertyEditor (peditor);
 *                      table.Attach (sipServerAddressEntry, 1, 2, 0, 1, AttachOptions.Expand | AttachOptions.Fill, 0, 0, 0);
 *
 *                      // Username
 *                      label = MakeLabel (Catalog.GetString ("Username:"******"Password:"));
 *                      label.Xalign = 1;
 *                      label.Yalign = 0;
 *                      table.Attach (label, 0, 1, 2, 3, AttachOptions.Fill, 0, 0, 0);
 *
 *                      sipPasswordEntry = new Entry ();
 *                      label.MnemonicWidget = passwordEntry;
 *                      sipPasswordEntry.Visibility = false; // password field
 *                      sipPasswordEntry.Show ();
 *                      table.Attach (sipPasswordEntry, 1, 2, 2, 3, AttachOptions.Expand | AttachOptions.Fill, 0, 0, 0);
 *
 *                      vbox.Show ();
 *
 *                      return vbox;
 *              }
 */
        Label MakeLabel(string label_text)
        {
            Gtk.Label label = new Gtk.Label(label_text);
            label.UseMarkup    = true;
            label.UseUnderline = true;
            label.Justify      = Gtk.Justification.Left;
            label.SetAlignment(0.0f, 0.5f);
            label.Show();

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

            align = new Gtk.Alignment(0.0f, 0.0f, 0.0f, 1.0f);
            align.Show();
            align.Add(table);
        }
Exemple #20
0
	    public GiverMenuItem(ServiceInfo serviceInfo) : base(false)
	    {
			this.serviceInfo = serviceInfo;

	        HBox hbox = new HBox(false, 10);
			Gtk.Image image;			
			if(serviceInfo.Photo != null)
				image = new Gtk.Image(serviceInfo.Photo);
			else
			 	image = new Gtk.Image(Utilities.GetIcon("giver-48", 48));
			hbox.PackStart(image, false, false, 0);
			VBox vbox = new VBox();
			hbox.PackStart(vbox, false, false, 0);
			Label label = new Label();
			label.Justify = Gtk.Justification.Left;
            label.SetAlignment (0.0f, 0.5f);
			label.LineWrap = false;
			label.UseMarkup = true;
			label.UseUnderline = false;
			label.Markup = string.Format ("<span weight=\"bold\" size=\"large\">{0}</span>",
                    						serviceInfo.UserName);
			vbox.PackStart(label, true, true, 0);

			label = new Label();
			label.Justify = Gtk.Justification.Left;
            label.SetAlignment (0.0f, 0.5f);
			label.LineWrap = false;
			label.UseMarkup = true;
			label.UseUnderline = false;
			label.Markup = string.Format ("<span size=\"small\">{0}</span>",
                    						serviceInfo.MachineName);

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

			label = new Label();
			label.Justify = Gtk.Justification.Left;
            label.SetAlignment (0.0f, 0.5f);
			label.LineWrap = false;
			label.UseMarkup = true;
			label.UseUnderline = false;
			label.Markup = string.Format ("<span style=\"italic\" size=\"small\">{0}:{1}</span>",
                    						serviceInfo.Address, serviceInfo.Port);

			vbox.PackStart(label, true, true, 0);
	        hbox.ShowAll();
	        Add(hbox);
	    }
Exemple #21
0
		public Base ()
		{
			table = new Gtk.Table (1, 2, false);
			table.RowSpacing = 12;
			table.ColumnSpacing = 12;

			header_icon = new Gtk.Image ();
			table.Attach (header_icon, 0, 1, 0, 1, Gtk.AttachOptions.Fill, Gtk.AttachOptions.Fill, 0, 5);

			header_label = new Gtk.Label ();
			header_label.SetAlignment (0.0f, 0.5f);
			table.Attach (header_label, 1, 2, 0, 1, Gtk.AttachOptions.Fill | Gtk.AttachOptions.Expand, 0, 0, 5);

			table.ShowAll ();			

			Add (table);
		}
Exemple #22
0
		public void Append (string tip)
		{
			uint row = table.NRows;

			Gtk.Image image = new Gtk.Image (arrow);
			image.Show ();
			table.Attach (image, 0, 1, row, row + 1, Gtk.AttachOptions.Fill, Gtk.AttachOptions.Fill, 0, 0);

			Gtk.Label label = new Gtk.Label ();
			label.Markup = tip;
			label.LineWrap = true;
			label.Justify = Justification.Fill;
			label.SetAlignment (0.0f, 0.5f);
			label.ModifyFg (Gtk.StateType.Normal, label.Style.Foreground (Gtk.StateType.Insensitive));
			label.Show ();
			table.Attach (label, 1, 2, row, row + 1, Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill, 0, 0, 0);
		}
Exemple #23
0
        public void Append(string tip)
        {
            uint row = table.NRows;

            Gtk.Image image = new Gtk.Image(arrow);
            image.Show();
            table.Attach(image, 0, 1, row, row + 1, Gtk.AttachOptions.Fill, Gtk.AttachOptions.Fill, 0, 0);

            Gtk.Label label = new Gtk.Label();
            label.Markup   = tip;
            label.LineWrap = true;
            label.Justify  = Justification.Fill;
            label.SetAlignment(0.0f, 0.5f);
            label.ModifyFg(Gtk.StateType.Normal, label.Style.Foreground(Gtk.StateType.Insensitive));
            label.Show();
            table.Attach(label, 1, 2, row, row + 1, Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill, 0, 0, 0);
        }
Exemple #24
0
        public Base()
        {
            table               = new Gtk.Table(1, 2, false);
            table.RowSpacing    = 12;
            table.ColumnSpacing = 12;

            header_icon = new Gtk.Image();
            table.Attach(header_icon, 0, 1, 0, 1, Gtk.AttachOptions.Fill, Gtk.AttachOptions.Fill, 0, 5);

            header_label = new Gtk.Label();
            header_label.SetAlignment(0.0f, 0.5f);
            table.Attach(header_label, 1, 2, 0, 1, Gtk.AttachOptions.Fill | Gtk.AttachOptions.Expand, 0, 0, 5);

            table.ShowAll();

            Add(table);
        }
        public void AddWidget(KeyAction action, string desc, HotKey key, int position)
        {
            uint row_top, row_bottom, col_left, col_right;
            HBox box;
            Label descLabel, keyLabel;
            Button edit;
            Gtk.Image editImage;

            box = new HBox ();
            box.Spacing = 5;
            descLabel = new Label ();
            descLabel.Markup = String.Format ("<b>{0}</b>", desc);
            keyLabel = new Label ();
            keyLabel.Markup = GLib.Markup.EscapeText (key.ToString());
            edit = new Button ();
            editImage = new Gtk.Image (LongoMatch.Gui.Helpers.Misc.LoadIcon ("longomatch-pencil", 24));
            edit.Add (editImage);
            box.PackStart (descLabel, true, true, 0);
            box.PackStart (keyLabel, false, true, 0);
            box.PackStart (edit, false, true, 0);
            box.ShowAll ();

            sgroup.AddWidget (keyLabel);
            descLabel.Justify = Justification.Left;
            descLabel.SetAlignment (0f, 0.5f);
            edit.Clicked += (sender, e) => {
                HotKey hotkey = Config.GUIToolkit.SelectHotkey (key);
                if (hotkey != null) {
                    if (Config.Hotkeys.ActionsHotkeys.ContainsValue (hotkey)) {
                        Config.GUIToolkit.ErrorMessage (Catalog.GetString ("Hotkey already in use: ") +
                                                        GLib.Markup.EscapeText (hotkey.ToString()), this);
                    } else {
                        Config.Hotkeys.ActionsHotkeys[action] = hotkey;
                        Config.Save ();
                        keyLabel.Markup = GLib.Markup.EscapeText (hotkey.ToString());
                    }
                }
            };

            row_top = (uint)(position / table.NColumns);
            row_bottom = (uint)row_top + 1;
            col_left = (uint)position % table.NColumns;
            col_right = (uint)col_left + 1;
            table.Attach (box, col_left, col_right, row_top, row_bottom);
        }
        public void add_toolbar(string name, Toolbar toolbar)
        {
            Gtk.Label label = new Label(name);
            label.SetSizeRequest((int)Sugar.Style.TOOLBOX_TAB_LABEL_WIDTH, -1);
            label.SetAlignment(0.0f, 0.5f);

            Gtk.HBox toolbar_box = new HBox();
            toolbar_box.PackStart(toolbar,true, true, Sugar.Style.TOOLBOX_HORIZONTAL_PADDING);

            toolbar_box.ExposeEvent += _toolbar_box_expose_cb;
            _notebook.AppendPage(toolbar_box, label);
            toolbar_box.Show();

            if (_notebook.NPages>1) {
                _notebook.ShowTabs=true;
            //				_separator.Show();
            }
        }
Exemple #27
0
	private void SetStatus(string status) {
		if (status == null && label != null) {
			Remove(label);
			label = null;
		} else if (status != null) {
			if (image != null) {
				Remove(image);
				image = null;
			}
			if (label == null) {
				label = new Label();
				label.SetAlignment(0.5f, 0.5f);
				label.Wrap = true;
				label.Show();
				Add(label);
			}
			label.Text = status;
		}
	}
Exemple #28
0
        public ScrolledTextView()
        {
            _table = new Table(1, 1, true);

            TextView = new TextView
            {
                AcceptsTab = false,
                WrapMode   = WrapMode.WordChar
            };

            TextView.Buffer.InsertText += InsertText;
            TextView.FocusOutEvent     += FocusedOut;

            _scrolledWindow = new ScrolledWindow
            {
                ShadowType       = ShadowType.In,
                HscrollbarPolicy = PolicyType.Never,
                VscrollbarPolicy = PolicyType.Automatic
            };

            _scrolledWindow.Add(TextView);

            _placeholder = new Gtk.Label();
            _placeholder.SetAlignment(0, 0);

            _placeholderContainer = new EventBox
            {
                BorderWidth = 2
            };

            _placeholderContainer.Add(_placeholder);

            _placeholderContainer.ButtonPressEvent += PlaceHolderContainerPressed;

            SetBackgroundColor(TextView.Style.BaseColors[(int)StateType.Normal]);

            Add(_table);

            _table.Attach(_placeholderContainer, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Fill, 0, 0);
            _table.Attach(_scrolledWindow, 0, 1, 0, 1);
        }
Exemple #29
0
        public Window CreateTooltipWindow(TextEditor editor, int offset, Gdk.ModifierType modifierState, TooltipItem item)
        {
            //create a message string from all the results
            var results = item.Item as AbstractTooltipContent[];

            var win = new DToolTipWindow();

            // Set white background
            win.ModifyBg(StateType.Normal,new Gdk.Color(0xff,0xff,0xff));

            var pack = new Gtk.VBox();

            foreach (var r in results)
            {
                var titleLabel = new Label(r.Title);

                // Make left-bound
                titleLabel.SetAlignment(0, 0);

                // Set bold font
                titleLabel.ModifyFont(new Pango.FontDescription() {Weight=Weight.Bold, AbsoluteSize=12*(int)Pango.Scale.PangoScale});

                pack.Add(titleLabel);

                if (!string.IsNullOrEmpty( r.Description))
                {
                    const int maximumDescriptionLength = 300;
                    var descLabel = new Label(r.Description.Length>maximumDescriptionLength ? (r.Description.Substring(0,maximumDescriptionLength)+"...") : r.Description);

                    descLabel.ModifyFont(new Pango.FontDescription() { AbsoluteSize = 10 * (int)Pango.Scale.PangoScale });
                    descLabel.SetAlignment(0, 0);

                    pack.Add(descLabel);
                }
            }

            win.Add(pack);

            return win;
        }
Exemple #30
0
        public void AddWidget(Control Cont, Widget Add)
        {
            Label Marker = new Label(Cont.Label);
            Marker.SetAlignment(0, 0.5f);
            uint Indent = HasHeading ? 20u : 0u;
            
            if(Cont.Width != 0)
                Add.WidthRequest = Cont.Width;
            if(Cont.Height != 0)
                Add.HeightRequest = Cont.Height;

            if(Cont.SubType != ControlType.Check && Cont.SubType != ControlType.Toggle)
            {
                Attach(Marker, 0, 1, CurrentRow, CurrentRow+1, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, Indent, 0);
                Attach(Add, 1, 2, CurrentRow, CurrentRow+1, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 0, 0);
            }
            else
            {
                Attach(Add, 0, 2, CurrentRow, CurrentRow+1, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, Indent, 0);
            }
            CurrentRow++;
        }
Exemple #31
0
        public ImageCell(
            Gdk.Pixbuf image,
            string text,
            Gdk.Color textColor,
            string detail,
            Gdk.Color detailColor)
        {
            _root = new HBox();
            Add(_root);

            _imageControl        = new Gtk.Image();
            _imageControl.Pixbuf = image;

            _root.PackStart(_imageControl, false, false, 0);

            _vertical = new VBox();

            var span = new Span()
            {
                FontSize = 12,
                Text     = text ?? string.Empty
            };

            _textLabel = new Gtk.Label();
            _textLabel.SetAlignment(0, 0);
            _textLabel.ModifyFg(StateType.Normal, textColor);
            _textLabel.SetTextFromSpan(span);

            _vertical.PackStart(_textLabel, false, false, 0);

            _detailLabel = new Gtk.Label();
            _detailLabel.SetAlignment(0, 0);
            _detailLabel.ModifyFg(StateType.Normal, detailColor);
            _detailLabel.Text = detail ?? string.Empty;

            _vertical.PackStart(_detailLabel, true, true, 0);

            _root.PackStart(_vertical, false, false, 0);
        }
Exemple #32
0
        public MessagePane()
        {
            HasWindow = true;

            table = new Gtk.Table (1, 2, false);
            table.RowSpacing = table.ColumnSpacing = 12;

            headerIcon = new Gtk.Image ();
            headerIcon.Yalign = 0.0f;
            table.Attach (headerIcon, 0, 1, 0, 1,
                      0, Gtk.AttachOptions.Fill,
                      0, 0);

            header = new Gtk.Label ();
            header.SetAlignment (0.0f, 0.5f);
            table.Attach (header, 1, 2, 0, 1,
                      Gtk.AttachOptions.Expand | Gtk.AttachOptions.Fill,
                      Gtk.AttachOptions.Fill,
                      0, 0);

            table.ShowAll ();
            Add (table);
        }
Exemple #33
0
        public SwitchCell(
            string text,
            bool on)
        {
            _root = new HBox();
            Add(_root);

            _labelBox = new HBox(false, 0);
            _root.PackStart(_labelBox, true, true, 0);

            _textLabel = new Gtk.Label();
            _textLabel.SetAlignment(0, 0);
            _textLabel.Text = text ?? string.Empty;

            _labelBox.PackStart(_textLabel, false, true, 0);

            _checkButton = new CheckButton();
            _checkButton.SetAlignment(0, 0);
            _checkButton.Active   = on;
            _checkButton.Toggled += OnCheckButtonToggled;

            _root.PackStart(_checkButton, false, false, 0);
        }
        public NotificationMessage(string t, string m) : base(false, 5)
        {
            this.Style = style;

            BorderWidth = 5;

            icon = new Image(Stock.DialogInfo, IconSize.Dialog);
            this.PackStart(icon, false, true, 5);

            VBox vbox = new VBox(false, 5);

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

            title = new Label();
            title.SetAlignment(0.0f, 0.5f);
            this.Title = t;
            vbox.PackStart(title, false, true, 0);

            message          = new Label();
            message.LineWrap = true;
            message.SetSizeRequest(500, -1);              // ugh, no way to sanely reflow a gtk label
            message.SetAlignment(0.0f, 0.0f);
            this.Message = m;
            vbox.PackStart(message, true, true, 0);

            action_box = new HBox(false, 3);

            Button hide_button = new Button(Catalog.GetString("Hide"));

            hide_button.Clicked += OnHideClicked;
            action_box.PackEnd(hide_button, false, true, 0);

            Alignment action_align = new Alignment(1.0f, 0.5f, 0.0f, 0.0f);

            action_align.Add(action_box);
            vbox.PackStart(action_align, false, true, 0);
        }
Exemple #35
0
		public FormOrderDetail() : base(3, 2, false)
		{
			
			
			Label labeltax;
			labeltax = new Label("Tax :");
			labeltax.SetAlignment(0, 0.5f);
			
			Label labelprice;
			labelprice = new Label("Price :");
			labelprice.SetAlignment(0, 0.5f);
			
			Label labelquant;
			labelquant = new Label("Quantity :");
			labelquant.SetAlignment(0, 0.5f);
			
			combotax = new ComboBoxTaxes();
			
			spinprice = new SpinButton(0.0f, (double)System.Decimal.MaxValue, 0.01f);
			spinprice.Digits = 2;
			
			spinquant = new SpinButton(0.0f, (double)System.Int64.MaxValue, 1.0f);
			spinquant.Digits = 0;
			
			this.BorderWidth = 6;
			this.ColumnSpacing = 6;
			
			this.Attach(labeltax, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Fill, 0, 0);
			this.Attach(labelprice, 0, 1, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 0, 0);
			this.Attach(labelquant, 0, 1, 2, 3, AttachOptions.Fill, AttachOptions.Fill, 0, 0);
			this.Attach(combotax, 1, 2, 0, 1, AttachOptions.Expand|AttachOptions.Fill, AttachOptions.Expand|AttachOptions.Fill, 0, 0);
			this.Attach(spinprice, 1, 2, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 0, 0);
			this.Attach(spinquant, 1, 2, 2, 3, AttachOptions.Fill, AttachOptions.Fill, 0, 0);
			
			this.ShowAll();
		}
Exemple #36
0
    private void CreatePropertyWidgets(string title, object NewObject)
    {
        //NOTE: we need to remove all the old widgets before we empty the widget and field tables, because the
        //      focus out event handlers which may be called during this step need them.
        Foreach(Remove);

        Gtk.VBox box = new Gtk.VBox();

        titleLabel        = new Gtk.Label();
        titleLabel.Xalign = 0;
        titleLabel.Xpad   = 12;
        titleLabel.Ypad   = 6;
        titleLabel.Markup = "<b>" + title + "</b>";
        box.PackStart(titleLabel, true, false, 0);

        Type type = NewObject.GetType();

        // Dispose all former custom editor widgets
        foreach (IDisposable disposable in customWidgets)
        {
            disposable.Dispose();
        }

        // Unregister our event handler from self-managed fields
        foreach (FieldOrProperty field in fieldTable)
        {
            field.Changed -= OnFieldChanged;
        }

        widgetTable.Clear();
        fieldTable.Clear();
        editWidgets.Clear();
        customWidgets.Clear();

        // iterate over all fields and properties
        foreach (FieldOrProperty field in FieldOrProperty.GetFieldsAndProperties(type))
        {
            CustomSettingsWidgetAttribute customSettings = (CustomSettingsWidgetAttribute)
                                                           field.GetCustomAttribute(typeof(CustomSettingsWidgetAttribute));
            if (customSettings != null)
            {
                Type customType = customSettings.Type;
                ICustomSettingsWidget customWidget = (ICustomSettingsWidget)CreateObject(customType);
                customWidgets.Add(customWidget);
                editWidgets.Add(customWidget.Create(this, NewObject, field));
                continue;
            }

            LispChildAttribute ChildAttrib = (LispChildAttribute)
                                             field.GetCustomAttribute(typeof(LispChildAttribute));
            if (ChildAttrib == null)
            {
                continue;
            }

            PropertyPropertiesAttribute propertyProperties = (PropertyPropertiesAttribute)
                                                             field.GetCustomAttribute(typeof(PropertyPropertiesAttribute));

            if ((propertyProperties != null) && (propertyProperties.Hidden))
            {
                continue;
            }

            if (field.Type == typeof(string) || field.Type == typeof(float) ||
                field.Type == typeof(int))
            {
                Gtk.Entry entry = new Gtk.Entry();
                entry.Name = field.Name;
                object val = field.GetValue(NewObject);
                if (val != null)
                {
                    entry.Text = val.ToString();
                }
                widgetTable.Add(entry);
                fieldTable.Add(field);
                entry.Changed       += OnEntryChanged;
                entry.FocusOutEvent += OnEntryChangeDone;
                editWidgets.Add(entry);
                AddTooltip(propertyProperties, entry);
            }
            else if (field.Type == typeof(bool))
            {
                Gtk.CheckButton checkButton = new Gtk.CheckButton(field.Name);
                checkButton.Name   = field.Name;
                checkButton.Active = (bool)field.GetValue(NewObject);
                widgetTable.Add(checkButton);
                fieldTable.Add(field);
                checkButton.Toggled += OnCheckButtonToggled;
                editWidgets.Add(checkButton);
                AddTooltip(propertyProperties, checkButton);
            }
            else if (field.Type.IsEnum)
            {
                // Create a combobox containing all the names of enum values.
                Gtk.ComboBox comboBox = new Gtk.ComboBox(Enum.GetNames(field.Type));
                // Set the name of the box.
                comboBox.Name = field.Name;
                // FIXME: This will break if:
                //        1) the first enum isn't 0 and/or
                //        2) the vaules are not sequential (0, 1, 3, 4 wouldn't work)
                object val = field.GetValue(NewObject);
                if (val != null)
                {
                    comboBox.Active = (int)val;
                }
                widgetTable.Add(comboBox);
                fieldTable.Add(field);
                comboBox.Changed += OnComboBoxChanged;
                editWidgets.Add(comboBox);
                AddTooltip(propertyProperties, comboBox);
            }
        }

        // Register our event handler for self-managed fields
        foreach (FieldOrProperty field in fieldTable)
        {
            field.Changed += OnFieldChanged;
        }

        Gtk.Table table = new Gtk.Table((uint)editWidgets.Count, 2, false);
        table.ColumnSpacing = 6;
        table.RowSpacing    = 6;
        table.BorderWidth   = 12;
        for (uint i = 0; i < editWidgets.Count; ++i)
        {
            Gtk.Widget widget = editWidgets[(int)i];
            if (widget is Gtk.CheckButton)
            {
                table.Attach(widget, 0, 2, i, i + 1,
                             Gtk.AttachOptions.Fill | Gtk.AttachOptions.Expand, Gtk.AttachOptions.Shrink, 0, 0);
            }
            else
            {
                Gtk.Label label = new Gtk.Label(widget.Name + ":");
                label.SetAlignment(0, 1);
                table.Attach(label, 0, 1, i, i + 1,
                             Gtk.AttachOptions.Fill, Gtk.AttachOptions.Shrink, 0, 0);
                table.Attach(widget, 1, 2, i, i + 1,
                             Gtk.AttachOptions.Fill | Gtk.AttachOptions.Expand, Gtk.AttachOptions.Shrink, 0, 0);
            }
        }
        box.PackStart(table, true, true, 0);

        // TODO add a (!) image in front of the label (and hide/show it depending
        // if there was an error)
        errorLabel        = new Gtk.Label(String.Empty);
        errorLabel.Xalign = 0;
        errorLabel.Xpad   = 12;
        box.PackStart(errorLabel, true, false, 0);

        box.ShowAll();

        AddWithViewport(box);
    }
Exemple #37
0
        public HIGMessageDialog(Gtk.Window parent,
					 Gtk.DialogFlags flags,
					 Gtk.MessageType type,
					 Gtk.ButtonsType buttons,
					 string          title,
					 string          header,
					 string          msg)
            : base()
        {
            HasSeparator = false;
            BorderWidth = 5;
            Resizable = false;
            Title = title;

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

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

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

            Gtk.Image image = null;

            switch (type) {
            case Gtk.MessageType.Error:
                image = new Gtk.Image (Gtk.Stock.DialogError,
                               Gtk.IconSize.Dialog);
                break;
            case Gtk.MessageType.Question:
                image = new Gtk.Image (Gtk.Stock.DialogQuestion,
                               Gtk.IconSize.Dialog);
                break;
            case Gtk.MessageType.Info:
                image = new Gtk.Image (Gtk.Stock.DialogInfo,
                               Gtk.IconSize.Dialog);
                break;
            case Gtk.MessageType.Warning:
                image = new Gtk.Image (Gtk.Stock.DialogWarning,
                               Gtk.IconSize.Dialog);
                break;
            }

            image.Show ();
            image.Yalign = 0;
            hbox.PackStart (image, false, false, 0);

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

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

            Gtk.Label label;

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

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

            switch (buttons) {
            case Gtk.ButtonsType.None:
                break;
            case Gtk.ButtonsType.Ok:
                AddButton (Gtk.Stock.Ok, Gtk.ResponseType.Ok, true);
                break;
            case Gtk.ButtonsType.Close:
                AddButton (Gtk.Stock.Close, Gtk.ResponseType.Close, true);
                break;
            case Gtk.ButtonsType.Cancel:
                AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, true);
                break;
            case Gtk.ButtonsType.YesNo:
                AddButton (Gtk.Stock.No, Gtk.ResponseType.No, false);
                AddButton (Gtk.Stock.Yes, Gtk.ResponseType.Yes, true);
                break;
            case Gtk.ButtonsType.OkCancel:
                AddButton (Gtk.Stock.Cancel, Gtk.ResponseType.Cancel, false);
                AddButton (Gtk.Stock.Ok, Gtk.ResponseType.Ok, true);
                break;
            }

            if (parent != null)
                TransientFor = parent;

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

            if ((int) (flags & Gtk.DialogFlags.DestroyWithParent) != 0)
                DestroyWithParent = true;
        }
Exemple #38
0
		public void UpdateTab ()
		{
			if (Child != null) {
				Widget w = Child;
				Remove (w);
				w.Destroy ();
			}
			
			mainBox = new Alignment (0,0,1,1);
			if (bar.Orientation == Gtk.Orientation.Horizontal) {
				box = new HBox ();
				if (bar.AlignToEnd)
					mainBox.SetPadding (5, 5, 11, 9);
				else
					mainBox.SetPadding (5, 5, 9, 11);
			}
			else {
				box = new VBox ();
				if (bar.AlignToEnd)
					mainBox.SetPadding (11, 9, 5, 5);
				else
					mainBox.SetPadding (9, 11, 5, 5);
			}
			
			if (it.Icon != null) {
				var desat = it.Icon.WithAlpha (0.5);
				crossfade = new CrossfadeIcon (desat, it.Icon);
				box.PackStart (crossfade, false, false, 0);
				desat.Dispose ();
			}
				
			if (!string.IsNullOrEmpty (it.Label)) {
				label = new Label (it.Label);
				label.UseMarkup = true;
				label.ModifyFont (FontService.SansFont.CopyModified (Styles.FontScale11));

				if (bar.Orientation == Orientation.Vertical)
					label.Angle = 270;

				// fine-tune label alignment issues
				if (Platform.IsMac) {
					if (bar.Orientation == Orientation.Horizontal)
						label.SetAlignment (0, 0.5f);
					else
						label.SetAlignment (0.6f, 0);
				} else {
					if (bar.Orientation == Orientation.Vertical)
						label.SetAlignment (1, 0);
				}
				// TODO: VV: Test Linux

				box.PackStart (label, true, true, 0);
			} else
				label = null;

			box.Spacing = 2;
			mainBox.Add (box);
			mainBox.ShowAll ();
			Add (mainBox);
			UpdateStyle (this, null); 
			QueueDraw ();
		}
 /// <summary>
 /// Add tab to notebook object
 /// </summary>
 private void AddLabelTab(ref Gtk.Label lblObj, string title)
 {
     // Create and add tab for Thanks info
     ScrolledWindow sw = new ScrolledWindow();
     Viewport vp = new Viewport();
     sw.AddWithViewport(vp);
     lblObj = new Label();
     lblObj.SetPadding(4,4);
     lblObj.SetAlignment((float)0, (float)0);
     vp.ModifyBg(StateType.Normal, new Gdk.Color(255,255,255));
     vp.Add(lblObj);
     tabInfo.AppendPage(sw, new Gtk.Label(title));
 }
Exemple #40
0
        void RefreshSource(TableRoot source)
        {
            // Clear
            _cells.Clear();

            foreach (var child in _root.AllChildren)
            {
                _root.RemoveFromContainer((Widget)child);
            }

            // Add Title
            if (!string.IsNullOrEmpty(source.Title))
            {
                var titleSpan = new Span()
                {
                    FontSize = 16,
                    Text     = source.Title ?? string.Empty
                };

                Gtk.Label title = new Gtk.Label();
                title.SetAlignment(0, 0);
                title.SetTextFromSpan(titleSpan);
                _root.PackStart(title, false, false, 0);
            }

            // Add Table Section
            for (int i = 0; i < source.Count; i++)
            {
                if (source[i] is TableSection tableSection)
                {
                    var tableSectionSpan = new Span()
                    {
                        FontSize  = 12,
                        Text      = tableSection.Title ?? string.Empty,
                        TextColor = tableSection.TextColor
                    };

                    // Table Section Title
                    Gtk.Label sectionTitle = new Gtk.Label();
                    sectionTitle.SetAlignment(0, 0);
                    sectionTitle.SetTextFromSpan(tableSectionSpan);
                    _root.PackStart(sectionTitle, false, false, 0);

                    // Table Section Separator
                    EventBox separator = new EventBox
                    {
                        HeightRequest = 1
                    };

                    separator.ModifyBg(StateType.Normal, Color.Black.ToGtkColor());
                    _root.PackStart(separator, false, false, 0);

                    // Cells
                    _cells.Clear();

                    for (int j = 0; j < tableSection.Count; j++)
                    {
                        var cell = tableSection[j];

                        var renderer =
                            (Cells.CellRenderer)Internals.Registrar.Registered.GetHandlerForObject <IRegisterable>(cell);
                        var nativeCell = renderer.GetCell(cell, null, null);

                        if (nativeCell != null)
                        {
                            nativeCell.ButtonPressEvent += (sender, args) =>
                            {
                                if (sender is CellBase gtkCell && gtkCell.Cell != null)
                                {
                                    var selectedCell = gtkCell.Cell;

                                    OnItemTapped?.Invoke(this, new ItemTappedEventArgs(selectedCell));
                                }
                            };
                            _cells.Add(nativeCell);
                        }
                    }

                    foreach (var cell in _cells)
                    {
                        _root.PackStart(cell, false, false, 0);
                    }
                }

                // Refresh
                _root.ShowAll();
            }
        }
        public ExceptionDialog(Exception e) : base()
        {
            debugInfo = BuildExceptionMessage(e);
           
            HasSeparator = false;
            BorderWidth = 5;
            Resizable = false;
            Title = Catalog.GetString("F-Spot Encountered a Fatal Error");
            
            VBox.Spacing = 12;
            ActionArea.Layout = ButtonBoxStyle.End;

            accel_group = new AccelGroup();
		    AddAccelGroup(accel_group);
        
            HBox hbox = new HBox(false, 12);
            hbox.BorderWidth = 5;
            VBox.PackStart(hbox, false, false, 0);
        
            Image image = new Image(Stock.DialogError, IconSize.Dialog);
            image.Yalign = 0.0f;
            hbox.PackStart(image, true, true, 0);

            VBox label_vbox = new VBox(false, 0);
            label_vbox.Spacing = 12;
            hbox.PackStart(label_vbox, false, false, 0);

            Label label = new Label(String.Format("<b><big>{0}</big></b>", GLib.Markup.EscapeText(Title)));
            label.UseMarkup = true;
            label.Justify = Justification.Left;
            label.LineWrap = true;
            label.SetAlignment(0.0f, 0.5f);
            label_vbox.PackStart(label, false, false, 0);

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

            Label details_label = new Label(String.Format("<b>{0}</b>", 
                GLib.Markup.EscapeText(Catalog.GetString("Error Details"))));
            details_label.UseMarkup = true;
            Expander details_expander = new Expander("Details");
            details_expander.LabelWidget = details_label;
            label_vbox.PackStart(details_expander, true, true, 0);

            ScrolledWindow scroll = new ScrolledWindow();
            TextView view = new TextView();
            
            scroll.HscrollbarPolicy = PolicyType.Automatic;
            scroll.VscrollbarPolicy = PolicyType.Automatic;
            scroll.AddWithViewport(view);
            
            scroll.SetSizeRequest(450, 250);
			
			view.Editable = false;
			view.Buffer.Text = debugInfo;
			
			details_expander.Add(scroll);
			
            hbox.ShowAll();

			AddButton(Stock.Close, ResponseType.Close, true);
        }
Exemple #42
0
        void AddHelpPane()
        {
            VBox desc = new VBox (false, 0);

            descTitleLabel = new Label ();
            descTitleLabel.SetAlignment(0, 0);
            descTitleLabel.SetPadding (5, 2);
            descTitleLabel.UseMarkup = true;
            desc.PackStart (descTitleLabel, false, false, 0);

            ScrolledWindow textScroll = new ScrolledWindow ();
            textScroll.HscrollbarPolicy = PolicyType.Never;
            textScroll.VscrollbarPolicy = PolicyType.Automatic;

            desc.PackEnd (textScroll, true, true, 0);

            //TODO: Use label, but wrapping seems dodgy.
            descTextView = new TextView ();
            descTextView.WrapMode = WrapMode.Word;
            descTextView.WidthRequest = 1;
            descTextView.HeightRequest = 70;
            descTextView.Editable = false;
            descTextView.LeftMargin = 5;
            descTextView.RightMargin = 5;

            Pango.FontDescription font = Style.FontDescription.Copy ();
            font.Size = (font.Size * 8) / 10;
            descTextView.ModifyFont (font);

            textScroll.Add (descTextView);

            descFrame = desc;
            vpaned.Pack2 (descFrame, false, true);
            descFrame.ShowAll ();
            UpdateHelp ();
        }
Exemple #43
0
        ///<summary>
        ///	Setup the gtk# structure
        ///</summary>
        private void Init()
        {
            toolTips         = new Tooltips();
            removeRequested  = false;
            this.BorderWidth = 0;
            //this.Relief = Gtk.ReliefStyle.None;
            this.CanFocus = false;

            this.ModifyBg(StateType.Normal, new Gdk.Color(255, 255, 255));
            this.ModifyBase(StateType.Normal, new Gdk.Color(255, 255, 255));
            this.BorderWidth = 0;

            VBox widgetVBox = new VBox(false, 4);

            widgetColumns = new HBox(false, 10);

            removeBox = new HBox(false, 5);
            widgetColumns.PackStart(removeBox, false, false, 0);

            if ((person != null) && (person.Photo != null))
            {
                image = new Gtk.Image(person.Photo.ScaleSimple(32, 32, InterpType.Bilinear));
            }
            else
            {
                image = new Gtk.Image(Utilities.GetIcon("blank-photo-128", 32));
            }

            widgetColumns.PackStart(image, false, false, 0);

            // Set up the name and status labels
            VBox nameVBox = new VBox();

            widgetColumns.PackStart(nameVBox, true, true, 0);
            nameLabel         = new Label();
            nameLabel.Justify = Gtk.Justification.Left;
            nameLabel.SetAlignment(0.0f, 0.5f);
            nameLabel.LineWrap     = false;
            nameLabel.UseMarkup    = true;
            nameLabel.UseUnderline = false;
            UpdateName();
            nameVBox.PackStart(nameLabel, true, true, 0);

            statusLabel         = new Label();
            statusLabel.Justify = Gtk.Justification.Left;
            statusLabel.SetAlignment(0.0f, 0.5f);
            statusLabel.UseMarkup    = true;
            statusLabel.UseUnderline = false;

            statusLabel.LineWrap = false;

            UpdateStatus();

            nameVBox.PackStart(statusLabel, true, true, 0);

            actionBox = new HBox(false, 0);
            widgetColumns.PackStart(actionBox, false, false, 0);


            widgetColumns.ShowAll();
            widgetVBox.PackStart(widgetColumns, true, true, 0);


            // Add a progress bar for file transfer progress but hide it
            progressBar             = new ProgressBar();
            progressBar.Orientation = ProgressBarOrientation.LeftToRight;
            progressBar.BarStyle    = ProgressBarStyle.Continuous;
            progressBar.NoShowAll   = true;
            widgetVBox.PackStart(progressBar, true, false, 0);
            progressLabel              = new Label();
            progressLabel.UseMarkup    = true;
            progressLabel.Xalign       = 0;
            progressLabel.UseUnderline = false;
            progressLabel.LineWrap     = true;
            progressLabel.Wrap         = true;
            progressLabel.NoShowAll    = true;
            progressLabel.Ellipsize    = Pango.EllipsizeMode.End;
            widgetVBox.PackStart(progressLabel, false, false, 0);

            if (person != null)
            {
                OnPersonPresenceUpdated(person);
            }

            widgetVBox.ShowAll();
            Add(widgetVBox);

            TargetEntry[] targets = new TargetEntry[] {
                new TargetEntry("text/uri-list", 0, (uint)DragTargetType.UriList)
            };

            this.DragDataReceived += DragDataReceivedHandler;

            Gtk.Drag.DestSet(this,
                             DestDefaults.All | DestDefaults.Highlight,
                             targets,
                             Gdk.DragAction.Copy);
        }
Exemple #44
0
        public HIGMessageDialog(Gtk.Window parent,
                                Gtk.DialogFlags flags,
                                Gtk.MessageType type,
                                Gtk.ButtonsType buttons,
                                string header,
                                string msg)
            : base()
        {
            HasSeparator = false;
            BorderWidth  = 5;
            Resizable    = false;
            Title        = "";

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

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

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

            Gtk.Image image = null;

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

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

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

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

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

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

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

            Gtk.Label label;

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

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

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

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

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

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

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

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

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

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

            if ((int)(flags & Gtk.DialogFlags.DestroyWithParent) != 0)
            {
                DestroyWithParent = true;
            }
        }
 void AddParameterControls()
 {
     foreach (Widget child in vboxParameters.Children)
     {
         vboxParameters.Remove(child);
     }
     foreach (UserReportParameter rp in report.UserReportParameters)
     {
         HBox hbox = new HBox();
         Label labelPrompt = new Label();
         labelPrompt.SetAlignment(0, 0.5f);
         labelPrompt.Text = string.Format("{0} :", rp.Prompt);
         hbox.PackStart(labelPrompt, true, true, 0);
         Entry entryValue = new Entry();
         if (Parameters.Contains(rp.Name))
         {
             if (Parameters[rp.Name] != null)
             {
                 entryValue.Text = Parameters[rp.Name].ToString();
             }
         }
         else
         {
             if (rp.DefaultValue != null)
             {
                 StringBuilder sb = new StringBuilder();
                 for (int i = 0; i < rp.DefaultValue.Length; i++)
                 {
                     if (i > 0)
                         sb.Append(", ");
                     sb.Append(rp.DefaultValue[i].ToString());
                 }
                 entryValue.Text = sb.ToString();
             }
         }
         hbox.PackStart(entryValue, false, false, 0);
         vboxParameters.PackStart(hbox, false, false, 0);
     }
 }
Exemple #46
0
		private void Init()
		{
			Logger.Debug("Called Init");
			this.Icon = Utilities.GetIcon ("giver-48", 48);
			// Update the window title
			this.Title = string.Format ("Giver Preferences");	
			
			//this.DefaultSize = new Gdk.Size (300, 500); 	
			this.VBox.Spacing = 0;
			this.VBox.BorderWidth = 0;
			this.SetDefaultSize (450, 100);


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


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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

			DeleteEvent += WindowDeleted;
		}
 public void SetAlignment(float aligmentValue)
 {
     _entry.Alignment = aligmentValue;
     _placeholder.SetAlignment(aligmentValue, 0.5f);
 }
		internal MonoDevelopStatusBar ()
		{
			mainContext = new MainStatusBarContextImpl (this);
			activeContext = mainContext;
			contexts.Add (mainContext);
			
			Frame originalFrame = (Frame)Children [0];
//			originalFrame.WidthRequest = 8;
//			originalFrame.Shadow = ShadowType.In;
//			originalFrame.BorderWidth = 0;
			
			BorderWidth = 0;
			Spacing = 0;
			
			// Feedback button
			
			if (FeedbackService.Enabled) {
				CustomFrame fr = new CustomFrame (0, 0, 1, 1);
				Gdk.Pixbuf px = Gdk.Pixbuf.LoadFromResource ("balloon.png");
				HBox b = new HBox (false, 3);
				b.PackStart (new Gtk.Image (px));
				b.PackStart (new Gtk.Label ("Feedback"));
				Gtk.Alignment al = new Gtk.Alignment (0f, 0f, 1f, 1f);
				al.RightPadding = 5;
				al.LeftPadding = 3;
				al.Add (b);
				feedbackButton = new MiniButton (al);
				//feedbackButton.BackroundColor = new Gdk.Color (200, 200, 255);
				fr.Add (feedbackButton);
				PackStart (fr, false, false, 0);
				feedbackButton.Clicked += HandleFeedbackButtonClicked;
				feedbackButton.ButtonPressEvent += HandleFeedbackButtonButtonPressEvent;
				;
				feedbackButton.ClickOnRelease = true;
				FeedbackService.FeedbackPositionGetter = delegate {
					int x, y;
					feedbackButton.GdkWindow.GetOrigin (out x, out y);
					x += feedbackButton.Allocation.Width;
					y -= 6;
					return new Gdk.Point (x, y);
				};
			}
			
			// Dock area
			
			DefaultWorkbench wb = (DefaultWorkbench)IdeApp.Workbench.RootWindow;
			wb.DockFrame.ShadedContainer.Add (this);
			Gtk.Widget dockBar = wb.DockFrame.ExtractDockBar (PositionType.Bottom);
			dockBar.NoShowAll = true;
			PackStart (dockBar, false, false, 0);
			
			// Status panels
			
			progressBar = new ProgressBar ();
			progressBar.PulseStep = 0.1;
			progressBar.SizeRequest ();
			progressBar.HeightRequest = 1;
			
			statusBox = new HBox (false, 0);
			statusBox.BorderWidth = 0;
			
			statusLabel = new Label ();
			statusLabel.SetAlignment (0, 0.5f);
			statusLabel.Wrap = false;
			int w, h;
			Gtk.Icon.SizeLookup (IconSize.Menu, out w, out h);
			statusLabel.HeightRequest = h;
			statusLabel.SetPadding (0, 0);
			
			EventBox eventMessageBox = new EventBox ();
			messageBox = new HBox ();
			messageBox.PackStart (progressBar, false, false, 0);
			messageBox.PackStart (statusLabel, true, true, 0);
			eventMessageBox.Add (messageBox);
			statusBox.PackStart (eventMessageBox, true, true, 0);
			eventMessageBox.ButtonPressEvent += HandleEventMessageBoxButtonPressEvent;
			
			textStatusBarPanel.BorderWidth = 0;
			textStatusBarPanel.ShadowType = ShadowType.None;
			textStatusBarPanel.Add (statusBox);
			
			var eventCaretBox = new EventBox ();
			var caretStatusBox = new HBox ();
			modeLabel = new Label (" ");
			caretStatusBox.PackEnd (modeLabel, false, false, 8);
			
			cursorLabel = new CaretStatusLabel (" ");
			caretStatusBox.PackEnd (cursorLabel, false, false, 0);
			
			caretStatusBox.GetSizeRequest (out w, out h);
			caretStatusBox.WidthRequest = w;
			caretStatusBox.HeightRequest = h;
			eventCaretBox.Add (caretStatusBox);
			statusBox.PackEnd (eventCaretBox, false, false, 0);
			
			statusIconBox = new HBox ();
			statusIconBox.BorderWidth = 0;
			statusIconBox.Spacing = 3;
			statusBox.PackEnd (statusIconBox, false, false, 4);
			
			this.PackStart (textStatusBarPanel, true, true, 0);
			
			ShowReady ();
			Gtk.Box.BoxChild boxChild = (Gtk.Box.BoxChild)this[textStatusBarPanel];
			boxChild.Position = 0;
			boxChild.Expand = boxChild.Fill = true;
			
	//		boxChild = (Gtk.Box.BoxChild)this[originalFrame];
	//		boxChild.Padding = 0;
	//		boxChild.Expand = boxChild.Fill = false;
			
			this.progressBar.Fraction = 0.0;
			this.ShowAll ();
			statusIconBox.HideAll ();
			
			originalFrame.HideAll ();
			progressBar.Visible = false;
			
			StatusBarContext completionStatus = null;
			
			// todo: Move this to the CompletionWindowManager when it's possible.
			CompletionWindowManager.WindowShown += delegate {
				CompletionListWindow wnd = CompletionWindowManager.Wnd;
				if (wnd != null && wnd.List != null && wnd.List.CategoryCount > 1) {
					if (completionStatus == null)
						completionStatus = CreateContext ();
					completionStatus.ShowMessage (string.Format (GettextCatalog.GetString ("To toggle categorized completion mode press {0}."), IdeApp.CommandService.GetCommandInfo (Commands.TextEditorCommands.ShowCompletionWindow).AccelKey));
				}
			};
			
			CompletionWindowManager.WindowClosed += delegate {
				if (completionStatus != null) {
					completionStatus.Dispose ();
					completionStatus = null;
				}
			};
		}