public void AddMessage(string msg, string icon)
        {
            if (lastImage != null)
            {
                HSeparator sep = new HSeparator();
                sep.Show();
                msgBox.PackStart(sep, false, false, 0);
                lastImage.IconSize = (int)Gtk.IconSize.Button;
            }

            HBox box = new HBox();

            box.Spacing = 12;
            Alignment imgBox = new Alignment(0, 0, 0, 0);
            Image     img    = new Image(icon, lastImage != null ? Gtk.IconSize.Button : IconSize.Dialog);

            imgBox.Add(img);
            lastImage = img;
            box.PackStart(imgBox, false, false, 0);
            Label lab = new Label(msg);

            lab.Xalign       = 0;
            lab.Yalign       = 0;
            lab.Wrap         = true;
            lab.WidthRequest = 500;
            box.PackStart(lab, true, true, 0);
            msgBox.PackStart(box, false, false, 0);
            box.ShowAll();
        }
Ejemplo n.º 2
0
        public void AddSeparator()
        {
            HSeparator sep = new HSeparator();

            Attach(sep, 0, 2, NRows, NRows + 1);
            sep.HeightRequest = 10;
        }
Ejemplo n.º 3
0
        public void AddMessage(string msg, IconId icon)
        {
            if (lastImage != null)
            {
                HSeparator sep = new HSeparator();
                sep.Show();
                msgBox.PackStart(sep, false, false, 0);
                lastImage.IconSize = Gtk.IconSize.Menu;
            }

            HBox box = new HBox();

            box.Spacing = 12;
            Alignment imgBox = new Alignment(0, 0, 0, 0);
            var       img    = new ImageView(icon, lastImage != null ? Gtk.IconSize.Menu : IconSize.Dialog);

            imgBox.Add(img);
            lastImage = img;
            box.PackStart(imgBox, false, false, 0);
            Label lab = new Label(msg);

            lab.UseUnderline = false;
            lab.Xalign       = 0;
            lab.Yalign       = 0;
            lab.Wrap         = true;
            lab.WidthRequest = 500;
            box.PackStart(lab, true, true, 0);
            msgBox.PackStart(box, false, false, 0);
            box.ShowAll();
        }
Ejemplo n.º 4
0
    public void Separate()
    {
        HSeparator separator = (HSeparator)separatorTemplate.Duplicate();

        separator.Show();
        AddChild(separator);
    }
Ejemplo n.º 5
0
    public void FillDataPipe(IEnumerable <IEnumerable <int> > data)
    {
        int numPipe = 0;

        foreach (IEnumerable <int> pipe in data)
        {
            HBoxContainer actualHBoxContainer = new HBoxContainer();
            var           actualLabelPipe     = new Label();
            numPipe++;
            actualLabelPipe.Text = $" * tube n°{numPipe}";
            actualLabelPipe.AddFontOverride("font", ResourceLoader.Load <Font>("res://fonts/fontsmall.tres"));
            actualLabelPipe.AddColorOverride("font_color", Colors.Black);
            vBoxContainer.AddChild(actualLabelPipe);

            vBoxContainer.AddChild(actualHBoxContainer);
            var          hSeparator = new HSeparator();
            StyleBoxLine sbl        = new StyleBoxLine()
            {
                Color = new Color("ad4c4c"), Thickness = 5
            };
            hSeparator.AddStyleboxOverride("separator", sbl);
            vBoxContainer.AddChild(hSeparator);

            foreach (int length in pipe)
            {
                actualHBoxContainer.AddChild(CreateLabelPipeDraw(length));
            }
        }
        RectSize = new Vector2(RectSize.x, (numPipe) * 68);
    }
Ejemplo n.º 6
0
        static Widget CreateSeparator()
        {
            var separator = new HSeparator();

            separator.Show();
            return(separator);
        }
Ejemplo n.º 7
0
        void AddOptionsButton(TaskRunnerInformation task)
        {
            if (task?.Options == null || !task.Options.Any())
            {
                return;
            }

            separator = new HSeparator();
            optionsToolbar.Add(separator);

            foreach (ITaskRunnerOption option in task.Options)
            {
                var button = new ToggleButton();
                button.Name        = option.Name;
                button.TooltipText = option.GetTooltipText();
                button.Active      = option.Checked;
                AddIcon(button, option.Icon);
                button.Data ["option"] = option;
                button.Clicked        += OptionButtonClicked;

                optionButtons.Add(button);
                optionsToolbar.Add(button);
            }

            optionsToolbar.ShowAll();
        }
Ejemplo n.º 8
0
    public AdminLogLabel(ref SharedAdminLog log, HSeparator separator)
    {
        Log       = log;
        Separator = separator;

        SetMessage($"{log.Date:HH:mm:ss}: {log.Message}");
        OnVisibilityChanged += VisibilityChanged;
    }
