Exemplo n.º 1
0
        internal static EventBox ClickableLabel(string lblTitle)
        {
            Gdk.Color lblColour  = new Gdk.Color(255, 255, 255);
            Gdk.Color lblBgColor = new Gdk.Color(36, 36, 36);

            Pango.AttrList attr = new Pango.AttrList();
            attr.Insert(new Pango.AttrUnderline(Pango.Underline.Single));
            attr.Insert(new Pango.AttrFontDesc(
                            Pango.FontDescription.FromString("Source Code Pro " +
                                                             "Regular 14")));
            Label label = new Label(lblTitle)
            {
                Attributes = attr
            };

            label.ModifyFg(StateType.Active, lblColour);
            label.ModifyFg(StateType.Normal, lblColour);
            label.ModifyFg(StateType.Prelight, lblColour);

            EventBox eventBox = new EventBox
            {
                label
            };

            eventBox.ModifyBg(StateType.Active, lblBgColor);
            eventBox.ModifyBg(StateType.Normal, lblBgColor);

            return(eventBox);
        }
Exemplo n.º 2
0
 public void SetToolbarColor(Gdk.Color?backgroundColor)
 {
     if (backgroundColor.HasValue)
     {
         _headerContainer.ModifyBg(StateType.Normal, backgroundColor.Value);
     }
     else
     {
         _headerContainer.ModifyBg(StateType.Normal, _defaultBackgroundColor);
     }
 }
Exemplo n.º 3
0
        Widget CreateInnerExceptionsTree()
        {
            InnerExceptionsTreeView = new InnerExceptionsTree();
            InnerExceptionsTreeView.ModifyBase(StateType.Normal, Styles.ExceptionCaughtDialog.TreeBackgroundColor.ToGdkColor());               // background
            InnerExceptionsTreeView.ModifyBase(StateType.Selected, Styles.ExceptionCaughtDialog.TreeSelectedBackgroundColor.ToGdkColor());     // selected
            InnerExceptionsTreeView.HeadersVisible = false;
            InnerExceptionsStore = new TreeStore(typeof(ExceptionInfo));

            FillInnerExceptionsStore(InnerExceptionsStore, exception);
            InnerExceptionsTreeView.AppendColumn("Exception", new CellRendererInnerException(), new TreeCellDataFunc((tree_column, cell, tree_model, iter) => {
                var c  = (CellRendererInnerException)cell;
                c.Text = ((ExceptionInfo)tree_model.GetValue(iter, 0)).Type;
            }));
            InnerExceptionsTreeView.ShowExpanders    = false;
            InnerExceptionsTreeView.LevelIndentation = 10;
            InnerExceptionsTreeView.Model            = InnerExceptionsStore;
            InnerExceptionsTreeView.ExpandAll();
            InnerExceptionsTreeView.Selection.Changed += (sender, e) => {
                TreeIter selectedIter;
                if (InnerExceptionsTreeView.Selection.GetSelected(out selectedIter))
                {
                    UpdateSelectedException((ExceptionInfo)InnerExceptionsTreeView.Model.GetValue(selectedIter, 0));
                }
            };
            var eventBox = new EventBox();

            eventBox.ModifyBg(StateType.Normal, Styles.ExceptionCaughtDialog.TreeBackgroundColor.ToGdkColor());               // top and bottom padders
            var vbox = new VBox();

            vbox.PackStart(InnerExceptionsTreeView, true, true, 12);
            eventBox.Add(vbox);
            eventBox.ShowAll();
            return(eventBox);
        }
Exemplo n.º 4
0
    private UploadFileChooserUI()
    {
        Glade.XML gxml = new Glade.XML(null, "organizer.glade", "filechooserdialog1", null);
        gxml.Autoconnect(this);
        _job           = new ThreadStart(ProcessThumbnail);
        _previewthread = new Thread(_job);

        label16.WidthRequest = eventbox7.WidthRequest;

        eventbox7.ModifyBg(Gtk.StateType.Normal, bgcolor);
        eventbox8.ModifyBg(Gtk.StateType.Normal, bgcolor);
        eventbox9.ModifyBg(Gtk.StateType.Normal, bgcolor);

        filechooserdialog1.Title = "Select files to upload";
        filechooserdialog1.SetIconFromFile(DeskFlickrUI.ICON_PATH);
        filechooserdialog1.SetFilename(PersistentInformation.GetInstance().UploadFilename);
        filechooserdialog1.SelectMultiple = true;

        FileFilter imagefilter = new FileFilter();

        imagefilter.AddMimeType("image/jpeg");
        imagefilter.AddMimeType("image/png");
        filechooserdialog1.Filter = imagefilter;

        filechooserdialog1.SelectionChanged += new EventHandler(OnFileSelectedChanged);
        filechooserdialog1.FileActivated    += new EventHandler(OnOpenButtonClicked);
        button10.Clicked += new EventHandler(OnOpenButtonClicked);
        button11.Clicked += new EventHandler(OnCancelButtonClicked);
        DeskFlickrUI.GetInstance().SetUploadWindow(false);
        filechooserdialog1.ShowAll();
    }
Exemplo n.º 5
0
        private void RecursiveAttach(int depth, TextView view, TextChildAnchor anchor)
        {
            if (depth > 4)
            {
                return;
            }

            TextView childView = new TextView(view.Buffer);

            // Event box is to add a black border around each child view
            EventBox eventBox = new EventBox();

            Gdk.Color color = new Gdk.Color();
            Gdk.Color.Parse("black", ref color);
            eventBox.ModifyBg(StateType.Normal, color);

            Alignment align = new Alignment(0.5f, 0.5f, 1.0f, 1.0f);

            align.BorderWidth = 1;

            eventBox.Add(align);
            align.Add(childView);

            view.AddChildAtAnchor(eventBox, anchor);

            RecursiveAttach(depth + 1, childView, anchor);
        }
Exemplo n.º 6
0
        void DisplayUploadNotification(MainWindow mainWindow)
        {
            //set our window width
            int frameWidth  = 250;
            int frameHeight = 100;
            int screenWidth = Gdk.Screen.Default.Width;

            //need to dispose of all our stuff in the window to handle memory
            DestroyMostlyEverything();


            //add event box
            notificationEventBox = new EventBox();

            //add click event to close app on click
            notificationEventBox.ButtonPressEvent += OnActivated;

            //add label to eb
            notificationMessage = new Gtk.Label("Image Uploaded. Link copied to clipboard");
            notificationMessage.ModifyFg(StateType.Normal, new Gdk.Color(255, 255, 255));              //change font color to white
            notificationEventBox.Add(notificationMessage);

            mainWindow.Decorated = false;
            mainWindow.Resize(frameWidth, frameHeight);
            mainWindow.Move((screenWidth - frameWidth), 0);

            //change background color to black
            notificationEventBox.ModifyBg(StateType.Normal, new Gdk.Color(67, 67, 67));

            mainWindow.Add(notificationEventBox);
            mainWindow.ShowAll();

            //fadeout timer function
            GLib.Timeout.Add(100, new GLib.TimeoutHandler(update_opacity));
        }
Exemplo n.º 7
0
 void UpdateStyle()
 {
     Theme.SetBackgroundColor(Styles.CodeCompletion.BackgroundColor);
     Theme.ShadowColor = Styles.PopoverWindow.ShadowColor;
     box.ModifyBg(StateType.Normal, Styles.CodeCompletion.BackgroundColor.ToGdkColor());
     this.ModifyBg(StateType.Normal, Styles.CodeCompletion.BackgroundColor.ToGdkColor());
 }
Exemplo n.º 8
0
        public void AddTabView(string tabName, object control)
        {
            if (labelDictionary.ContainsKey(tabName))
            {
                return;
            }

            Viewport newViewport = new Viewport()
            {
                ShadowType = ShadowType.None,
            };

            Label newLabel = new Label
            {
                Xalign = 0.0f,
                Xpad   = 3,
                Text   = tabName
            };

            viewportDictionary.Add(tabName, newViewport);
            labelDictionary.Add(tabName, newLabel);

            if (!nbook.Children.Contains(newViewport))
            {
                nbook.AppendPage(newViewport, newLabel);
            }

            foreach (Widget child in newViewport.Children)
            {
                newViewport.Remove(child);
                child.Cleanup();
            }
            if (typeof(ViewBase).IsInstanceOfType(control))
            {
                EventBox frame = new EventBox();
#if NETFRAMEWORK
                frame.ModifyBg(StateType.Normal, mainWidget.Style.Base(StateType.Normal));
#endif
                HBox hbox   = new HBox();
                uint border = 0;
                if (tabName == "Properties")
                {
                    border = 5;
                }
                else if (tabName != "Display" & tabName != "Data")
                {
                    border = 10;
                }

                hbox.BorderWidth = border;

                ViewBase view = (ViewBase)control;
                hbox.Add(view.MainWidget);
                frame.Add(hbox);
                newViewport.Add(frame);

                newViewport.ShowAll();
            }
        }
Exemplo n.º 9
0
        private void btn_Entered(object sender, EventArgs e)
        {
            uint i, j;
            uint selCol = 0;
            uint selRow = 0;

            for (i = 0; i < maxColumns; i++)
            {
                for (j = 0; j < maxRows; j++)
                {
                    if (!ReferenceEquals(sender, btnsSelect [i, j]))
                    {
                        continue;
                    }

                    selCol = i * 2 + 2;
                    selRow = j * 2 + 2;
                    break;
                }
            }

            for (i = 0; i < maxColumns * 2 + 1; i++)
            {
                for (j = 0; j < maxRows * 2 + 1; j++)
                {
                    EventBox da = dasSelect [i, j];
                    if (da == null)
                    {
                        continue;
                    }

                    if (i > 0 && j > 0 && i < selCol && j < selRow)
                    {
                        da.ModifyBg(StateType.Normal, innerSelectedColor);
                    }
                    else if (i >= 0 && j >= 0 && i <= selCol && j <= selRow)
                    {
                        da.ModifyBg(StateType.Normal, outerSelectedColor);
                    }
                    else
                    {
                        da.ModifyBg(StateType.Normal);
                    }
                }
            }
        }
Exemplo n.º 10
0
        public static EventBox add2EventBox(Widget w, Gdk.Color boxColor)
        {
            var e = new EventBox();

            e.Add(w);
            e.ModifyBg(StateType.Normal, boxColor);
            return(e);
        }
Exemplo n.º 11
0
 public HackEntry(EditSession session, Gtk.Widget child)
 {
     this.session          = session;
     box                   = new EventBox();
     box.ButtonPressEvent += new ButtonPressEventHandler(OnClickBox);
     box.ModifyBg(StateType.Normal, Style.White);
     box.Add(child);
 }
Exemplo n.º 12
0
        public RecommendationPane()
        {
            Visible = false;

            EventBox event_box = new EventBox();

            event_box.ModifyBg(StateType.Normal, new Gdk.Color(0xff, 0xff, 0xff));

            main_box             = new HBox();
            main_box.BorderWidth = 5;

            similar_box = new VBox(false, 3);
            tracks_box  = new VBox(false, 3);
            albums_box  = new VBox(false, 3);

            Label similar_header = new Label();

            similar_header.Xalign    = 0;
            similar_header.Ellipsize = Pango.EllipsizeMode.End;
            similar_header.Markup    = String.Format("<b>{0}</b>", Catalog.GetString("Recommended Artists"));
            similar_box.PackStart(similar_header, false, false, 0);

            tracks_header            = new Label();
            tracks_header.Xalign     = 0;
            tracks_header.WidthChars = 25;
            tracks_header.Ellipsize  = Pango.EllipsizeMode.End;
            tracks_box.PackStart(tracks_header, false, false, 0);

            albums_header            = new Label();
            albums_header.Xalign     = 0;
            albums_header.WidthChars = 25;
            albums_header.Ellipsize  = Pango.EllipsizeMode.End;
            albums_box.PackStart(albums_header, false, false, 0);

            similar_items_table = new Table(DEFAULT_SIMILAR_TABLE_ROWS, DEFAULT_SIMILAR_TABLE_COLS, false);
            similar_items_table.SizeAllocated += OnSizeAllocated;
            similar_box.PackEnd(similar_items_table, true, true, 0);

            tracks_items_box = new VBox(false, 0);
            tracks_box.PackEnd(tracks_items_box, true, true, 0);

            albums_items_box = new VBox(false, 0);
            albums_box.PackEnd(albums_items_box, true, true, 0);

            main_box.PackStart(similar_box, true, true, 5);
            main_box.PackStart(new VSeparator(), false, false, 0);
            main_box.PackStart(tracks_box, false, false, 5);
            main_box.PackStart(new VSeparator(), false, false, 0);
            main_box.PackStart(albums_box, false, false, 5);

            event_box.Add(main_box);
            Add(event_box);

            if (!Directory.Exists(CACHE_PATH))
            {
                Directory.CreateDirectory(CACHE_PATH);
            }
        }
Exemplo n.º 13
0
 private Widget CreateColorBox(string name, Gdk.Color color)
 {
     EventBox eb = new EventBox();
        eb.ModifyBg(StateType.Normal, color);
        Label l = new Label(name);
        eb.Add(l);
        l.Show();
        return eb;
 }
