예제 #1
0
        public void Initialize(EditSession session)
        {
            PropertyDescriptor prop = session.Property;

            if (!prop.PropertyType.IsEnum)
            {
                throw new ApplicationException("Flags editor does not support editing values of type " + prop.PropertyType);
            }

            Spacing  = 3;
            propType = prop.PropertyType;

            property = prop.Description;
            if (property == null || property.Length == 0)
            {
                property = prop.Name;
            }

            // For small enums, the editor is a list of checkboxes inside a frame
            // For large enums (>5), use a selector dialog.

            values = System.Enum.GetValues(prop.PropertyType);

            if (values.Length < 6)
            {
                Gtk.VBox vbox = new Gtk.VBox(true, 3);

                flags = new Hashtable();

                foreach (object value in values)
                {
                    Gtk.CheckButton check = new Gtk.CheckButton(value.ToString());
                    check.TooltipText = value.ToString();
                    ulong uintVal = Convert.ToUInt64(value);
                    flags[check]   = uintVal;
                    flags[uintVal] = check;

                    check.Toggled += FlagToggled;
                    vbox.PackStart(check, false, false, 0);
                }

                Gtk.Frame frame = new Gtk.Frame();
                frame.Add(vbox);
                frame.ShowAll();
                PackStart(frame, true, true, 0);
            }
            else
            {
                flagsLabel            = new Gtk.Entry();
                flagsLabel.IsEditable = false;
                flagsLabel.HasFrame   = false;
                flagsLabel.ShowAll();
                PackStart(flagsLabel, true, true, 0);

                Gtk.Button but = new Gtk.Button("...");
                but.Clicked += OnSelectFlags;
                but.ShowAll();
                PackStart(but, false, false, 0);
            }
        }
예제 #2
0
        public LayoutSelectionDialog(DataBook db)
            : base(Catalog.GetString("Select Layout"), null, 0)
        {
            Glade.XML gxml = new Glade.XML(FileResourcePath.GetDataPath("bless.glade"), "LayoutSelectionPaned", "bless");
            gxml.Autoconnect(this);

            dataBook = db;

            // create the preview area
            dataPreview = new DataView();
            ByteBuffer bb = new ByteBuffer();

            bb.Append(new byte[] { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15 }, 0, 16);
            bb.Append(new byte[] { 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31 }, 0, 16);
            dataPreview.Buffer = bb;

            PreviewFrame.Add(dataPreview.Display);
            PreviewFrame.ShowAll();

            layoutDir = System.IO.Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "bless");
            layoutDir = System.IO.Path.Combine(layoutDir, "layouts");

            // Initialize list
            PopulateLayoutList();

            this.DefaultWidth  = 600;
            this.DefaultHeight = 300;
            this.Modal         = false;
            this.BorderWidth   = 6;
            this.HasSeparator  = false;
            this.AddButton(Gtk.Stock.Close, ResponseType.Close);
            this.AddButton(Gtk.Stock.Ok, ResponseType.Ok);
            this.Response += new ResponseHandler(OnDialogResponse);
            this.VBox.Add(LayoutSelectionPaned);
        }
예제 #3
0
        public ConfigurationDialog (LCDService plugin)
        {
            this.plugin = plugin;
            Title = AddinManager.CurrentLocalizer.GetString ("LCD configuration");
            BorderWidth = 5;
            HasSeparator = false;
            Resizable = false;

            VBox lcdproc_box = new VBox ();

            HBox host_box = new HBox ();
            host_box.PackStart (new Label (AddinManager.CurrentLocalizer.GetString ("Hostname:")), false, false, 3);
            host_entry = new Entry ();
            host_box.PackStart (host_entry, true, true, 3);
            host_entry.Text = this.plugin.Host;
            host_entry.Changed += new EventHandler (Host_Changed);

            HBox port_box = new HBox ();
            port_box.PackStart (new Label (AddinManager.CurrentLocalizer.GetString ("Port:")), false, false, 3);
            port_spin = new SpinButton (1, 65535, 1);
            port_box.PackStart (port_spin, true, true, 3);
            port_spin.Value = this.plugin.Port;
            port_spin.Changed += new EventHandler (Port_Changed);

            Frame lcdproc_frame = new Frame (AddinManager.CurrentLocalizer.GetString ("LCDProc Daemon:"));
            lcdproc_box.PackStart (host_box);
            lcdproc_box.PackStart (port_box);
            lcdproc_frame.Add (lcdproc_box);
            lcdproc_frame.ShowAll ();

            VBox.PackStart (lcdproc_frame, false, false, 3);
            AddButton (Stock.Close, ResponseType.Close);
        }
