Exemplo n.º 1
0
        public ArtworkPopup() : base(Gtk.WindowType.Popup)
        {
            VBox vbox = new VBox();
            Add(vbox);

            Decorated = false;
            BorderWidth = 6;

            SetPosition(WindowPosition.CenterAlways);

            image = new Gtk.Image();
            label = new Label(String.Empty);
            label.CanFocus = false;
            label.Wrap = true;

            label.ModifyBg(StateType.Normal, new Color(0, 0, 0));
            label.ModifyFg(StateType.Normal, new Color(160, 160, 160));
            ModifyBg(StateType.Normal, new Color(0, 0, 0));
            ModifyFg(StateType.Normal, new Color(160, 160, 160));

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

            vbox.Spacing = 6;
            vbox.ShowAll();
        }
Exemplo n.º 2
0
		public DockFrame ()
		{
			Mono.TextEditor.GtkWorkarounds.FixContainerLeak (this);

			dockBarTop = new DockBar (this, Gtk.PositionType.Top);
			dockBarBottom = new DockBar (this, Gtk.PositionType.Bottom);
			dockBarLeft = new DockBar (this, Gtk.PositionType.Left);
			dockBarRight = new DockBar (this, Gtk.PositionType.Right);
			
			container = new DockContainer (this);
			HBox hbox = new HBox ();
			hbox.PackStart (dockBarLeft, false, false, 0);
			hbox.PackStart (container, true, true, 0);
			hbox.PackStart (dockBarRight, false, false, 0);
			mainBox = new VBox ();
			mainBox.PackStart (dockBarTop, false, false, 0);
			mainBox.PackStart (hbox, true, true, 0);
			mainBox.PackStart (dockBarBottom, false, false, 0);
			Add (mainBox);
			mainBox.ShowAll ();
			mainBox.NoShowAll = true;
			CompactGuiLevel = 2;
			dockBarTop.UpdateVisibility ();
			dockBarBottom.UpdateVisibility ();
			dockBarLeft.UpdateVisibility ();
			dockBarRight.UpdateVisibility ();

			DefaultVisualStyle = new DockVisualStyle ();
		}
Exemplo n.º 3
0
        public TrackInfoPopup()
            : base(Gtk.WindowType.Popup)
        {
            BorderWidth = 8;
            AppPaintable = true;
            Resizable = false;
            TypeHint = Gdk.WindowTypeHint.Notification;

            VBox box = new VBox ();
            box.Spacing = 4;

            header = new ClassicTrackInfoDisplay ();
            header.SetSizeRequest (320, 64);

            seek_slider = new ConnectedSeekSlider (SeekSliderLayout.Horizontal);
            seek_slider.StreamPositionLabel.FormatString = "<small>{0}</small>";
            seek_slider.LeftPadding = 0;
            seek_slider.RightPadding = 0;

            box.PackStart (header, true, true, 0);
            box.PackStart (seek_slider, false, false, 0);

            Add (box);
            box.ShowAll ();
        }
Exemplo n.º 4
0
        void LoadGui(MonoDevelopProxy proxy, string document, string fileName)
        {
            System.Diagnostics.Trace.WriteLine("Creating AspNetEdit EditorHost");
            host = new EditorHost(proxy);
            host.Initialise(document, fileName);
            System.Diagnostics.Trace.WriteLine("Created AspNetEdit EditorHost");

            System.Diagnostics.Trace.WriteLine("Building AspNetEdit GUI");
            Gtk.VBox outerBox = new Gtk.VBox();

            geckoFrame        = new Frame();
            geckoFrame.Shadow = ShadowType.In;
            geckoFrame.Add(host.DesignerView);
            outerBox.PackEnd(geckoFrame, true, true, 0);

            Toolbar tb = BuildToolbar();

            outerBox.PackStart(tb, false, false, 0);

            outerBox.ShowAll();
            base.DesignerWidget = outerBox;

            //grid picks up some services from the designer host
            propertyGrid = new PropertyGrid(host.Services);
            propertyGrid.ShowAll();
            base.PropertyGridWidget = propertyGrid;
            System.Diagnostics.Trace.WriteLine("Built AspNetEdit GUI");
        }
Exemplo n.º 5
0
        public ArtworkPopup()
            : base(Gtk.WindowType.Popup)
        {
            VBox vbox = new VBox();
            Add(vbox);

            Decorated = false;
            BorderWidth = 6;

            SetPosition(WindowPosition.CenterAlways);

            image = new Gtk.Image();
            label = new Label(String.Empty);
            label.CanFocus = false;
            label.Wrap = true;

            var bg_color = new RGBA ();
            bg_color.Red = bg_color.Green = bg_color.Blue = 0;
            var fg_color = new RGBA ();
            fg_color.Red = bg_color.Green = bg_color.Blue =  160.0 / 255;
            label.OverrideBackgroundColor (StateFlags.Normal, bg_color);
            label.OverrideColor (StateFlags.Normal, fg_color);
            OverrideBackgroundColor (StateFlags.Normal, bg_color);
            OverrideColor (StateFlags.Normal, fg_color);

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

            vbox.Spacing = 6;
            vbox.ShowAll();
        }
Exemplo n.º 6
0
		public DockFrame ()
		{
			shadedContainer = new ShadedContainer ();
			
			dockBarTop = new DockBar (this, Gtk.PositionType.Top);
			dockBarBottom = new DockBar (this, Gtk.PositionType.Bottom);
			dockBarLeft = new DockBar (this, Gtk.PositionType.Left);
			dockBarRight = new DockBar (this, Gtk.PositionType.Right);
			
			container = new DockContainer (this);
			HBox hbox = new HBox ();
			hbox.PackStart (dockBarLeft, false, false, 0);
			hbox.PackStart (container, true, true, 0);
			hbox.PackStart (dockBarRight, false, false, 0);
			mainBox = new VBox ();
			mainBox.PackStart (dockBarTop, false, false, 0);
			mainBox.PackStart (hbox, true, true, 0);
			mainBox.PackStart (dockBarBottom, false, false, 0);
			Add (mainBox);
			mainBox.ShowAll ();
			mainBox.NoShowAll = true;
			CompactGuiLevel = 2;
			dockBarTop.UpdateVisibility ();
			dockBarBottom.UpdateVisibility ();
			dockBarLeft.UpdateVisibility ();
			dockBarRight.UpdateVisibility ();
		}