Exemplo n.º 14
0
        /// <summary>
        /// Set up the UI inside the Window
        /// </summary>
        private void InitializeWidgets(Manager simiasManager)
        {
            this.SetDefaultSize(480, 550);

            // Create an extra vbox to add the spacing
            EventBox prefsWindow = new EventBox();

            prefsWindow.ModifyBg(StateType.Normal, this.Style.Background(StateType.Normal));
            VBox winBox = new VBox();

            //this.Add (winBox);
            prefsWindow.Add(winBox);
            this.Add(prefsWindow);
            winBox.BorderWidth = 7;
            winBox.Spacing     = 7;

            this.Icon           = new Gdk.Pixbuf(Util.ImagesPath("ifolder16.png"));
            this.WindowPosition = Gtk.WindowPosition.Center;

            //-----------------------------
            // Set up the Notebook (tabs)
            //-----------------------------
            PrefNoteBook = new Notebook();

            generalPage = new PrefsGeneralPage(this, ifws);
            PrefNoteBook.AppendPage(generalPage,
                                    new Label(Util.GS("General")));

            accountsPage = new PrefsAccountsPage(this);
            PrefNoteBook.AppendPage(accountsPage,
                                    new Label(Util.GS("Accounts")));

            /*migrationPage =*/ new MigrationPage(this, ifws);
//			PrefNoteBook.AppendPage( migrationPage, new Label(Util.GS("Migration")));

            PrefNoteBook.SwitchPage +=
                new SwitchPageHandler(OnSwitchPageEvent);

            winBox.PackStart(PrefNoteBook, true, true, 0);

            HButtonBox buttonBox = new HButtonBox();

            buttonBox.BorderWidth = 10;
            buttonBox.Spacing     = 10;
            buttonBox.Layout      = ButtonBoxStyle.Edge;
            winBox.PackStart(buttonBox, false, false, 0);

            Button helpButton = new Button(Gtk.Stock.Help);

            buttonBox.PackStart(helpButton);
            helpButton.Clicked += new EventHandler(HelpEventHandler);

            Button closeButton = new Button(Gtk.Stock.Close);

            buttonBox.PackStart(closeButton);
            closeButton.Clicked += new EventHandler(CloseEventHandler);
        }
Exemplo n.º 15
0
        public override int Run()
        {
            base.Dialog.Resize(1, 1);
            eventbox10.ModifyBg(Gtk.StateType.Normal, keyTextView.Style.Base(Gtk.StateType.Normal));

            GLib.Timeout.Add(1000, new GLib.TimeoutHandler(IncreaseDenyCountdown));

            return(base.Run());
        }
Exemplo n.º 16
0
 public TreeViewCellContainer(Gtk.Widget child)
 {
     box = new EventBox();
     box.ButtonPressEvent += new ButtonPressEventHandler(OnClickBox);
     box.ModifyBg(StateType.Normal, Style.White);
     box.Add(child);
     child.Show();
     Show();
 }
Exemplo n.º 17
0
		public TreeViewCellContainer (Gtk.Widget child)
		{
			box = new EventBox ();
			box.ButtonPressEvent += new ButtonPressEventHandler (OnClickBox);
			box.ModifyBg (StateType.Normal, Style.White);
			box.Add (child);
			child.Show ();
			Show ();
		}
Exemplo n.º 18
0
        public static EventBox add2EventBox(Widget w, Gdk.Color boxColor, Gdk.Color textColor, string font)
        {
            var e = new EventBox();

            e.Add(w);
            e.ModifyBg(StateType.Normal, boxColor);
            w.ModifyFg(StateType.Normal, textColor);
            w.ModifyFont(Pango.FontDescription.FromString(font));
            return(e);
        }
Exemplo n.º 19
0
        ///<summary>
        ///	InitWindow
        /// Sets up the widgets and events in the chat window
        ///</summary>
        void InitWindow()
        {
            this.Icon = Utilities.GetIcon("giver-48", 48);
            // Update the window title
            Title = string.Format("Giver Recipients");

            this.DefaultSize = new Gdk.Size(300, 500);

            // Start with an event box to paint the background white
            EventBox eb = new EventBox();

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

            VBox mainVBox = new VBox();

            mainVBox.BorderWidth = 0;
            mainVBox.Show();
            eb.Add(mainVBox);
            this.Add(eb);

            scrolledWindow = new ScrolledWindow();
            scrolledWindow.VscrollbarPolicy = PolicyType.Automatic;
            scrolledWindow.HscrollbarPolicy = PolicyType.Never;
            //scrolledWindow.ShadowType = ShadowType.None;
            scrolledWindow.BorderWidth = 0;
            scrolledWindow.CanFocus    = true;
            scrolledWindow.Show();
            mainVBox.PackStart(scrolledWindow, true, true, 0);

            // Add a second Event box in the scrolled window so it will also be white
            EventBox innerEb = new EventBox();

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

            targetVBox             = new VBox();
            targetVBox.BorderWidth = 0;
            targetVBox.Show();
            innerEb.Add(targetVBox);

            scrolledWindow.AddWithViewport(innerEb);

            //mainVBox.PackStart (targetVBox, false, false, 0);
            manualTarget = new TargetService();
            manualTarget.Show();
            mainVBox.PackStart(manualTarget, false, false, 0);

            Shown       += OnWindowShown;
            DeleteEvent += WindowDeleted;

            Application.Instance.TransferStarted += TransferStartedHandler;
        }
Exemplo n.º 20
0
        public static EventBox MakeBackground(Widget w, Gdk.Color col)
        {
            EventBox eb = new EventBox();

            if (w != null)
            {
                eb.Add(w);
            }
            eb.ModifyBg(StateType.Normal, col);
            return(eb);
        }
Exemplo n.º 21
0
        protected override void OnRealized()
        {
            base.OnRealized();
            HslColor gcol = ebox.Style.Background(Gtk.StateType.Normal);

            gcol.L -= 0.03;
            ebox.ModifyBg(Gtk.StateType.Normal, gcol);
            ebox2.ModifyBg(Gtk.StateType.Normal, gcol);
            scrolledwindow.ModifyBg(Gtk.StateType.Normal, gcol);
            SetComponentsBg();
        }
        public RecommendationPane()
        {
            Visible = false;

            EventBox event_box = new EventBox ();
            event_box.ModifyBg(StateType.Normal, new Gdk.Color(0xff,0xff,0xff));

            main_box = new HBox ();
            main_box.BorderWidth = 5;

            similar_box = new VBox (false, 3);
            tracks_box = new VBox (false, 3);
            albums_box = new VBox (false, 3);

            Label similar_header = new Label ();
            similar_header.Xalign = 0;
            similar_header.Ellipsize = Pango.EllipsizeMode.End;
            similar_header.Markup = String.Format ("<b>{0}</b>", Catalog.GetString ("Recommended Artists"));
            similar_box.PackStart (similar_header, false, false, 0);

            tracks_header = new Label ();
            tracks_header.Xalign = 0;
            tracks_header.WidthChars = 25;
            tracks_header.Ellipsize = Pango.EllipsizeMode.End;
            tracks_box.PackStart (tracks_header, false, false, 0);

            albums_header = new Label ();
            albums_header.Xalign = 0;
            albums_header.WidthChars = 25;
            albums_header.Ellipsize = Pango.EllipsizeMode.End;
            albums_box.PackStart (albums_header, false, false, 0);

            similar_items_table = new Table (DEFAULT_SIMILAR_TABLE_ROWS, DEFAULT_SIMILAR_TABLE_COLS, false);
            similar_items_table.SizeAllocated += OnSizeAllocated;
            similar_box.PackEnd (similar_items_table, true, true, 0);

            tracks_items_box = new VBox (false, 0);
            tracks_box.PackEnd (tracks_items_box, true, true, 0);

            albums_items_box = new VBox (false, 0);
            albums_box.PackEnd (albums_items_box, true, true, 0);

            main_box.PackStart (similar_box, true, true, 5);
            main_box.PackStart (new VSeparator (), false, false, 0);
            main_box.PackStart (tracks_box, false, false, 5);
            main_box.PackStart (new VSeparator (), false, false, 0);
            main_box.PackStart (albums_box, false, false, 5);

            event_box.Add (main_box);
            Add (event_box);

            if (!Directory.Exists (CACHE_PATH))
                Directory.CreateDirectory (CACHE_PATH);
        }
Exemplo n.º 23
0
 public void SetBackgroundColor(System.Drawing.Color pColor, EventBox pTargetEventBox)
 {
     if (pColor == System.Drawing.Color.Transparent)
     {
         pTargetEventBox.VisibleWindow = false;
     }
     else
     {
         Color colNormal      = pColor;
         Color colPrelight    = Utils.Lighten(colNormal);
         Color colActive      = Utils.Lighten(colPrelight);
         Color colInsensitive = Utils.Darken(colNormal);
         Color colSelected    = Color.FromArgb(125, 0, 0);
         pTargetEventBox.ModifyBg(StateType.Normal, Utils.ColorToGdkColor(colNormal));
         pTargetEventBox.ModifyBg(StateType.Selected, Utils.ColorToGdkColor(colSelected));
         pTargetEventBox.ModifyBg(StateType.Prelight, Utils.ColorToGdkColor(colPrelight));
         pTargetEventBox.ModifyBg(StateType.Active, Utils.ColorToGdkColor(colActive));
         pTargetEventBox.ModifyBg(StateType.Insensitive, Utils.ColorToGdkColor(colInsensitive));
     }
 }
Exemplo n.º 24
0
 public void SetBackgroundColor(Gdk.Color?backgroundColor)
 {
     if (backgroundColor != null)
     {
         _contentContainerWrapper.VisibleWindow = true;
         _contentContainerWrapper.ModifyBg(StateType.Normal, backgroundColor.Value);
     }
     else
     {
         _contentContainerWrapper.VisibleWindow = false;
     }
 }
Exemplo n.º 25
0
        Widget CreateExceptionHeader()
        {
            var icon = new ImageView(WarningIconPixbuf);

            icon.Yalign = 0;

            ExceptionTypeLabel = new Label {
                Xalign = 0.0f
            };
            ExceptionMessageLabel = new Label {
                Wrap = true, Xalign = 0.0f
            };
            ExceptionTypeLabel.ModifyFg(StateType.Normal, new Gdk.Color(255, 255, 255));
            ExceptionMessageLabel.ModifyFg(StateType.Normal, new Gdk.Color(255, 255, 255));

            if (Platform.IsWindows)
            {
                ExceptionTypeLabel.ModifyFont(Pango.FontDescription.FromString("bold 19"));
                ExceptionMessageLabel.ModifyFont(Pango.FontDescription.FromString("10"));
            }
            else
            {
                ExceptionTypeLabel.ModifyFont(Pango.FontDescription.FromString("21"));
                ExceptionMessageLabel.ModifyFont(Pango.FontDescription.FromString("12"));
            }

            //Force rendering of background with EventBox
            var eventBox  = new EventBox();
            var hBox      = new HBox();
            var leftVBox  = new VBox();
            var rightVBox = new VBox();

            leftVBox.PackStart(icon, false, false, (uint)(Platform.IsWindows ? 5 : 0));              // as we change frame.BorderWidth below, we need to compensate

            rightVBox.PackStart(ExceptionTypeLabel, false, false, (uint)(Platform.IsWindows ? 0 : 2));
            rightVBox.PackStart(ExceptionMessageLabel, true, true, (uint)(Platform.IsWindows ? 6 : 5));

            hBox.PackStart(leftVBox, false, false, (uint)(Platform.IsWindows ? 5 : 0));              // as we change frame.BorderWidth below, we need to compensate
            hBox.PackStart(rightVBox, true, true, (uint)(Platform.IsWindows ? 5 : 10));

            var frame = new Frame();

            frame.Add(hBox);
            frame.BorderWidth = (uint)(Platform.IsWindows ? 5 : 10);             // on Windows we need to have smaller border due to ExceptionTypeLabel vertical misalignment
            frame.Shadow      = ShadowType.None;
            frame.ShadowType  = ShadowType.None;

            eventBox.Add(frame);
            eventBox.ShowAll();
            eventBox.ModifyBg(StateType.Normal, new Gdk.Color(119, 130, 140));

            return(eventBox);
        }
Exemplo n.º 26
0
        EventBoxTooltip CreateTooltip(EventBox eventBox, string tooltipText)
        {
            Xwt.Drawing.Image image = ImageService.GetIcon("md-help");
            eventBox.ModifyBg(StateType.Normal, leftHandBackgroundColor);
            eventBox.Add(new ImageView(image));
            eventBox.ShowAll();

            return(new EventBoxTooltip(eventBox)
            {
                ToolTip = GettextCatalog.GetString(tooltipText),
                Severity = TaskSeverity.Information
            });
        }
Exemplo n.º 27
0
        public SparkleWindow()
            : base("")
        {
            Title          = "SparkleShare Setup";
            BorderWidth    = 0;
            IconName       = "folder-sparkleshare";
            Resizable      = false;
            WindowPosition = WindowPosition.Center;

            SetSizeRequest (680, 440);

            DeleteEvent += delegate (object o, DeleteEventArgs args) {

                args.RetVal = true;
                Close ();

            };

            HBox = new HBox (false, 6);

                VBox = new VBox (false, 0);

                    Wrapper = new VBox (false, 0) {
                        BorderWidth = 30
                    };

                    Buttons = CreateButtonBox ();

                VBox.PackStart (Wrapper, true, true, 0);
                VBox.PackStart (Buttons, false, false, 0);

                EventBox box = new EventBox ();
                Gdk.Color bg_color = new Gdk.Color ();
                Gdk.Color.Parse ("#2e3336", ref bg_color);
                box.ModifyBg (StateType.Normal, bg_color);

                    string image_path = SparkleHelpers.CombineMore (Defines.DATAROOTDIR, "sparkleshare",
                        "pixmaps", "side-splash.png");

                    Image side_splash = new Image (image_path) {
                        Yalign = 1
                    };

                box.Add (side_splash);

            HBox.PackStart (box, false, false, 0);
            HBox.PackStart (VBox, true, true, 0);

            base.Add (HBox);
        }