예제 #4
0
        private void BuildInterface ()
        {
            NoShowAll = true;

            Alignment matchesAlignment = new Alignment (0.0f, 0.0f, 1.0f, 1.0f);
            matchesAlignment.SetPadding (5, 5, 5, 5);
            matchesAlignment.Add (terms_box);

            matchesFrame = new Frame (null);
            matchesFrame.Add (matchesAlignment);
            matchesFrame.LabelWidget = BuildMatchHeader ();
            matchesFrame.ShowAll ();

            terms_entry_box = new HBox ();
            terms_entry_box.Spacing = 8;
            terms_entry_box.PackStart (new Label (Catalog.GetString ("Condition:")), false, false, 0);
            terms_entry = new Entry ();
            terms_entry_box.PackStart (terms_entry, true, true, 0);

            limit_box.ShowAll ();

            PackStart(matchesFrame, true, true, 0);
            PackStart(terms_entry_box, false, false, 0);
            PackStart(limit_box, false, false, 0);

            //ShowAll ();
        }
        public ChessGameWidget(Widget board)
        {
            whiteLabel = new Label ();
            blackLabel = new Label ();

            blackClock = new ChessClock ();
            blackHBox = new HBox ();
            blackHBox.PackStart (blackLabel, true, true, 2);
            blackHBox.PackStart (blackClock, false, false, 2);

            whiteClock = new ChessClock ();
            whiteHBox = new HBox ();
            whiteHBox.PackStart (whiteLabel, true, true, 2);
            whiteHBox.PackStart (whiteClock, false, false, 2);

            topBin = new Frame ();
            bottomBin = new Frame ();

            whiteAtBottom = true;
            topBin.Add (blackHBox);
            bottomBin.Add (whiteHBox);

            PackStart (topBin, false, false, 2);
            PackStart (board, true, true, 2);
            PackStart (bottomBin, false, false, 2);

            topBin.ShowAll ();
            bottomBin.ShowAll ();
        }
예제 #6
0
파일: Flags.cs 프로젝트: orf53975/stetic
        public void Initialize(PropertyDescriptor prop)
        {
            if (!prop.PropertyType.IsEnum)
            {
                throw new ApplicationException("Flags editor does not support editing values of type " + prop.PropertyType);
            }

            property = prop.Label;
            Spacing  = 3;

            // For small enums, the editor is a list of checkboxes inside a frame
            // For large enums (>5), use a selector dialog.

            enm = Registry.LookupEnum(prop.PropertyType.FullName);

            if (enm.Values.Length < 6)
            {
                Gtk.VBox vbox = new Gtk.VBox(true, 3);

                tips  = new Gtk.Tooltips();
                flags = new Hashtable();

                foreach (Enum value in enm.Values)
                {
                    EnumValue eval = enm[value];
                    if (eval.Label == "")
                    {
                        continue;
                    }

                    Gtk.CheckButton check = new Gtk.CheckButton(eval.Label);
                    tips.SetTip(check, eval.Description, eval.Description);
                    uint uintVal = (uint)(int)eval.Value;
                    flags[check]   = uintVal;
                    flags[uintVal] = check;

                    check.Toggled += FlagToggled;
                    vbox.PackStart(check, false, false, 0);
                }

                Gtk.Frame frame = new Gtk.Frame();
                frame.Add(vbox);
                frame.ShowAll();
                PackStart(frame, true, true, 0);
            }
            else
            {
                flagsLabel            = new Gtk.Entry();
                flagsLabel.IsEditable = false;
                flagsLabel.HasFrame   = false;
                flagsLabel.ShowAll();
                PackStart(flagsLabel, true, true, 0);

                Gtk.Button but = new Gtk.Button("...");
                but.Clicked += OnSelectFlags;
                but.ShowAll();
                PackStart(but, false, false, 0);
            }
        }
 public DataGridView()
     : base()
 {
     frame = new Gtk.Frame ();
     grid = new DataGrid ();
     frame.Add (grid);
     frame.ShowAll ();
 }
예제 #8
0
파일: Flags.cs 프로젝트: Kalnor/monodevelop
		public void Initialize (PropertyDescriptor prop)
		{
			if (!prop.PropertyType.IsEnum)
				throw new ApplicationException ("Flags editor does not support editing values of type " + prop.PropertyType);
				
			property = prop.Label;
			Spacing = 3;

			// For small enums, the editor is a list of checkboxes inside a frame
			// For large enums (>5), use a selector dialog.

			enm = Registry.LookupEnum (prop.PropertyType.FullName);
			
			if (enm.Values.Length < 6) 
			{
				Gtk.VBox vbox = new Gtk.VBox (true, 3);

				flags = new Hashtable ();

				foreach (Enum value in enm.Values) {
					EnumValue eval = enm[value];
					if (eval.Label == "")
						continue;

					Gtk.CheckButton check = new Gtk.CheckButton (eval.Label);
					check.TooltipText = eval.Description;
					uint uintVal = (uint) Convert.ToInt32 (eval.Value);
					flags[check] = uintVal;
					flags[uintVal] = check;
					
					check.Toggled += FlagToggled;
					vbox.PackStart (check, false, false, 0);
				}

				Gtk.Frame frame = new Gtk.Frame ();
				frame.Add (vbox);
				frame.ShowAll ();
				PackStart (frame, true, true, 0);
			} 
			else 
			{
				flagsLabel = new Gtk.Entry ();
				flagsLabel.IsEditable = false;
				flagsLabel.HasFrame = false;
				flagsLabel.ShowAll ();
				PackStart (flagsLabel, true, true, 0);
				
				Gtk.Button but = new Gtk.Button ("...");
				but.Clicked += OnSelectFlags;
				but.ShowAll ();
				PackStart (but, false, false, 0);
			}
		}