Exemplo n.º 7
0
        public CodeCompilationPanel()
        {
            InitializeComponent();
            vbox = new VBox();
            var hboxTmp = new HBox();
            hboxTmp.PackStart (codeGenerationLabel, false, false, 0);
            vbox.PackStart (hboxTmp, false, false, 12);

            hboxTmp = new HBox();
            var tableOutputOptions = new Table (4, 2, false);
            tableOutputOptions.Attach (outputLabel, 0, 1, 0, 1, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
            tableOutputOptions.Attach (outputAssembly, 1, 2, 0, 1, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill, 0, 3);
            tableOutputOptions.Attach (labelOutputDir, 0, 1, 1, 2, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
            tableOutputOptions.Attach (outputDirectory, 1, 2, 1, 2, AttachOptions.Fill | AttachOptions.Expand , AttachOptions.Fill, 0, 3);
            tableOutputOptions.Attach (labelCompileTarget, 0, 1, 2, 3, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
            tableOutputOptions.Attach (compileTargetCombo, 1, 2, 2, 3, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill, 0, 3);
            tableOutputOptions.Attach (labelCulture, 0, 1, 3, 4, AttachOptions.Shrink, AttachOptions.Shrink, 0, 0);
            tableOutputOptions.Attach (culture, 1, 2, 3, 4, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill, 0, 3);
            hboxTmp.PackStart (tableOutputOptions, true, true, 6);
            vbox.PackStart (hboxTmp, false, false, 0);

            hboxTmp = new HBox ();
            hboxTmp.PackStart (labelWarnings, false, false, 0);
            vbox.PackStart (hboxTmp, false, false, 12);
            hboxTmp = new HBox();
            hboxTmp.PackStart (checkDebug, false, false, 6);
            vbox.PackStart (hboxTmp, false, false, 0);
            hboxTmp = new HBox();
            hboxTmp.PackStart (checkDucky, false, false, 6);
            vbox.PackStart (hboxTmp, false, false, 0);

            vbox.ShowAll ();
        }
Exemplo n.º 8
0
 private Widget CreateWidgets()
 {
     VBox vbox = new VBox(false, 0);
        Label l = new Label("<span size=\"large\">Base Colors</span>");
        vbox.PackStart(l, false, false, 0);
        l.UseMarkup = true;
        l.Xalign = 0;
        vbox.PackStart(CreateColorBox("Normal", this.Style.Base(StateType.Normal)));
        vbox.PackStart(CreateColorBox("Active", this.Style.Base(StateType.Active)));
        vbox.PackStart(CreateColorBox("Prelight", this.Style.Base(StateType.Prelight)));
        vbox.PackStart(CreateColorBox("Selected", this.Style.Base(StateType.Selected)));
        vbox.PackStart(CreateColorBox("Insensitive", this.Style.Base(StateType.Insensitive)));
        l = new Label("<span size=\"large\">Background Colors</span>");
        vbox.PackStart(l, false, false, 0);
        l.UseMarkup = true;
        l.Xalign = 0;
        vbox.PackStart(CreateColorBox("Normal", this.Style.Background(StateType.Normal)));
        vbox.PackStart(CreateColorBox("Active", this.Style.Background(StateType.Active)));
        vbox.PackStart(CreateColorBox("Prelight", this.Style.Background(StateType.Prelight)));
        vbox.PackStart(CreateColorBox("Selected", this.Style.Background(StateType.Selected)));
        vbox.PackStart(CreateColorBox("Insensitive", this.Style.Background(StateType.Insensitive)));
        l = new Label("<span size=\"large\">Foreground Colors</span>");
        vbox.PackStart(l, false, false, 0);
        l.UseMarkup = true;
        l.Xalign = 0;
        vbox.PackStart(CreateColorBox("Normal", this.Style.Foreground(StateType.Normal)));
        vbox.PackStart(CreateColorBox("Active", this.Style.Foreground(StateType.Active)));
        vbox.PackStart(CreateColorBox("Prelight", this.Style.Foreground(StateType.Prelight)));
        vbox.PackStart(CreateColorBox("Selected", this.Style.Foreground(StateType.Selected)));
        vbox.PackStart(CreateColorBox("Insensitive", this.Style.Foreground(StateType.Insensitive)));
        vbox.ShowAll();
        return vbox;
 }
		public ProgressWindow() : base(Catalog.GetString("File Operation Progress")) {
			vbox = new VBox();
			
			
			this.Add(vbox);
			vbox.ShowAll();
			
			DeleteEvent += OnDeleteEvent;
		}
Exemplo n.º 10
0
		public TopLevelDialog ( )
		{
			vbox = new VBox ();
			separator = new HSeparator ();
			buttonBox = new HButtonBox ();
			vbox.PackEnd (buttonBox, false, false, 0);
			vbox.PackEnd (separator, false, false, 0);
			vbox.ShowAll ();
			Add (vbox);
		}
Exemplo n.º 11
0
		public TrayPopupWindow() : base(Gtk.WindowType.Popup)
		{
			//Stetic.Gui.Build(this, typeof(giver.TrayPopupWindow));
			
			VBox test = new VBox();
			titleLabel = new Label("User X has sent Y of Z files");
			test.Add (titleLabel);
			test.ShowAll();
			this.Add(test);
			
			
		}
Exemplo n.º 12
0
        /// <summary>
        /// Creates a Gtk.Widget that's used to configure the service.	This
        /// will be used in the Synchronization Preferences.	Preferences should
        /// not automatically be saved by a GConf Property Editor.	Preferences
        /// should be saved when SaveConfiguration () is called.
        /// </summary>
        public override Gtk.Widget CreatePreferencesControl()
        {
            Gtk.VBox container = new Gtk.VBox(false, 0);

            container.PackStart(GtkUtil.newMarkupLabel(Catalog.GetString("<span weight='bold'>Server Settings:</span>")));
            SetupGuiServerRelated(container, 4);
            container.PackStart(new Gtk.Label());
            container.PackStart(GtkUtil.newMarkupLabel(Catalog.GetString("<span weight='bold'>Encryption Settings:</span>")));
            SetupGuiEncryptionRelated(container, 4);
            container.ShowAll();
            return(container);
        }
Exemplo n.º 13
0
        public void ShowControlBox(Gtk.VBox labels, Gtk.VBox widgets)
        {
            Label label = new Label("Target height:");

            heightscale               = new HScale(minheight, maxheight, (maxheight - minheight) / 20);
            heightscale.Value         = lastheight;
            heightscale.ValueChanged += new EventHandler(heightscale_ValueChanged);

            labels.PackEnd(label);
            widgets.PackEnd(heightscale);
            labels.ShowAll();
            widgets.ShowAll();
        }
		public ImageVisualizerView ()
		{
			vbox = new VBox (false, 6);
			vbox.BorderWidth = 6;
			
			image = new Gtk.Image ();

			scrolledWindow = new ScrolledWindow ();
			scrolledWindow.Add (image);
			
			vbox.PackStart (scrolledWindow, true, true, 0);
			
			vbox.ShowAll ();
		}
Exemplo n.º 15
0
			private void build()
			{
				this.buildMain ();

				var a =  new Gtk.VBox (false, 5);

				this.vBoxMain.Visible = true;	
				a.PackStart (vBoxMain);

				this.Add (a);
				a.ShowAll ();
				//events
				this.DeleteEvent += (o, args) =>this.OnClose() ;
			}
Exemplo n.º 16
0
        public DockFrame()
        {
            shadedContainer = new ShadedContainer ();

            container = new DockContainer (this);
            HBox hbox = new HBox ();
            hbox.PackStart (container, true, true, 0);
            mainBox = new VBox ();
            mainBox.PackStart (hbox, true, true, 0);
            Add (mainBox);
            mainBox.ShowAll ();
            mainBox.NoShowAll = true;
            CompactGuiLevel = 2;
        }
		public void AddOperation(GtkFileOperationProgress progress) {
			VBox subvbox = new VBox();
			Label lbl = new Label();
			subvbox.PackStart(lbl, false, false, 0);
			ProgressBar bar = new ProgressBar();
			bar.Adjustment = new Adjustment(0.0, 0.0, 500.0, 1.0, 1.0, 1.0);
			subvbox.PackStart(bar, true, true, 0);
			vbox.PackStart(subvbox, false, true, 0);
			subvbox.ShowAll();
			
			progress.DisplayWidget = bar;
			progress.Label = lbl;
			progress.Adjustment = bar.Adjustment;
			this.ShowAll();
		}
Exemplo n.º 18
0
        public void ShowControlBox(Gtk.VBox labels, Gtk.VBox widgets)
        {
            Tooltips tooltips = new Tooltips();

            coresize               = new HScale(0, 100, 5);
            coresize.Value         = coresizevalue;
            coresize.ValueChanged += new EventHandler(coresize_ValueChanged);
            tooltips.SetTip(coresize, "Radius of core.  Core has no fall-off", "Radius of core.  Inside core, brush has full effect; outside of core, brush effect falls off towards the edge.");
            tooltips.Enable();

            labels.PackEnd(new Label("Brush core radius:"));
            widgets.PackEnd(coresize);
            labels.ShowAll();
            widgets.ShowAll();
        }
Exemplo n.º 19
0
		/// <summary>
		/// Creates a Gtk.Widget that's used to configure the service.  This
		/// will be used in the Synchronization Preferences.  Preferences should
		/// not automatically be saved by a GConf Property Editor.  Preferences
		/// should be saved when SaveConfiguration () is called.
		/// </summary>
		public override Gtk.Widget CreatePreferencesControl (EventHandler requiredPrefChanged)
		{
			Gtk.Table table = new Gtk.Table (3, 2, false);
			table.RowSpacing = 5;
			table.ColumnSpacing = 10;

			// Read settings out of gconf
			string server, folder, username;
			int port;
			GetConfigSettings (out server, out folder, out username, out port);
			if (server == null)
				server = string.Empty;
			if (port > -1 && port != 22)
				server += ":" + port.ToString ();
			if (folder == null)
				folder = string.Empty;
			if (username == null)
				username = string.Empty;

			serverEntry = new Entry ();
			serverEntry.Text = server;
			serverEntry.Changed += requiredPrefChanged;
			AddRow (table, serverEntry, Catalog.GetString ("Se_rver:"), 0);

			usernameEntry = new Entry ();
			usernameEntry.Text = username;
			AddRow (table, usernameEntry, Catalog.GetString ("User_name:"), 1);

			folderEntry = new Entry ();
			folderEntry.Text = folder;
			AddRow (table, folderEntry, Catalog.GetString ("_Folder Path (optional):"), 2);

			// Text for label describing setup required for SSH sync addin to work
			string sshInfo = Catalog.GetString ("SSH synchronization requires an existing SSH key for this " +
			                                    "server and user, added to a running SSH daemon.");
			Label l = new Label ();
			l.UseMarkup = true;
			l.Markup = string.Format ("<span size=\"small\">{0}</span>",
			                          sshInfo);
			l.Wrap = true;

			VBox vbox = new VBox (false, 5);
			vbox.PackStart (table);
			vbox.PackStart (l);
			vbox.ShowAll ();

			return vbox;
		}
Exemplo n.º 20
0
		public TextVisualizerView ()
		{
			vbox = new VBox (false, 6);
			vbox.BorderWidth = 6;
			
			TextTagTable tagTable = new TextTagTable ();
			TextBuffer buffer = new TextBuffer (tagTable);
			textView = new TextView (buffer);

			scrolledWindow = new ScrolledWindow ();
			scrolledWindow.AddWithViewport (textView);
			
			vbox.PackStart (scrolledWindow, true, true, 0);
			
			vbox.ShowAll ();
		}
		public override Widget CreatePanelWidget ()
		{
			VBox vbox = new VBox();
			showOnStartCheckButton.Label = GettextCatalog.GetString ("Show welcome page on startup");
			showOnStartCheckButton.Active = WelcomePageOptions.ShowOnStartup;
			vbox.PackStart(showOnStartCheckButton, false, false, 0);
			
			internetUpdateCheckButton.Label = GettextCatalog.GetString ("Update welcome page from internet");
			internetUpdateCheckButton.Active = WelcomePageOptions.UpdateFromInternet;
			vbox.PackStart(internetUpdateCheckButton, false, false, 0);
			
			closeOnOpenSlnCheckButton.Label = GettextCatalog.GetString ("Close welcome page after opening a solution");
			closeOnOpenSlnCheckButton.Active = WelcomePageOptions.CloseWhenSolutionOpened;
			vbox.PackStart(closeOnOpenSlnCheckButton, false, false, 0);
			
			vbox.ShowAll ();
			return vbox;
		}
Exemplo n.º 22
0
	private void build(){
		SetDefaultSize(250, 200);
		vBoxMain = new Gtk.VBox (false, 5);
		//widgets
		this.lb1 = new Gtk.Label("Put your records");
		//vBox
		vBoxMain.PackStart(this.lb1,true,false,5);
		this.DeleteEvent += (o, args) => this.OnClose() ;

		var a =  new Gtk.VBox (false, 5);
		this.vBoxMain.Visible = true;
		a.PackStart (vBoxMain);

		this.Add (a);
		a.ShowAll ();
		//events
		this.DeleteEvent += (o, args) => this.OnClose() ;
	}
Exemplo n.º 23
0
 public iFolderCreationDialog(iFolderWeb ifolder)
     : base()
 {
     this.Title = "";
        this.HasSeparator = false;
        this.Resizable = false;
        this.Icon = new Gdk.Pixbuf(Util.ImagesPath("ifolder16.png"));
        Gdk.Pixbuf bigiFolder =
     new Gdk.Pixbuf(Util.ImagesPath("ifolder48.png"));
        Image folderImage = new Image(bigiFolder);
        VBox vbox = new VBox();
        vbox.BorderWidth = 10;
        vbox.Spacing = 10;
        HBox h = new HBox();
        h.Spacing = 12;
        folderImage.SetAlignment(0.5F, 0);
        h.PackStart(folderImage, false, false, 0);
        VBox vbox2 = new VBox();
        vbox2.Spacing = 10;
        Label l = new Label("<span weight=\"bold\" size=\"larger\">" +
     Util.GS("iFolder Created") +
     "</span>");
        l.LineWrap = false;
        l.UseMarkup = true;
        l.Selectable = false;
        l.Xalign = 0;
        l.Yalign = 0;
        vbox2.PackStart(l, false, false, 0);
        l = new Label(Util.GS("The folder you selected is now an iFolder.  To learn more about using iFolder and sharing iFolders with other users, see \"Managing iFolders\" in iFolder Help."));
        l.LineWrap = true;
        l.Xalign = 0;
        vbox2.PackStart(l, true, true, 0);
        h.PackEnd(vbox2, true, true, 0);
        vbox.PackStart(h);
        Alignment cbAlignment = new Alignment(1, 1, 1, 0);
        vbox.PackStart(cbAlignment, true, true, 0);
        cbutton =
     new CheckButton(Util.GS("Do not show this message again."));
        cbAlignment.Add(cbutton);
        vbox.ShowAll();
        this.VBox.Add(vbox);
        this.AddButton(Stock.Close, ResponseType.Ok);
        this.AddButton(Stock.Help, ResponseType.Help);
 }
Exemplo n.º 24
0
 public iFolderNetworkDialog()
     : base()
 {
     this.Title = "";
                 this.HasSeparator = false;
                 this.Resizable = false;
                 this.Icon = new Gdk.Pixbuf(Util.ImagesPath("ifolder16.png"));
     Gdk.Pixbuf bigiFolder =
                         new Gdk.Pixbuf(Util.ImagesPath("ifolder48.png"));
                 Image folderImage = new Image(bigiFolder);
                 VBox vbox = new VBox();
                 vbox.BorderWidth = 10;
                 vbox.Spacing = 10;
                 HBox h = new HBox();
                 h.Spacing = 12;
                 folderImage.SetAlignment(0.5F, 0);
                 h.PackStart(folderImage, false, false, 0);
                 VBox vbox2 = new VBox();
                 vbox2.Spacing = 10;
                 Label l = new Label("<span weight=\"bold\" size=\"larger\">" +
                                                         Util.GS("Network Events") +
                                                         "</span>");
                 l.LineWrap = false;
                 l.UseMarkup = true;
                 l.Selectable = false;
                 l.Xalign = 0;
                 l.Yalign = 0;
                 vbox2.PackStart(l, false, false, 0);
                 l = new Label(Util.GS("Novell iFolder does not currently support this machine's Network card to detect Network events. DBus failed to initialize for the Network card."));
                 l.LineWrap = true;
                 l.Xalign = 0;
                 vbox2.PackStart(l, true, true, 0);
                 h.PackEnd(vbox2, true, true, 0);
                 vbox.PackStart(h);
                 Alignment cbAlignment = new Alignment(1, 1, 1, 0);
                 vbox.PackStart(cbAlignment, true, true, 0);
                 cbutton =
                         new CheckButton(Util.GS("Do not show this message again."));
                 cbAlignment.Add(cbutton);
                 vbox.ShowAll();
                 this.VBox.Add(vbox);
                 this.AddButton(Stock.Close, ResponseType.Ok);
 }
Exemplo n.º 25
0
        private void CustomBuild()
        {
            string[] labels = new string[] { "General", "Pagos", "Usuarios" };
            string[] images = new string[] { "opt_general.png", "opt_payments.png", "opt_users.png" };

            //creating beautiful tabs :D
            for(int i = 0; i < labels.Length; i++)
            {
                VBox nb_vbox = new VBox();
                nb_vbox.WidthRequest = 60;
                Image img = new Image(null, images[i]);
                Label lbl = new Label(labels[i]);
                nb_vbox.PackStart(img);
                nb_vbox.PackStart(lbl);
                this.notebook1.SetTabLabel(this.notebook1.GetNthPage(i), nb_vbox);
                nb_vbox.ShowAll();
            }

            this.UsersNodeView.AppendColumn("Usuario", new CellRendererText(), "text", 0);
        }
Exemplo n.º 26
0
        public JpegCompressionDialog(int defaultQuality)
            : base(Catalog.GetString ("JPEG Quality"), Pinta.Core.PintaCore.Chrome.MainWindow, DialogFlags.Modal | DialogFlags.DestroyWithParent,
				Stock.Cancel, ResponseType.Cancel, Stock.Ok, ResponseType.Ok)
        {
            this.BorderWidth = 6;
            this.VBox.Spacing = 3;
            VBox content = new VBox ();
            content.Spacing = 5;

            Label label = new Label (Catalog.GetString ("Quality: "));
            label.Xalign = 0;
            content.PackStart (label, false, false, 0);

            compressionLevel = new HScale (1, 100, 1);
            compressionLevel.Value = defaultQuality;
            content.PackStart (compressionLevel, false, false, 0);

            content.ShowAll ();
            this.VBox.Add (content);
            AlternativeButtonOrder = new int[] { (int) ResponseType.Ok, (int) ResponseType.Cancel };
        }
Exemplo n.º 27
0
 public iFolderCrashDialog(System.Exception e)
     : base()
 {
     this.SetDefaultSize (600, 400);
        this.Title = "";
        this.HasSeparator = false;
        this.Resizable = true;
        this.Icon = new Gdk.Pixbuf(Util.ImagesPath("ifolder-crash.png"));
        Image crashImage =
     new Image(new Gdk.PixbufAnimation(Util.ImagesPath("ifolder-crash.gif")));
        VBox vbox = new VBox();
        vbox.BorderWidth = 10;
        vbox.Spacing = 10;
        Label l = new Label("<span weight=\"bold\" size=\"larger\">" +
     Util.GS("iFolder crashed because of an unhandled exception") +
     "</span>");
        l.LineWrap = false;
        l.UseMarkup = true;
        l.Selectable = false;
        l.Xalign = 0; l.Yalign = 0;
        vbox.PackStart(l, false, false, 0);
        HBox h = new HBox();
        h.BorderWidth = 10;
        h.Spacing = 12;
        crashImage.SetAlignment(0.5F, 0);
        h.PackStart(crashImage, false, false, 0);
        TextView tv = new TextView();
        tv.WrapMode = Gtk.WrapMode.Word;
        tv.Editable = false;
        tv.Buffer.Text = e.ToString();
        ScrolledWindow sw = new ScrolledWindow();
        sw.ShadowType = Gtk.ShadowType.EtchedIn;
        sw.Add(tv);
        h.PackEnd(sw, true, true, 0);
        vbox.PackEnd(h);
        vbox.ShowAll();
        this.VBox.Add(vbox);
        this.AddButton(Stock.Close, ResponseType.Ok);
 }
Exemplo n.º 28
0
 public BusyDialog(Window parent)
 {
     TransientFor = parent;
     box = new VBox (false, 10);
     titleLabel = new Label ();
     progressBar = new ProgressBar ();
     box.PackStart (titleLabel, true, true, 0);
     box.PackStart (progressBar, true, true, 0);
     box.ShowAll ();
     VBox.PackStart (box);
     Icon = LongoMatch.Gui.Helpers.Misc.LoadIcon ("longomatch", 28);
     TypeHint = Gdk.WindowTypeHint.Dialog;
     WindowPosition = WindowPosition.Center;
     Modal = true;
     Resizable = false;
     Gravity = Gdk.Gravity.Center;
     SkipPagerHint = true;
     SkipTaskbarHint = true;
     DefaultWidth = 300;
     DefaultHeight = 100;
     timeout = 0;
 }
Exemplo n.º 29
0
		public WindowShell (string name, string title, int width, int height, bool maximize) : base (WindowType.Toplevel)
		{
			Name = name;
			Title = title;
			DefaultWidth = width;
			DefaultHeight = height;

			WindowPosition = WindowPosition.Center;
			AllowShrink = true;

			if (maximize)
				Maximize ();

			shell_layout = new VBox () { Name = "shell_layout" };
			menu_layout = new VBox () { Name = "menu_layout" };

			shell_layout.PackStart (menu_layout, false, false, 0);

			Add (shell_layout);

			shell_layout.ShowAll ();
		}
        Gtk.Widget CreateAssembliesTable()
        {
            var box = new Gtk.VBox();

            box.PackStart(new Gtk.Label()
            {
                Markup = string.Format("<b>{0}</b>", GettextCatalog.GetString("Loaded Assemblies")),
                Xalign = 0
            });
            var table = new Gtk.Table(0, 0, false);

            table.ColumnSpacing = 3;
            uint line = 0;

            foreach (var assembly in AppDomain.CurrentDomain.GetAssemblies().Where(a => !a.IsDynamic).OrderBy(a => a.FullName))
            {
                try {
                    var assemblyName = assembly.GetName();
                    table.Attach(new Gtk.Label(assemblyName.Name)
                    {
                        Xalign = 0
                    }, 0, 1, line, line + 1);
                    table.Attach(new Gtk.Label(assemblyName.Version.ToString())
                    {
                        Xalign = 0
                    }, 1, 2, line, line + 1);
                    table.Attach(new Gtk.Label(System.IO.Path.GetFullPath(assembly.Location))
                    {
                        Xalign = 0
                    }, 2, 3, line, line + 1);
                } catch {
                }
                line++;
            }
            box.PackStart(table, false, false, 0);
            box.ShowAll();
            return(box);
        }
Exemplo n.º 31
0
        protected Tab AddButton(string label, IBaseViewContent viewContent)
        {
            CheckCreateSubViewToolbar();
            updating = true;

            Tab tab = new Tab(subViewToolbar, label);

            tab.Tag        = subViewToolbar.TabCount;
            tab.Activated += (sender, e) => { SetCurrentView((int)((Tab)sender).Tag); QueueDraw(); };
            subViewToolbar.AddTab(tab);

            Gtk.VBox widgetBox = new Gtk.VBox();
            widgetBox.Realized += delegate {
                widgetBox.Add(viewContent.Control);
            };

            subViewNotebook.AppendPage(widgetBox, new Gtk.Label());
            widgetBox.ShowAll();

            EnsureToolbarBoxSeparator();
            updating = false;
            return(tab);
        }
		public Gtk.Widget GetVisualizerWidget (ObjectValue val)
		{
			VBox box = new VBox (false, 6);
			textView = new TextView ();
			textView.Buffer.Text = val.GetRawValue () as string;
			textView.WrapMode = WrapMode.Char;
			Gtk.ScrolledWindow scrolled = new Gtk.ScrolledWindow ();
			scrolled.HscrollbarPolicy = PolicyType.Automatic;
			scrolled.VscrollbarPolicy = PolicyType.Automatic;
			scrolled.ShadowType = ShadowType.In;
			scrolled.Add (textView);
			box.PackStart (scrolled, true, true, 0);
			CheckButton cb = new CheckButton (GettextCatalog.GetString ("Wrap text"));
			cb.Active = true;
			cb.Toggled += delegate {
				if (cb.Active)
					textView.WrapMode = WrapMode.Char;
				else
					textView.WrapMode = WrapMode.None;
			};
			box.PackStart (cb, false, false, 0);
			box.ShowAll ();
			return box;
		}
Exemplo n.º 33
0
        public RatingEntryTestModule()
            : base("Rating Entry")
        {
            VBox pbox = new VBox ();
            Add (pbox);

            Menu m = new Menu ();
            MenuBar b = new MenuBar ();
            MenuItem item = new MenuItem ("Rate Me!");
            item.Submenu = m;
            b.Append (item);
            m.Append (new MenuItem ("Apples"));
            m.Append (new MenuItem ("Pears"));
            m.Append (new RatingMenuItem ());
            m.Append (new ImageMenuItem ("gtk-remove", null));
            m.ShowAll ();
            pbox.PackStart (b, false, false, 0);

            VBox box = new VBox ();
            box.BorderWidth = 10;
            box.Spacing = 10;
            pbox.PackStart (box, true, true, 0);

            RatingEntry entry1 = new RatingEntry ();
            box.PackStart (entry1, true, true, 0);

            RatingEntry entry2 = new RatingEntry ();
            box.PackStart (entry2, false, false, 0);

            box.PackStart (new Entry ("Normal GtkEntry"), false, false, 0);

            RatingEntry entry3 = new RatingEntry ();
            Pango.FontDescription fd = entry3.PangoContext.FontDescription.Copy ();
            fd.Size = (int)(fd.Size * Pango.Scale.XXLarge);
            entry3.OverrideFont (fd);
            fd.Dispose ();
            box.PackStart (entry3, true, true, 0);

            pbox.ShowAll ();
        }
Exemplo n.º 34
0
    void CreateComponents()
    {
        fullViewVBox = new VBox(false, 0);
        rootWidget   = fullViewVBox;

        CreateMenuBar();

        CreateToolBar();

        // Create the docking widget and add it to the window.
        dock                   = new DockFrame();
        dock.Homogeneous       = false;
        dock.DefaultItemHeight = 100;
        dock.DefaultItemWidth  = 100;
        //dock.CompactGuiLevel = 1;

        toolbarFrame.AddContent(dock);

        // Create the notebook for the various documents.
        tabControl            = new DragNotebook(); //(dock.ShadedContainer);
        tabControl.Scrollable = true;
        tabControl.AppendPage(new Label("Other page"), new Label("Favorite Page  "));
        tabControl.AppendPage(new Label("What page"), new Label("Welcome/Start Page  "));
        tabControl.AppendPage(new TextView(), new Image("gtk-new", IconSize.Menu));
        tabControl.ShowAll();

        // The main document area
        documentDockItem                 = dock.AddItem("Documents");
        documentDockItem.Behavior        = DockItemBehavior.Locked;
        documentDockItem.Status          = DockItemStatus.AutoHide;
        documentDockItem.DefaultHeight   = 100;
        documentDockItem.DefaultWidth    = 100;
        documentDockItem.DefaultStatus   = DockItemStatus.AutoHide;
        documentDockItem.DefaultLocation = "Document/Right";
        documentDockItem.Expand          = true;
        documentDockItem.DrawFrame       = true;
        documentDockItem.Label           = "Documents";
        documentDockItem.Content         = tabControl;
        documentDockItem.DefaultVisible  = true;
        documentDockItem.Visible         = true;


        DockItem dit = dock.AddItem("left");

        dit.Status          = DockItemStatus.AutoHide;
        dit.DefaultHeight   = 100;
        dit.DefaultWidth    = 100;
        dit.DefaultStatus   = DockItemStatus.AutoHide;
        dit.DefaultLocation = "left";
        dit.Behavior        = DockItemBehavior.Normal;
        dit.Label           = "Left";
        dit.DefaultVisible  = true;
        dit.Visible         = true;
        DockItemToolbar tb = dit.GetToolbar(PositionType.Top);
        ToolButton      b  = new ToolButton(null, "Hello");

        tb.Add(b, false);
        tb.Visible = true;
        tb.ShowAll();

        dit                 = dock.AddItem("right");
        dit.Status          = DockItemStatus.AutoHide;
        dit.DefaultHeight   = 100;
        dit.DefaultWidth    = 100;
        dit.DefaultStatus   = DockItemStatus.AutoHide;
        dit.DefaultLocation = "Documents/Right";
        dit.Behavior        = DockItemBehavior.Normal;
        dit.Label           = "Right";
        dit.DefaultVisible  = true;
        dit.Visible         = true;
        //dit.Icon = Gdk.Pixbuf.LoadFromResource("Cage.Shell.Docking.stock-close-12.png");

        dit                 = dock.AddItem("top");
        dit.Status          = DockItemStatus.AutoHide;
        dit.DefaultHeight   = 100;
        dit.DefaultWidth    = 100;
        dit.DefaultStatus   = DockItemStatus.AutoHide;
        dit.DefaultLocation = "Documents/Top";
        dit.Behavior        = DockItemBehavior.Normal;
        dit.Label           = "Top";
        dit.DefaultVisible  = true;
        dit.Visible         = true;

        dit                 = dock.AddItem("bottom");
        dit.Status          = DockItemStatus.AutoHide;
        dit.DefaultHeight   = 100;
        dit.DefaultWidth    = 100;
        dit.DefaultStatus   = DockItemStatus.AutoHide;
        dit.DefaultLocation = "Documents/Bottom";
        dit.Behavior        = DockItemBehavior.Normal;
        dit.Label           = "Bottom";
        dit.DefaultVisible  = true;
        dit.Visible         = true;



        if (File.Exists("toolbar.status"))
        {
            toolbarFrame.LoadStatus("toolbar.status");
        }

        if (File.Exists("config.layout"))
        {
            dock.LoadLayouts("config.layout");
        }
        else
        {
            dock.CreateLayout("test", true);
        }


        dock.CurrentLayout = "test";
        dock.HandlePadding = 0;
        dock.HandleSize    = 10;

        dock.SaveLayouts("config.layout");
        toolbarFrame.SaveStatus("toolbar.status");

        Add(fullViewVBox);
        fullViewVBox.ShowAll();

        statusBar = new Gtk.Statusbar();
        fullViewVBox.PackEnd(statusBar, false, true, 0);
    }
Exemplo n.º 35
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);
    }
Exemplo n.º 36
0
        private void BuildViews ()
        {
            source_box = new VBox ();

            views_pane = new HPaned ();
            PersistentPaneController.Control (views_pane, SourceViewWidth);
            view_container = new ViewContainer ();

            source_view = new SourceView ();
            composite_view = new CompositeTrackSourceContents ();

            Container source_scroll;
            if (PlatformDetection.IsMeeGo) {
                source_scroll = new Gtk.ScrolledWindow () {
                    HscrollbarPolicy = PolicyType.Never,
                    VscrollbarPolicy = PolicyType.Automatic,
                    ShadowType = ShadowType.None
                };
                source_scroll.Add (source_view);

                var color = new Gdk.Color ((byte)0xe6, (byte)0xe6, (byte)0xe6);
                Gdk.Colormap.System.AllocColor (ref color, true, true);
                source_view.ModifyBase (StateType.Normal, color);
            } else {
                Hyena.Widgets.ScrolledWindow window;
                if (ApplicationContext.CommandLine.Contains ("smooth-scroll")) {
                    window = new Hyena.Widgets.SmoothScrolledWindow ();
                } else {
                    window = new Hyena.Widgets.ScrolledWindow ();
                }

                window.AddWithFrame (source_view);
                source_scroll = window;
            }

            composite_view.TrackView.HeaderVisible = false;
            view_container.Content = composite_view;

            source_box.PackStart (source_scroll, true, true, 0);
            source_box.PackStart (new UserJobTileHost (), false, false, 0);

            UpdateCoverArtDisplay ();

            source_view.SetSizeRequest (125, -1);
            view_container.SetSizeRequest (425, -1);

            views_pane.Pack1 (source_box, false, false);
            views_pane.Pack2 (view_container, true, false);

            source_box.ShowAll ();
            view_container.Show ();
            views_pane.Show ();

            primary_vbox.PackStart (views_pane, true, true, 0);
        }
Exemplo n.º 37
0
		void CreateComponents ()
		{
			fullViewVBox = new VBox (false, 0);
			rootWidget = fullViewVBox;
			
			InstallMenuBar ();
			
			toolbarFrame = new CommandFrame (IdeApp.CommandService);
			fullViewVBox.PackStart (toolbarFrame, true, true, 0);
			
			foreach (DockToolbar t in toolbars)
				toolbarFrame.AddBar (t);
			
			// Create the docking widget and add it to the window.
			dock = new DockFrame ();
			
			dock.CompactGuiLevel = ((int)IdeApp.Preferences.WorkbenchCompactness) + 1;
			IdeApp.Preferences.WorkbenchCompactnessChanged += delegate {
				dock.CompactGuiLevel = ((int)IdeApp.Preferences.WorkbenchCompactness) + 1;
			};
			
			/* Side bar is experimental. Disabled for now
			HBox hbox = new HBox ();
			VBox sideBox = new VBox ();
			sideBox.PackStart (new SideBar (workbench, Orientation.Vertical), false, false, 0);
			hbox.PackStart (sideBox, false, false, 0);
			hbox.ShowAll ();
			sideBox.NoShowAll = true;
			hbox.PackStart (dock, true, true, 0);
			DockBar bar = dock.ExtractDockBar (PositionType.Left);
			bar.AlwaysVisible = true;
			sideBox.PackStart (bar, true, true, 0);
			toolbarFrame.AddContent (hbox);
			*/

			toolbarFrame.AddContent (dock);
			
			// Create the notebook for the various documents.
			tabControl = new SdiDragNotebook (dock.ShadedContainer);
			tabControl.Scrollable = true;
			tabControl.SwitchPage += OnActiveWindowChanged;
			tabControl.PageAdded += delegate { OnActiveWindowChanged (null, null); };
			tabControl.PageRemoved += delegate { OnActiveWindowChanged (null, null); };
		
			tabControl.ButtonPressEvent += delegate(object sender, ButtonPressEventArgs e) {
				int tab = tabControl.FindTabAtPosition (e.Event.XRoot, e.Event.YRoot);
				if (tab < 0)
					return;
				tabControl.CurrentPage = tab;
				if (e.Event.Type == Gdk.EventType.TwoButtonPress)
					ToggleFullViewMode ();
			};
			
			this.tabControl.PopupMenu += delegate {
				ShowPopup ();
			};
			this.tabControl.ButtonReleaseEvent += delegate (object sender, Gtk.ButtonReleaseEventArgs e) {
				int tab = tabControl.FindTabAtPosition (e.Event.XRoot, e.Event.YRoot);
				if (tab < 0)
					return;
				if (e.Event.Button == 3)
					ShowPopup ();
			};
			
			tabControl.TabsReordered += new TabsReorderedHandler (OnTabsReordered);

			// The main document area
			documentDockItem = dock.AddItem ("Documents");
			documentDockItem.Behavior = DockItemBehavior.Locked;
			documentDockItem.Expand = true;
			documentDockItem.DrawFrame = false;
			documentDockItem.Label = GettextCatalog.GetString ("Documents");
			documentDockItem.Content = tabControl;
			
			// Add some hiden items to be used as position reference
			DockItem dit = dock.AddItem ("__left");
			dit.DefaultLocation = "Documents/Left";
			dit.Behavior = DockItemBehavior.Locked;
			dit.DefaultVisible = false;
			
			dit = dock.AddItem ("__right");
			dit.DefaultLocation = "Documents/Right";
			dit.Behavior = DockItemBehavior.Locked;
			dit.DefaultVisible = false;
			
			dit = dock.AddItem ("__top");
			dit.DefaultLocation = "Documents/Top";
			dit.Behavior = DockItemBehavior.Locked;
			dit.DefaultVisible = false;
			
			dit = dock.AddItem ("__bottom");
			dit.DefaultLocation = "Documents/Bottom";
			dit.Behavior = DockItemBehavior.Locked;
			dit.DefaultVisible = false;

			Add (fullViewVBox);
			fullViewVBox.ShowAll ();
			
			fullViewVBox.PackEnd (this.StatusBar, false, true, 0);
			
			if (MonoDevelop.Core.PropertyService.IsMac)
				this.StatusBar.HasResizeGrip = true;
			else {
				if (GdkWindow != null && GdkWindow.State == Gdk.WindowState.Maximized)
					IdeApp.Workbench.StatusBar.HasResizeGrip = false;
				SizeAllocated += delegate {
					if (GdkWindow != null)
						IdeApp.Workbench.StatusBar.HasResizeGrip = GdkWindow.State != Gdk.WindowState.Maximized;
				};
			}

			// create DockItems for all the pads
			foreach (PadCodon content in padContentCollection)
				AddPad (content, content.DefaultPlacement, content.DefaultStatus);
			
			try {
				if (System.IO.File.Exists (configFile)) {
					dock.LoadLayouts (configFile);
					foreach (string layout in dock.Layouts) {
						if (!layouts.Contains (layout) && !layout.EndsWith (fullViewModeTag))
							layouts.Add (layout);
					}
				}
			} catch (Exception ex) {
				LoggingService.LogError (ex.ToString ());
			}
		}
Exemplo n.º 38
0
    public DialogPersonPopup(int personID, string name, string rfid,
                             List <Task> tasks, List <StationCount> stationsCount, bool serverConnected, bool Autologout)
    {
        Glade.XML gladeXML;
        gladeXML = Glade.XML.FromAssembly(Util.GetGladePath() + "dialog_person_popup.glade", "dialog_person_popup", null);
        gladeXML.Autoconnect(this);

        //put an icon to window
        UtilGtk.IconWindow(dialog_person_popup);

        Visible         = true;
        this.Autologout = Autologout;

        //1) Show top of the window widgets
        label_name.Text      = "<b>" + name + "</b>";
        label_name.UseMarkup = true;
        label_rfid.Text      = rfid;

        Pixbuf pixbuf = new Pixbuf(null, Util.GetImagePath(false) + "image_close.png");

        image_close.Pixbuf = pixbuf;

        pixbuf = new Pixbuf(null, Util.GetImagePath(false) + "image_person_logout.png");
        image_person_logout.Pixbuf = pixbuf;

        pixbuf = new Pixbuf(null, Util.GetImagePath(false) + "gtk-apply.png");
        image_server_connected_yes.Pixbuf = pixbuf;
        pixbuf = new Pixbuf(null, Util.GetImagePath(false) + "gtk-cancel.png");
        image_server_connected_no.Pixbuf = pixbuf;

        if (serverConnected)
        {
            label_server_connected.Text        = "Server is connected";
            image_server_connected_yes.Visible = true;
            image_server_connected_no.Visible  = false;
        }
        else
        {
            label_server_connected.Text        = Constants.ServerDisconnectedMessage;
            image_server_connected_yes.Visible = false;
            image_server_connected_no.Visible  = true;
        }

        //string photoFile = Util.GetPhotoFileName(false, personID);
        string photoFile = Util.UserPhotoURL(false, personID);

        if (File.Exists(photoFile))
        {
            try {
                pixbuf = new Pixbuf(photoFile);                  //from a file
                image_person.Pixbuf = pixbuf;
            } catch {
                string extension = Util.GetMultimediaExtension(photoFile);
                //on windows there are problem using the fileNames that are not on temp
                string tempFileName = Path.Combine(Path.GetTempPath(),
                                                   Constants.PhotoSmallTemp + extension);
                File.Copy(photoFile, tempFileName, true);
                pixbuf = new Pixbuf(tempFileName);
                image_person.Pixbuf = pixbuf;
            }
        }

        //2) Show tasks stuff
        list_tasks_fixed                      = new List <Task>();
        list_hboxs_row                        = new List <Gtk.HBox>();
        list_buttons_start                    = new List <Gtk.Button>();
        list_buttons_done                     = new List <Gtk.Button>();
        list_buttons_done_id                  = new List <int>();
        taskActive                            = new Task();
        Fake_button_start_task                = new Gtk.Button();
        Fake_button_person_logout             = new Gtk.Button();
        Fake_button_person_autologout_changed = new Gtk.Button();

        checkbutton_autologout.Active = Autologout;

        bool task_parametrized_exist = false;

        pixbuf = new Pixbuf(null, Util.GetImagePath(false) + "image_capture_big.png");

        Gtk.HBox hboxRow;
        foreach (Task t in tasks)
        {
            hboxRow = new Gtk.HBox(false, 10);

            if (t.Laterality == "R,L")
            {
                Gtk.VBox vboxRL = new Gtk.VBox(false, 4);

                Task taskCopy = new Task(t.Id, t.PersonId, t.StationId, t.ExerciseId, t.ExerciseName,
                                         t.Sets, t.Nreps, t.Load, t.Speed, t.PercentMaxSpeed,
                                         "R", t.Comment);
                Gtk.HBox hboxStartAndLabel = createHBoxStartAndLabel(taskCopy, pixbuf);
                vboxRL.PackStart(hboxStartAndLabel, false, false, 0);

                taskCopy = new Task(t.Id, t.PersonId, t.StationId, t.ExerciseId, t.ExerciseName,
                                    t.Sets, t.Nreps, t.Load, t.Speed, t.PercentMaxSpeed,
                                    "L", t.Comment);
                hboxStartAndLabel = createHBoxStartAndLabel(taskCopy, pixbuf);
                vboxRL.PackStart(hboxStartAndLabel, false, false, 0);

                Gtk.VSeparator vsep = new Gtk.VSeparator();
                hboxRow.PackStart(vsep, false, false, 0);
                hboxRow.PackStart(vboxRL, false, false, 0);
            }
            else
            {
                Gtk.HBox hboxStartAndLabel = createHBoxStartAndLabel(t, pixbuf);
                hboxRow.PackStart(hboxStartAndLabel, false, false, 0);
            }

            task_parametrized_exist = true;

            //create button_done (shared on R,L)
            Gtk.Button button_done = new Gtk.Button("Fet!");
            button_done.Clicked += new EventHandler(button_done_clicked);
            hboxRow.PackEnd(button_done, false, false, 0);
            list_buttons_done.Add(button_done);
            list_buttons_done_id.Add(t.Id);
            list_hboxs_row.Add(hboxRow);

            vbox_tasks_parametrized.PackStart(hboxRow, false, false, 0);
        }

        if (!task_parametrized_exist)
        {
            Gtk.Label label = new Gtk.Label("There are no pending tasks on this station.");
            vbox_tasks_parametrized.PackStart(label, false, false, 0);
        }

        vbox_tasks_parametrized.ShowAll();

        //3) Show other stations tasks
        string sep            = "";
        string stationsString = "";

        foreach (StationCount sc in stationsCount)
        {
            stationsString += sep + sc.ToString();
            sep             = ", ";
        }

        if (stationsString == "")
        {
            label_other_stations.Text = "There are no tasks at other stations";
        }
        else
        {
            //label_other_stations.Text = "There are task at this stations:" + "\n\n" + stationsString;
            label_other_stations.Text = stationsString;
        }
    }
Exemplo n.º 39
0
        public override Control CreatePanelWidget()
        {
            var solution = DataObject as Solution;

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

            if (solution == null)
            {
                return(box); // something went very wrong
            }

            var scrollArea = new ScrolledWindow();

            store      = new Gtk.ListStore(typeof(ComboChoice), typeof(ComboChoice));
            list       = new Gtk.TreeView();
            list.Model = store;

            LoadConfig();

            var crt = new CellRendererComboBox();

            crt.Changed += GetOnChangedListener(0);
            var projectsColumn = list.AppendColumn("Project", crt, new TreeCellDataFunc(GetOnSetDataFunc(0, GetProjectNames)));

            projectsColumn.Expand = true;


            var testRenderer = new CellRendererComboBox();

            testRenderer.Changed += GetOnChangedListener(1);
            var testsColumn = list.AppendColumn("Tests to run", testRenderer, new TreeCellDataFunc(GetOnSetDataFunc(1, GetTestNames)));

            testsColumn.Expand = true;

            list.Selection.Changed += delegate
            {
                Gtk.TreeIter it;
                list.Selection.GetSelected(out it);
                Gtk.TreeViewColumn ccol;
                Gtk.TreePath       path;
                list.GetCursor(out path, out ccol);
                list.SetCursor(path, ccol, true);
            };

            Button b = new Button();

            b.Label    = "Add row";
            b.Clicked += (o, e) => {
                var project = new ComboChoice {
                    Text = GetProjectNames()[0]
                };
                var test = new ComboChoice {
                    Text = EmptyChoice
                };
                rows.Add(Tuple.Create(project, test));
                store.AppendValues(project, test);
            };

            box.Spacing = 6;
            scrollArea.Add(list);
            box.PackStart(scrollArea);
            box.PackStart(b, false, false, 5);
            box.ShowAll();
            return(box);
        }
Exemplo n.º 40
0
        void CreateComponents()
        {
            fullViewVBox = new VBox (false, 0);
            rootWidget = fullViewVBox;

            InstallMenuBar ();
            Realize ();
            toolbar = DesktopService.CreateMainToolbar (this);
            DesktopService.SetMainWindowDecorations (this);
            var toolbarBox = new HBox ();
            fullViewVBox.PackStart (toolbarBox, false, false, 0);
            toolbarFrame = new CommandFrame (IdeApp.CommandService);

            fullViewVBox.PackStart (toolbarFrame, true, true, 0);

            // Create the docking widget and add it to the window.
            dock = new DockFrame ();

            dock.CompactGuiLevel = ((int)IdeApp.Preferences.WorkbenchCompactness) + 1;
            IdeApp.Preferences.WorkbenchCompactnessChanged += delegate {
                dock.CompactGuiLevel = ((int)IdeApp.Preferences.WorkbenchCompactness) + 1;
            };

            /* Side bar is experimental. Disabled for now
            HBox hbox = new HBox ();
            VBox sideBox = new VBox ();
            sideBox.PackStart (new SideBar (workbench, Orientation.Vertical), false, false, 0);
            hbox.PackStart (sideBox, false, false, 0);
            hbox.ShowAll ();
            sideBox.NoShowAll = true;
            hbox.PackStart (dock, true, true, 0);
            DockBar bar = dock.ExtractDockBar (PositionType.Left);
            bar.AlwaysVisible = true;
            sideBox.PackStart (bar, true, true, 0);
            toolbarFrame.AddContent (hbox);
            */

            toolbarFrame.AddContent (dock);

            // Create the notebook for the various documents.
            tabControl = new SdiDragNotebook (this);

            DockNotebook.ActiveNotebookChanged += delegate {
                OnActiveWindowChanged (null, null);
            };

            Add (fullViewVBox);
            fullViewVBox.ShowAll ();
            bottomBar = new MonoDevelopStatusBar ();
            fullViewVBox.PackEnd (bottomBar, false, true, 0);
            bottomBar.ShowAll ();
            toolbarBox.PackStart (this.toolbar, true, true, 0);

            // In order to get the correct bar height we need to calculate the tab size using the
            // correct style (the style of the window). At this point the widget is not yet a child
            // of the window, so its style is not yet the correct one.
            tabControl.InitSize ();
            var barHeight = tabControl.BarHeight;

            // The main document area
            documentDockItem = dock.AddItem ("Documents");
            documentDockItem.Behavior = DockItemBehavior.Locked;
            documentDockItem.Expand = true;
            documentDockItem.DrawFrame = false;
            documentDockItem.Label = GettextCatalog.GetString ("Documents");
            documentDockItem.Content = new DockNotebookContainer (tabControl, true);

            DockVisualStyle style = new DockVisualStyle ();
            style.PadTitleLabelColor = Styles.PadLabelColor;
            style.PadBackgroundColor = Styles.PadBackground;
            style.InactivePadBackgroundColor = Styles.InactivePadBackground;
            style.PadTitleHeight = barHeight;
            dock.DefaultVisualStyle = style;

            style = new DockVisualStyle ();
            style.PadTitleLabelColor = Styles.PadLabelColor;
            style.PadTitleHeight = barHeight;
            style.ShowPadTitleIcon = false;
            style.UppercaseTitles = false;
            style.ExpandedTabs = true;
            style.PadBackgroundColor = Styles.BrowserPadBackground;
            style.InactivePadBackgroundColor = Styles.InactiveBrowserPadBackground;
            style.TreeBackgroundColor = Styles.BrowserPadBackground;
            dock.SetDockItemStyle ("ProjectPad", style);
            dock.SetDockItemStyle ("ClassPad", style);

            //			dock.SetRegionStyle ("Documents/Left", style);
            //dock.SetRegionStyle ("Documents/Right", style);

            //			style = new DockVisualStyle ();
            //			style.SingleColumnMode = true;
            //			dock.SetRegionStyle ("Documents/Left;Documents/Right", style);
            //			dock.SetDockItemStyle ("Documents", style);

            // Add some hiden items to be used as position reference
            DockItem dit = dock.AddItem ("__left");
            dit.DefaultLocation = "Documents/Left";
            dit.Behavior = DockItemBehavior.Locked;
            dit.DefaultVisible = false;

            dit = dock.AddItem ("__right");
            dit.DefaultLocation = "Documents/Right";
            dit.Behavior = DockItemBehavior.Locked;
            dit.DefaultVisible = false;

            dit = dock.AddItem ("__top");
            dit.DefaultLocation = "Documents/Top";
            dit.Behavior = DockItemBehavior.Locked;
            dit.DefaultVisible = false;

            dit = dock.AddItem ("__bottom");
            dit.DefaultLocation = "Documents/Bottom";
            dit.Behavior = DockItemBehavior.Locked;
            dit.DefaultVisible = false;

            if (MonoDevelop.Core.Platform.IsMac)
                bottomBar.HasResizeGrip = true;
            else {
                if (GdkWindow != null && GdkWindow.State == Gdk.WindowState.Maximized)
                    bottomBar.HasResizeGrip = false;
                SizeAllocated += delegate {
                    if (GdkWindow != null)
                        bottomBar.HasResizeGrip = GdkWindow.State != Gdk.WindowState.Maximized;
                };
            }

            // create DockItems for all the pads
            ExtensionNodeList padCodons = AddinManager.GetExtensionNodes (viewContentPath);
            foreach (ExtensionNode node in padCodons)
                ShowPadNode (node);

            try {
                if (System.IO.File.Exists (configFile)) {
                    dock.LoadLayouts (configFile);
                    foreach (string layout in dock.Layouts) {
                        if (!layouts.Contains (layout) && !layout.EndsWith (fullViewModeTag))
                            layouts.Add (layout);
                    }
                }
            } catch (Exception ex) {
                LoggingService.LogError (ex.ToString ());
            }
        }
Exemplo n.º 41
0
        public ImageEditor(string filePath)
        {
            fileName = filePath;

            fileBarierName = fileName + ".mso";
            if (System.IO.File.Exists(fileBarierName))
            {
                string barierFile;
                try {
                    using (StreamReader file = new StreamReader(fileBarierName)) {
                        barierFile = file.ReadToEnd();
                        file.Close();
                        file.Dispose();
                    }
                    if (!string.IsNullOrEmpty(barierFile))
                    {
                        //listPoint =  JsonConvert.DeserializeObject<List<BarierPoint>>(barierFile);
                        System.Web.Script.Serialization.JavaScriptSerializer jss = new System.Web.Script.Serialization.JavaScriptSerializer();
                        jss.RegisterConverters(new[] { new BarierPointJavaScriptConverter() });
                        listPoint = jss.Deserialize <List <BarierPoint> >(barierFile);
                    }
                } catch (Exception ex) {
                    MessageDialogs ms = new MessageDialogs(MessageDialogs.DialogButtonType.Ok, MainClass.Languages.Translate("file_cannot_open", fileBarierName), ex.Message, Gtk.MessageType.Error, null);
                    ms.ShowDialog();
                }
            }


            editorAction = new Gtk.ActionGroup("imageeditor");

            //ic = new ImageCanvas(filePath,listPoint);
            ic = new ImageCanvas(filePath, listPoint)
            {
                Name       = "canvas",
                CanDefault = true,
                CanFocus   = true,
                Events     = (Gdk.EventMask) 16134
            };

            vbox = new Gtk.VBox();

            /*Gdk.Color col = new Gdk.Color(255,255,0);
             * vbox.ModifyBg(StateType.Normal, col);*/

            itc = new ImageToolBarControl(ic);             //new ImageToolBarControl(ic);
            itc.DeleteBarierLayerEvent += delegate(object sender, EventArgs e) {
                if (System.IO.File.Exists(fileBarierName))
                {
                    try{
                        System.IO.File.Delete(fileBarierName);
                        OnModifiedChanged(false);
                        ic.DeleteBarier();
                    }catch (Exception ex) {
                        MessageDialogs mdd =
                            new MessageDialogs(MessageDialogs.DialogButtonType.Ok, MainClass.Languages.Translate("cannot_delete_file", fileBarierName), ex.Message, Gtk.MessageType.Error);
                        mdd.ShowDialog();
                    }
                }
                else
                {
                    ic.DeleteBarier();
                }
            };

            vbox.PackStart(itc, false, false, 0);

            ScrolledWindow sw = new Gtk.ScrolledWindow();

            sw.ShadowType = Gtk.ShadowType.Out;

            sw.Hadjustment.ValueChanged += delegate(object sender, EventArgs e) {
                //Console.WriteLine("sw.Hadjustment -> {0}",sw.Hadjustment.Value);
            };

            sw.Vadjustment.ValueChanged += delegate(object sender, EventArgs e) {
                //Console.WriteLine("sw.Vadjustment -> {0}",sw.Vadjustment.Value);
            };

            Viewport vp = new Viewport()
            {
                ShadowType = ShadowType.None
            };

            vp.ScrollEvent += delegate(object o, ScrollEventArgs args) {
                if (args.Event.State == ModifierType.ControlMask)
                {
                    switch (args.Event.Direction)
                    {
                    case ScrollDirection.Down:
                    case ScrollDirection.Right:
                        itc.ZoomOut();
                        return;

                    case ScrollDirection.Left:
                    case ScrollDirection.Up:
                        itc.ZoomIn();
                        return;
                    }
                }
            };

            vp.MotionNotifyEvent += delegate(object o, MotionNotifyEventArgs args) {
                Cairo.PointD offset = new Cairo.PointD(sw.Hadjustment.Value, sw.Vadjustment.Value);
                int          x      = (int)args.Event.X;
                int          y      = (int)args.Event.Y;
                if (ic.ConvertPointToCanvasPoint(offset, ref x, ref y))
                {
                    OnWriteToStatusbar(String.Format(statusFormat, x, y, ic.WidthImage, ic.HeightImage));
                }

                if (itc.ToolState == ImageToolBarControl.ToolStateEnum.nothing)
                {
                    return;
                }

                if (itc.ToolState == ImageToolBarControl.ToolStateEnum.editpoint)
                {
                    ic.StepMovingPoint((int)args.Event.X, (int)args.Event.Y, offset);
                    //OnModifiedChanged(true);
                }
            };

            vp.ButtonReleaseEvent += delegate(object o, ButtonReleaseEventArgs args) {
                //Console.WriteLine("1_ButtonReleaseEvent");
                if (args.Event.Button != 1)
                {
                    return;
                }

                if (itc.ToolState == ImageToolBarControl.ToolStateEnum.nothing)
                {
                    return;
                }
                Cairo.PointD offset = new Cairo.PointD(sw.Hadjustment.Value, sw.Vadjustment.Value);

                if (itc.ToolState == ImageToolBarControl.ToolStateEnum.editpoint)
                {
                    ic.EndMovingPoint((int)args.Event.X, (int)args.Event.Y, offset);
                    OnModifiedChanged(true);
                }
            };

            vp.ButtonPressEvent += delegate(object o, ButtonPressEventArgs args) {
                if (args.Event.Button != 1)
                {
                    return;
                }

                if (itc.ToolState == ImageToolBarControl.ToolStateEnum.nothing)
                {
                    return;
                }

                Cairo.PointD offset = new Cairo.PointD(sw.Hadjustment.Value, sw.Vadjustment.Value);
                if (itc.ToolState == ImageToolBarControl.ToolStateEnum.addpoint)
                {
                    ic.AddPoint((int)args.Event.X, (int)args.Event.Y, offset);
                    OnModifiedChanged(true);
                }
                else if (itc.ToolState == ImageToolBarControl.ToolStateEnum.deletepoint)
                {
                    ic.DeletePoint((int)args.Event.X, (int)args.Event.Y, offset);
                    OnModifiedChanged(true);
                }
                else if (itc.ToolState == ImageToolBarControl.ToolStateEnum.moviepoint)
                {
                    ic.StartMovingPoint((int)args.Event.X, (int)args.Event.Y, offset);
                    OnModifiedChanged(true);
                }
                else if (itc.ToolState == ImageToolBarControl.ToolStateEnum.editpoint)
                {
                    if (args.Event.State == ModifierType.ShiftMask)
                    {
                        ic.DeletePoint((int)args.Event.X, (int)args.Event.Y, offset);
                        OnModifiedChanged(true);
                        return;
                    }
                    ic.EditPoint((int)args.Event.X, (int)args.Event.Y, offset);
                    OnModifiedChanged(true);
                }
            };


            sw.Add(vp);
            vp.Add(ic);

            vbox.PackEnd(sw, true, true, 0);
            ic.Show();
            vp.Show();

            vbox.ShowAll();
        }