Exemplo n.º 28
0
        EventBoxTooltip ShowErrorTooltip(EventBox eventBox, string tooltipText)
        {
            eventBox.ModifyBg(StateType.Normal, backgroundColor);
            Xwt.Drawing.Image image = ImageService.GetIcon("md-error", IconSize.Menu);

            eventBox.Add(new ImageView(image));
            eventBox.ShowAll();

            return(new EventBoxTooltip(eventBox)
            {
                ToolTip = tooltipText,
                Severity = TaskSeverity.Error
            });
        }
Exemplo n.º 29
0
    public MainWindow() : base(Gtk.WindowType.Toplevel)
    {
        Build();
        var eventBox = new EventBox();

        eventBox.ModifyBg(StateType.Normal, new Gdk.Color(0, 0, 255));
        var vbox = new VBox();

        vbox.BorderWidth = 2;
        vbox.PackStart(eventBox);
        Add(vbox);
        ModifyBg(StateType.Normal, new Gdk.Color(255, 0, 0));
        ShowAll();
    }
Exemplo n.º 30
0
        public SparkleWindow() : base("")
        {
            Title          = "SparkleShare Setup";
            BorderWidth    = 0;
            IconName       = "folder-sparkleshare";
            Resizable      = false;
            WindowPosition = WindowPosition.Center;

            SetSizeRequest(680, 440);

            DeleteEvent += delegate(object o, DeleteEventArgs args) {
                args.RetVal = true;
                Close();
            };

            HBox = new HBox(false, 6);

            VBox = new VBox(false, 0);

            Wrapper = new VBox(false, 0)
            {
                BorderWidth = 30
            };

            Buttons = CreateButtonBox();

            VBox.PackStart(Wrapper, true, true, 0);
            VBox.PackStart(Buttons, false, false, 0);

            EventBox box = new EventBox();

            Gdk.Color bg_color = new Gdk.Color();
            Gdk.Color.Parse("#2e3336", ref bg_color);
            box.ModifyBg(StateType.Normal, bg_color);

            string image_path = SparkleHelpers.CombineMore(Defines.DATAROOTDIR, "sparkleshare",
                                                           "pixmaps", "side-splash.png");

            Image side_splash = new Image(image_path)
            {
                Yalign = 1
            };

            box.Add(side_splash);

            HBox.PackStart(box, false, false, 0);
            HBox.PackStart(VBox, true, true, 0);

            base.Add(HBox);
        }
Exemplo n.º 31
0
        public SparkleSetupWindow() : base("")
        {
            Title          = Catalog.GetString("SparkleShare Setup");
            BorderWidth    = 0;
            IconName       = "folder-sparkleshare";
            Resizable      = false;
            WindowPosition = WindowPosition.Center;
            Deletable      = false;

            SetSizeRequest(680, 440);

            DeleteEvent += delegate(object o, DeleteEventArgs args) {
                args.RetVal = true;
                Close();
            };

            HBox = new HBox(false, 6);

            VBox = new VBox(false, 0);

            Wrapper = new VBox(false, 0)
            {
                BorderWidth = 30
            };

            Buttons = CreateButtonBox();

            VBox.PackStart(Wrapper, true, true, 0);
            VBox.PackStart(Buttons, false, false, 0);

            EventBox box = new EventBox();

            Gdk.Color bg_color = new Gdk.Color();
            Gdk.Color.Parse("#000", ref bg_color);
            box.ModifyBg(StateType.Normal, bg_color);

            Image side_splash = SparkleUIHelpers.GetImage("side-splash.png");

            side_splash.Yalign = 1;

            box.Add(side_splash);

            HBox.PackStart(box, false, false, 0);
            HBox.PackStart(VBox, true, true, 0);

            base.Add(HBox);
        }
Exemplo n.º 32
0
        public MemoWindow(Memo memo) : base("MemoWindow")
        {
            lblSubject.Markup   = String.Format("<b>{0}</b>", GLib.Markup.EscapeText(memo.Subject));
            lblPostedBy.Text    = memo.Node.ToString();
            lblDate.Text        = memo.CreatedOn.ToString();
            txtMemo.Buffer.Text = memo.Text;
            base.Window.Title   = memo.Subject;
            networkLabel.Text   = memo.Network.NetworkName;

            this.memo = memo;

            eventbox2.ModifyBg(StateType.Normal, new Gdk.Color(0xff, 0xff, 0xff));

            if (!memo.Network.TrustedNodes.ContainsKey(memo.Node.NodeID))
            {
                if (memo.Node.IsLocal)
                {
                    alignmentSignatureInfo.Visible = false;
                }
                else
                {
                    lblSignatureStatus.Markup = "<b>Unable to verify digital signature (Node not trusted)</b>";
                    signedByButton.Sensitive  = false;
                    signatureImage.IconName   = "dialog-warning";
                }
            }
            else
            {
                lblSignatureStatus.Markup = "<b>This memo has a valid digital signature.</b>";
            }
            lblSignatureInfo.Text = String.Format("{0} ({1})", memo.Node.NickName, memo.Node.NodeID);

            fileListStore  = new ListStore(typeof(string), typeof(string));
            fileList.Model = fileListStore;
            fileList.AppendColumn("FileName", new CellRendererText(), "text", 0);
            fileList.HeadersVisible = false;

            /*
             * if (memo.FileLinks.Count > 0) {
             *      foreach (FileLink thisFile in memo.FileLinks) {
             *              fileListStore.AppendValues ( new object[] { thisFile.FileName + " (" + FileFind.Common.FormatBytes(thisFile.FileSize) + ")", thisFile.FilePath });
             *      }
             *      hboxFilesList.Visible = true;
             * }
             */
        }
Exemplo n.º 33
0
        /// <summary>
        /// Display an image
        /// </summary>
        /// <param name="url">The url of the image.</param>
        /// <param name="insertPos">The text iterator insert position.</param>
        private void DisplayImage(string url, string tooltip, ref TextIter insertPos)
        {
            // Convert relative paths in url to absolute.
            string absolutePath = PathUtilities.GetAbsolutePath(url, ImagePath);

            Gtk.Image image = null;
            if (File.Exists(absolutePath))
            {
                image = new Gtk.Image(absolutePath);
            }
            else
            {
                string imagePath = "ApsimNG.Resources." + url;
                foreach (string resourceName in Assembly.GetExecutingAssembly().GetManifestResourceNames())
                {
                    if (string.Equals(imagePath, resourceName, StringComparison.InvariantCultureIgnoreCase))
                    {
                        image = new Gtk.Image(Assembly.GetExecutingAssembly().GetManifestResourceStream(resourceName));
                    }
                }
            }

            if (image != null)
            {
                image.SetAlignment(0, 0);
                if (!string.IsNullOrWhiteSpace(tooltip))
                {
                    image.TooltipText = tooltip;
                }

                var eventBox = new EventBox();
                eventBox.Visible = true;
                eventBox.ModifyBg(StateType.Normal, mainWidget.Style.Base(StateType.Normal));
                eventBox.Add(image);

                container.Add(eventBox);
                image.Visible = true;

                textView = new TextView();
                textView.PopulatePopup += OnPopulatePopupMenu;
                container.Add(textView);
                textView.Visible = true;
                insertPos        = textView.Buffer.GetIterAtOffset(0);
                CreateStyles(textView);
            }
        }
Exemplo n.º 34
0
        private Widget CreateContentArea()
        {
            EventBox eb = new EventBox();

            eb.ModifyBg(StateType.Normal, this.Style.Background(StateType.Active));

            HBox hbox = new HBox(false, 0);

            hbox.Show();
            eb.Add(hbox);

            sidebar = CreateSidebar();
            hbox.PackStart(sidebar, false, false, 0);
            hbox.PackStart(CreatePersonView(), true, true, 0);

            return(eb);
        }
Exemplo n.º 35
0
        public SparkleSetupWindow()
            : base("")
        {
            Title          = Catalog.GetString ("SparkleShare Setup");
            BorderWidth    = 0;
            IconName       = "folder-sparkleshare";
            Resizable      = false;
            WindowPosition = WindowPosition.Center;
            Deletable      = false;

            SetSizeRequest (680, 440);

            DeleteEvent += delegate (object o, DeleteEventArgs args) {
                args.RetVal = true;
                Close ();
            };

            HBox = new HBox (false, 6);

                VBox = new VBox (false, 0);

                    Wrapper = new VBox (false, 0) {
                        BorderWidth = 30
                    };

                    Buttons = CreateButtonBox ();

                VBox.PackStart (Wrapper, true, true, 0);
                VBox.PackStart (Buttons, false, false, 0);

                EventBox box = new EventBox ();
                Gdk.Color bg_color = new Gdk.Color ();
                Gdk.Color.Parse ("#000", ref bg_color);
                box.ModifyBg (StateType.Normal, bg_color);

                Image side_splash = SparkleUIHelpers.GetImage ("side-splash.png");
                side_splash.Yalign = 1;

            box.Add (side_splash);

            HBox.PackStart (box, false, false, 0);
            HBox.PackStart (VBox, true, true, 0);

            base.Add (HBox);
        }