예제 #9
0
        public EntryPopup () : base (Gtk.WindowType.Popup)
        {
            CanFocus = true;
            Resizable = false;
            TypeHint = Gdk.WindowTypeHint.Utility;
            Modal = true;

            Frame frame = new Frame ();
            frame.Shadow = ShadowType.EtchedIn;
            Add (frame);

            hbox = new HBox () { Spacing = 6 };
            text_entry = new Entry();
            hbox.PackStart (text_entry, true, true, 0);
            hbox.BorderWidth = 3;

            frame.Add (hbox);
            frame.ShowAll ();

            text_entry.Text = String.Empty;
            text_entry.CanFocus = true;

            //TODO figure out why this event does not get raised
            text_entry.FocusOutEvent += (o, a) => {
                if (hide_when_focus_lost) {
                    HidePopup ();
                }
            };

            text_entry.KeyReleaseEvent += delegate (object o, KeyReleaseEventArgs args) {
                if (args.Event.Key == Gdk.Key.Escape ||
                    args.Event.Key == Gdk.Key.Return ||
                    args.Event.Key == Gdk.Key.Tab) {

                    HidePopup ();
                }

                InitializeDelayedHide ();
            };

            text_entry.KeyPressEvent += (o, a) => OnKeyPressed (a);

            text_entry.Changed += (o, a) => {
                if (GdkWindow.IsVisible) {
                    OnChanged (a);
                }
            };
        }
        public SqlDefinitionPad()
            : base("SQL Definition", "md-mono-query-view")
        {
            frame = new Gtk.Frame ();
            sw = new Gtk.ScrolledWindow ();
            frame.Add (sw);
            SourceLanguagesManager lm = new SourceLanguagesManager ();
            textBuffer = new SourceBuffer(lm.GetLanguageFromMimeType("text/x-sql"));
            textBuffer.Highlight = true;
            textView = new SourceView (textBuffer);
            textView.ShowLineNumbers = false;
            textView.ShowMargin = false;
            textView.TabsWidth = 2;
            textView.Editable = false;
            sw.Add (textView);
            frame.ShowAll ();

            service.SqlDefinitionPad = this;
        }
        public ConfigurationDialog(AlarmClockService plugin)
            : base()
        {
            this.plugin = plugin;

            Title = Catalog.GetString ("Alarm Clock configuration");
            HasSeparator = false;
            BorderWidth = 5;

            fade_start = new VScale (0, 100, 1);
            fade_start.Inverted = true;
            fade_start.HeightRequest = volumeSliderHeight;
            fade_end = new VScale (0, 100, 1);
            fade_end.Inverted = true;
            fade_end.HeightRequest = volumeSliderHeight;
            fade_duration = new SpinButton (0, 65535, 1);
            fade_duration.WidthChars = 6;

            VBox fade_big_box = new VBox ();

            VBox fade_start_box = new VBox ();
            fade_start_box.PackEnd (new Label (Catalog.GetString ("Start")));
            fade_start_box.PackStart (fade_start, false, false, 3);

            VBox fade_end_box = new VBox ();
            fade_end_box.PackEnd (new Label (Catalog.GetString ("End")));
            fade_end_box.PackStart (fade_end, false, false, 3);

            HBox fade_box_group = new HBox ();
            fade_box_group.PackStart (fade_start_box);
            fade_box_group.PackStart (fade_end_box);

            Label volume_label = new Label (Catalog.GetString ("<b>Volume</b>"));
            volume_label.UseMarkup = true;
            fade_big_box.PackStart (volume_label, false, true, 3);
            fade_big_box.PackStart (fade_box_group);
            Label duration_label = new Label (Catalog.GetString ("Duration:"));
            Label duration_seconds_label = new Label (Catalog.GetString (" <i>(seconds)</i>"));
            duration_label.UseMarkup = true;
            duration_seconds_label.UseMarkup = true;
            HBox duration_box = new HBox ();
            duration_box.PackStart (duration_label, false, false, 3);
            duration_box.PackStart (fade_duration, false, false, 3);
            duration_box.PackStart (duration_seconds_label, false, true, 3);
            fade_big_box.PackStart (duration_box);

            Frame alarm_fade_frame = new Frame (Catalog.GetString ("Fade-In Adjustment"));
            alarm_fade_frame.Add (fade_big_box);
            alarm_fade_frame.ShowAll ();

            HBox command_box = new HBox ();
            command_box.PackStart (new Label (Catalog.GetString ("Command:")), false, false, 3);
            command_entry = new Entry ();
            command_box.PackStart (command_entry, true, true, 3);

            Frame alarm_misc_frame = new Frame (Catalog.GetString ("Command To Execute:"));
            alarm_misc_frame.Add (command_box);
            alarm_misc_frame.ShowAll ();

            VBox.PackStart (alarm_fade_frame, false, false, 3);
            VBox.PackStart (alarm_misc_frame, false, false, 3);

            AddButton (Stock.Close, ResponseType.Close);

            // initialize values
            command_entry.Text = plugin.AlarmCommand;
            fade_start.Value = plugin.FadeStartVolume;
            fade_end.Value = plugin.FadeEndVolume;
            fade_duration.Value = plugin.FadeDuration;

            // attach change handlers
            command_entry.Changed += new EventHandler (AlarmCommand_Changed);
            fade_start.ValueChanged += new EventHandler (FadeStartVolume_Changed);
            fade_end.ValueChanged += new EventHandler (FadeEndVolume_Changed);
            fade_duration.ValueChanged += new EventHandler (FadeDuration_Changed);
        }