Ejemplo n.º 9
0
        /// <summary>
        /// Constructor.
        /// </summary>
        public MainContent(MainWindow window)
        {
            // the left controls
            ActiveMeshControls activeMesh = new ActiveMeshControls();
            HSeparator         separator  = new HSeparator();
            MeshList           meshList   = new MeshList();

            VBox leftControls = new VBox(false, 0);

            leftControls.WidthRequest = 250;
            leftControls.PackStart(activeMesh, false, false, 0);
            leftControls.PackStart(separator, false, false, 0);
            leftControls.PackStart(meshList, true, true, 0);

            Frame leftFrame = new Frame();

            leftFrame.Shadow = ShadowType.EtchedIn;
            leftFrame.Add(leftControls);

            // the scene content
            VBox sceneBox = new VBox();

            m_sceneWindow = SceneWindow.CreateSceneWindow();
            SceneToolbar sceneToolbar = new SceneToolbar(window, m_sceneWindow);

            sceneBox.PackStart(sceneToolbar, false, false, 0);
            sceneBox.PackStart(m_sceneWindow, true, true, 0);

            // the right controls
            SmoothingContent smoothing = new SmoothingContent();

            VBox rightControls = new VBox(false, 0);

            rightControls.WidthRequest = 250;
            rightControls.PackStart(smoothing, true, true, 0);

            Frame rightFrame = new Frame();

            rightFrame.Shadow = ShadowType.EtchedIn;
            rightFrame.Add(rightControls);

            // fit everything into the main window
            HPaned pan1 = new HPaned();
            HPaned pan2 = new HPaned();

            pan1.Pack1(leftFrame, false, false);
            pan1.Pack2(sceneBox, true, true);

            pan2.Pack1(pan1, true, true);
            pan2.Pack2(rightFrame, false, false);

            PackStart(pan2, true, true, 0);

            KeyPressEvent += m_sceneWindow.OnKeyPress;

            Time.SetStartTime();
            GLib.Idle.Add(Update);
        }
 public TopLevelDialog( )
 {
     vbox      = new VBox();
     separator = new HSeparator();
     buttonBox = new HButtonBox();
     vbox.PackEnd(buttonBox, false, false, 0);
     vbox.PackEnd(separator, false, false, 0);
     vbox.ShowAll();
     Add(vbox);
 }
            public WidgetBuilderOptionPanelWidget(Project project) : base(false, 6)
            {
                this.project = project as DotNetProject;

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

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

                HSeparator sep = new HSeparator();

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

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

                GtkDesignInfo designInfo = GtkDesignInfo.FromProject(project);

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

                checkGettext.Clicked += delegate
                {
                    box.Sensitive = checkGettext.Active;
                    if (checkGettext.Active)
                    {
                        entryGettext.Text = "Mono.Unix.Catalog";
                    }
                };
            }
Ejemplo n.º 12
0
        public NotebookPage(Page page)
        {
            this.page = page;

            BorderWidth = 5;
            Spacing     = 10;

            tab_widget = new Label(page.Name);
            tab_widget.Show();

            Widget page_widget = page.DisplayWidget as Widget;

            if (page_widget != null)
            {
                page_widget.Show();
                PackStart(page_widget, true, true, 0);
            }
            else
            {
                foreach (Section section in page)
                {
                    AddSection(section);
                }

                if (page.ChildPages.Count > 0)
                {
                    Notebook notebook = new Notebook();
                    notebook.ShowBorder = false;
                    notebook.ShowTabs   = false;
                    notebook.Show();

                    PageComboBox page_combo = new PageComboBox(page.ChildPages, notebook);
                    PackStart(page_combo, false, false, 0);

                    HSeparator sep = new HSeparator();
                    sep.Show();
                    PackStart(sep, false, false, 0);

                    foreach (Page child_page in page.ChildPages)
                    {
                        NotebookPage page_ui = new NotebookPage(child_page);
                        page_ui.BorderWidth = 0;
                        page_ui.Show();
                        notebook.AppendPage(page_ui, null);
                    }

                    PackStart(notebook, true, true, 0);
                }
            }
        }
        Widget IMimeTypePolicyOptionsPanel.CreateMimePanelWidget()
        {
            panelWidget = CreatePanelWidget();
            //HACK: work around bug 469427 - broken themes match on widget names
            if (panelWidget.Name.IndexOf("Panel") > 0)
            {
                panelWidget.Name = panelWidget.Name.Replace("Panel", "_");
            }
            if (isExactMimeType)
            {
                return(panelWidget);
            }

            VBox box = new VBox();

            box.Spacing = 6;

            string baseType = mimeTypeScopes.ElementAt(1);

            baseType = IdeServices.DesktopService.GetMimeTypeDescription(baseType);
            defaultSettingsButton          = new CheckButton(GettextCatalog.GetString("Use default settings from '{0}'", baseType));
            defaultSettingsButton.Clicked += delegate {
                if (defaultSettingsButton.Active)
                {
                    panelWidget.Sensitive = false;
                    List <string> baseTypes = new List <string> (mimeTypeScopes);
                    baseTypes.RemoveAt(0);
                    LoadFrom(GetInheritedPolicy(baseTypes));
                }
                else
                {
                    panelWidget.Sensitive = true;
                }
            };

            defaultSettingsButton.SetCommonAccessibilityAttributes("MimePanel.DefaultCheckbox", "",
                                                                   GettextCatalog.GetString("Check to use the default settings from '{0}'", baseType));
            defaultSettingsButton.Accessible.AddLinkedUIElement(panelWidget.Accessible);

            box.PackStart(defaultSettingsButton, false, false, 0);
            var hsep = new HSeparator();

            hsep.Accessible.SetShouldIgnore(true);

            box.PackStart(hsep, false, false, 0);
            box.ShowAll();
            box.PackStart(panelWidget, true, true, 0);
            panelWidget.Show();
            return(box);
        }