Exemplo n.º 36
0
 private Widget CreateiFolderActionButtonArea()
 {
     EventBox buttonArea = new EventBox();
        VBox actionsVBox = new VBox(false, 0);
        actionsVBox.WidthRequest = 100;
        buttonArea.ModifyBg(StateType.Normal, this.Style.Background(StateType.Normal));
        buttonArea.Add(actionsVBox);
        buttontips = new Tooltips();
     HBox ButtonControl = new HBox (false, 0);
        actionsVBox.PackStart(ButtonControl, false, false, 0);
        Image stopImage = new Image(Stock.Stop, Gtk.IconSize.Menu);
        stopImage.SetAlignment(0.5F, 0F);
        CancelSearchButton = new Button(stopImage);
        CancelSearchButton.Sensitive = false;
        CancelSearchButton.Clicked +=
     new EventHandler(OnCancelSearchButton);
        CancelSearchButton.Visible = false;
        HBox spacerHBox = new HBox(false, 0);
        ButtonControl.PackStart(spacerHBox, false, false, 0);
        HBox vbox = new HBox(false, 0);
        spacerHBox.PackStart(vbox, true, true, 0);
        HBox hbox = new HBox(false, 0);
        AddiFolderButton = new Button(hbox);
        vbox.PackStart(AddiFolderButton, false, false, 0);
        Label buttonText = new Label(
     string.Format("<span>{0}</span>",
      Util.GS("Upload a folder...")));
        hbox.PackStart(buttonText, false, false, 4);
        buttonText.UseMarkup = true;
        buttonText.UseUnderline = false;
        buttonText.Xalign = 0;
        AddiFolderButton.Image = new Image(new Gdk.Pixbuf(Util.ImagesPath("ifolder48.png")));
        AddiFolderButton.Clicked +=
     new EventHandler(AddiFolderHandler);
        buttontips.SetTip(AddiFolderButton, Util.GS("Create iFolder"),"");
        hbox = new HBox(false, 0);
        ShowHideAllFoldersButton = new Button(hbox);
        vbox.PackStart(ShowHideAllFoldersButton, false, false, 0);
        ShowHideAllFoldersButtonText = new Label(
     string.Format("<span>{0}</span>",
      Util.GS("View available iFolders")));
        hbox.PackStart(ShowHideAllFoldersButtonText, false, false, 4);
        ShowHideAllFoldersButtonText.UseMarkup = true;
        ShowHideAllFoldersButtonText.UseUnderline = false;
        ShowHideAllFoldersButtonText.Xalign = 0;
        ShowHideAllFoldersButton.Image = new Image(new Gdk.Pixbuf(Util.ImagesPath("ifolder48.png")));
        ShowHideAllFoldersButton.Clicked +=
     new EventHandler(ShowHideAllFoldersHandler);
        buttontips.SetTip(ShowHideAllFoldersButton, Util.GS("Show or Hide iFolder"),"");
        hbox = new HBox(false, 0);
        DownloadAvailableiFolderButton = new Button(hbox);
        vbox.PackStart(DownloadAvailableiFolderButton, false, false, 0);
        buttonText = new Label(
     string.Format("<span>{0}</span>",
      Util.GS("Download...")));
        hbox.PackStart(buttonText, true, true, 4);
        buttonText.UseMarkup = true;
        buttonText.UseUnderline = false;
        buttonText.Xalign = 0;
        DownloadAvailableiFolderButton.Sensitive = false;
        DownloadAvailableiFolderButton.Image= new Image(new Gdk.Pixbuf(Util.ImagesPath("ifolder-download48.png")));
        DownloadAvailableiFolderButton.Clicked +=
     new EventHandler(DownloadAvailableiFolderHandler);
        buttontips.SetTip(DownloadAvailableiFolderButton, Util.GS("Download"),"");
        hbox = new HBox(false, 0);
        MergeAvailableiFolderButton = new Button(hbox);
        vbox.PackStart(MergeAvailableiFolderButton, false, false, 0);
        buttonText = new Label(
     string.Format("<span>{0}</span>",
      Util.GS("Merge")));
        hbox.PackStart(buttonText, true, true, 4);
        buttonText.UseMarkup = true;
        buttonText.UseUnderline = false;
        buttonText.Xalign = 0;
        MergeAvailableiFolderButton.Sensitive = false;
        MergeAvailableiFolderButton.Image = new Image(new Gdk.Pixbuf(Util.ImagesPath("merge48.png")));
        MergeAvailableiFolderButton.Clicked +=
     new EventHandler(MergeAvailableiFolderHandler);
        buttontips.SetTip(MergeAvailableiFolderButton, Util.GS("Merge"),"");
        hbox = new HBox(false, 0);
        RemoveMembershipButton = new Button(hbox);
        vbox.PackStart(RemoveMembershipButton, false, false, 0);
        buttonText = new Label(
     string.Format("<span>{0}</span>",
      Util.GS("Remove My Membership")));
        hbox.PackStart(buttonText, true, true, 4);
        buttonText.UseMarkup = true;
        buttonText.UseUnderline = false;
        buttonText.Xalign = 0;
        RemoveMembershipButton.Sensitive = false;
        RemoveMembershipButton.Visible = false;
        RemoveMembershipButton.Image = new Image(new Gdk.Pixbuf(Util.ImagesPath("ifolder-error48.png")));
        RemoveMembershipButton.Clicked += new EventHandler(RemoveMembershipHandler);
        buttontips.SetTip(RemoveMembershipButton, Util.GS("Remove My Membership"),"");
        hbox = new HBox(false, 0);
        DeleteFromServerButton = new Button(hbox);
        vbox.PackStart(DeleteFromServerButton, false, false, 0);
        buttonText = new Label(
     string.Format("<span>{0}</span>",
      Util.GS("Delete from server")));
        hbox.PackStart(buttonText, true, true, 4);
        buttonText.UseMarkup = true;
        buttonText.UseUnderline = false;
        buttonText.Xalign = 0;
        DeleteFromServerButton.Sensitive = false;
        DeleteFromServerButton.Image = new Image(new Gdk.Pixbuf(Util.ImagesPath("delete_48.png")));
        DeleteFromServerButton.Clicked +=
     new EventHandler(DeleteFromServerHandler);
        buttontips.SetTip(DeleteFromServerButton, Util.GS("Delete from server"),"");
        hbox = new HBox(false, 0);
        ShareSynchronizedFolderButton = new Button(hbox);
        vbox.PackStart(ShareSynchronizedFolderButton, false, false, 0);
        buttonText = new Label(
     string.Format("<span>{0}</span>",
      Util.GS("Share with...")));
        hbox.PackStart(buttonText, true, true, 4);
        buttonText.UseMarkup = true;
        buttonText.UseUnderline = false;
        buttonText.Xalign = 0;
        ShareSynchronizedFolderButton.Sensitive= false;
       ShareSynchronizedFolderButton.Image = new Image(new Gdk.Pixbuf(Util.ImagesPath("ifolder_share48.png")));
        ShareSynchronizedFolderButton.Clicked +=
     new EventHandler(OnShareSynchronizedFolder);
        buttontips.SetTip(ShareSynchronizedFolderButton, Util.GS("Share with"),"");
        hbox = new HBox(false, 0);
        ResolveConflictsButton = new Button(hbox);
        vbox.PackStart(ResolveConflictsButton, false, false, 0);
        buttonText = new Label(
     string.Format("<span>{0}</span>",
      Util.GS("Resolve conflicts...")));
        hbox.PackStart(buttonText, false, false, 4);
        buttonText.UseMarkup = true;
        buttonText.UseUnderline = false;
        buttonText.Xalign = 0;
        ResolveConflictsButton.Sensitive = false;
        ResolveConflictsButton.Image = new Image(new Gdk.Pixbuf(Util.ImagesPath("ifolder-conflict48.png")));
        ResolveConflictsButton.Clicked +=
     new EventHandler(OnResolveConflicts);
        buttontips.SetTip(ResolveConflictsButton, Util.GS("Resolve conflicts"),"");
        SynchronizedFolderTasks = new VBox(false, 0);
        ButtonControl.PackStart(SynchronizedFolderTasks, false, false, 0);
        spacerHBox = new HBox(false, 0);
        SynchronizedFolderTasks.PackStart(spacerHBox, false, false, 0);
        hbox = new HBox(false, 0);
        OpenSynchronizedFolderButton = new Button(hbox);
        vbox.PackStart(OpenSynchronizedFolderButton, false, false, 0);
        buttonText = new Label(
     string.Format("<span>{0}</span>",
      Util.GS("Open...")));
        hbox.PackStart(buttonText, false, false, 4);
        buttonText.UseMarkup = true;
        buttonText.UseUnderline = false;
        buttonText.Xalign = 0;
        OpenSynchronizedFolderButton.Visible = false;
        OpenSynchronizedFolderButton.Image = new Image(new Gdk.Pixbuf(Util.ImagesPath("ifolder48.png")));
        OpenSynchronizedFolderButton.Clicked +=
     new EventHandler(OnOpenSynchronizedFolder);
        buttontips.SetTip(OpenSynchronizedFolderButton, Util.GS("Open iFolder"),"");
        hbox = new HBox(false, 0);
        SynchronizeNowButton = new Button(hbox);
        vbox.PackStart(SynchronizeNowButton, false, false, 0);
        buttonText = new Label(
     string.Format("<span>{0}</span>",
      Util.GS("Synchronize Now")));
        hbox.PackStart(buttonText, true, true, 4);
        buttonText.UseMarkup = true;
        buttonText.UseUnderline = false;
        buttonText.Xalign = 0;
        SynchronizeNowButton.Sensitive = false;
       SynchronizeNowButton.Image = new Image(new Gdk.Pixbuf(Util.ImagesPath("ifolder-sync48.png")));
        SynchronizeNowButton.Clicked +=
     new EventHandler(OnSynchronizeNow);
        buttontips.SetTip(SynchronizeNowButton, Util.GS("Synchronize Now"),"");
        hbox = new HBox(false, 0);
        RemoveiFolderButton = new Button(hbox);
        vbox.PackStart(RemoveiFolderButton, false, false, 0);
        buttonText = new Label(
     string.Format("<span>{0}</span>",
      Util.GS("Revert to a Normal Folder")));
        hbox.PackStart(buttonText, true, true, 4);
        buttonText.UseMarkup = true;
        buttonText.UseUnderline = false;
        buttonText.Xalign = 0;
        RemoveiFolderButton.Sensitive = false;
        RemoveiFolderButton.Image = new Image(new Gdk.Pixbuf(Util.ImagesPath("revert48.png")));
        RemoveiFolderButton.Clicked +=
     new EventHandler(RemoveiFolderHandler);
        buttontips.SetTip(RemoveiFolderButton, Util.GS("Revert to a Normal Folder"),"");
        hbox = new HBox(false, 0);
        ViewFolderPropertiesButton = new Button(hbox);
        vbox.PackStart(ViewFolderPropertiesButton, false, false, 0);
        buttonText = new Label(
     string.Format("<span>{0}</span>",
      Util.GS("Properties...")));
        hbox.PackStart(buttonText, true, true, 4);
        buttonText.UseMarkup = true;
        buttonText.UseUnderline = false;
        buttonText.Xalign = 0;
        ViewFolderPropertiesButton.Visible = false;
        ViewFolderPropertiesButton.Image = new Image(new Gdk.Pixbuf(Util.ImagesPath("ifolder48.png")));
        ViewFolderPropertiesButton.Clicked +=
     new EventHandler(OnShowFolderProperties);
        buttontips.SetTip(ViewFolderPropertiesButton, Util.GS("Properties"),"");
        ButtonControl.PackStart(new Label(""), false, false, 4);
        HBox searchHBox = new HBox(false, 4);
        searchHBox.WidthRequest = 110;
        ButtonControl.PackEnd(searchHBox, false, false, 0);
        SearchEntry = new Entry();
        searchHBox.PackStart(SearchEntry, true, true, 0);
        SearchEntry.SelectRegion(0, -1);
        SearchEntry.CanFocus = true;
        SearchEntry.Changed +=
     new EventHandler(OnSearchEntryChanged);
        Label l = new Label("<span size=\"small\"></span>");
        l = new Label(
     string.Format(
      "<span size=\"large\">{0}</span>",
      Util.GS("Filter")));
        ButtonControl.PackEnd(l, false, false, 0);
        l.UseMarkup = true;
        l.ModifyFg(StateType.Normal, this.Style.Base(StateType.Selected));
        l.Xalign = 0.0F;
       VBox viewChanger = new VBox(false,0);
        string[] list = {Util.GS("Open Panel"),Util.GS("Close Panel"),Util.GS("Thumbnail View"),Util.GS("List View") };
       viewList = new ComboBoxEntry (list);
        viewList.Active = 0;
        viewList.WidthRequest = 110;
        viewList.Changed += new EventHandler(OnviewListIndexChange);
        VBox dummyVbox = new VBox(false,0);
       Label labeldummy = new Label( string.Format( ""));
       labeldummy.UseMarkup = true;
        dummyVbox.PackStart(labeldummy,false,true,0);
        viewChanger.PackStart(dummyVbox,false,true,0);
        viewChanger.PackStart(viewList,false,true,0);
        ButtonControl.PackEnd(viewChanger, false, true,0);
        return buttonArea;
 }
Exemplo n.º 37
0
 public HackEntry(Gtk.Widget child, EditSession session)
 {
     this.session = session;
     box = new EventBox ();
     box.ButtonPressEvent += new ButtonPressEventHandler (OnClickBox);
     box.ModifyBg (StateType.Normal, Style.White);
     box.Add (child);
 }
		EventBoxTooltip ShowErrorTooltip (EventBox eventBox, string tooltipText)
		{
			eventBox.ModifyBg (StateType.Normal, backgroundColor);
			Xwt.Drawing.Image image = ImageService.GetIcon ("md-error", IconSize.Menu);

			eventBox.Add (new ImageView (image));
			eventBox.ShowAll ();

			return new EventBoxTooltip (eventBox) {
				ToolTip = tooltipText,
				Severity = TaskSeverity.Error
			};
		}
Exemplo n.º 39
0
		private void RecursiveAttach (int depth, TextView view, TextChildAnchor anchor)
		{
			if (depth > 4)
				return;

			TextView childView = new TextView (view.Buffer);

			// Event box is to add a black border around each child view
			EventBox eventBox = new EventBox ();
			Gdk.Color color = new Gdk.Color ();
			Gdk.Color.Parse ("black", ref color);
			eventBox.ModifyBg (StateType.Normal, color);

			Alignment align = new Alignment (0.5f, 0.5f, 1.0f, 1.0f);
			align.BorderWidth = 1;

			eventBox.Add (align);
			align.Add (childView);

			view.AddChildAtAnchor (eventBox, anchor);

			RecursiveAttach (depth+1, childView, anchor);
		}
Exemplo n.º 40
0
		///<summary>
		///	InitWindow
		/// Sets up the widgets and events in the chat window
		///</summary>	
		void InitWindow()
		{
			this.Icon = Utilities.GetIcon ("giver-48", 48);
			// Update the window title
			Title = string.Format ("Giver Recipients");	
			
			this.DefaultSize = new Gdk.Size (300, 500); 			

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

			VBox mainVBox = new VBox();
			mainVBox.BorderWidth = 0;
			mainVBox.Show ();
			eb.Add(mainVBox);
			this.Add (eb);

			scrolledWindow = new ScrolledWindow ();
			scrolledWindow.VscrollbarPolicy = PolicyType.Automatic;
			scrolledWindow.HscrollbarPolicy = PolicyType.Never;
			//scrolledWindow.ShadowType = ShadowType.None;
			scrolledWindow.BorderWidth = 0;
			scrolledWindow.CanFocus = true;
			scrolledWindow.Show ();
			mainVBox.PackStart (scrolledWindow, true, true, 0);

			// Add a second Event box in the scrolled window so it will also be white
			EventBox innerEb = new EventBox();
			innerEb.BorderWidth = 0;
            innerEb.ModifyBg(StateType.Normal, new Gdk.Color(255,255,255));
            innerEb.ModifyBase(StateType.Normal, new Gdk.Color(255,255,255));

			targetVBox = new VBox();
			targetVBox.BorderWidth = 0;
			targetVBox.Show ();
			innerEb.Add(targetVBox);

			scrolledWindow.AddWithViewport(innerEb);

			//mainVBox.PackStart (targetVBox, false, false, 0);
			manualTarget = new TargetService();
			manualTarget.Show ();
			mainVBox.PackStart(manualTarget, false, false, 0);

			Shown += OnWindowShown;
			DeleteEvent += WindowDeleted;

			Application.Instance.TransferStarted += TransferStartedHandler;
		}