예제 #12
0
		public override void Initialize (NodeBuilder[] builders, TreePadOption[] options, string menuPath)
		{
			base.Initialize (builders, options, menuPath);
			
			testChangedHandler = (EventHandler) DispatchService.GuiDispatch (new EventHandler (OnDetailsTestChanged));
			testService.TestSuiteChanged += (EventHandler) DispatchService.GuiDispatch (new EventHandler (OnTestSuiteChanged));
			paned = new VPaned ();
			
			VBox vbox = new VBox ();
			DockItemToolbar topToolbar = Window.GetToolbar (PositionType.Top);
			
			buttonRunAll = new Button (new Gtk.Image (Gtk.Stock.GoUp, IconSize.Menu));
			buttonRunAll.Clicked += new EventHandler (OnRunAllClicked);
			buttonRunAll.Sensitive = true;
			buttonRunAll.TooltipText = GettextCatalog.GetString ("Run all tests");
			topToolbar.Add (buttonRunAll);
			
			buttonRun = new Button (new Gtk.Image (Gtk.Stock.Execute, IconSize.Menu));
			buttonRun.Clicked += new EventHandler (OnRunClicked);
			buttonRun.Sensitive = true;
			buttonRun.TooltipText = GettextCatalog.GetString ("Run test");
			topToolbar.Add (buttonRun);
			
			buttonStop = new Button (new Gtk.Image (Gtk.Stock.Stop, IconSize.Menu));
			buttonStop.Clicked += new EventHandler (OnStopClicked);
			buttonStop.Sensitive = false;
			buttonStop.TooltipText = GettextCatalog.GetString ("Cancel running test");
			topToolbar.Add (buttonStop);
			topToolbar.ShowAll ();
			
			vbox.PackEnd (base.Control, true, true, 0);
			vbox.FocusChain = new Gtk.Widget [] { base.Control };
			
			paned.Pack1 (vbox, true, true);
			
			detailsPad = new VBox ();
			
			EventBox eb = new EventBox ();
			HBox header = new HBox ();
			eb.Add (header);

			detailLabel = new HeaderLabel ();
			detailLabel.Padding = 6;
			
			Button hb = new Button (new Gtk.Image ("gtk-close", IconSize.SmallToolbar));
			hb.Relief = ReliefStyle.None;
			hb.Clicked += new EventHandler (OnCloseDetails);
			header.PackEnd (hb, false, false, 0);
			
			hb = new Button (new Gtk.Image ("gtk-go-back", IconSize.SmallToolbar));
			hb.Relief = ReliefStyle.None;
			hb.Clicked += new EventHandler (OnGoBackTest);
			header.PackEnd (hb, false, false, 0);
			
			header.Add (detailLabel);
			Gdk.Color hcol = eb.Style.Background (StateType.Normal);
			hcol.Red = (ushort) (((double)hcol.Red) * 0.9);
			hcol.Green = (ushort) (((double)hcol.Green) * 0.9);
			hcol.Blue = (ushort) (((double)hcol.Blue) * 0.9);
		//	eb.ModifyBg (StateType.Normal, hcol);
			
			detailsPad.PackStart (eb, false, false, 0);
			
			VPaned panedDetails = new VPaned ();
			panedDetails.BorderWidth = 3;
			VBox boxPaned1 = new VBox ();
			
			chart = new TestChart ();
			chart.ButtonPressEvent += OnChartButtonPress;
			chart.SelectionChanged += new EventHandler (OnChartDateChanged);
			chart.HeightRequest = 50;
			
			Toolbar toolbar = new Toolbar ();
			toolbar.IconSize = IconSize.SmallToolbar;
			toolbar.ToolbarStyle = ToolbarStyle.Icons;
			toolbar.ShowArrow = false;
			ToolButton but = new ToolButton ("gtk-zoom-in");
			but.Clicked += new EventHandler (OnZoomIn);
			toolbar.Insert (but, -1);
			
			but = new ToolButton ("gtk-zoom-out");
			but.Clicked += new EventHandler (OnZoomOut);
			toolbar.Insert (but, -1);
			
			but = new ToolButton ("gtk-go-back");
			but.Clicked += new EventHandler (OnChartBack);
			toolbar.Insert (but, -1);
			
			but = new ToolButton ("gtk-go-forward");
			but.Clicked += new EventHandler (OnChartForward);
			toolbar.Insert (but, -1);
			
			but = new ToolButton ("gtk-goto-last");
			but.Clicked += new EventHandler (OnChartLast);
			toolbar.Insert (but, -1);
			
			boxPaned1.PackStart (toolbar, false, false, 0);
			boxPaned1.PackStart (chart, true, true, 0);
			
			panedDetails.Pack1 (boxPaned1, false, false);
			
			// Detailed test information --------
			
			infoBook = new ButtonNotebook ();
			infoBook.PageLoadRequired += new EventHandler (OnPageLoadRequired);
			
			// Info - Group summary
			
			Frame tf = new Frame ();
			ScrolledWindow sw = new ScrolledWindow ();
			detailsTree = new TreeView ();
			
			detailsTree.HeadersVisible = true;
			detailsTree.RulesHint = true;
			detailsStore = new ListStore (typeof(object), typeof(string), typeof (string), typeof (string), typeof (string));
			
			CellRendererText trtest = new CellRendererText ();
			CellRendererText tr;
			
			TreeViewColumn col3 = new TreeViewColumn ();
			col3.Expand = false;
//			col3.Alignment = 0.5f;
			col3.Widget = new Gtk.Image (CircleImage.Success);
			col3.Widget.Show ();
			tr = new CellRendererText ();
//			tr.Xalign = 0.5f;
			col3.PackStart (tr, false);
			col3.AddAttribute (tr, "markup", 2);
			detailsTree.AppendColumn (col3);
			
			TreeViewColumn col4 = new TreeViewColumn ();
			col4.Expand = false;
//			col4.Alignment = 0.5f;
			col4.Widget = new Gtk.Image (CircleImage.Failure);
			col4.Widget.Show ();
			tr = new CellRendererText ();
//			tr.Xalign = 0.5f;
			col4.PackStart (tr, false);
			col4.AddAttribute (tr, "markup", 3);
			detailsTree.AppendColumn (col4);
			
			TreeViewColumn col5 = new TreeViewColumn ();
			col5.Expand = false;
//			col5.Alignment = 0.5f;
			col5.Widget = new Gtk.Image (CircleImage.NotRun);
			col5.Widget.Show ();
			tr = new CellRendererText ();
//			tr.Xalign = 0.5f;
			col5.PackStart (tr, false);
			col5.AddAttribute (tr, "markup", 4);
			detailsTree.AppendColumn (col5);
			
			TreeViewColumn col1 = new TreeViewColumn ();
//			col1.Resizable = true;
//			col1.Expand = true;
			col1.Title = "Test";
			col1.PackStart (trtest, true);
			col1.AddAttribute (trtest, "markup", 1);
			detailsTree.AppendColumn (col1);
			
			detailsTree.Model = detailsStore;
			
			sw.Add (detailsTree);
			tf.Add (sw);
			tf.ShowAll ();
			
			TestSummaryPage = infoBook.AddPage (GettextCatalog.GetString ("Summary"), tf);
			
			// Info - Regressions list
			
			tf = new Frame ();
			sw = new ScrolledWindow ();
			tf.Add (sw);
			regressionTree = new TreeView ();
			regressionTree.HeadersVisible = false;
			regressionTree.RulesHint = true;
			regressionStore = new ListStore (typeof(object), typeof(string), typeof (Pixbuf));
			
			CellRendererText trtest2 = new CellRendererText ();
			var pr = new CellRendererPixbuf ();
			
			TreeViewColumn col = new TreeViewColumn ();
			col.PackStart (pr, false);
			col.AddAttribute (pr, "pixbuf", 2);
			col.PackStart (trtest2, false);
			col.AddAttribute (trtest2, "markup", 1);
			regressionTree.AppendColumn (col);
			regressionTree.Model = regressionStore;
			sw.Add (regressionTree);
			tf.ShowAll ();
			
			TestRegressionsPage = infoBook.AddPage (GettextCatalog.GetString ("Regressions"), tf);
			
			// Info - Failed tests list
			
			tf = new Frame ();
			sw = new ScrolledWindow ();
			tf.Add (sw);
			failedTree = new TreeView ();
			failedTree.HeadersVisible = false;
			failedTree.RulesHint = true;
			failedStore = new ListStore (typeof(object), typeof(string), typeof (Pixbuf));
			
			trtest2 = new CellRendererText ();
			pr = new CellRendererPixbuf ();
			
			col = new TreeViewColumn ();
			col.PackStart (pr, false);
			col.AddAttribute (pr, "pixbuf", 2);
			col.PackStart (trtest2, false);
			col.AddAttribute (trtest2, "markup", 1);
			failedTree.AppendColumn (col);
			failedTree.Model = failedStore;
			sw.Add (failedTree);
			tf.ShowAll ();
			
			TestFailuresPage = infoBook.AddPage (GettextCatalog.GetString ("Failed tests"), tf);
			
			// Info - results
			
			tf = new Frame ();
			sw = new ScrolledWindow ();
			tf.Add (sw);
			resultView = new TextView ();
			resultView.Editable = false;
			sw.Add (resultView);
			tf.ShowAll ();
			TestResultPage = infoBook.AddPage (GettextCatalog.GetString ("Result"), tf);
			
			// Info - Output
			
			tf = new Frame ();
			sw = new ScrolledWindow ();
			tf.Add (sw);
			outputView = new TextView ();
			outputView.Editable = false;
			sw.Add (outputView);
			tf.ShowAll ();
			TestOutputPage = infoBook.AddPage (GettextCatalog.GetString ("Output"), tf);
			
			panedDetails.Pack2 (infoBook, true, true);
			detailsPad.PackStart (panedDetails, true, true, 0);
			paned.Pack2 (detailsPad, true, true);
			
			paned.ShowAll ();
			
			infoBook.HidePage (TestResultPage);
			infoBook.HidePage (TestOutputPage);
			infoBook.HidePage (TestSummaryPage);
			infoBook.HidePage (TestRegressionsPage);
			infoBook.HidePage (TestFailuresPage);
			
			detailsPad.Sensitive = false;
			detailsPad.Hide ();
			
			detailsTree.RowActivated += new Gtk.RowActivatedHandler (OnTestActivated);
			regressionTree.RowActivated += new Gtk.RowActivatedHandler (OnRegressionTestActivated);
			failedTree.RowActivated += new Gtk.RowActivatedHandler (OnFailedTestActivated);
			
			foreach (UnitTest t in testService.RootTests)
				TreeView.AddChild (t);
		}
        public RConsolePad()
            : base("R Console")
        {
            Frame frame = new Frame();
            ScrolledWindow scrolledWindow = new ScrolledWindow();
            HBox hbox = new HBox ();
            terminal = new Terminal();
            VScrollbar vscrollbar = new VScrollbar(terminal.Adjustment);
            hbox.PackStart(terminal, true, true, 0);
            hbox.PackStart(vscrollbar, false, true, 0);

            //scrolledWindow.AddWithViewport(hbox);
            frame.ShadowType = Gtk.ShadowType.In;
            scrolledWindow.Add(hbox);
            frame.Add(scrolledWindow);

            widget = frame;
            DefaultPlacement = "bottom";

            string[] environment = new string[Environment.GetEnvironmentVariables().Count];
            int index = 0;
            foreach (DictionaryEntry e in Environment.GetEnvironmentVariables ())
            {
                environment[index++] = String.Format ("{0}={1}", e.Key, e.Value);
            }
            terminal.ForkCommand(
                "R",
                new string[] {"--no-save"},
                environment,
                Environment.CurrentDirectory,
                false,
                false,
                false
            );

            frame.ShowAll();
            instance = this;
        }