Ejemplo n.º 14
0
    public override void _Ready()
    {
        compoundBars = GetTree().GetNodesInGroup("CompoundBar");

        winExtinctBoxHolder = GetNode <Control>("WinExtinctBoxHolder");

        panelsTween     = GetNode <Tween>(PanelsTweenPath);
        mouseHoverPanel = GetNode <MarginContainer>(MouseHoverPanelPath);
        pauseButton     = GetNode <TextureButton>(PauseButtonPath);
        resumeButton    = GetNode <TextureButton>(ResumeButtonPath);
        agentsPanel     = GetNode <Control>(AgentsPanelPath);

        environmentPanel             = GetNode <Panel>(EnvironmentPanelPath);
        environmentPanelBarContainer = GetNode <GridContainer>(EnvironmentPanelBarContainerPath);
        oxygenBar     = GetNode <ProgressBar>(OxygenBarPath);
        co2Bar        = GetNode <ProgressBar>(Co2BarPath);
        nitrogenBar   = GetNode <ProgressBar>(NitrogenBarPath);
        temperature   = GetNode <ProgressBar>(TemperaturePath);
        sunlightLabel = GetNode <ProgressBar>(SunlightPath);
        pressure      = GetNode <ProgressBar>(PressurePath);

        compoundsPanel             = GetNode <Panel>(CompoundsPanelPath);
        compoundsPanelBarContainer = GetNode <GridContainer>(CompoundsPanelBarContainerPath);
        glucoseBar         = GetNode <ProgressBar>(GlucoseBarPath);
        ammoniaBar         = GetNode <ProgressBar>(AmmoniaBarPath);
        phosphateBar       = GetNode <ProgressBar>(PhosphateBarPath);
        hydrogenSulfideBar = GetNode <ProgressBar>(HydrogenSulfideBarPath);
        ironBar            = GetNode <ProgressBar>(IronBarPath);

        oxytoxyBar               = GetNode <ProgressBar>(OxytoxyBarPath);
        atpBar                   = GetNode <TextureProgress>(AtpBarPath);
        healthBar                = GetNode <TextureProgress>(HealthBarPath);
        ammoniaReproductionBar   = GetNode <TextureProgress>(AmmoniaReproductionBarPath);
        phosphateReproductionBar = GetNode <TextureProgress>(PhosphateReproductionBarPath);

        atpLabel                  = GetNode <Label>(AtpLabelPath);
        hpLabel                   = GetNode <Label>(HpLabelPath);
        menu                      = GetNode <PauseMenu>(MenuPath);
        animationPlayer           = GetNode <AnimationPlayer>(AnimationPlayerPath);
        hoveredCompoundsContainer = GetNode <VBoxContainer>(HoveredCompoundsContainerPath);
        hoveredCellsSeparator     = GetNode <HSeparator>(HoverPanelSeparatorPath);
        hoveredCellsContainer     = GetNode <VBoxContainer>(HoveredCellsContainerPath);
        populationLabel           = GetNode <Label>(PopulationLabelPath);
        patchLabel                = GetNode <Label>(PatchLabelPath);
        editorButton              = GetNode <TextureButton>(EditorButtonPath);

        processPanel       = GetNode <ProcessPanel>(ProcessPanelPath);
        processPanelButton = GetNode <TextureButton>(ProcessPanelButtonPath);
    }
Ejemplo n.º 15
0
    public static void DrawApp(Gtk.TreeView localTree)
    {
        if (firstrun == false)
        {
            window.Remove(box1);
        }
        else
        {
            firstrun = false;
        }

        ScrolledWindow sw = new ScrolledWindow();

        separator = new HSeparator();
        box1      = new VBox(false, 0);
        sw.Add(localTree);
        box1.PackStart(sw, true, true, 5);
        box1.PackStart(separator, false, true, 5);
        separator.Show();

        box2 = new HBox(false, 0);

        quitbox = new HBox(false, 0);

        Button downloadButton = new Button("Download");

        downloadButton.Clicked += new EventHandler(downloadButton_Clicked);

        Button button = new Button("Quit");

        button.Clicked += QuitButton_Clicked;

        Button FetchXml = new Button("Fetch Feed");

        FetchXml.Clicked += FetchXml_Clicked;

        quitbox.PackStart(FetchXml, true, false, 0);
        quitbox.PackStart(downloadButton, true, false, 0);
        quitbox.PackStart(button, true, false, 0);



        box1.PackStart(box2, false, false, 0);
        box1.PackStart(quitbox, false, false, 0);


        window.Add(box1);
    }
Ejemplo n.º 16
0
        public BestellWidget()
        {
            this.Build();

            eventBox.ModifyBg(Gtk.StateType.Normal, new Gdk.Color(255, 255, 255));

            table.NRows    = Rows + 2;
            table.NColumns = 3;

            HSeparator s = new HSeparator();

            table.Attach(s, 0, 3, Rows, Rows + 1);

            sumLabel        = new Label();
            sumLabel.Xalign = 1.0f;
            sumLabel.Markup = "<span size=\"xx-large\"><b>Summe:</b></span>";
            table.Attach(sumLabel, 0, 1, Rows + 1, Rows + 2);

            sumLabel        = new Label();
            sumLabel.Markup = "<span size=\"xx-large\"><b>0,00 €</b></span>";
            sumLabel.Xalign = 1.0f;
            table.Attach(sumLabel, 1, 2, Rows + 1, Rows + 2);

            artikelLabel = new Label[Rows];
            preisLabel   = new Label[Rows];
            delBtn       = new Button[Rows];

            for (uint y = 0; y < Rows; y++)
            {
                artikelLabel[y]        = new Label();
                artikelLabel[y].Xalign = 1.0f;
                preisLabel[y]          = new Label();
                preisLabel[y].Xalign   = 1.0f;
                Image delImg = new Image(Gtk.Stock.Delete, Gtk.IconSize.Button);
                delBtn[y]          = new Button(delImg);
                delBtn[y].Clicked += new EventHandler(this.OnDelClicked);

                table.Attach(artikelLabel[y], 0, 1, y, y + 1);
                table.Attach(preisLabel[y], 1, 2, y, y + 1);
                table.Attach(delBtn[y], 2, 3, y, y + 1);
            }

            Posten = new List <Artikel>();

            Update();
        }
Ejemplo n.º 17
0
        void RemoveExistingOptionButtons()
        {
            if (separator != null)
            {
                optionsToolbar.Remove(separator);
                separator.Dispose();
                separator = null;
            }

            foreach (ToggleButton button in optionButtons)
            {
                button.Clicked -= OptionButtonClicked;
                optionsToolbar.Remove(button);
                button.Dispose();
            }

            optionButtons.Clear();
        }