Exemplo n.º 41
0
		Widget CreateInnerExceptionsTree ()
		{
			InnerExceptionsTreeView = new InnerExceptionsTree ();
			InnerExceptionsTreeView.ModifyBase (StateType.Normal, Styles.ExceptionCaughtDialog.TreeBackgroundColor.ToGdkColor ()); // background
			InnerExceptionsTreeView.ModifyBase (StateType.Selected, Styles.ExceptionCaughtDialog.TreeSelectedBackgroundColor.ToGdkColor ()); // selected
			InnerExceptionsTreeView.HeadersVisible = false;
			InnerExceptionsStore = new TreeStore (typeof (ExceptionInfo));

			FillInnerExceptionsStore (InnerExceptionsStore, exception);
			InnerExceptionsTreeView.AppendColumn ("Exception", new CellRendererInnerException (), new TreeCellDataFunc ((tree_column, cell, tree_model, iter) => {
				var c = (CellRendererInnerException)cell;
				c.Text = ((ExceptionInfo)tree_model.GetValue (iter, 0)).Type;
			}));
			InnerExceptionsTreeView.ShowExpanders = false;
			InnerExceptionsTreeView.LevelIndentation = 10;
			InnerExceptionsTreeView.Model = InnerExceptionsStore;
			InnerExceptionsTreeView.ExpandAll ();
			InnerExceptionsTreeView.Selection.Changed += (sender, e) => {
				TreeIter selectedIter;
				if (InnerExceptionsTreeView.Selection.GetSelected (out selectedIter)) {
					UpdateSelectedException ((ExceptionInfo)InnerExceptionsTreeView.Model.GetValue (selectedIter, 0));
				}
			};
			var eventBox = new EventBox ();
			eventBox.ModifyBg (StateType.Normal, Styles.ExceptionCaughtDialog.TreeBackgroundColor.ToGdkColor ()); // top and bottom padders
			var vbox = new VBox ();
			vbox.PackStart (InnerExceptionsTreeView, true, true, 12);
			eventBox.Add (vbox);
			eventBox.ShowAll ();
			return eventBox;
		}
		void Build ()
		{
			BorderWidth = 0;
			WidthRequest = 901;
			HeightRequest = 632;

			Name = "wizard_dialog";
			Title = GettextCatalog.GetString ("New Project");
			WindowPosition = WindowPosition.CenterOnParent;
			TransientFor = IdeApp.Workbench.RootWindow;

			projectConfigurationWidget = new GtkProjectConfigurationWidget ();
			projectConfigurationWidget.Name = "projectConfigurationWidget";

			// Top banner of dialog.
			var topLabelEventBox = new EventBox ();
			topLabelEventBox.Name = "topLabelEventBox";
			topLabelEventBox.HeightRequest = 52;
			topLabelEventBox.ModifyBg (StateType.Normal, bannerBackgroundColor);
			topLabelEventBox.ModifyFg (StateType.Normal, whiteColor);
			topLabelEventBox.BorderWidth = 0;

			var topBannerTopEdgeLineEventBox = new EventBox ();
			topBannerTopEdgeLineEventBox.Name = "topBannerTopEdgeLineEventBox";
			topBannerTopEdgeLineEventBox.HeightRequest = 1;
			topBannerTopEdgeLineEventBox.ModifyBg (StateType.Normal, bannerLineColor);
			topBannerTopEdgeLineEventBox.BorderWidth = 0;

			var topBannerBottomEdgeLineEventBox = new EventBox ();
			topBannerBottomEdgeLineEventBox.Name = "topBannerBottomEdgeLineEventBox";
			topBannerBottomEdgeLineEventBox.HeightRequest = 1;
			topBannerBottomEdgeLineEventBox.ModifyBg (StateType.Normal, bannerLineColor);
			topBannerBottomEdgeLineEventBox.BorderWidth = 0;

			topBannerLabel = new Label ();
			topBannerLabel.Name = "topBannerLabel";
			Pango.FontDescription font = topBannerLabel.Style.FontDescription.Copy (); // UNDONE: VV: Use FontService?
			font.Size = (int)(font.Size * 1.8);
			topBannerLabel.ModifyFont (font);
			topBannerLabel.ModifyFg (StateType.Normal, whiteColor);
			var topLabelHBox = new HBox ();
			topLabelHBox.Name = "topLabelHBox";
			topLabelHBox.PackStart (topBannerLabel, false, false, 20);
			topLabelEventBox.Add (topLabelHBox);

			VBox.PackStart (topBannerTopEdgeLineEventBox, false, false, 0);
			VBox.PackStart (topLabelEventBox, false, false, 0);
			VBox.PackStart (topBannerBottomEdgeLineEventBox, false, false, 0);

			// Main templates section.
			centreVBox = new VBox ();
			centreVBox.Name = "centreVBox";
			VBox.PackStart (centreVBox, true, true, 0);
			templatesHBox = new HBox ();
			templatesHBox.Name = "templatesHBox";
			centreVBox.PackEnd (templatesHBox, true, true, 0);

			// Template categories.
			var templateCategoriesBgBox = new EventBox ();
			templateCategoriesBgBox.Name = "templateCategoriesVBox";
			templateCategoriesBgBox.BorderWidth = 0;
			templateCategoriesBgBox.ModifyBg (StateType.Normal, categoriesBackgroundColor);
			templateCategoriesBgBox.WidthRequest = 220;
			var templateCategoriesScrolledWindow = new ScrolledWindow ();
			templateCategoriesScrolledWindow.Name = "templateCategoriesScrolledWindow";
			templateCategoriesScrolledWindow.HscrollbarPolicy = PolicyType.Never;

			// Template categories tree view.
			templateCategoriesTreeView = new TreeView ();
			templateCategoriesTreeView.Name = "templateCategoriesTreeView";
			templateCategoriesTreeView.BorderWidth = 0;
			templateCategoriesTreeView.HeadersVisible = false;
			templateCategoriesTreeView.Model = templateCategoriesListStore;
			templateCategoriesTreeView.SearchColumn = -1; // disable the interactive search
			templateCategoriesTreeView.AppendColumn (CreateTemplateCategoriesTreeViewColumn ());
			templateCategoriesScrolledWindow.Add (templateCategoriesTreeView);
			templateCategoriesBgBox.Add (templateCategoriesScrolledWindow);
			templatesHBox.PackStart (templateCategoriesBgBox, false, false, 0);

			// Templates.
			var templatesBgBox = new EventBox ();
			templatesBgBox.ModifyBg (StateType.Normal, templateListBackgroundColor);
			templatesBgBox.Name = "templatesVBox";
			templatesBgBox.WidthRequest = 400;
			templatesHBox.PackStart (templatesBgBox, false, false, 0);
			var templatesScrolledWindow = new ScrolledWindow ();
			templatesScrolledWindow.Name = "templatesScrolledWindow";
			templatesScrolledWindow.HscrollbarPolicy = PolicyType.Never;

			// Templates tree view.
			templatesTreeView = new TreeView ();
			templatesTreeView.Name = "templatesTreeView";
			templatesTreeView.HeadersVisible = false;
			templatesTreeView.Model = templatesListStore;
			templatesTreeView.SearchColumn = -1; // disable the interactive search
			templatesTreeView.AppendColumn (CreateTemplateListTreeViewColumn ());
			templatesScrolledWindow.Add (templatesTreeView);
			templatesBgBox.Add (templatesScrolledWindow);

			// Template
			var templateEventBox = new EventBox ();
			templateEventBox.Name = "templateEventBox";
			templateEventBox.ModifyBg (StateType.Normal, templateBackgroundColor);
			templatesHBox.PackStart (templateEventBox, true, true, 0);
			templateVBox = new VBox ();
			templateVBox.Visible = false;
			templateVBox.BorderWidth = 20;
			templateVBox.Spacing = 10;
			templateEventBox.Add (templateVBox);

			// Template large image.
			templateImage = new ImageView ();
			templateImage.Name = "templateImage";
			templateImage.HeightRequest = 140;
			templateImage.WidthRequest = 240;
			templateVBox.PackStart (templateImage, false, false, 10);

			// Template description.
			templateNameLabel = new Label ();
			templateNameLabel.Name = "templateNameLabel";
			templateNameLabel.WidthRequest = 240;
			templateNameLabel.Wrap = true;
			templateNameLabel.Xalign = 0;
			templateNameLabel.Markup = MarkupTemplateName ("TemplateName");
			templateVBox.PackStart (templateNameLabel, false, false, 0);
			templateDescriptionLabel = new Label ();
			templateDescriptionLabel.Name = "templateDescriptionLabel";
			templateDescriptionLabel.WidthRequest = 240;
			templateDescriptionLabel.Wrap = true;
			templateDescriptionLabel.Xalign = 0;
			templateVBox.PackStart (templateDescriptionLabel, false, false, 0);
			templateVBox.PackStart (new Label (), true, true, 0);

			// Template - button separator.
			var templateSectionSeparatorEventBox = new EventBox ();
			templateSectionSeparatorEventBox.Name = "templateSectionSeparatorEventBox";
			templateSectionSeparatorEventBox.HeightRequest = 1;
			templateSectionSeparatorEventBox.ModifyBg (StateType.Normal, templateSectionSeparatorColor);
			VBox.PackStart (templateSectionSeparatorEventBox, false, false, 0);

			// Buttons at bottom of dialog.
			var bottomHBox = new HBox ();
			bottomHBox.Name = "bottomHBox";
			VBox.PackStart (bottomHBox, false, false, 0);

			// Cancel button - bottom left.
			var cancelButtonBox = new HButtonBox ();
			cancelButtonBox.Name = "cancelButtonBox";
			cancelButtonBox.BorderWidth = 16;
			cancelButton = new Button ();
			cancelButton.Name = "cancelButton";
			cancelButton.Label = "gtk-cancel";
			cancelButton.UseStock = true;
			cancelButtonBox.PackStart (cancelButton, false, false, 0);
			bottomHBox.PackStart (cancelButtonBox, false, false, 0);

			// Previous button - bottom right.
			var previousNextButtonBox = new HButtonBox ();
			previousNextButtonBox.Name = "previousNextButtonBox";
			previousNextButtonBox.BorderWidth = 16;
			previousNextButtonBox.Spacing = 9;
			bottomHBox.PackStart (previousNextButtonBox);
			previousNextButtonBox.Layout = ButtonBoxStyle.End;

			previousButton = new Button ();
			previousButton.Name = "previousButton";
			previousButton.Label = GettextCatalog.GetString ("Previous");
			previousButton.Sensitive = false;
			previousNextButtonBox.PackEnd (previousButton);

			// Next button - bottom right.
			nextButton = new Button ();
			nextButton.Name = "nextButton";
			nextButton.Label = GettextCatalog.GetString ("Next");
			previousNextButtonBox.PackEnd (nextButton);

			// Remove default button action area.
			VBox.Remove (ActionArea);

			if (Child != null) {
				Child.ShowAll ();
			}

			Show ();

			templatesTreeView.HasFocus = true;
			Resizable = false;
		}