예제 #14
0
        public void Initialize(EditSession session)
        {
            PropertyDescriptor prop = session.Property;

            if (!prop.PropertyType.IsEnum)
                throw new ApplicationException ("Flags editor does not support editing values of type " + prop.PropertyType);

            Spacing = 3;
            propType = prop.PropertyType;

            property = prop.Description;
            if (property == null || property.Length == 0)
                property = prop.Name;

            // For small enums, the editor is a list of checkboxes inside a frame
            // For large enums (>5), use a selector dialog.

            values = System.Enum.GetValues (prop.PropertyType);

            if (values.Length < 6)
            {
                Gtk.VBox vbox = new Gtk.VBox (true, 3);

                flags = new Hashtable ();

                foreach (object value in values) {
                    Gtk.CheckButton check = new Gtk.CheckButton (value.ToString ());
                    check.TooltipText = value.ToString ();
                    ulong uintVal = Convert.ToUInt64 (value);
                    flags[check] = uintVal;
                    flags[uintVal] = check;

                    check.Toggled += FlagToggled;
                    vbox.PackStart (check, false, false, 0);
                }

                Gtk.Frame frame = new Gtk.Frame ();
                frame.Add (vbox);
                frame.ShowAll ();
                PackStart (frame, true, true, 0);
            }
            else
            {
                flagsLabel = new Gtk.Entry ();
                flagsLabel.IsEditable = false;
                flagsLabel.HasFrame = false;
                flagsLabel.ShowAll ();
                PackStart (flagsLabel, true, true, 0);

                Gtk.Button but = new Gtk.Button ("...");
                but.Clicked += OnSelectFlags;
                but.ShowAll ();
                PackStart (but, false, false, 0);
            }
        }