Ejemplo n.º 18
0
        public static Gtk.Window Create()
        {
            window = new Window("GtkCheckButton");
            window.SetDefaultSize(200, 100);

            VBox box1 = new VBox(false, 0);

            window.Add(box1);

            VBox box2 = new VBox(false, 10);

            box2.BorderWidth = 10;
            box1.PackStart(box2, true, true, 0);

            checked_button = new CheckButton("_button1");
            box2.PackStart(checked_button, true, true, 0);

            checked_button = new CheckButton("button2");
            box2.PackStart(checked_button, true, true, 0);

            checked_button = new CheckButton("button3");
            box2.PackStart(checked_button, true, true, 0);

            checked_button = new CheckButton("Inconsistent");
            checked_button.Inconsistent = true;
            box2.PackStart(checked_button, true, true, 0);

            HSeparator separator = new HSeparator();

            box1.PackStart(separator, false, false, 0);

            box2             = new VBox(false, 10);
            box2.BorderWidth = 10;
            box1.PackStart(box2, false, false, 0);

            Button button = new Button(Stock.Close);

            button.Clicked   += new EventHandler(OnCloseClicked);
            button.CanDefault = true;

            box2.PackStart(button, true, true, 0);
            button.GrabDefault();
            return(window);
        }
Ejemplo n.º 19
0
    public override void _Ready()
    {
        leftColumn      = GetNode <VBoxContainer>(LeftColumnPath);
        rightColumn     = GetNode <VBoxContainer>(RightColumnPath);
        lineSeparator   = GetNode <HSeparator>(LineSeparatorPath);
        tipMessageLabel = GetNode <Label>(TipMessageLabelPath);
        timer           = GetNode <Timer>(TimerPath);

        random = new Random();

        if (!string.IsNullOrEmpty(Category))
        {
            BuildHelpTexts(Category);
        }
        else
        {
            GD.PrintErr("Help screen has no category, can't load texts");
        }
    }
Ejemplo n.º 20
0
    private void onStoryEnded()
    {
        CanvasItem endOfStory = new VBoxContainer();

        endOfStory.AddChild(new HSeparator());
        CanvasItem endOfStoryLine = new HBoxContainer();

        endOfStory.AddChild(endOfStoryLine);
        endOfStory.AddChild(new HSeparator());
        Control separator = new HSeparator();

        separator.SizeFlagsHorizontal = (int)(SizeFlags.Fill | SizeFlags.Expand);
        Label endOfStoryText = new Label();

        endOfStoryText.Text = "End of story";
        endOfStoryLine.AddChild(separator);
        endOfStoryLine.AddChild(endOfStoryText);
        endOfStoryLine.AddChild(separator.Duplicate());
        addToStory(endOfStory);
    }