Exemplo n.º 43
0
        private ScrolledWindow CreateEventLog()
        {
            List <SparkleCommit> commits = new List <SparkleCommit> ();

            foreach (SparkleRepo repo in SparkleShare.Controller.Repositories) {

                // Get commits from the repository
                if (repo.LocalPath.Equals (LocalPath)) {

                    commits = repo.GetCommits (25);
                    break;

                }

            }

            List <ActivityDay> activity_days = new List <ActivityDay> ();

            foreach (SparkleCommit commit in commits) {

                bool commit_inserted = false;
                foreach (ActivityDay stored_activity_day in activity_days) {

                    if (stored_activity_day.DateTime.Year  == commit.DateTime.Year &&
                        stored_activity_day.DateTime.Month == commit.DateTime.Month &&
                        stored_activity_day.DateTime.Day   == commit.DateTime.Day) {

                        stored_activity_day.Add (commit);
                        commit_inserted = true;
                        break;

                    }

                }

                if (!commit_inserted) {

                        ActivityDay activity_day = new ActivityDay (commit.DateTime);
                        activity_day.Add (commit);
                        activity_days.Add (activity_day);

                }

            }

            VBox layout_vertical = new VBox (false, 0);

            if (SparkleShare.Controller.Repositories.Find (
                    delegate (SparkleRepo r)
                        { return r.LocalPath.Equals (LocalPath) && r.HasUnsyncedChanges; }
                ) != null) {

                string title = _("This folder has unsynced changes");
                string text  = _("We will sync these once we’re connected again");

                SparkleInfobar infobar = new SparkleInfobar ("dialog-error", title, text);

                layout_vertical.PackStart (infobar, false, false, 0);

            } else {

                if (SparkleShare.Controller.Repositories.Find (
                    delegate (SparkleRepo r)
                        { return r.LocalPath.Equals (LocalPath) && r.HasUnsyncedChanges; }
                    ) != null) {

                        string title = _("Could not sync with the remote folder");
                        string text  = _("Is the you and the server online?");

                        SparkleInfobar infobar = new SparkleInfobar ("dialog-error", title, text);

                        layout_vertical.PackStart (infobar, false, false, 0);

                }

            }

            TreeView tree_view = new TreeView ();
            Gdk.Color background_color = tree_view.Style.Base (StateType.Normal);

            foreach (ActivityDay activity_day in activity_days) {

                EventBox box = new EventBox ();

                Label date_label = new Label ("") {
                    UseMarkup = true,
                    Xalign = 0,
                    Xpad = 9,
                    Ypad = 9
                };

                    DateTime today = DateTime.Now;
                    DateTime yesterday = DateTime.Now.AddDays (-1);

                    if (today.Day   == activity_day.DateTime.Day &&
                        today.Month == activity_day.DateTime.Month &&
                        today.Year  == activity_day.DateTime.Year) {

                        date_label.Markup = "<b>Today</b>";

                    } else if (yesterday.Day   == activity_day.DateTime.Day &&
                               yesterday.Month == activity_day.DateTime.Month &&
                               yesterday.Year  == activity_day.DateTime.Year) {

                        date_label.Markup = "<b>Yesterday</b>";

                    } else {

                        date_label.Markup = "<b>" + activity_day.DateTime.ToString ("ddd MMM d, yyyy") + "</b>";

                    }

                box.Add (date_label);
                layout_vertical.PackStart (box, false, false, 0);

                Gdk.Color color = Style.Foreground (StateType.Insensitive);
                string secondary_text_color = SparkleUIHelpers.GdkColorToHex (color);

                foreach (SparkleCommit change_set in activity_day) {

                    VBox log_entry     = new VBox (false, 0);
                    VBox deleted_files = new VBox (false, 0);
                    VBox edited_files  = new VBox (false, 0);
                    VBox added_files   = new VBox (false, 0);
                    VBox moved_files   = new VBox (false, 0);

                    foreach (string file_path in change_set.Edited) {

                        SparkleLink link = new SparkleLink (file_path,
                            SparkleHelpers.CombineMore (LocalPath, file_path));

                        link.ModifyBg (StateType.Normal, background_color);

                        edited_files.PackStart (link, false, false, 0);

                    }

                    foreach (string file_path in change_set.Added) {

                        SparkleLink link = new SparkleLink (file_path,
                            SparkleHelpers.CombineMore (LocalPath, file_path));

                        link.ModifyBg (StateType.Normal, background_color);

                        added_files.PackStart (link, false, false, 0);

                    }

                    foreach (string file_path in change_set.Deleted) {

                        SparkleLink link = new SparkleLink (file_path,
                            SparkleHelpers.CombineMore (LocalPath, file_path));

                        link.ModifyBg (StateType.Normal, background_color);

                        deleted_files.PackStart (link, false, false, 0);

                    }

                    for (int i = 0; i < change_set.MovedFrom.Count; i++) {

                        SparkleLink from_link = new SparkleLink (change_set.MovedFrom [i],
                            SparkleHelpers.CombineMore (LocalPath, change_set.MovedFrom [i]));

                        from_link.ModifyBg (StateType.Normal, background_color);

                        SparkleLink to_link = new SparkleLink (change_set.MovedTo [i],
                            SparkleHelpers.CombineMore (LocalPath, change_set.MovedTo [i]));

                        to_link.ModifyBg (StateType.Normal, background_color);

                        Label to_label = new Label ("<span fgcolor='" + secondary_text_color +"'>" +
                                                    "<small>to</small></span> ") {
                            UseMarkup = true,
                            Xalign = 0
                        };

                        HBox link_wrapper = new HBox (false, 0);
                        link_wrapper.PackStart (to_label, false, false, 0);
                        link_wrapper.PackStart (to_link, true, true, 0);

                        moved_files.PackStart (from_link, false, false, 0);
                        moved_files.PackStart (link_wrapper, false, false, 0);

                        if (change_set.MovedFrom.Count > 1)
                            moved_files.PackStart (new Label (""), false, false, 0);

                    }

                    HBox change_set_info_hbox = new HBox (false, 0);

                        Label change_set_info = new Label ("<b>" + change_set.UserName + "</b>") {
                            UseMarkup = true,
                            Xalign = 0
                        };

                        Label change_set_time = new Label ("<span fgcolor='" + secondary_text_color +"'><small>" +
                                                           change_set.DateTime.ToString ("H:mm") +
                                                           "</small></span>") {
                            Xalign = 1,
                            UseMarkup = true
                        };

                    change_set_info_hbox.PackStart (change_set_info, true, true, 0);
                    change_set_info_hbox.PackStart (change_set_time, false, false, 0);

                    log_entry.PackStart (change_set_info_hbox, false, false, 0);

                    if (edited_files.Children.Length > 0) {

                        Label edited_label = new Label ("\n<span fgcolor='" + secondary_text_color +"'><small>" +
                                                        _("Edited") +
                                                        "</small></span>") {
                            UseMarkup = true,
                            Xalign = 0
                        };

                        log_entry.PackStart (edited_label, false, false, 0);
                        log_entry.PackStart (edited_files, false, false, 0);

                    }

                    if (added_files.Children.Length > 0) {

                        Label added_label = new Label ("\n<span fgcolor='" + secondary_text_color +"'><small>" +
                                                        _("Added") +
                                                        "</small></span>") {
                            UseMarkup = true,
                            Xalign = 0
                        };

                        log_entry.PackStart (added_label, false, false, 0);
                        log_entry.PackStart (added_files, false, false, 0);

                    }

                    if (deleted_files.Children.Length > 0) {

                        Label deleted_label = new Label ("\n<span fgcolor='" + secondary_text_color +"'><small>" +
                                                        _("Deleted") +
                                                        "</small></span>") {
                            UseMarkup = true,
                            Xalign = 0
                        };

                        log_entry.PackStart (deleted_label, false, false, 0);
                        log_entry.PackStart (deleted_files, false, false, 0);

                    }

                    if (moved_files.Children.Length > 0) {

                        Label moved_label = new Label ("\n<span fgcolor='" + secondary_text_color +"'><small>" +
                                                         _("Moved") +
                                                         "</small></span>") {
                            UseMarkup = true,
                            Xalign = 0
                        };

                        log_entry.PackStart (moved_label, false, false, 0);
                        log_entry.PackStart (moved_files, false, false, 0);

                    }

                    HBox hbox = new HBox (false, 0);

                    Image avatar = new Image (SparkleUIHelpers.GetAvatar (change_set.UserEmail, 32)) {
                        Yalign = 0
                    };

                    hbox.PackStart (avatar, false, false, 18);

                        VBox vbox = new VBox (false, 0);
                        vbox.PackStart (log_entry, false, false, 0);

                    hbox.PackStart (vbox, true, true, 0);
                    hbox.PackStart (new Label (""), false, false, 12);

                    layout_vertical.PackStart (hbox, false, false, 18);

                }

                layout_vertical.PackStart (new Label (""), false, false, 3);

            }

            ScrolledWindow = new ScrolledWindow ();

                EventBox wrapper = new EventBox ();
                wrapper.ModifyBg (StateType.Normal, background_color);
                wrapper.Add (layout_vertical);

            ScrolledWindow.AddWithViewport (wrapper);
            (ScrolledWindow.Child as Viewport).ShadowType = ShadowType.None;

            return ScrolledWindow;
        }
Exemplo n.º 44
0
        private void CreateAbout()
        {
            Gdk.Color color = Style.Foreground (StateType.Insensitive);
            string secondary_text_color = SparkleUIHelpers.GdkColorToHex (color);

            EventBox box = new EventBox ();
            box.ModifyBg (StateType.Normal, new TreeView ().Style.Base (StateType.Normal));

                Label header = new Label () {
                    Markup = "<span font_size='xx-large'>SparkleShare</span>\n<span fgcolor='" + secondary_text_color + "'><small>" + Defines.VERSION + "</small></span>",
                    Xalign = 0,
                    Xpad = 18,
                    Ypad = 18
                };

            box.Add (header);

            this.version = new Label () {
                Markup = "<small>Checking for updates...</small>",
                Xalign = 0,
                Xpad   = 18,
                Ypad   = 22,
            };

            Label license = new Label () {
                Xalign = 0,
                Xpad   = 18,
                Ypad   = 0,
                LineWrap     = true,
                Wrap         = true,
                LineWrapMode = Pango.WrapMode.Word,

                Markup = "<small>Copyright © 2010–" + DateTime.Now.Year + " Hylke Bons and others\n" +
                         "\n" +
                         "SparkleShare is Free and Open Source Software. " +
                         "You are free to use, modify, and redistribute it " +
                         "under the terms of the GNU General Public License version 3 or later.</small>"
            };

            VBox vbox = new VBox (false, 0) {
                BorderWidth = 0
            };

                HButtonBox button_bar = new HButtonBox () {
                    BorderWidth = 12
                };

                Button credits_button = new Button (_("_Show Credits")) {
                    UseUnderline = true
                };

                    credits_button.Clicked += delegate {

                        Process process             = new Process ();
                        process.StartInfo.FileName  = "xdg-open";
                        process.StartInfo.Arguments = "http://www.sparkleshare.org/credits";
                        process.Start ();

                    };

                    Button website_button = new Button (_("_Visit Website")) {
                        UseUnderline = true
                    };

                    website_button.Clicked += delegate {

                        Process process = new Process ();
                        process.StartInfo.FileName = "xdg-open";
                        process.StartInfo.Arguments = "http://www.sparkleshare.org/";
                        process.Start ();

                    };

                button_bar.Add (website_button);
                button_bar.Add (credits_button);

            vbox.PackStart (box, true, true, 0);
            vbox.PackStart (this.version, false, false, 0);
            vbox.PackStart (license, true, true, 0);
            vbox.PackStart (new Label (""), true, true, 0);
            vbox.PackStart (button_bar, false, false, 0);

            Add (vbox);
        }
Exemplo n.º 45
0
        public RtmPreferencesWidget(RtmBackend backend, IPreferences preferences)
            : base()
        {
            if (backend == null)
                throw new ArgumentNullException ("backend");
            if (preferences == null)
                throw new ArgumentNullException ("preferences");
            this.backend = backend;
            this.preferences = preferences;

            LoadPreferences ();

            BorderWidth = 0;

            // We're using an event box so we can paint the background white
            EventBox imageEb = new EventBox ();
            imageEb.BorderWidth = 0;
            imageEb.ModifyBg(StateType.Normal, new Gdk.Color(255,255,255));
            imageEb.ModifyBase(StateType.Normal, new Gdk.Color(255,255,255));
            imageEb.Show ();

            VBox mainVBox = new VBox(false, 0);
            mainVBox.BorderWidth = 10;
            mainVBox.Show();
            Add(mainVBox);

            // Add the rtm logo
            image = new Gtk.Image (normalPixbuf);
            image.Show();
            //make the dialog box look pretty without hard coding total size and
            //therefore clipping displays with large fonts.
            Alignment spacer = new Alignment((float)0.5, 0, 0, 0);
            spacer.SetPadding(0, 0, 125, 125);
            spacer.Add(image);
            spacer.Show();
            imageEb.Add (spacer);
            mainVBox.PackStart(imageEb, true, true, 0);

            // Status message label
            statusLabel = new Label();
            statusLabel.Justify = Gtk.Justification.Center;
            statusLabel.Wrap = true;
            statusLabel.LineWrap = true;
            statusLabel.Show();
            statusLabel.UseMarkup = true;
            statusLabel.UseUnderline = false;

            authButton = new LinkButton (
            #if GETTEXT
            Catalog.GetString ("Click Here to Connect"));
            #elif ANDROID

            #endif
            authButton.Clicked += OnAuthButtonClicked;

            if ( isAuthorized ) {
                statusLabel.Text = "\n\n" +
            #if GETTEXT
                    Catalog.GetString ("You are currently connected");
            #elif ANDROID

            #endif
                string userName = preferences.Get (PreferencesKeys.UserNameKey);
                if (userName != null && userName.Trim () != string.Empty)
                    statusLabel.Text = "\n\n" +
            #if GETTEXT
                        Catalog.GetString ("You are currently connected as") +
            #elif ANDROID

            #endif
                        "\n" + userName.Trim();
            } else {
                statusLabel.Text = "\n\n" +
            #if GETTEXT
                    Catalog.GetString ("You are not connected");
            #elif ANDROID

            #endif
                authButton.Show();
            }
            mainVBox.PackStart(statusLabel, false, false, 0);
            mainVBox.PackStart(authButton, false, false, 0);

            Label blankLabel = new Label("\n");
            blankLabel.Show();
            mainVBox.PackStart(blankLabel, false, false, 0);
        }