예제 #15
0
		public void ShowSourceView (string label)
		{
			if (text == null) {
				ScrolledWindow sw = new ScrolledWindow ();
				buffer = new SourceView (new TextTagTable ());
				text = new TextView (buffer);
				text.Editable = false;
				text.CanFocus = false;
				text.Name = "SourceView";
				Frame frame = new Frame ();
				frame.BorderWidth = 5;
				frame.ShadowType = ShadowType.In;
				sw.Add (text);
				frame.Add (sw);
				frame.ShowAll ();
				SourceLabel = new Label ("");
				Content.InsertPage (frame, SourceLabel, 1);
			}
			SourceLabel.Markup = "Source: " + label;
		}
예제 #16
0
파일: DisplayItem.cs 프로젝트: GNOME/nemo
        protected void create_representation(List<KeyValuePair<string, string>> new_fields)
        {
            box = new VBox();

            set_picture_path();

            try {
                if (item.file.starred)
                picture = CairoDrawing.create_big_starred_image(pic_path);
                else
                picture = CairoDrawing.create_image_with_border(pic_path);
            } catch (Exception e) {
                System.Console.WriteLine("failed to generate thumbnail, error: {0}", e.Message);
            }

            Gtk.Table picture_resizer = new Table(1,1, true); // for size
            picture_wrapper = new EventBox(); // for events
            GtkCommon.set_background_color(picture_wrapper, "white");
            picture_wrapper.Add(picture);
            picture_resizer.Attach(picture_wrapper, 0, 1, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);

            Gtk.Alignment picture_alignment = new Gtk.Alignment(0.5f, 0.5f, 0, 0);

            picture_alignment.Add(picture_resizer);

            GtkCommon.show_hand_and_tooltip(picture_wrapper, Mono.Unix.Catalog.GetString("Open"));

            box.PackStart(picture_alignment, true, true, 3);

            string image = Singleton<Types>.Instance.get_type((int)item.file.type.category).icon;
            if (!String.IsNullOrEmpty(image))
            {
                Gtk.HBox tmp = new Gtk.HBox();

                Gtk.Alignment img_alignment = new Gtk.Alignment(1F, 0.5F, 0F, 0.5F);
                img_alignment.RightPadding = 5;
                Gtk.Image img = new Gtk.Image(null, image);
                img_alignment.Add(img);

                tmp.PackStart(img_alignment, true, true, 0);

                Gtk.Alignment label_alignment = new Gtk.Alignment(0F, 0.5F, 0F, 0.5F);
                Gtk.Label tmp_label = new Gtk.Label();
                tmp_label.Markup = "<b>" + item.name(35) + "</b>";
                tmp_label.UseUnderline = false;
                label_alignment.Add(tmp_label);
                tmp.PackStart(label_alignment, true, true, 0);

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

            } else {

                Gtk.Label title = new Gtk.Label();
                title.Markup = "<b>" + item.name(35) + "</b>";

                box.PackStart(title, true, true, 3);
            }

            Gtk.Alignment labels_alignment = new Gtk.Alignment(0.5f, 0.5f, 0f, 0f);

            labels = new Gtk.HBox();

            create_labels();

            labels_alignment.Add(labels);

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

            extra_info = new Gtk.Table((uint)(3 + new_fields.Count), 2, false);

            row = 0;

            foreach (KeyValuePair<string, string> kvp in new_fields)
                add_line(kvp.Key, kvp.Value);

            string path = item.path;

            string homedir = Environment.GetFolderPath(System.Environment.SpecialFolder.Personal);

            if (path.StartsWith(homedir))
                path = path.Replace(homedir, "~");

            int index = -1;
            if ((index = path.LastIndexOf('/')) != -1)
                if (index > 27) {
                    path = path.Substring(0, 25);
                    path += "...";
                } else
                    path = path.Substring(0, index+1);

            add_line(Mono.Unix.Catalog.GetString("Path:"), path);
            add_line(Mono.Unix.Catalog.GetString("Size:"), item.size);
            add_line(Mono.Unix.Catalog.GetString("Last modified:"), item.accessed);
            add_line(Mono.Unix.Catalog.GetString("Last accessed:"), item.modify);

            box.PackStart(extra_info, false, false, 3);

            Gtk.Alignment box_alignment = new Alignment(0.5f, 1f, 0, 0);
            box_alignment.BottomPadding = 12;
            box_alignment.TopPadding = 12;
            box_alignment.LeftPadding = 12;
            box_alignment.RightPadding = 12;

            box_alignment.Add(box);

            box_wrapper = new EventBox(); // for bg color
            box_wrapper.Add(box_alignment);
            GtkCommon.set_background_color(box_wrapper, "white");

            box_wrapper.ButtonPressEvent += GtkCommon.ButtonPressEventWrapper(item);

            representation = new Frame();
            representation.Add(box_wrapper);

            representation.ShowAll();
        }
        public ConfigurationDialog(AlarmClockService service)
            : base(AddinManager.CurrentLocalizer.GetString ("Alarm Clock configuration"))
        {
            this.service = service;

            fade_start = new VScale (0, 100, 1);
            fade_start.Inverted = true;
            fade_start.HeightRequest = volumeSliderHeight;
            fade_end = new VScale (0, 100, 1);
            fade_end.Inverted = true;
            fade_end.HeightRequest = volumeSliderHeight;
            fade_duration = new SpinButton (0, 65535, 1);
            fade_duration.WidthChars = 6;

            VBox fade_big_box = new VBox ();

            VBox fade_start_box = new VBox ();
            fade_start_box.PackEnd (new Label (AddinManager.CurrentLocalizer.GetString ("Start")), true, true, 2);
            fade_start_box.PackStart (fade_start, false, false, 3);

            VBox fade_end_box = new VBox ();
            fade_end_box.PackEnd (new Label (AddinManager.CurrentLocalizer.GetString ("End")), true, true, 2);
            fade_end_box.PackStart (fade_end, false, false, 3);

            HBox fade_box_group = new HBox ();
            fade_box_group.PackStart (fade_start_box, true, true, 2);
            fade_box_group.PackStart (fade_end_box, true, true, 2);

            Label volume_label = new Label (AddinManager.CurrentLocalizer.GetString ("<b>Volume</b>"));
            volume_label.UseMarkup = true;
            fade_big_box.PackStart (volume_label, false, true, 3);
            fade_big_box.PackStart (fade_box_group, true, true, 2);
            Label duration_label = new Label (AddinManager.CurrentLocalizer.GetString ("Duration:"));
            Label duration_seconds_label = new Label (AddinManager.CurrentLocalizer.GetString (" <i>(seconds)</i>"));
            duration_label.UseMarkup = true;
            duration_seconds_label.UseMarkup = true;
            HBox duration_box = new HBox ();
            duration_box.PackStart (duration_label, false, false, 3);
            duration_box.PackStart (fade_duration, false, false, 3);
            duration_box.PackStart (duration_seconds_label, false, true, 3);
            fade_big_box.PackStart (duration_box, true, true, 2);

            Frame alarm_fade_frame = new Frame (AddinManager.CurrentLocalizer.GetString ("Fade-In Adjustment"));
            alarm_fade_frame.Add (fade_big_box);
            alarm_fade_frame.ShowAll ();

            HBox command_box = new HBox ();
            command_box.PackStart (new Label (AddinManager.CurrentLocalizer.GetString ("Command:")), false, false, 3);
            command_entry = new Entry ();
            command_box.PackStart (command_entry, true, true, 3);

            Frame alarm_misc_frame = new Frame (AddinManager.CurrentLocalizer.GetString ("Command To Execute:"));
            alarm_misc_frame.Add (command_box);
            alarm_misc_frame.ShowAll ();

            VBox.PackStart (alarm_fade_frame, false, false, 3);
            VBox.PackStart (alarm_misc_frame, false, false, 3);

            AddDefaultCloseButton ();

            // initialize values
            command_entry.Text = service.AlarmCommand;
            fade_start.Value = service.FadeStartVolume;
            fade_end.Value = service.FadeEndVolume;
            fade_duration.Value = service.FadeDuration;

            // attach change handlers
            command_entry.Changed += new EventHandler (AlarmCommand_Changed);
            fade_start.ValueChanged += new EventHandler (FadeStartVolume_Changed);
            fade_end.ValueChanged += new EventHandler (FadeEndVolume_Changed);
            fade_duration.ValueChanged += new EventHandler (FadeDuration_Changed);
        }