Ejemplo n.º 21
0
        void MouseEnter(object obj, EnterNotifyEventArgs args)
        {
            if (leftPopup != null)
            {
                leftPopup.Destroy();
            }
            if (lline != null)
            {
                lline.Destroy();
            }
            if (rightPopup != null)
            {
                rightPopup.Destroy();
            }
            if (rline != null)
            {
                rline.Destroy();
            }
            if (node.Parent == map.stage)
            {
                map.stage.Remove(node);
            }

            GdkWindow.GetOrigin(out int x, out int y);
            Vector2 nodeFixedPosition  = scaledPosition + lineOffset;
            Vector2 nodeScreenPosition = new Vector2(x + Allocation.Left, y + Allocation.Top) + lineOffset - offset;

            //This is the screen coordinates of the point defined by lineOffset — where the line(s) begin and the node sits.

            leftPopup = GenerateLeftPopup();
            if (leftPopup != null)
            {
                lline = new HSeparator();
                lline.SetSizeRequest(popupDistance, 4);
                map.stage.Put(lline, (int)nodeFixedPosition.x - popupDistance, (int)nodeFixedPosition.y - 2);
                lline.ShowAll();
                Graphics.SetAllocTrigger(leftPopup, delegate {
                    leftPopup.GetSize(out int width, out int height);
                    Vector2 truePosition = nodeScreenPosition + new Vector2(-popupDistance - width, -height / 4);
                    leftPopup.Move((int)truePosition.x, (int)truePosition.y);
                });
Ejemplo n.º 22
0
        public D152AccessibilityPanelWidget() : base(false, 6)
        {
            NSUserDefaults defaults = NSUserDefaults.StandardUserDefaults;

            enabled         = new CheckButton("Enable Accessibility");
            enabled.Active  = originalSetting = defaults.BoolForKey(EnabledKey);
            enabled.Visible = true;

            enabled.Toggled += ShowQuitOption;
            PackStart(enabled, false, false, 0);

            separatorRestart = new HSeparator();
            PackStart(this.separatorRestart, false, false, 0);

            tableRestart               = new Table(2, 3, false);
            tableRestart.RowSpacing    = 6;
            tableRestart.ColumnSpacing = 6;

            btnRestart              = new Button();
            btnRestart.CanFocus     = true;
            btnRestart.UseUnderline = true;
            btnRestart.Clicked     += RestartClicked;

            tableRestart.Attach(btnRestart, 1, 2, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 0, 0);

            imageRestart          = new global::MonoDevelop.Components.ImageView();
            imageRestart.IconId   = "md-information";
            imageRestart.IconSize = ((global::Gtk.IconSize)(1));

            tableRestart.Attach(imageRestart, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Fill, 0, 0);
            labelRestart = new global::Gtk.Label();
            tableRestart.Attach(labelRestart, 1, 3, 0, 1, AttachOptions.Fill, AttachOptions.Fill, 0, 0);

            PackStart(tableRestart, false, false, 0);

            labelRestart.LabelProp = GettextCatalog.GetString("These preferences will take effect next time you start {0}", BrandingService.ApplicationName);
            btnRestart.Label       = GettextCatalog.GetString("Restart {0}", BrandingService.ApplicationName);

            Visible = true;
        }
Ejemplo n.º 23
0
        public static Gtk.Window Create()
        {
            window = new Window("GtkComboBox");
            window.SetDefaultSize(200, 100);

            VBox box1 = new VBox(false, 0);

            window.Add(box1);

            VBox box2 = new VBox(false, 10);

            box2.BorderWidth = 10;
            box1.PackStart(box2, true, true, 0);

            ComboBoxText combo = ComboBoxText.NewWithEntry();

            combo.AppendText("Foo");
            combo.AppendText("Bar");
            combo.Changed       += new EventHandler(OnComboActivated);
            combo.Entry.Changed += new EventHandler(OnComboEntryChanged);
            box2.PackStart(combo, true, true, 0);

            HSeparator separator = new HSeparator();

            box1.PackStart(separator, false, false, 0);

            box2             = new VBox(false, 10);
            box2.BorderWidth = 10;
            box1.PackStart(box2, false, false, 0);

            Button button = new Button(Stock.Close);

            button.Clicked   += new EventHandler(OnCloseClicked);
            button.CanDefault = true;

            box2.PackStart(button, true, true, 0);
            button.GrabDefault();
            return(window);
        }
Ejemplo n.º 24
0
        public static Gtk.Window Create()
        {
            window = new Window("GtkCombo");
            window.SetDefaultSize(200, 100);

            VBox box1 = new VBox(false, 0);

            window.Add(box1);

            VBox box2 = new VBox(false, 10);

            box2.BorderWidth = 10;
            box1.PackStart(box2, true, true, 0);

            combo = new Gtk.Combo();
            string[] pop = { "Foo", "Bar" };
            combo.PopdownStrings   = pop;
            combo.Entry.Activated += new EventHandler(OnComboActivated);
            box2.PackStart(combo, true, true, 0);

            HSeparator separator = new HSeparator();

            box1.PackStart(separator, false, false, 0);

            box2             = new VBox(false, 10);
            box2.BorderWidth = 10;
            box1.PackStart(box2, false, false, 0);

            Button button = new Button(Stock.Close);

            button.Clicked   += new EventHandler(OnCloseClicked);
            button.CanDefault = true;

            box2.PackStart(button, true, true, 0);
            button.GrabDefault();
            return(window);
        }
Ejemplo n.º 25
0
        void CreatePageWidget(SectionPage page)
        {
            List <PanelInstance> boxPanels = new List <PanelInstance> ();
            List <PanelInstance> tabPanels = new List <PanelInstance> ();

            foreach (PanelInstance pi in page.Panels)
            {
                if (pi.Widget == null)
                {
                    pi.Widget = pi.Panel.CreatePanelWidget();
                    if (pi.Widget == null)
                    {
                        continue;
                    }

                    //HACK: work around bug 469427 - broken themes match on widget names
                    if (pi.Widget.Name.IndexOf("Panel") > 0)
                    {
                        pi.Widget.Name = pi.Widget.Name.Replace("Panel", "_");
                    }
                }
                else if (pi.Widget.Parent != null)
                {
                    ((Gtk.Container)pi.Widget.Parent).Remove(pi.Widget);
                }

                if (pi.Node.Grouping == PanelGrouping.Tab)
                {
                    tabPanels.Add(pi);
                }
                else
                {
                    boxPanels.Add(pi);
                }
            }

            // Try to fit panels with grouping=box or auto in the main page.
            // If they don't fit. Move auto panels to its own tab page.

            int  mainPageSize;
            bool fits;

            do
            {
                PanelInstance lastAuto = null;
                mainPageSize = 0;
                foreach (PanelInstance pi in boxPanels)
                {
                    if (pi.Node.Grouping == PanelGrouping.Auto)
                    {
                        lastAuto = pi;
                    }
                    // HACK: This we are parenting/unparenting the widget here as a workaround
                    // for a layout issue. To properly calculate the size of the widget, the widget
                    // needs to have the style that it will have when added to the window.
                    pi.Widget.Parent = this;
                    mainPageSize    += pi.Widget.SizeRequest().Height + 6;
                    pi.Widget.Unparent();
                }
                fits = mainPageSize <= pageFrame.Allocation.Height;
                if (!fits)
                {
                    if (lastAuto != null && boxPanels.Count > 1)
                    {
                        boxPanels.Remove(lastAuto);
                        tabPanels.Insert(0, lastAuto);
                    }
                    else
                    {
                        fits = true;
                    }
                }
            } while (!fits);

            Gtk.VBox box = new VBox(false, 12);
            box.Show();
            for (int n = 0; n < boxPanels.Count; n++)
            {
                if (n != 0)
                {
                    HSeparator sep = new HSeparator();
                    sep.Show();
                    box.PackStart(sep, false, false, 0);
                }
                PanelInstance pi = boxPanels [n];
                box.PackStart(pi.Widget, pi.Node.Fill, pi.Node.Fill, 0);
                pi.Widget.Show();
            }

            box.BorderWidth = 12;

            if (tabPanels.Count > 0)
            {
                /*				SquaredNotebook nb = new SquaredNotebook ();
                 * nb.Show ();
                 * nb.AddTab (box, GettextCatalog.GetString ("General"));
                 * foreach (PanelInstance pi in tabPanels) {
                 *      Gtk.Alignment a = new Alignment (0, 0, 1, 1);
                 *      a.BorderWidth = 9;
                 *      a.Show ();
                 *      a.Add (pi.Widget);
                 *      nb.AddTab (a, GettextCatalog.GetString (pi.Node.Label));
                 *      pi.Widget.Show ();
                 * }*/
                Gtk.Notebook nb = new Notebook();
                nb.Show();
                if (box.Children.Length > 0)
                {
                    Gtk.Label blab = new Gtk.Label(GettextCatalog.GetString("General"));
                    blab.Show();
                    box.BorderWidth = 9;
                    nb.InsertPage(box, blab, -1);
                }
                foreach (PanelInstance pi in tabPanels)
                {
                    Gtk.Label lab = new Gtk.Label(GettextCatalog.GetString(pi.Node.Label));
                    lab.Show();
                    Gtk.Alignment a = new Alignment(0, 0, 1, 1);
                    a.BorderWidth = 9;
                    a.Show();
                    a.Add(pi.Widget);
                    nb.InsertPage(a, lab, -1);
                    pi.Widget.Show();
                }
                page.Widget    = nb;
                nb.BorderWidth = 12;
            }
            else
            {
                page.Widget = box;
            }
        }
Ejemplo n.º 26
0
        internal PropertyGrid(EditorManager editorManager)
        {
            this.editorManager = editorManager;

            #region Toolbar

            PropertyGridToolbar tb = new PropertyGridToolbar();
            base.PackStart(tb, false, false, 0);
            toolbar = tb;

            catButton = new RadioButton((Gtk.RadioButton)null);
            catButton.DrawIndicator = false;
            catButton.Relief        = ReliefStyle.None;
            Gdk.Pixbuf pixbuf = null;
            try {
                pixbuf = new Gdk.Pixbuf(typeof(PropertyGrid).Assembly, "MonoDevelop.Components.PropertyGrid.SortByCat.png");
            } catch (Exception e) {
                //LoggingService.LogError ("Can't create pixbuf from resource: MonoDevelop.Components.PropertyGrid.SortByCat.png", e);
            }
            if (pixbuf != null)
            {
                catButton.Image = new Gtk.Image(pixbuf);
                catButton.Image.Show();
            }
            catButton.TooltipText = "Sort in categories";
            catButton.Toggled    += new EventHandler(toolbarClick);
            toolbar.Insert(catButton, 0);

            alphButton = new RadioButton(catButton);
            alphButton.DrawIndicator = false;
            alphButton.Relief        = ReliefStyle.None;
            alphButton.Image         = new Gtk.Image(Stock.SortAscending, IconSize.Menu);
            alphButton.Image.Show();
            alphButton.TooltipText = "Sort alphabetically";
            alphButton.Clicked    += new EventHandler(toolbarClick);
            toolbar.Insert(alphButton, 1);

            catButton.Active = true;

            #endregion

            vpaned = new VPaned();

            tree          = new PropertyGridTable(editorManager, this);
            tree.Changed += delegate {
                Update();
            };

            CompactScrolledWindow sw = new CompactScrolledWindow();
            sw.AddWithViewport(tree);
            ((Gtk.Viewport)sw.Child).ShadowType = Gtk.ShadowType.None;
            sw.ShadowType       = Gtk.ShadowType.None;
            sw.HscrollbarPolicy = PolicyType.Never;
            sw.VscrollbarPolicy = PolicyType.Automatic;

            VBox tbox = new VBox();
            toolbarSeparator         = new HSeparator();
            toolbarSeparator.Visible = true;
            tbox.PackStart(toolbarSeparator, false, false, 0);
            tbox.PackStart(sw, true, true, 0);
            helpSeparator = new HSeparator();
            tbox.PackStart(helpSeparator, false, false, 0);
            helpSeparator.NoShowAll = true;
            vpaned.Pack1(tbox, true, true);

            AddPropertyTab(new DefaultPropertyTab());
            AddPropertyTab(new EventPropertyTab());

            base.PackEnd(vpaned);
            base.FocusChain = new Gtk.Widget [] { vpaned };

            Populate();
            UpdateTabs();
        }
Ejemplo n.º 27
0
        internal PropertyGrid(EditorManager editorManager)
        {
            this.editorManager = editorManager;

            #region Toolbar

            PropertyGridToolbar tb = new PropertyGridToolbar();
            base.PackStart(tb, false, false, 0);
            toolbar = tb;

            catButton = new RadioButton((Gtk.RadioButton)null);
            catButton.DrawIndicator = false;
            catButton.Relief        = ReliefStyle.None;
            catButton.Image         = new Gtk.Image(MonoDevelop.Ide.Gui.Stock.GroupByCategory, IconSize.Menu);
            catButton.Image.Show();
            catButton.TooltipText = GettextCatalog.GetString("Sort in categories");
            catButton.Toggled    += new EventHandler(toolbarClick);
            toolbar.Insert(catButton, 0);

            alphButton = new RadioButton(catButton);
            alphButton.DrawIndicator = false;
            alphButton.Relief        = ReliefStyle.None;
            alphButton.Image         = new Gtk.Image(MonoDevelop.Ide.Gui.Stock.SortAlphabetically, IconSize.Menu);
            alphButton.Image.Show();
            alphButton.TooltipText = GettextCatalog.GetString("Sort alphabetically");
            alphButton.Clicked    += new EventHandler(toolbarClick);
            toolbar.Insert(alphButton, 1);

            catButton.Active = true;

            #endregion

            vpaned = new VPaned();

            tree          = new PropertyGridTable(editorManager, this);
            tree.Changed += delegate {
                Update();
            };

            CompactScrolledWindow sw = new CompactScrolledWindow();
            sw.AddWithViewport(tree);
            ((Gtk.Viewport)sw.Child).ShadowType = Gtk.ShadowType.None;
            sw.ShadowType       = Gtk.ShadowType.None;
            sw.HscrollbarPolicy = PolicyType.Never;
            sw.VscrollbarPolicy = PolicyType.Automatic;

            VBox tbox = new VBox();
            toolbarSeparator         = new HSeparator();
            toolbarSeparator.Visible = true;
            tbox.PackStart(toolbarSeparator, false, false, 0);
            tbox.PackStart(sw, true, true, 0);
            helpSeparator = new HSeparator();
            tbox.PackStart(helpSeparator, false, false, 0);
            helpSeparator.NoShowAll = true;
            vpaned.Pack1(tbox, true, true);

            AddPropertyTab(new DefaultPropertyTab());
            AddPropertyTab(new EventPropertyTab());

            base.PackEnd(vpaned);
            base.FocusChain = new Gtk.Widget [] { vpaned };

            Populate();
            UpdateTabs();
        }
Ejemplo n.º 28
0
        public CommitDialog(ChangeSet changeSet)
        {
            Build();

            store                 = new ListStore(typeof(Xwt.Drawing.Image), typeof(string), typeof(string), typeof(bool), typeof(object));
            fileList.Model        = store;
            fileList.SearchColumn = -1;             // disable the interactive search
            this.changeSet        = changeSet;
            oldMessage            = changeSet.GlobalComment;

            CellRendererText crt     = new CellRendererText();
            var            crp       = new CellRendererImage();
            TreeViewColumn colStatus = new TreeViewColumn();

            colStatus.Title = GettextCatalog.GetString("Status");
            colStatus.PackStart(crp, false);
            colStatus.PackStart(crt, true);
            colStatus.Spacing = 2;
            colStatus.AddAttribute(crp, "image", 0);
            colStatus.AddAttribute(crt, "text", 1);
            CellRendererToggle cellToggle = new CellRendererToggle();

            cellToggle.Toggled += new ToggledHandler(OnCommitToggledHandler);
            TreeViewColumn colCommit = new TreeViewColumn("", cellToggle, "active", 3);
            TreeViewColumn colFile   = new TreeViewColumn(GettextCatalog.GetString("File"), new CellRendererText(), "text", 2);

            fileList.AppendColumn(colCommit);
            fileList.AppendColumn(colStatus);
            fileList.AppendColumn(colFile);

            colCommit.Visible = false;

            object[] exts = AddinManager.GetExtensionObjects("/MonoDevelop/VersionControl/CommitDialogExtensions", false);
            bool     separatorRequired = false;

            foreach (object ob in exts)
            {
                CommitDialogExtension ext = ob as CommitDialogExtension;
                if (ext == null)
                {
                    LoggingService.LogError("Commit extension type " + ob.GetType() + " must be a subclass of CommitDialogExtension");
                    continue;
                }
                if (ext.Initialize(changeSet))
                {
                    var newTitle = ext.FormatDialogTitle(changeSet, Title);
                    if (newTitle != null)
                    {
                        Title = newTitle;
                    }

                    ext.CommitMessageTextViewHook(textview);
                    if (separatorRequired)
                    {
                        HSeparator sep = new HSeparator();
                        sep.Show();
                        vboxExtensions.PackEnd(sep, false, false, 0);
                    }
                    vboxExtensions.PackEnd(ext, false, false, 0);
                    extensions.Add(ext);
                    ext.AllowCommitChanged += HandleAllowCommitChanged;
                    separatorRequired       = true;
                }
                else
                {
                    ext.Destroy();
                }
            }
            HandleAllowCommitChanged(null, null);

            LoadChangeset(changeSet.Items);

            if (string.IsNullOrEmpty(changeSet.GlobalComment))
            {
                AuthorInformation   aInfo;
                CommitMessageFormat fmt = VersionControlService.GetCommitMessageFormat(changeSet, out aInfo);
                Message = changeSet.GenerateGlobalComment(fmt, aInfo);
            }
            else
            {
                Message = changeSet.GlobalComment;
            }

            textview.Buffer.Changed += OnTextChanged;
            responseSensitive        = !string.IsNullOrEmpty(Message);

            // Focus the text view and move the insert point to the beginning. Makes it easier to insert
            // a comment header.
            textview.Buffer.MoveMark(textview.Buffer.InsertMark, textview.Buffer.StartIter);
            textview.Buffer.MoveMark(textview.Buffer.SelectionBound, textview.Buffer.StartIter);
            textview.GrabFocus();
            textview.Buffer.MarkSet += OnMarkSet;

            SetResponseSensitive(ResponseType.Ok, responseSensitive);

            VersionControlService.FileStatusChanged += OnFileStatusChanged;
        }
Ejemplo n.º 29
0
        internal PropertyGrid(EditorManager editorManager)
        {
            this.editorManager = editorManager;

            #region Toolbar

            PropertyGridToolbar tb = new PropertyGridToolbar();
            base.PackStart(tb, false, false, 0);
            toolbar = tb;

            catButton = new RadioButton((Gtk.RadioButton)null);
            catButton.DrawIndicator = false;
            catButton.Relief        = ReliefStyle.None;
            Gdk.Pixbuf pixbuf = null;
            try {
                pixbuf = new Gdk.Pixbuf(typeof(PropertyGrid).Assembly, "MonoDevelop.Components.PropertyGrid.SortByCat.png");
            } catch (Exception e) {
                NLog.LogManager.GetCurrentClassLogger().Error("Can't create pixbuf from resource: MonoDevelop.Components.PropertyGrid.SortByCat.png", e);
            }
            if (pixbuf != null)
            {
                catButton.Image = new Gtk.Image(pixbuf);
                catButton.Image.Show();
            }
            catButton.TooltipText = Catalog.GetString("Sort in categories");
            catButton.Toggled    += new EventHandler(toolbarClick);
            toolbar.Insert(catButton, 0);

            alphButton = new RadioButton(catButton);
            alphButton.DrawIndicator = false;
            alphButton.Relief        = ReliefStyle.None;
            alphButton.Image         = new Gtk.Image(Stock.SortAscending, IconSize.Menu);
            alphButton.Image.Show();
            alphButton.TooltipText = Catalog.GetString("Sort alphabetically");
            alphButton.Clicked    += new EventHandler(toolbarClick);
            toolbar.Insert(alphButton, 1);

            catButton.Active = true;

            toolbar.Insert(new SeparatorToolItem(), 2);
            helpButton             = new ToggleButton();
            helpButton.Relief      = ReliefStyle.None;
            helpButton.Image       = new Gtk.Image(Gtk.Stock.Help, IconSize.Menu);
            helpButton.TooltipText = Catalog.GetString("Show help panel");
            helpButton.Clicked    += delegate {
                ShowHelp = helpButton.Active;
                //MonoDevelop.Core.PropertyService.Set (PROP_HELP_KEY, helpButton.Active);
            };
            toolbar.Insert(helpButton, 3);

            #endregion

            vpaned = new VPaned();

            tree          = new PropertyGridTree(editorManager, this);
            tree.Changed += delegate {
                Update();
            };

            VBox tbox = new VBox();
            toolbarSeparator         = new HSeparator();
            toolbarSeparator.Visible = true;
            tbox.PackStart(toolbarSeparator, false, false, 0);
            tbox.PackStart(tree, true, true, 0);
            helpSeparator = new HSeparator();
            tbox.PackStart(helpSeparator, false, false, 0);
            helpSeparator.NoShowAll = true;
            vpaned.Pack1(tbox, true, true);

            AddPropertyTab(new DefaultPropertyTab());
            AddPropertyTab(new EventPropertyTab());

            base.PackEnd(vpaned);
            base.FocusChain = new Gtk.Widget [] { vpaned };

            //helpButton.Active = ShowHelp = MonoDevelop.Core.PropertyService.Get<bool> (PROP_HELP_KEY, true);
            helpButton.Active = ShowHelp = false;

            Populate();
            UpdateTabs();
        }
Ejemplo n.º 30
0
        public CommitDialog(ChangeSet changeSet)
        {
            Build();

            store          = new ListStore(typeof(Gdk.Pixbuf), typeof(string), typeof(string), typeof(bool), typeof(object));
            fileList.Model = store;
            this.changeSet = changeSet;
            oldMessage     = changeSet.GlobalComment;

            CellRendererText crt     = new CellRendererText();
            var            crp       = new CellRendererPixbuf();
            TreeViewColumn colStatus = new TreeViewColumn();

            colStatus.Title = GettextCatalog.GetString("Status");
            colStatus.PackStart(crp, false);
            colStatus.PackStart(crt, true);
            colStatus.Spacing = 2;
            colStatus.AddAttribute(crp, "pixbuf", 0);
            colStatus.AddAttribute(crt, "text", 1);
            CellRendererToggle cellToggle = new CellRendererToggle();

            cellToggle.Toggled += new ToggledHandler(OnCommitToggledHandler);
            TreeViewColumn colCommit = new TreeViewColumn("", cellToggle, "active", 3);
            TreeViewColumn colFile   = new TreeViewColumn(GettextCatalog.GetString("File"), new CellRendererText(), "text", 2);

            fileList.AppendColumn(colCommit);
            fileList.AppendColumn(colStatus);
            fileList.AppendColumn(colFile);

            colCommit.Visible = false;

            object[] exts = AddinManager.GetExtensionObjects("/MonoDevelop/VersionControl/CommitDialogExtensions", false);
            bool     separatorRequired = false;

            foreach (object ob in exts)
            {
                CommitDialogExtension ext = ob as CommitDialogExtension;
                if (ext == null)
                {
                    MessageService.ShowError("Commit extension type " + ob.GetType() + " must be a subclass of CommitDialogExtension");
                    continue;
                }
                if (ext.Initialize(changeSet))
                {
                    if (separatorRequired)
                    {
                        HSeparator sep = new HSeparator();
                        sep.Show();
                        vboxExtensions.PackEnd(sep, false, false, 0);
                    }
                    vboxExtensions.PackEnd(ext, false, false, 0);
                    extensions.Add(ext);
                    ext.AllowCommitChanged += HandleAllowCommitChanged;
                    separatorRequired       = true;
                }
                else
                {
                    ext.Destroy();
                }
            }
            HandleAllowCommitChanged(null, null);

            foreach (ChangeSetItem info in changeSet.Items)
            {
                Gdk.Pixbuf statusicon = VersionControlService.LoadIconForStatus(info.Status);
                string     lstatus    = VersionControlService.GetStatusLabel(info.Status);

                string localpath = (!info.LocalPath.IsChildPathOf(changeSet.BaseLocalPath)?
                                    ".":
                                    (string)info.LocalPath.ToRelative(changeSet.BaseLocalPath));
                if (localpath.Length > 0 && localpath[0] == System.IO.Path.DirectorySeparatorChar)
                {
                    localpath = localpath.Substring(1);
                }
                if (localpath == "")
                {
                    localpath = ".";
                }                                                         // not sure if this happens

                store.AppendValues(statusicon, lstatus, localpath, true, info);
                selected.Add(info.LocalPath);
            }

            if (string.IsNullOrEmpty(changeSet.GlobalComment))
            {
                AuthorInformation   aInfo;
                CommitMessageFormat fmt = VersionControlService.GetCommitMessageFormat(changeSet, out aInfo);
                Message = changeSet.GenerateGlobalComment(fmt, aInfo);
            }
            else
            {
                Message = changeSet.GlobalComment;
            }

            textview.Buffer.Changed += OnTextChanged;

            // Focus the text view and move the insert point to the begining. Makes it easier to insert
            // a comment header.
            textview.Buffer.MoveMark(textview.Buffer.InsertMark, textview.Buffer.StartIter);
            textview.Buffer.MoveMark(textview.Buffer.SelectionBound, textview.Buffer.StartIter);
            textview.GrabFocus();
        }