Exemplo n.º 46
0
        private void Build()
        {
            this.Title = "MonoGame Packager";
            this.DefaultWidth = this.WidthRequest = 640;
            this.DefaultHeight = this.HeightRequest = 480;

#if WINDOWS
            this.ModifyBg (StateType.Normal, new Gdk.Color (255, 255, 255));
#endif

#if GTK3
            var geom = new Gdk.Geometry();
            geom.MinWidth = geom.MaxWidth = this.DefaultWidth;
            geom.MinHeight = geom.MaxHeight = this.DefaultHeight;
            this.SetGeometryHints(this, geom, Gdk.WindowHints.MinSize | Gdk.WindowHints.MaxSize);
#else
            this.Resizable = false;
#endif

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

            notebook1 = new Notebook();
            notebook1.ShowBorder = false;
            notebook1.ShowTabs = false;

            // Wizard Page 0

            vbox2 = new VBox();
            vbox2.Spacing = 10;

            label1 = new Label();
            label1.Wrap = true;
            label1.LineWrapMode = Pango.WrapMode.Word;
            label1.Text = "Welcome to MonoGame Packager\n" +
                "\n" +
                "This tool will help you pack you desktop game for redistribution. It offers 2 options, installer and bundle of binaries. The difference between bundling the game into an archive with this tool and doing it by hand is the fact that this tool will help by adding per platform dependencies.";
            vbox2.PackStart(label1, true, true, 0);

            label2 = new Label("Do note that installer generation is usually only supported for the OS this tool is run from.\n");
            vbox2.PackStart(label2, false, true, 1);

            notebook1.Add(vbox2);

            // Wizaed Page 1

            table1 = new Table(5, 3, false);

            table1.Attach(new Label(), 0, 3, 0, 1);

            label3 = new Label(" Select game folder: ");
            label3.SetAlignment(0f, 0.5f);
            table1.Attach(label3, 0, 1, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 4, 4);

            entryGameDir = new Entry();
            entryGameDir.Sensitive = false;
            table1.Attach(entryGameDir, 1, 2, 1, 2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Fill, 4, 4);

            btnBrowse = new Button("Browse...");
            btnBrowse.Clicked += BtnBrowse_Clicked;
            table1.Attach(btnBrowse, 2, 3, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 4, 4);

            label4 = new Label(" Select game .exe file:");
            label4.SetAlignment(0f, 0.5f);
            table1.Attach(label4, 0, 1, 2, 3, AttachOptions.Fill, AttachOptions.Fill, 4, 4);

            scroll1 = new ScrolledWindow();
            scroll1.HeightRequest = 200;

            treeview1 = new TreeView();
            treeview1.HeightRequest = scroll1.HeightRequest;
            treeview1.HeadersVisible = false;
            treeview1.Reorderable = false;
            treeview1.CursorChanged += Treeview1_CursorChanged;

            scroll1.Add(treeview1);

            table1.Attach(scroll1, 0, 3, 3, 4, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);

            table1.Attach(new Label(), 0, 3, 4, 5);

            notebook1.Add(table1);

            // Wizard Page 2

            table2 = new Table(10, 3, false);

            table2.Attach(new Label(), 0, 3, 0, 1);

            imageIcon = new Image();

            btnIcon = new Button(imageIcon);
            btnIcon.WidthRequest = btnIcon.HeightRequest = 64;
            btnIcon.Clicked += BtnIcon_Clicked;
            table2.Attach(btnIcon, 0, 1, 1, 3, AttachOptions.Fill, AttachOptions.Fill, 4, 4);

            label5 = new Label("Title:");
            label5.SetAlignment(0f, 0.5f);
            table2.Attach(label5, 1, 2, 1, 2, AttachOptions.Fill, AttachOptions.Shrink, 4, 4);

            entryTitle = new Entry();
            table2.Attach(entryTitle, 2, 3, 1, 2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 4, 4);

            label6 = new Label("Version:");
            label6.SetAlignment(0f, 0.5f);
            table2.Attach(label6, 1, 2, 2, 3, AttachOptions.Fill, AttachOptions.Fill, 4, 4);

            entryVersion = new Entry();
            table2.Attach(entryVersion, 2, 3, 2, 3, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 4, 4);

            label7 = new Label("Creator:");
            label7.SetAlignment(0f, 0.5f);
            table2.Attach(label7, 1, 2, 3, 4, AttachOptions.Fill, AttachOptions.Fill, 4, 4);

            entryCompany = new Entry();
            table2.Attach(entryCompany, 2, 3, 3, 4, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 4, 4);

            table2.Attach(new HSeparator(), 0, 3, 4, 5, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 4, 4);

            table3 = new Table(3, 5, false);

            label8 = new Label("Generate bundle of binaries:");
            label8.SetAlignment(0f, 0.5f);
            table3.Attach(label8, 0, 1, 0, 1, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 4, 4);

            var bundlers = Generators.GetBundlerList();
            for (int i = 0; i < bundlers.Count; i++)
            {
                var checkButton = new TagCheckButton(bundlers[i].Name);
                checkButton.SetAlignment(0f, 0.5f);
                checkButton.Tag = bundlers[i];
                checkButton.Toggled += (sender, e) => btnNext.Sensitive = Page3NextSensitive();

                table3.Attach(checkButton, 0, 1, 1 + (uint)i, 2 + (uint)i, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 20, 2);
                checkBundlers.Add(checkButton);
            }

            label9 = new Label("Generate installer:");
            label9.SetAlignment(0f, 0.5f);
            table3.Attach(label9, 2, 3, 0, 1, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 4, 4);

            var installers = Generators.GetInstallerList();
            for (int i = 0; i < installers.Count; i++)
            {
                var checkButton = new TagCheckButton(installers[i].Name);
                checkButton.SetAlignment(0f, 0.5f);
                checkButton.Tag = installers[i];
                checkButton.Toggled += (sender, e) => btnNext.Sensitive = Page3NextSensitive();

                table3.Attach(checkButton, 2, 3, 1 + (uint)i, 2 + (uint)i, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Shrink, 20, 2);
                checkInstallers.Add(checkButton);
            }

            table2.Attach(table3, 0, 3, 5, 6, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Fill, 40, 4);

            table2.Attach(new Label(), 0, 3, 6, 7);

            notebook1.Add(table2);

            // Wizard Page 3

            vbox3 = new VBox();
            vbox3.BorderWidth = 4;
            vbox3.Spacing = 4;

            label10 = new Label("Select output folder:");
            label10.SetAlignment(0f, 1f);
            vbox3.PackStart(label10, true, true, 0);

            hbox2 = new HBox();
            hbox2.Spacing = 4;

            entryOutputDir = new Entry();
            entryOutputDir.Sensitive = false;
            hbox2.PackStart(entryOutputDir, true, true, 0);

            btnBrowse2 = new Button("Browse...");
            btnBrowse2.Clicked += BtnBrowse2_Clicked;
            hbox2.PackStart(btnBrowse2, false, true, 1);

            vbox3.PackStart(hbox2, false, false, 1);

            vbox3.PackStart(new Label(), true, true, 2);

            notebook1.Add(vbox3);

            // Wizard Page 4

            scroll2 = new ScrolledWindow();

            textView1 = new TextView();
            scroll2.Add(textView1);

            notebook1.Add(scroll2);

            // Control Buttons

            vbox1.PackStart(notebook1, true, true, 0);

            var eventBox = new EventBox ();
#if WINDOWS
            eventBox.ModifyBg (StateType.Normal, new Gdk.Color (240, 240, 240));
#endif

            hbox1 = new HBox();
            hbox1.BorderWidth = 10;

            btnCancel = new Button("Cancel");
            btnCancel.WidthRequest = 90;
            btnCancel.Clicked += (sender, e) => Application.Quit();
            hbox1.PackStart(btnCancel, false, false, 0);

            hbox1.PackStart(new Label(), true, true, 1);

            btnPrev = new Button("Previous");
            btnPrev.WidthRequest = btnCancel.WidthRequest;
            btnPrev.Clicked += BtnPrev_Clicked;
            btnPrev.Sensitive = false;
            hbox1.PackStart(btnPrev, false, false, 2);

            btnNext = new Button("Next");
            btnNext.WidthRequest = btnCancel.WidthRequest;
            btnNext.Clicked += BtnNext_Clicked;
            hbox1.PackStart(btnNext, false, false, 3);

            eventBox.Add (hbox1);
            vbox1.PackStart(eventBox, false, true, 1);

            this.Add(vbox1);
            this.ShowAll();

            this.DeleteEvent += OnDeleteEvent;
        }
Exemplo n.º 47
0
 private Widget CreateiFolderWhiteBoradArea()
 {
     WhiteBoradEventBox = new EventBox();
        WhiteBoradEventBox.ModifyBg(StateType.Normal, this.Style.Background(StateType.Normal));
        VBox actionsVBox = new VBox(false, 0);
        WhiteBoradEventBox.Add(actionsVBox);
        HBox whiteBoard = new HBox(false,0);
        whiteBoard.HeightRequest = 50;
        whiteBoard.PackStart(iFolderInfoBox(), true, true,0);
        whiteBoard.PackStart(UserInfoBox(), true, true,0);
        actionsVBox.PackStart(whiteBoard, true, true,0);
        return WhiteBoradEventBox;
 }
		EventBoxTooltip CreateTooltip (EventBox eventBox, string tooltipText)
		{
			Xwt.Drawing.Image image = ImageService.GetIcon ("md-information");
			eventBox.ModifyBg (StateType.Normal, leftHandBackgroundColor);
			eventBox.Add (new ImageView (image));
			eventBox.ShowAll ();

			return new EventBoxTooltip (eventBox) {
				ToolTip = GettextCatalog.GetString (tooltipText),
				Severity = TaskSeverity.Information
			};
		}
Exemplo n.º 49
0
		void Build ()
		{
			Title = GettextCatalog.GetString ("Exception Caught");
			DefaultWidth = 500;
			DefaultHeight = 500;
			HeightRequest = 350;
			WidthRequest = 350;
			VBox.Foreach (VBox.Remove);
			VBox.PackStart (CreateExceptionHeader (), false, true, 0);
			paned = new VPanedThin ();
			paned.GrabAreaSize = 10;
			paned.Pack1 (CreateStackTraceTreeView (), true, false);
			paned.Pack2 (CreateExceptionValueTreeView (), true, false);
			paned.Show ();
			var vbox = new VBox (false, 0);
			var whiteBackground = new EventBox ();
			whiteBackground.Show ();
			whiteBackground.ModifyBg (StateType.Normal, Ide.Gui.Styles.PrimaryBackgroundColor.ToGdkColor ());
			whiteBackground.Add (vbox);
			hadInnerException = HasInnerException ();
			if (hadInnerException) {
				vbox.PackStart (new VBox (), false, false, 6);
				vbox.PackStart (CreateInnerExceptionMessage (), false, true, 0);
				vbox.ShowAll ();
			}
			vbox.PackStart (paned, true, true, 0);
			vbox.Show ();

			if (hadInnerException) {
				var box = new HBox ();
				box.PackStart (CreateInnerExceptionsTree (), false, false, 0);
				box.PackStart (whiteBackground, true, true, 0);
				box.Show ();
				VBox.PackStart (box, true, true, 0);
				DefaultWidth = 900;
				DefaultHeight = 700;
				WidthRequest = 550;
				HeightRequest = 450;
			} else {
				VBox.PackStart (whiteBackground, true, true, 0);
			}
			var actionArea = new HBox (false, 0) { BorderWidth = 14 };

			OnlyShowMyCodeCheckbox = new CheckButton (GettextCatalog.GetString ("_Only show my code."));
			OnlyShowMyCodeCheckbox.Toggled += OnlyShowMyCodeToggled;
			OnlyShowMyCodeCheckbox.Show ();
			OnlyShowMyCodeCheckbox.Active = DebuggingService.GetUserOptions ().ProjectAssembliesOnly;

			var alignment = new Alignment (0.0f, 0.5f, 0.0f, 0.0f) { Child = OnlyShowMyCodeCheckbox };
			alignment.Show ();

			actionArea.PackStart (alignment, true, true, 0);
			actionArea.PackStart (CreateButtonBox (), false, true, 0);
			actionArea.PackStart (new VBox (), false, true, 3); // dummy just to take extra 6px at end to make it 20pixels
			actionArea.ShowAll ();

			VBox.PackStart (actionArea, false, true, 0);
		}
Exemplo n.º 50
0
		private void Init()
		{
			Logger.Debug("Called Init");
			this.Icon = Utilities.GetIcon ("giver-48", 48);
			// Update the window title
			this.Title = string.Format ("Giver Preferences");	
			
			//this.DefaultSize = new Gdk.Size (300, 500); 	
			this.VBox.Spacing = 0;
			this.VBox.BorderWidth = 0;
			this.SetDefaultSize (450, 100);


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


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

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

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

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

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

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

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

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


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

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

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

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

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

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

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

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

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

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

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

			DeleteEvent += WindowDeleted;
		}
Exemplo n.º 51
0
		Widget CreateExceptionHeader ()
		{
			var icon = new ImageView (WarningIconPixbuf);
			icon.Yalign = 0;

			ExceptionTypeLabel = new Label { Xalign = 0.0f, Selectable = true };
			ExceptionMessageLabel = new Label { Wrap = true, Xalign = 0.0f, Selectable = true };
			ExceptionTypeLabel.ModifyFg (StateType.Normal, new Gdk.Color (255, 255, 255));
			ExceptionMessageLabel.ModifyFg (StateType.Normal, new Gdk.Color (255, 255, 255));

			if (Platform.IsWindows) {
				ExceptionTypeLabel.ModifyFont (Pango.FontDescription.FromString ("bold 19"));
				ExceptionMessageLabel.ModifyFont (Pango.FontDescription.FromString ("10"));
			} else {
				ExceptionTypeLabel.ModifyFont (Pango.FontDescription.FromString ("21"));
				ExceptionMessageLabel.ModifyFont (Pango.FontDescription.FromString ("12"));
			}

			//Force rendering of background with EventBox
			var eventBox = new EventBox ();
			var hBox = new HBox ();
			var leftVBox = new VBox ();
			rightVBox = new VBox ();
			leftVBox.PackStart (icon, false, false, (uint)(Platform.IsWindows ? 5 : 0)); // as we change frame.BorderWidth below, we need to compensate

			rightVBox.PackStart (ExceptionTypeLabel, false, false, (uint)(Platform.IsWindows ? 0 : 2));
			rightVBox.PackStart (ExceptionMessageLabel, true, true, (uint)(Platform.IsWindows ? 6 : 5));

			hBox.PackStart (leftVBox, false, false, (uint)(Platform.IsWindows ? 5 : 0)); // as we change frame.BorderWidth below, we need to compensate
			hBox.PackStart (rightVBox, true, true, (uint)(Platform.IsWindows ? 5 : 10));

			var frame = new Frame ();
			frame.Add (hBox);
			frame.BorderWidth = (uint)(Platform.IsWindows ? 5 : 10); // on Windows we need to have smaller border due to ExceptionTypeLabel vertical misalignment
			frame.Shadow = ShadowType.None;
			frame.ShadowType = ShadowType.None;

			eventBox.Add (frame);
			eventBox.ShowAll ();
			eventBox.ModifyBg (StateType.Normal, new Gdk.Color (119, 130, 140));

			return eventBox;
		}
Exemplo n.º 52
0
        public SetupWindow () : base ("")
        {
            Title          = Catalog.GetString ("CmisSync Setup");
            BorderWidth    = 0;
            IconName       = "app-cmissync";
            Resizable      = false;
            WindowPosition = WindowPosition.Center;
            Deletable      = false;

            DeleteEvent += delegate (object sender, DeleteEventArgs args) {
                args.RetVal = true;
            };

            SecondaryTextColor = UIHelpers.GdkColorToHex (Style.Foreground (StateType.Insensitive));
                        
            SecondaryTextColorSelected =
                UIHelpers.GdkColorToHex (
                    MixColors (
                        new TreeView ().Style.Foreground (StateType.Selected),
                        new TreeView ().Style.Background (StateType.Selected),
                        0.15
                    )
                );

            SetSizeRequest (680, 400);

            HBox = new HBox (false, 0);

                VBox = new VBox (false, 0);

                    Wrapper = new VBox (false, 0) {
                        BorderWidth = 0
                    };

                    OptionArea = new VBox (false, 0) {
                        BorderWidth = 0
                    };

                    Buttons = CreateButtonBox ();


                HBox layout_horizontal = new HBox (false , 0) {
                    BorderWidth = 0
                };

                layout_horizontal.PackStart (OptionArea, true, true, 0);
                layout_horizontal.PackStart (Buttons, false, false, 0);

                VBox.PackStart (Wrapper, true, true, 0);
                VBox.PackStart (layout_horizontal, false, false, 15);

                EventBox box = new EventBox ();
                Gdk.Color bg_color = new Gdk.Color ();
                Gdk.Color.Parse ("#000", ref bg_color);
                box.ModifyBg (StateType.Normal, bg_color);

                Image side_splash = UIHelpers.GetImage ("side-splash.png");
                side_splash.Yalign = 1;

            box.Add (side_splash);

            HBox.PackStart (box, false, false, 0);
            HBox.PackStart (VBox, true, true, 30);

            base.Add (HBox);
        }
Exemplo n.º 53
0
        public SetupWindow() : base(string.Empty) {
            this.Title          = string.Format("{0} {1}", Properties_Resources.ApplicationName, Catalog.GetString("Setup"));
            this.BorderWidth    = 0;
            this.IconName       = "dataspacesync-app";
            this.Resizable      = false;
            this.WindowPosition = WindowPosition.Center;
            this.Deletable      = false;

            this.DeleteEvent += delegate(object sender, DeleteEventArgs args) {
                args.RetVal = true;
            };

            this.SecondaryTextColor = Style.Foreground(StateType.Insensitive).ToHex();

            this.SecondaryTextColorSelected = this.MixColors(
                new TreeView().Style.Foreground(StateType.Selected),
                new TreeView().Style.Background(StateType.Selected),
                0.15).ToHex();

            this.SetSizeRequest(680, 400);

            this.hBox = new HBox(false, 0);

            this.vBox = new VBox(false, 0);

            this.wrapper = new VBox(false, 0) {
                BorderWidth = 0
            };

            this.optionArea = new VBox(false, 0) {
                BorderWidth = 0
            };

            this.buttons = this.CreateButtonBox();

            HBox layout_horizontal = new HBox(false, 0) {
                BorderWidth = 0
            };

            layout_horizontal.PackStart(this.optionArea, true, true, 0);
            layout_horizontal.PackStart(this.buttons, false, false, 0);

            this.vBox.PackStart(this.wrapper, true, true, 0);
            this.vBox.PackStart(layout_horizontal, false, false, 15);

            EventBox box = new EventBox();
            Gdk.Color bg_color = new Gdk.Color();
            Gdk.Color.Parse("#000", ref bg_color);
            box.ModifyBg(StateType.Normal, bg_color);

            Image side_splash = UIHelpers.GetImage("side-splash.png");
            side_splash.Yalign = 1;

            box.Add(side_splash);

            this.hBox.PackStart(box, false, false, 0);
            this.hBox.PackStart(this.vBox, true, true, 30);

            base.Add(this.hBox);
        }
		Gtk.Widget AddFeature (ISolutionItemFeature feature)
		{
			Gtk.HBox cbox = new Gtk.HBox ();
			CheckButton check = null;
			
			Label fl = new Label ();
			fl.Wrap = true;
			fl.WidthRequest = 630;
			fl.Markup = "<b>" + feature.Title + "</b>\n<small>" + feature.Description + "</small>";
			bool enabledByDefault = feature.GetSupportLevel (parentCombine, entry) == FeatureSupportLevel.Enabled;

			if (enabledByDefault) {
				Alignment al = new Alignment (0,0,0,0);
				al.SetPadding (6,6,6,6);
				al.Add (fl);
				cbox.PackStart (al, false, false, 0);
			}
			else {
				check = new CheckButton ();
				check.Image = fl;
				cbox.PackStart (check, false, false, 0);
				check.ModifyBg (StateType.Prelight, Style.MidColors [(int)StateType.Normal]);
				check.BorderWidth = 3;
			}
			EventBox eb = new EventBox ();
			if (!enabledByDefault) {
				eb.Realized += delegate {
					eb.GdkWindow.Cursor = handCursor;
				};
			}
			eb.ModifyBg (StateType.Normal, Style.MidColors[(int)StateType.Normal]);
			eb.Add (cbox);
			eb.ShowAll ();
			box.PackStart (eb, false, false, 0);
			
			HBox fbox = new HBox ();
			Gtk.Widget editor = feature.CreateFeatureEditor (parentCombine, entry);
			if (editor != null) {
				Label sp = new Label ("");
				sp.WidthRequest = 24;
				sp.Show ();
				fbox.PackStart (sp, false, false, 0);
				editor.Show ();
				fbox.PackStart (editor, false, false, 0);
				box.PackStart (fbox, false, false, 0);
			}
			
			if (check != null) {
				ISolutionItemFeature f = feature;
				check.Toggled += delegate {
					OnClickFeature (f, check, fbox, editor);
				};
			} else {
				fbox.Show ();
			}
			return editor;
		}
Exemplo n.º 55
0
 private void InitializeWidgets(Manager simiasManager)
 {
     this.SetDefaultSize (480, 550);
        EventBox prefsWindow = new EventBox();
        prefsWindow.ModifyBg(StateType.Normal, this.Style.Background(StateType.Normal));
        VBox winBox = new VBox();
        prefsWindow.Add(winBox);
        this.Add (prefsWindow);
        winBox.BorderWidth = 7;
        winBox.Spacing = 7;
        this.Icon = new Gdk.Pixbuf(Util.ImagesPath("ifolder16.png"));
        this.WindowPosition = Gtk.WindowPosition.Center;
        PrefNoteBook = new Notebook();
        generalPage = new PrefsGeneralPage(this, ifws);
        PrefNoteBook.AppendPage( generalPage,
       new Label(Util.GS("General")));
        accountsPage = new PrefsAccountsPage(this);
        PrefNoteBook.AppendPage( accountsPage,
       new Label(Util.GS("Accounts")));
        new MigrationPage(this, ifws);
        settingPage = new PrefsSettingPage(this);
        PrefNoteBook.AppendPage( settingPage, new Label(Util.GS("Settings")));
        PrefNoteBook.SwitchPage +=
     new SwitchPageHandler(OnSwitchPageEvent);
        winBox.PackStart(PrefNoteBook, true, true, 0);
        HButtonBox buttonBox = new HButtonBox();
        buttonBox.BorderWidth = 10;
        buttonBox.Spacing = 10;
        buttonBox.Layout = ButtonBoxStyle.Edge;
        winBox.PackStart(buttonBox, false, false, 0);
        Button helpButton = new Button(Gtk.Stock.Help);
        buttonBox.PackStart(helpButton);
        helpButton.Clicked += new EventHandler(HelpEventHandler);
        Button closeButton = new Button(Gtk.Stock.Close);
        buttonBox.PackStart(closeButton);
        closeButton.Clicked += new EventHandler(CloseEventHandler);
 }
Exemplo n.º 56
0
        public GridRow(PropertyGrid parentGrid, PropertyDescriptor descriptor)
        {
            this.parent = parentGrid;
            this.propertyDescriptor = descriptor;

            // TODO: Need a better way to check if the property has no get accessor.
            // Write-only? Don't add this to the list.
            try {object propertyValue = descriptor.GetValue (parent.CurrentObject);}
            catch (Exception) {
                isValidProperty = false;
                return;
            }

            #region Name label

            string name = descriptor.DisplayName;
            ParenthesizePropertyNameAttribute paren = descriptor.Attributes[typeof (ParenthesizePropertyNameAttribute)] as ParenthesizePropertyNameAttribute;
            if (paren != null && paren.NeedParenthesis)
                name = "(" + name + ")";

            propertyNameLabel = new Label (name);
            propertyNameLabel.Xalign = 0;
            propertyNameLabel.Xpad = 3;
            propertyNameLabel.HeightRequest = 20;

            propertyNameEventBox = new EventBox ();
            propertyNameEventBox.ModifyBg (StateType.Normal, parent.Style.White);
            propertyNameEventBox.Add (propertyNameLabel);
            propertyNameEventBox.ButtonReleaseEvent += on_label_ButtonRelease;

            if (propertyNameLabel.SizeRequest ().Width > 100) {
                propertyNameLabel.WidthRequest = 100;
                //TODO: Display tooltip of full name when truncated
                //parent.tooltips.SetTip (propertyNameLabel, descriptor.DisplayName, descriptor.DisplayName);
            }

            #endregion

            editor = parent.EditorManager.GetEditor(propertyDescriptor, this);

            propertyValueHBox = new HBox();

            //check if it needs a button. Note arrays are read-only but have buttons
            if (editor.DialogueEdit && (!propertyDescriptor.IsReadOnly || editor.EditsReadOnlyObject)) {
                Label buttonLabel = new Label ();
                buttonLabel.UseMarkup = true;
                buttonLabel.Xpad = 0; buttonLabel.Ypad = 0;
                buttonLabel.Markup = "<span size=\"small\">...</span>";
                Button dialogueButton = new Button (buttonLabel);
                dialogueButton.Clicked += new EventHandler (dialogueButton_Clicked);
                propertyValueHBox.PackEnd (dialogueButton, false, false, 0);
            }

            propertyValueEventBox = new EventBox ();
            propertyValueEventBox.ModifyBg (StateType.Normal, parent.Style.White);
            propertyValueEventBox.CanFocus = true;
            propertyValueEventBox.ButtonReleaseEvent += on_value_ButtonRelease;
            propertyValueEventBox.Focused += on_value_ButtonRelease;
            propertyValueHBox.PackStart (propertyValueEventBox, true, true, 0);

            valueBeforeEdit = propertyDescriptor.GetValue (parentGrid.CurrentObject);
            DisplayRenderWidget ();
        }
		void CreateTooltip (ProjectConfigurationControl control, ExtraControlTableRow extraRow)
		{
			if (string.IsNullOrEmpty (control.InformationTooltip))
				return;

			var hbox = new HBox ();
			var paddingEventBox = new EventBox ();
			paddingEventBox.ModifyBg (StateType.Normal, leftHandBackgroundColor);
			hbox.PackStart (paddingEventBox, true, true, 0);

			var tooltipEventBox = new EventBox {
				HeightRequest = 16,
				WidthRequest = 16,
				VisibleWindow = false
			};

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

			extraRow.InformationTooltipWidget = hbox;
			extraRow.InformationTooltip = CreateTooltip (tooltipEventBox, control.InformationTooltip);
		}
Exemplo n.º 58
0
 private Widget CreateWidgets()
 {
     EventBox widgetEventbox = new EventBox();
       widgetEventbox.ModifyBg(StateType.Normal, this.Style.Background(StateType.Normal));
        VBox vbox = new VBox(false, 0);
        widgetEventbox.Add(vbox);
        AddAccountPixbuf = new Gdk.Pixbuf(Util.ImagesPath("ifolder-add-account48.png"));
        AddAccountPixbuf = AddAccountPixbuf.ScaleSimple(48, 48, Gdk.InterpType.Bilinear);
        AccountDruid = new Gnome.Druid();
        vbox.PackStart(AccountDruid, true, true, 0);
        AccountDruid.ShowHelp = true;
        AccountDruid.Help += new EventHandler(OnAccountWizardHelp);
        AccountDruid.AppendPage(CreateIntroductoryPage());
        AccountDruid.AppendPage(CreateServerInformationPage());
        AccountDruid.AppendPage(CreateUserInformationPage());
        AccountDruid.AppendPage(CreateConnectPage());
        AccountDruid.AppendPage(CreateRAPage());
        AccountDruid.AppendPage(CreateDefaultiFolderPage());
        AccountDruid.AppendPage(CreateSummaryPage());
        AccountDruid.SetButtonsSensitive(false, true, true, true);
        return widgetEventbox;
 }
Exemplo n.º 59
0
 private Widget CreateiFolderContentArea()
 {
     ContentEventBox = new EventBox();
        ContentEventBox.ModifyBg(StateType.Normal, this.Style.Background(StateType.Active));
        VBox vbox = new VBox(false, 0);
        ContentEventBox.Add(vbox);
        HBox hbox = new HBox(false, 0);
        hbox.PackStart(CreateActions(), false, false, 12);
        hbox.PackStart(CreateIconViewPane(), true, true, 0);
        vbox.PackStart(hbox, true, true, 0);
        return ContentEventBox;
 }
Exemplo n.º 60
0
 private Widget CreateWidgets()
 {
     EventBox widgetEventbox = new EventBox();
             widgetEventbox.ModifyBg(StateType.Normal, this.Style.Background(StateType.Normal));
                 VBox vbox = new VBox(false, 0);
                 widgetEventbox.Add(vbox);
                 KeyRecoveryPixbuf = new Gdk.Pixbuf(Util.ImagesPath("ifolder48.png"));
                 KeyRecoveryPixbuf = KeyRecoveryPixbuf.ScaleSimple(48, 48, Gdk.InterpType.Bilinear);
                 KeyRecoveryDruid = new Gnome.Druid();
                 vbox.PackStart(KeyRecoveryDruid, false,false ,0);
                 KeyRecoveryDruid.ShowHelp = true;
                 KeyRecoveryDruid.Help += new EventHandler(OnKeyRecoveryWizardHelp);
        KeyRecoveryDruid.AppendPage(CreateDomainSelectionPage());
        KeyRecoveryDruid.AppendPage(CreateEnterPassphrasePage());
        KeyRecoveryDruid.AppendPage(CreateInfoPage());
                 KeyRecoveryDruid.AppendPage(CreateSelectionPage());
                 KeyRecoveryDruid.AppendPage(CreateSingleWizPage());
        KeyRecoveryDruid.AppendPage(CreateImportKeyPage());
                KeyRecoveryDruid.AppendPage(CreateExportKeyPage());
        KeyRecoveryDruid.AppendPage(CreateEmailPage());
       KeyRecoveryDruid.AppendPage(CreateFinishPage());
                 return widgetEventbox;
 }