Esempio n. 1
0
    protected void OnButtonClicked(object sender, EventArgs e)
    {
        if (sender == button1)
        {

            Gtk.FileChooserDialog dialog = new Gtk.FileChooserDialog ("Choose item...", this, FileChooserAction.Open, "Cancel",  ResponseType.Cancel, "Insert Spacer",  ResponseType.None, "Add", ResponseType.Accept);

            Gtk.Alignment align = new Alignment (1, 0, 0, 1);
            Gtk.Frame frame = new Frame ("Position");
            Gtk.HBox hbox = new HBox (false, 4);

            RadioButton rbRight;
            rbRight = new RadioButton ("Right");
            hbox.PackEnd(rbRight, false, false, 1);
            hbox.PackEnd(new RadioButton (rbRight, "Left"), false, false, 1);

            frame.Add (hbox);
            align.Add (frame);
            align.ShowAll ();
            dialog.ExtraWidget = align;

            ResponseType response = (ResponseType)dialog.Run ();
            if (response == ResponseType.Accept) {
                RunCommand ("defaults write com.apple.dock " + GetAlign(dialog.ExtraWidget) + " -array-add '<dict><key>tile-data</key><dict><key>file-data</key><dict><key>_CFURLString</key><string>" + dialog.Filename + "</string><key>_CFURLStringType</key><integer>0</integer></dict></dict></dict>' && /bin/sleep 1 &&/usr/bin/killall Dock");
            } else if (response == ResponseType.None) {
                RunCommand ("defaults write com.apple.dock " + GetAlign(dialog.ExtraWidget) + " -array-add '{tile-data={}; tile-type=\"spacer-tile\";}' && /bin/sleep 1 &&/usr/bin/killall Dock");
            }
            dialog.Destroy ();

        }
    }
Esempio n. 2
0
    public SharpApp()
        : base("Windows")
    {
        SetDefaultSize(300,250);
        SetPosition(WindowPosition.Center);
        BorderWidth=15;
        DeleteEvent += delegate{Application.Quit();};

        Table table = new Table(8, 4, false);

        table.ColumnSpacing = 3;

        Label title = new Label("Windows");

        Alignment halign = new Alignment(0,0,0,0);

        halign.Add(title);

        table.Attach(halign, 0,1,0,1, AttachOptions.Fill, AttachOptions.Fill, 0,0);

        TextView wins = new TextView();

        wins.ModifyFg(StateType.Normal, new Gdk.Color(20,20,20));
        wins.CursorVisible = false;
        table.Attach(wins, 0,2,1,3, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill | AttachOptions.Expand, 1,1);
        Button activate = new Button("Activate");
        activate.SetSizeRequest(50,30);
        table.Attach(activate,3,4,1,2,AttachOptions.Fill, AttachOptions.Shrink,1,1);
        Alignment valign = new Alignment(0,0,0,0);
        Button close = new Button("Close");
        close.SetSizeRequest(70,30);
        valign.Add(close);
        table.SetRowSpacing(1,3);
        table.Attach(valign,3,4,2,3,AttachOptions.Fill, AttachOptions.Fill | AttachOptions.Expand,1,1);

        Alignment halign2 =  new Alignment(0,1,0,0);
        Button help = new Button("Help");
        help.SetSizeRequest(70,30);
        halign2.Add(help);
        table.SetRowSpacing(3,6);
        table.Attach(halign2, 0,1,4,5, AttachOptions.Fill, AttachOptions.Fill, 0,0);

        Button ok = new Button("Ok");
        ok.SetSizeRequest(70,30);
        table.Attach(ok,3,4,4,5,AttachOptions.Fill, AttachOptions.Fill, 0,0);

        Add(table);
        ShowAll();
    }
Esempio n. 3
0
        public Infobar(DataBook db)
        {
            dataBook = db;

            // create bars
            MessageStatusbar = new Statusbar();

            OffsetStatusbar = new Statusbar();
            OffsetStatusbar.WidthRequest = 270;

            SelectionStatusbar = new Statusbar();
            SelectionStatusbar.WidthRequest = 270;

            OverwriteStatusbar = new Statusbar();
            OverwriteStatusbar.WidthRequest = 60;

            DummyStatusbar         = new Statusbar();
            DummyStatusbar.Visible = false;

            EventBox OffsetEB = new EventBox();

            OffsetEB.Add(OffsetStatusbar);
            OffsetEB.ButtonPressEvent += ChangeNumberBase;

            EventBox SelectionEB = new EventBox();

            SelectionEB.Add(SelectionStatusbar);
            SelectionEB.ButtonPressEvent += ChangeNumberBase;

            EventBox OverwriteEB = new EventBox();

            OverwriteEB.Add(OverwriteStatusbar);
            OverwriteEB.ButtonPressEvent += OnOverwriteStatusbarPressed;

            // create hbox to put bars in
            HBox StatusHBox = new HBox();

            StatusHBox.PackStart(DummyStatusbar, false, true, 0);
            StatusHBox.PackStart(OffsetEB, false, true, 0);
            StatusHBox.PackStart(SelectionEB, false, true, 0);
            StatusHBox.PackStart(OverwriteEB, false, true, 0);

            // align the hbox
            Alignment StatusAlignment = new Alignment(1.0f, 0.5f, 0.0f, 1.0f);

            StatusAlignment.Add(StatusHBox);

            this.Pack1(MessageStatusbar, true, true);
            this.Pack2(StatusAlignment, false, true);

            this.NumberBase = 16;

            PreferencesChangedHandler handler = new PreferencesChangedHandler(OnPreferencesChanged);

            Preferences.Proxy.Subscribe("View.Statusbar.Show", "ib2", handler);
            Preferences.Proxy.Subscribe("View.Statusbar.Selection", "ib2", handler);
            Preferences.Proxy.Subscribe("View.Statusbar.Overwrite", "ib2", handler);
            Preferences.Proxy.Subscribe("View.Statusbar.Offset", "ib2", handler);

            this.MapEvent += OnMapEvent;
            this.ShowAll();
        }
        private void Build()
        {
            Gui.Initialize(this);
            // Widget Launchpad.Utilities.Interface.MainWindow
            UIManager = new UIManager();
            ActionGroup w1 = new ActionGroup("Default");

            UIManager.InsertActionGroup(w1, 0);
            AddAccelGroup(UIManager.AccelGroup);
            WidthRequest   = 640;
            HeightRequest  = 384;
            Name           = "Launchpad.Utilities.Interface.MainWindow";
            Title          = LocalizationCatalog.GetString("Launchpad Utilities - Manifest");
            Icon           = Pixbuf.LoadFromResource("Launchpad.Utilities.Resources.Icons8-Android-Industry-Engineering.ico");
            WindowPosition = (WindowPosition)4;
            // Container child Launchpad.Utilities.Interface.MainWindow.Gtk.Container+ContainerChild
            vbox3 = new VBox
            {
                Name    = "vbox3",
                Spacing = 6
            };
            // Container child vbox3.Gtk.Box+BoxChild
            UIManager.AddUiFromString("<ui><menubar name='menubar1'/></ui>");
            menubar1      = (MenuBar)(UIManager.GetWidget("/menubar1"));
            menubar1.Name = "menubar1";
            vbox3.Add(menubar1);
            Box.BoxChild w2 = (Box.BoxChild)vbox3 [menubar1];
            w2.Position = 0;
            w2.Expand   = false;
            w2.Fill     = false;
            // Container child vbox3.Gtk.Box+BoxChild
            alignment14 = new Alignment(0.5F, 0.5F, 1F, 1F)
            {
                Name         = "alignment14",
                LeftPadding  = 8,
                RightPadding = 8
            };
            // Container child alignment14.Gtk.Container+ContainerChild
            fileChooser = new FileChooserWidget((FileChooserAction)2)
            {
                Name      = "fileChooser",
                LocalOnly = false
            };
            alignment14.Add(fileChooser);
            vbox3.Add(alignment14);
            Box.BoxChild w4 = (Box.BoxChild)vbox3 [alignment14];
            w4.Position = 1;
            // Container child vbox3.Gtk.Box+BoxChild
            alignment12 = new Alignment(0.5F, 0.5F, 1F, 1F)
            {
                Name = "alignment12"
            };
            // Container child alignment12.Gtk.Container+ContainerChild
            hseparator3 = new HSeparator
            {
                Name = "hseparator3"
            };
            alignment12.Add(hseparator3);
            vbox3.Add(alignment12);
            Box.BoxChild w6 = (Box.BoxChild)vbox3 [alignment12];
            w6.Position = 2;
            w6.Expand   = false;
            w6.Fill     = false;
            // Container child vbox3.Gtk.Box+BoxChild
            hbox4 = new HBox
            {
                Name    = "hbox4",
                Spacing = 6
            };
            // Container child hbox4.Gtk.Box+BoxChild
            alignment18 = new Alignment(0.5F, 0.5F, 1F, 1F)
            {
                Name        = "alignment18",
                LeftPadding = 8
            };
            // Container child alignment18.Gtk.Container+ContainerChild
            label4 = new Label
            {
                Name      = "label4",
                LabelProp = LocalizationCatalog.GetString("Progress: ")
            };
            alignment18.Add(label4);
            hbox4.Add(alignment18);
            Box.BoxChild w8 = (Box.BoxChild)hbox4 [alignment18];
            w8.Position = 0;
            w8.Expand   = false;
            w8.Fill     = false;
            // Container child hbox4.Gtk.Box+BoxChild
            alignment19 = new Alignment(0.5F, 0.5F, 1F, 1F)
            {
                Name         = "alignment19",
                RightPadding = 8
            };
            // Container child alignment19.Gtk.Container+ContainerChild
            progressLabel = new Label
            {
                Name      = "progressLabel",
                LabelProp = LocalizationCatalog.GetString("/some/file/path : 1 out of 100")
            };
            alignment19.Add(progressLabel);
            hbox4.Add(alignment19);
            Box.BoxChild w10 = ((Box.BoxChild)(hbox4 [alignment19]));
            w10.Position = 1;
            w10.Expand   = false;
            w10.Fill     = false;
            vbox3.Add(hbox4);
            Box.BoxChild w11 = (Box.BoxChild)vbox3 [hbox4];
            w11.Position = 3;
            w11.Expand   = false;
            w11.Fill     = false;
            // Container child vbox3.Gtk.Box+BoxChild
            alignment17 = new Alignment(0.5F, 0.5F, 1F, 1F)
            {
                Name         = "alignment17",
                LeftPadding  = 8,
                RightPadding = 8
            };
            // Container child alignment17.Gtk.Container+ContainerChild
            progressbar = new ProgressBar
            {
                Name = "progressbar"
            };
            alignment17.Add(progressbar);
            vbox3.Add(alignment17);
            Box.BoxChild w13 = (Box.BoxChild)vbox3 [alignment17];
            w13.Position = 4;
            w13.Expand   = false;
            w13.Fill     = false;
            // Container child vbox3.Gtk.Box+BoxChild
            hbox3 = new HBox
            {
                Name    = "hbox3",
                Spacing = 6
            };
            // Container child hbox3.Gtk.Box+BoxChild
            alignment15 = new Alignment(0.5F, 0.5F, 1F, 1F)
            {
                Name          = "alignment15",
                RightPadding  = 8,
                BottomPadding = 8
            };
            // Container child alignment15.Gtk.Container+ContainerChild
            generateGameManifestButton = new Button
            {
                CanFocus     = true,
                Name         = "generateGameManifestButton",
                UseUnderline = true,
                Label        = LocalizationCatalog.GetString("Generate Game Manifest")
            };
            alignment15.Add(generateGameManifestButton);
            hbox3.Add(alignment15);
            Box.BoxChild w15 = (Box.BoxChild)hbox3 [alignment15];
            w15.PackType = (PackType)1;
            w15.Position = 0;
            w15.Expand   = false;
            w15.Fill     = false;
            // Container child hbox3.Gtk.Box+BoxChild
            alignment1 = new Alignment(0.5F, 0.5F, 1F, 1F)
            {
                Name          = "alignment1",
                RightPadding  = 8,
                BottomPadding = 8
            };
            // Container child alignment1.Gtk.Container+ContainerChild
            generateLaunchpadManifestButton = new Button
            {
                CanFocus     = true,
                Name         = "generateLaunchpadManifestButton",
                UseUnderline = true,
                Label        = LocalizationCatalog.GetString("Generate Launchpad Manifest")
            };
            alignment1.Add(generateLaunchpadManifestButton);
            hbox3.Add(alignment1);
            Box.BoxChild w17 = ((Box.BoxChild)(hbox3 [alignment1]));
            w17.PackType = ((PackType)(1));
            w17.Position = 1;
            w17.Expand   = false;
            w17.Fill     = false;
            vbox3.Add(hbox3);
            Box.BoxChild w18 = ((Box.BoxChild)(vbox3 [hbox3]));
            w18.Position = 5;
            w18.Expand   = false;
            w18.Fill     = false;
            Add(vbox3);
            if ((Child != null))
            {
                Child.ShowAll();
            }

            this.DefaultWidth  = 640;
            this.DefaultHeight = 384;

            this.Show();

            DeleteEvent += OnDeleteEvent;
            generateLaunchpadManifestButton.Clicked += OnGenerateLaunchpadManifestButtonClicked;
            generateGameManifestButton.Clicked      += OnGenerateGameManifestButtonClicked;
        }
Esempio n. 5
0
        public void UpdateTab()
        {
            if (Child != null)
            {
                Widget w = Child;
                Remove(w);
                w.Destroy();
            }

            mainBox = new Alignment(0, 0, 1, 1);
            if (bar.Orientation == Gtk.Orientation.Horizontal)
            {
                box = new HBox();
                if (bar.AlignToEnd)
                {
                    mainBox.SetPadding(3, 3, 11, 9);
                }
                else
                {
                    mainBox.SetPadding(3, 3, 9, 11);
                }
            }
            else
            {
                box = new VBox();
                if (bar.AlignToEnd)
                {
                    mainBox.SetPadding(11, 9, 3, 3);
                }
                else
                {
                    mainBox.SetPadding(9, 11, 3, 3);
                }
            }

            Gtk.Widget customLabel = null;
            if (it.DockLabelProvider != null)
            {
                customLabel = it.DockLabelProvider.CreateLabel(bar.Orientation);
            }

            if (customLabel != null)
            {
                customLabel.ShowAll();
                box.PackStart(customLabel, true, true, 0);
            }
            else
            {
                if (it.Icon != null)
                {
                    Gdk.Pixbuf desat = it.Icon.Copy();
                    desat.SaturateAndPixelate(desat, 0.5f, false);
                    crossfade = new CrossfadeIcon(desat, it.Icon);
                    box.PackStart(crossfade, false, false, 0);
                    desat.Dispose();
                }

                if (!string.IsNullOrEmpty(it.Label))
                {
                    label           = new Gtk.Label(it.Label);
                    label.UseMarkup = true;
                    if (bar.Orientation == Gtk.Orientation.Vertical)
                    {
                        label.Angle = 270;
                    }
                    box.PackStart(label, true, true, 0);
                }
                else
                {
                    label = null;
                }
            }

            box.Spacing = 2;
            mainBox.Add(box);
            mainBox.ShowAll();
            Add(mainBox);
            QueueDraw();
        }
        public DefaultPolicyOptionsDialog(Gtk.Window parentWindow)
            : base(parentWindow, new PolicySet(),
                   "/MonoDevelop/ProjectModel/Gui/DefaultPolicyPanels")
        {
            this.Title = GettextCatalog.GetString("Custom Policies");
            editingSet = (PolicySet)DataObject;

            HBox topBar = new HBox();

            topBar.Spacing = 3;
            topBar.PackStart(new Label(GettextCatalog.GetString("Editing Policy:")), false, false, 0);

            policiesCombo = ComboBox.NewText();
            topBar.PackStart(policiesCombo, false, false, 0);

            deleteButton = new Button(GettextCatalog.GetString("Delete Policy"));
            topBar.PackEnd(deleteButton, false, false, 0);

            exportButton             = new MenuButton();
            exportButton.Label       = GettextCatalog.GetString("Export");
            exportButton.MenuCreator = delegate {
                Gtk.Menu menu = new Gtk.Menu();
                MenuItem mi   = new MenuItem(GettextCatalog.GetString("To file..."));
                mi.Activated += HandleToFile;
                menu.Insert(mi, -1);
                mi            = new MenuItem(GettextCatalog.GetString("To project or solution..."));
                mi.Activated += HandleToProject;
                if (!IdeApp.Workspace.IsOpen)
                {
                    mi.Sensitive = false;
                }
                menu.Insert(mi, -1);
                menu.ShowAll();
                return(menu);
            };
            topBar.PackEnd(exportButton, false, false, 0);

            newButton             = new MenuButton();
            newButton.Label       = GettextCatalog.GetString("Add Policy");
            newButton.MenuCreator = delegate {
                Gtk.Menu menu = new Gtk.Menu();
                MenuItem mi   = new MenuItem(GettextCatalog.GetString("New policy..."));
                mi.Activated += HandleNewButtonClicked;
                menu.Insert(mi, -1);
                mi            = new MenuItem(GettextCatalog.GetString("From file..."));
                mi.Activated += HandleFromFile;
                menu.Insert(mi, -1);
                mi            = new MenuItem(GettextCatalog.GetString("From project or solution..."));
                mi.Activated += HandleFromProject;
                if (!IdeApp.Workspace.IsOpen)
                {
                    mi.Sensitive = false;
                }
                menu.Insert(mi, -1);
                menu.ShowAll();
                return(menu);
            };
            topBar.PackEnd(newButton, false, false, 0);

            Alignment align = new Alignment(0f, 0f, 1f, 1f);

            align.LeftPadding   = 9;
            align.TopPadding    = 9;
            align.RightPadding  = 9;
            align.BottomPadding = 9;
            align.Add(topBar);

            HeaderBox ebox = new HeaderBox();

            ebox.GradientBackground = true;
            ebox.SetMargins(0, 1, 0, 0);
            ebox.Add(align);

            ebox.ShowAll();

            VBox.PackStart(ebox, false, false, 0);
            VBox.BorderWidth = 0;
            Box.BoxChild c = (Box.BoxChild)VBox [ebox];
            c.Position = 0;

            foreach (PolicySet ps in PolicyService.GetUserPolicySets())
            {
                PolicySet copy = ps.Clone();
                originalSets [copy] = ps;
                sets.Add(copy);
            }
            FillPolicySets();

            policiesCombo.Changed += HandlePoliciesComboChanged;
            deleteButton.Clicked  += HandleDeleteButtonClicked;
        }
Esempio n. 7
0
        public void SetLabel(Gtk.Widget page, Gdk.Pixbuf icon, string label)
        {
            this.label = label;
            this.page  = page;
            if (Child != null)
            {
                Gtk.Widget oc = Child;
                Remove(oc);
                oc.Destroy();
            }

            Gtk.HBox box = new HBox();
            box.Spacing = 2;

            if (icon != null)
            {
                tabIcon = new Gtk.Image(icon);
                tabIcon.Show();
                box.PackStart(tabIcon, false, false, 0);
            }
            else
            {
                tabIcon = null;
            }

            if (!string.IsNullOrEmpty(label))
            {
                labelWidget = new ExtendedLabel(label);
                labelWidget.DropShadowVisible = true;
                labelWidget.UseMarkup         = true;
                box.PackStart(labelWidget, true, true, 0);
            }
            else
            {
                labelWidget = null;
            }

            btnDock             = new ImageButton();
            btnDock.Image       = pixAutoHide;
            btnDock.TooltipText = GettextCatalog.GetString("Auto Hide");
            btnDock.CanFocus    = false;
//			btnDock.WidthRequest = btnDock.HeightRequest = 17;
            btnDock.Clicked          += OnClickDock;
            btnDock.ButtonPressEvent += (o, args) => args.RetVal = true;
            btnDock.WidthRequest      = btnDock.SizeRequest().Width;

            btnClose             = new ImageButton();
            btnClose.Image       = pixClose;
            btnClose.TooltipText = GettextCatalog.GetString("Close");
            btnClose.CanFocus    = false;
//			btnClose.WidthRequest = btnClose.HeightRequest = 17;
            btnClose.WidthRequest = btnDock.SizeRequest().Width;
            btnClose.Clicked     += delegate {
                item.Visible = false;
            };
            btnClose.ButtonPressEvent += (o, args) => args.RetVal = true;

            Gtk.Alignment al     = new Alignment(0, 0, 1, 1);
            HBox          btnBox = new HBox(false, 3);

            btnBox.PackStart(btnDock, false, false, 0);
            btnBox.PackStart(btnClose, false, false, 0);
            al.Add(btnBox);
            al.LeftPadding = 3;
            al.TopPadding  = 1;
            box.PackEnd(al, false, false, 0);

            Add(box);

            // Get the required size before setting the ellipsize property, since ellipsized labels
            // have a width request of 0
            box.ShowAll();
            Show();

            UpdateBehavior();
            UpdateVisualStyle();
        }
Esempio n. 8
0
	static void Main (string [] args)
	{
		if (args.Length > 0 && args [0] == "debug")
			BoardPiece.Debug = true;
		Program fifteen = new Program ("Fifteen", "0.1", Modules.UI, args);
		
		window = new Gtk.Window ("Fifteen #");
		VBox box = new VBox (false, 0);
		window.Add (box);
		window.DefaultWidth = 300;
		window.DefaultHeight = 300;
		
		VBox vbox = new VBox (false, 4);
		vbox.BorderWidth = 4;

		MenuBar menu = Create_Menu ();
		box.PackStart (menu, false, false, 0);
		box.PackStart (vbox, false, false, 0);
		window.DeleteEvent += new DeleteEventHandler (Window_Delete);

		Alignment alignment = new Alignment (0.5f, 0.5f, 0.0f, 0.0f);
		vbox.PackStart (alignment, true, true, 4);

		Frame frame = new Frame (null);
		frame.ShadowType = ShadowType.In;
		alignment.Add (frame);

		canvas = new Canvas ();
		canvas.SetSizeRequest (BoardPiece.PIECE_SIZE * 4 + 1, BoardPiece.PIECE_SIZE * 4 + 1);
		canvas.SetScrollRegion (0, 0, BoardPiece.PIECE_SIZE * 4 + 1, BoardPiece.PIECE_SIZE * 4 + 1);
		frame.Add (canvas);
		
		board = new BoardPiece [16];

		for (int i = 0; i < 15; i ++) {					
			int y = i /4;
			int x = i % 4;
			board [i] = new BoardPiece (canvas.Root (), board, x, y, i);
		}

		box.PackStart (new HSeparator (), false, false, 0);
		HBox hbox = new HBox (false, 4);
		box.PackStart (hbox, true, false, 4);

		// Scramble button here.
		Button scramble = new Button ("_Scramble");
		scramble.BorderWidth = 8;
		scramble.Clicked += new EventHandler (Scramble);
		scramble.CanDefault = true;
		hbox.PackStart (scramble, true, true, 4);
		scramble.GrabDefault ();

		// Close button
		Button close = new Button ("_Close");
		close.BorderWidth = 8;
		close.Clicked += new EventHandler (Quit);
		hbox.PackStart (close, true, true, 4);
		
		window.ShowAll ();
		fifteen.Run ();
	}
Esempio n. 9
0
        /// <summary>
        /// Constructor
        /// </summary>
        public UpgradeView(ViewBase owner) : base(owner)
        {
            Builder builder = BuilderFromResource("ApsimNG.Resources.Glade.UpgradeView.glade");

            window1         = (Window)builder.GetObject("window1");
            button1         = (Button)builder.GetObject("button1");
            button2         = (Button)builder.GetObject("button2");
            table1          = (Table)builder.GetObject("table1");
            table2          = (Table)builder.GetObject("table2");
            firstNameBox    = (Entry)builder.GetObject("firstNameBox");
            lastNameBox     = (Entry)builder.GetObject("lastNameBox");
            organisationBox = (Entry)builder.GetObject("organisationBox");
            emailBox        = (Entry)builder.GetObject("emailBox");
            address1Box     = (Entry)builder.GetObject("address1Box");
            address2Box     = (Entry)builder.GetObject("address2Box");
            cityBox         = (Entry)builder.GetObject("cityBox");
            stateBox        = (Entry)builder.GetObject("stateBox");
            countryBox      = (Entry)builder.GetObject("countryBox");
            postcodeBox     = (Entry)builder.GetObject("postcodeBox");
            label1          = (Label)builder.GetObject("label1");
            htmlAlign       = (Alignment)builder.GetObject("HTMLalign");
            checkbutton1    = (CheckButton)builder.GetObject("checkbutton1");
            listview1       = (Gtk.TreeView)builder.GetObject("listview1");
            alignment3      = (Alignment)builder.GetObject("alignment3");
            alignment4      = (Alignment)builder.GetObject("alignment4");
            alignment5      = (Alignment)builder.GetObject("alignment5");
            alignment6      = (Alignment)builder.GetObject("alignment6");
            alignment7      = (Alignment)builder.GetObject("alignment7");
            oldVersions     = (CheckButton)builder.GetObject("checkbutton2");
            listview1.Model = listmodel;

            CellRendererText textRender = new Gtk.CellRendererText();

            textRender.Editable = false;

            TreeViewColumn column0 = new TreeViewColumn("Version", textRender, "text", 0);

            listview1.AppendColumn(column0);
            column0.Sizing    = TreeViewColumnSizing.Autosize;
            column0.Resizable = true;

            TreeViewColumn column1 = new TreeViewColumn("Description", textRender, "text", 1);

            listview1.AppendColumn(column1);
            column1.Sizing    = TreeViewColumnSizing.Autosize;
            column1.Resizable = true;

            // Make the tab order a little more sensible than the defaults
            table1.FocusChain = new Widget[] { alignment7, button1, button2 };
            table2.FocusChain = new Widget[] { firstNameBox, lastNameBox, organisationBox, emailBox,
                                               alignment3, alignment4, cityBox, alignment5, countryBox, alignment6 };

            htmlView = new HTMLView(new ViewBase(null));
            htmlAlign.Add(htmlView.MainWidget);
            tabbedExplorerView   = owner as IMainView;
            window1.TransientFor = owner.MainWidget.Toplevel as Window;
            oldVersions.Toggled += OnShowOldVersionsToggled;
            button1.Clicked     += OnUpgrade;
            button2.Clicked     += OnViewMoreDetail;
            window1.Destroyed   += OnFormClosing;
            window1.MapEvent    += OnShown;
        }
Esempio n. 10
0
        public void UpdateTab()
        {
            if (Child != null)
            {
                Widget w = Child;
                Remove(w);
                w.Destroy();
            }

            mainBox = new Alignment(0, 0, 1, 1);
            mainBox.Accessible.SetShouldIgnore(true);
            if (bar.Orientation == Gtk.Orientation.Horizontal)
            {
                box = new HBox();
                if (bar.AlignToEnd)
                {
                    mainBox.SetPadding(5, 5, 11, 9);
                }
                else
                {
                    mainBox.SetPadding(5, 5, 9, 11);
                }
            }
            else
            {
                box = new VBox();
                if (bar.AlignToEnd)
                {
                    mainBox.SetPadding(11, 9, 5, 5);
                }
                else
                {
                    mainBox.SetPadding(9, 11, 5, 5);
                }
            }
            box.Accessible.SetShouldIgnore(true);

            if (it.Icon != null)
            {
                var desat = it.Icon.WithAlpha(0.5);
                crossfade = new CrossfadeIcon(desat, it.Icon);
                crossfade.Accessible.SetShouldIgnore(true);
                box.PackStart(crossfade, false, false, 0);
                desat.Dispose();
            }

            if (!string.IsNullOrEmpty(it.Label))
            {
                label = new Label(it.Label);
                label.Accessible.SetShouldIgnore(true);
                label.UseMarkup = true;
                label.ModifyFont(IdeServices.FontService.SansFont.CopyModified(Styles.FontScale11));

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

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

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

                Accessible.SetLabel(it.Label);
                Accessible.SetTitle(it.Label);
                Accessible.Description = GettextCatalog.GetString("Show the {0} pad", it.Label);
            }
            else
            {
                label = null;
            }

            box.Spacing = 2;
            mainBox.Add(box);
            mainBox.ShowAll();
            Add(mainBox);
            UpdateStyle(this, null);
            QueueDraw();
        }
Esempio n. 11
0
    // This returns ResponseType.Yes, No, or Cancel
    ResponseType AskSave(string info)
    {
        if (Project == null)
            return ResponseType.No;

        ResponseType response;
        Gtk.Dialog d = new Dialog("Save Project?", this,
                DialogFlags.DestroyWithParent,
                Gtk.Stock.Yes, ResponseType.Yes,
                Gtk.Stock.No, ResponseType.No,
                Gtk.Stock.Cancel, ResponseType.Cancel);
        Alignment a = new Alignment(1,0.25f,1,0);
        a.SetSizeRequest(0, 50);
        a.Add(new Gtk.Label(info));
        d.VBox.Add(a);
        d.VBox.ShowAll();
        response = (ResponseType)d.Run();
        d.Destroy();
        if (response == ResponseType.Yes) {
            Project.Save();
        }

        return response;
    }
            public ObservableGamesWidget(GameObservationManager
						      observer)
            {
                obManager = observer;
                iters = new TreeIter[3, 4];
                gamesView = new TreeView ();
                infoLabel = new Label ();
                infoLabel.Xalign = 0;
                infoLabel.Xpad = 4;
                observer.ObservableGameEvent +=
                    OnObservableGameEvent;

                store = new TreeStore (typeof (string),	// used for filtering
                               typeof (int),	// gameid
                               typeof (string),	// markup
                               typeof (string),	//
                               typeof (string));

                  gamesView.HeadersVisible = true;
                  gamesView.HeadersClickable = true;

                  gamesView.AppendColumn (Catalog.
                              GetString ("Games"),
                              new
                              CellRendererText (),
                              "markup", 2);
                  gamesView.AppendColumn (Catalog.
                              GetString ("Time"),
                              new
                              CellRendererText (),
                              "markup", 3);
                  gamesView.AppendColumn (Catalog.
                              GetString
                              ("Category"),
                              new
                              CellRendererText (),
                              "markup", 4);

                ScrolledWindow win = new ScrolledWindow ();
                  win.HscrollbarPolicy =
                    win.VscrollbarPolicy =
                    PolicyType.Automatic;
                  win.Add (gamesView);

                  UpdateInfoLabel ();

                  filterEntry = new Entry ();
                  filterEntry.Changed += OnFilter;

                  filter = new TreeModelFilter (store, null);
                  filter.VisibleFunc = FilterFunc;
                  gamesView.Model = filter;

                  AddParentIters ();

                  infoLabel.UseMarkup = true;
                Button refreshButton =
                    new Button (Stock.Refresh);
                  refreshButton.Clicked +=
                    delegate (object o, EventArgs args)
                {
                    Clear ();
                    obManager.GetGames ();
                };
                Alignment align = new Alignment (0, 1, 0, 0);
                align.Add (refreshButton);

                HBox hbox = new HBox ();
                hbox.PackStart (infoLabel, true, true, 4);
                hbox.PackStart (align, false, false, 4);

                PackStart (hbox, false, true, 4);

                Label tipLabel = new Label ();
                tipLabel.Xalign = 0;
                tipLabel.Xpad = 4;
                tipLabel.Markup =
                    String.
                    Format ("<small><i>{0}</i></small>",
                        Catalog.
                        GetString
                        ("Press the refresh button to get an updated list of games.\nDouble click on a game to observe it."));
                PackStart (tipLabel, false, true, 4);
                PackStart (filterEntry, false, true, 4);
                PackStart (win, true, true, 4);

                gamesView.RowActivated += OnRowActivated;
                SetSizeRequest (600, 400);
                ShowAll ();
            }
Esempio n. 13
0
    // This requires that the perl program autorestart wraps this....
    public DialBOT()
        : base("DialBOT")
    {
        SetDefaultSize(800, 600);
        SetPosition(WindowPosition.Center);
        DeleteEvent += delegate { Application.Quit(); };

        // Top level container. This vertically divides the window into 3 sections:
        // Top is the 2 windows (balls-deep items and console output
        VBox topvbox = new VBox(false, 5);

        // Lets build the top 1/3rd here.
        Frame ballsdeepframe = new Frame("Balls-Deep Items");
        Frame consoleframe = new Frame("Console Output");
        // HBox mainhbox = new HBox(true,2);

        ballsdeeptree = new TreeView();

        bdstore = new TreeStore (typeof(string), typeof (string), typeof (string), typeof (string));
        LoadBalls();
        fillStore();

        // Put the TreeStore into a TreeModelSort so we can sort columns...
        // Sort by score for now
        bdsorted = new TreeModelSort(bdstore);
        bdsorted.SetSortColumnId(1,SortType.Descending);

        // Put the TreeModelSort into a TreeModelFilter so we can implement the filtering
        filterEntry = new Entry();
        // filter = new TreeModelFilter(bdsorted,null);
        // filter.VisibleFunc = FilterTreeFunc;   // Use this as the filter function.

        // And then set the visible TreeView to use the filter as it's store.
        ballsdeeptree.Model = bdsorted;

        ballsdeeptree.HeadersVisible = true;
        ballsdeeptree.HeadersClickable=true;
        ballsdeeptree.AppendColumn ("Added By", new CellRendererText (), "text", 0);
        ballsdeeptree.AppendColumn ("Score", new CellRendererText (), "text", 1);
        CellRendererText ballRenderer = new CellRendererText();
        ballsdeeptree.AppendColumn ("Text", ballRenderer, "text", 2);
        CellRendererText voteRenderer = new CellRendererText();
        voteRenderer.Editable=true;
        voteRenderer.Edited+=editVotes;
        ballsdeeptree.AppendColumn ("Votes", voteRenderer, "text", 3);

        TreeViewColumn col = ballsdeeptree.GetColumn(0);
        col.Clickable=true;
        col.Resizable = true;
        col.Clicked += new EventHandler (col_clicked0);

        col = ballsdeeptree.GetColumn(1);
        col.Resizable = true;
        col.Clickable=true;
        col.Clicked += new EventHandler (col_clicked1);

        col = ballsdeeptree.GetColumn(2);
        col.Resizable = true;
        col.Clickable=true;
        col.Clicked += new EventHandler (col_clicked2);

        col = ballsdeeptree.GetColumn(3);
        col.Clickable=true;
        col.Resizable = true;
        col.Clicked += new EventHandler (col_clicked3);

        ScrolledWindow ballsdeepscroll = new ScrolledWindow();

        ballsdeepscroll.Add(ballsdeeptree);

        Button deleteentry = new Button("Remove Entry");
        deleteentry.SetSizeRequest(70, 30);
        deleteentry.Clicked += new EventHandler(deleteBallMsg);

        ballsdeepframe.Add(ballsdeepscroll);
        ballsdeepframe.Add(deleteentry);

        // Entry box and label to filter on message as well as an HBox to put them next to each other
        filterEntry.Changed += OnFilterEntryTextChanged;
        Label filterLabel = new Label("Ball Message Search: ");
        HBox filterBox = new HBox();
        filterBox.PackStart(filterLabel,false,false,5);
        filterBox.PackStart(filterEntry,true,true,5);

        VBox ballvbox = new VBox(false,5);
        ballvbox.Add(ballsdeepframe);
        //ballvbox.PackStart(filterBox,false,false,1);

        topvbox.Add(ballvbox);

        consoleview = new TextView();
        consolebuffer=consoleview.Buffer;
        consolebuffer.Text = consoletext;

        ScrolledWindow consolescroll = new ScrolledWindow();
        consolescroll.SetPolicy(PolicyType.Automatic,PolicyType.Always);
        consolescroll.Add(consoleview);

        consoleframe.Add(consolescroll);

        followConsole = new CheckButton("Tail Console");
        followConsole.SetSizeRequest(70,30);

        VBox consolevbox = new VBox(false,5);
        consolevbox.Add(consoleframe);
        consolevbox.PackStart(followConsole,false,false,1);

        topvbox.Add(consolevbox);

        //        topvbox.PackStart(mainhbox, true,true,4);

        // Now the 2nd 3rd. This contains 2 buttons. A start/stop, and a close.
        HBox buttonhbox = new HBox(true, 3);
        startstop = new Button("Stop");
        startstop.SetSizeRequest(70, 30);
        startstop.Clicked += new EventHandler(startstopEvent);
        Button close = new Button("Close");
        close.Clicked += new EventHandler(quitEvent);

        buttonhbox.Add(startstop);
        buttonhbox.Add(close);

        Alignment halign = new Alignment(1, 0, 0, 0);
        halign.Add(buttonhbox);

        topvbox.PackStart(halign, false, false, 3);

        // Now the bottom 3rd. A status bar
        statusbar = new Statusbar();
        statusbar.Push(1,"Hey, it's a status");
        topvbox.PackStart(statusbar,false,false,0);

        // Add our top level container to the window
        Add(topvbox);

        ShowAll();
    }
            private void AddGameNavigationButtons(VBox box)
            {
                firstButton = new Button ();
                firstButton.Clicked += OnClicked;
                firstButton.Image =
                    new Image (Stock.GotoFirst,
                           IconSize.Button);
                prevButton = new Button ();
                prevButton.Clicked += OnClicked;
                prevButton.Image =
                    new Image (Stock.GoBack,
                           IconSize.Button);
                nextButton = new Button ();
                nextButton.Clicked += OnClicked;
                nextButton.Image =
                    new Image (Stock.GoForward,
                           IconSize.Button);
                lastButton = new Button ();
                lastButton.Clicked += OnClicked;
                lastButton.Image =
                    new Image (Stock.GotoLast,
                           IconSize.Button);

                HBox hbox = new HBox ();
                hbox.PackStart (firstButton, false, false, 2);
                hbox.PackStart (prevButton, false, false, 2);
                hbox.PackStart (nextButton, false, false, 2);
                hbox.PackStart (lastButton, false, false, 2);

                Alignment align =
                    new Alignment (0.5f, 1, 1, 0);
                align.Add (hbox);
                box.PackStart (align, false, true, 2);
            }
            private Widget GetRightPane()
            {
                VBox vbox = new VBox ();

                // labels
                moveNumberLabel = new Label ();
                nagCommentLabel = new Label ();
                nagCommentLabel.Xalign = 0;
                HBox hbox = new HBox ();
                hbox.PackStart (moveNumberLabel, false, false,
                        2);
                hbox.PackStart (nagCommentLabel, false, false,
                        2);

                vbox.PackStart (hbox, false, false, 2);

                // board
                chessGameDetailsBox = new VBox ();
                chessGameDetailsBox.PackStart (gameView,
                                   true, true, 4);

                vbox.PackStart (chessGameDetailsBox, true,
                        true, 2);

                // buttons
                playButton = new PlayPauseButton ();
                playButton.PlayNextEvent +=
                    on_play_next_event;

                firstButton = new Button ();
                firstButton.Clicked += on_first_clicked;
                firstButton.Image =
                    new Image (Stock.GotoFirst,
                           IconSize.Button);
                prevButton = new Button ();
                prevButton.Clicked += on_prev_clicked;
                prevButton.Image =
                    new Image (Stock.GoBack,
                           IconSize.Button);
                nextButton = new Button ();
                nextButton.Clicked += on_next_clicked;
                nextButton.Image =
                    new Image (Stock.GoForward,
                           IconSize.Button);
                lastButton = new Button ();
                lastButton.Clicked += on_last_clicked;
                lastButton.Image =
                    new Image (Stock.GotoLast,
                           IconSize.Button);

                HBox bbox = new HBox ();
                bbox.PackStart (firstButton, false, false, 1);
                bbox.PackStart (prevButton, false, false, 1);
                bbox.PackStart (playButton, false, false, 1);
                bbox.PackStart (nextButton, false, false, 1);
                bbox.PackStart (lastButton, false, false, 1);
                Alignment alignment =
                    new Alignment (0.5f, 1, 0, 0);
                alignment.Add (bbox);
                alignment.Show ();

                vbox.PackStart (alignment, false, false, 2);
                book.AppendPage (gamesListWidget,
                         new Label (Catalog.
                                GetString
                                ("Games")));
                book.AppendPage (vbox,
                         new Label (Catalog.
                                GetString
                                ("Current Game")));

                return book;
            }
Esempio n. 16
0
        public MultiPropertyDialog(int x, int y, int width, int height) : base(WindowType.Toplevel)
        {
            var buttonsHBox = new HBox(false, 0);

            var suffix    = GLTheme.DialogScaling >= 2.0f ? "@2x" : "";
            var buttonYes = new FlatButton(Gdk.Pixbuf.LoadFromResource($"FamiStudio.Resources.Yes{suffix}.png"));
            var buttonNo  = new FlatButton(Gdk.Pixbuf.LoadFromResource($"FamiStudio.Resources.No{suffix}.png"));

            buttonYes.Show();
            buttonYes.ButtonPressEvent += ButtonYes_ButtonPressEvent;
            buttonNo.Show();
            buttonNo.ButtonPressEvent += ButtonNo_ButtonPressEvent;

            buttonsHBox.PackStart(buttonYes, false, false, 0);
            buttonsHBox.PackStart(buttonNo, false, false, 0);
            buttonsHBox.HeightRequest = 40;
            buttonsHBox.Show();

            var buttonsAlign = new Alignment(1.0f, 0.5f, 0.0f, 0.0f);

            buttonsAlign.TopPadding = 5;
            buttonsAlign.Show();
            buttonsAlign.Add(buttonsHBox);

            var vbox = new VBox();

            buttonsVBox = new VBox();
            buttonsVBox.Show();
            buttonsVBox.WidthRequest = 160;

            var buttonsVBoxPadding = new Alignment(0.0f, 0.0f, 0.0f, 0.0f);

            buttonsVBoxPadding.RightPadding = 5;
            buttonsVBoxPadding.Show();
            buttonsVBoxPadding.Add(buttonsVBox);

            propsVBox = new VBox();
            propsVBox.Show();
            propsVBox.HeightRequest = 210;

            mainHbox = new HBox();
            mainHbox.Show();
            mainHbox.PackStart(buttonsVBoxPadding, false, false, 0);
            mainHbox.PackStart(propsVBox, true, true, 0);

            vbox.Show();
            vbox.PackStart(mainHbox);
            vbox.PackStart(buttonsAlign, false, false, 0);

            Add(vbox);

            WidthRequest  = width;
            HeightRequest = height;

            BorderWidth     = 5;
            Resizable       = false;
            Decorated       = false;
            KeepAbove       = true;
            Modal           = true;
            SkipTaskbarHint = true;
#if FAMISTUDIO_LINUX
            TransientFor = FamiStudioForm.Instance;
            SetPosition(WindowPosition.CenterOnParent);
#else
            Move(x, y);
#endif
        }
        public PreviewVisualizerWindow(ObjectValue val, Gtk.Widget invokingWidget) : base(Gtk.WindowType.Toplevel)
        {
            this.TypeHint  = WindowTypeHint.PopupMenu;
            this.Decorated = false;
            if (((Gtk.Window)invokingWidget.Toplevel).Modal)
            {
                this.Modal = true;
            }
            TransientFor = (Gtk.Window)invokingWidget.Toplevel;

            Theme.SetBackgroundColor(Styles.PreviewVisualizerBackgroundColor.ToCairoColor());
            Theme.Padding = 3;
            ShowArrow     = true;
            var mainBox     = new VBox();
            var headerTable = new Table(1, 3, false);

            headerTable.ColumnSpacing = 5;
            var closeButton = new ImageButton()
            {
                InactiveImage = ImageService.GetIcon("md-popup-close", IconSize.Menu),
                Image         = ImageService.GetIcon("md-popup-close-hover", IconSize.Menu)
            };

            closeButton.SetCommonAccessibilityAttributes("Preview visualizer close button", GettextCatalog.GetString("Close"), null);
            closeButton.Clicked += delegate {
                this.Destroy();
            };
            var hb = new HBox();
            var vb = new VBox();

            hb.PackStart(vb, false, false, 0);
            vb.PackStart(closeButton, false, false, 0);
            headerTable.Attach(hb, 0, 1, 0, 1);

            var headerTitle = new Label();

            headerTitle.ModifyFg(StateType.Normal, Styles.PreviewVisualizerHeaderTextColor.ToGdkColor());
            var font = IdeServices.FontService.SansFont.CopyModified(Ide.Gui.Styles.FontScale12);

            font.Weight = Pango.Weight.Bold;
            headerTitle.ModifyFont(font);
            headerTitle.Text = val.TypeName;
            var vbTitle = new VBox();

            vbTitle.PackStart(headerTitle, false, false, 3);
            headerTable.Attach(vbTitle, 1, 2, 0, 1);

            if (DebuggingService.HasValueVisualizers(val))
            {
                var openButton = new Button();
                openButton.Label    = GettextCatalog.GetString("Open");
                openButton.Relief   = ReliefStyle.Half;
                openButton.Clicked += delegate {
                    PreviewWindowManager.DestroyWindow();
                    DebuggingService.ShowValueVisualizer(val);
                };
                var hbox = new HBox();
                hbox.PackEnd(openButton, false, false, 2);
                headerTable.Attach(hbox, 2, 3, 0, 1);
            }
            else
            {
                headerTable.Attach(new Label(), 2, 3, 0, 1, AttachOptions.Fill | AttachOptions.Expand, AttachOptions.Fill | AttachOptions.Expand, 10, 0);
            }
            mainBox.PackStart(headerTable);
            mainBox.ShowAll();

            var     previewVisualizer = DebuggingService.GetPreviewVisualizer(val);
            Control widget            = null;

            try {
                widget = previewVisualizer?.GetVisualizerWidget(val);
            } catch (EvaluatorException ex) {
                widget = CreateErrorPreview(ex.Message);
            } catch (Exception e) {
                LoggingService.LogInternalError("Exception during preview widget creation", e);
            }
            if (widget == null)
            {
                try {
                    genericPreview = new GenericPreviewVisualizer();
                    widget         = genericPreview.GetVisualizerWidget(val);
                } catch (EvaluatorException ex) {
                    widget = CreateErrorPreview(ex.Message);
                } catch (Exception ex) {
                    widget = CreateErrorPreview(GettextCatalog.GetString("There was an error retrieving the value"));
                    LoggingService.LogInternalError(ex);
                }
            }
            var alignment = new Alignment(0, 0, 1, 1);

            alignment.SetPadding(3, 5, 5, 5);
            alignment.Show();
            alignment.Add(widget);
            mainBox.PackStart(alignment);
            ContentBox.Add(mainBox);
        }
Esempio n. 18
0
        public RtmPreferencesWidget() : base()
        {
            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(Catalog.GetString("Click Here to Connect"));

            authButton.Clicked += OnAuthButtonClicked;

            if (isAuthorized)
            {
                statusLabel.Text = "\n\n" +
                                   Catalog.GetString("You are currently connected");
                string userName = Application.Preferences.Get(Preferences.UserNameKey);
                if (userName != null && userName.Trim() != string.Empty)
                {
                    statusLabel.Text = "\n\n" +
                                       Catalog.GetString("You are currently connected as") +
                                       "\n" + userName.Trim();
                }
            }
            else
            {
                statusLabel.Text = "\n\n" +
                                   Catalog.GetString("You are not connected");
                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);
        }
        void AddMultiOptionCombo(OptionCombo option)
        {
            if (option.Items.Count < 2)
            {
                throw new InvalidOperationException();
            }

            var model    = new ListStore(new Type[] { typeof(string), typeof(object) });
            var renderer = new CellRendererText();

            foreach (var item in option.Items)
            {
                var label = item.Name;
                var sfx   = item.Framework;

                bool hasOtherVersions = false;
                foreach (var other in option.Items)
                {
                    if (sfx == other.Framework)
                    {
                        continue;
                    }
                    if (!string.IsNullOrEmpty(other.Framework.MonoSpecificVersionDisplayName))
                    {
                        continue;
                    }
                    hasOtherVersions = true;
                    break;
                }

                if (hasOtherVersions && string.IsNullOrEmpty(sfx.MonoSpecificVersionDisplayName))
                {
                    label += " or later";
                }

                model.AppendValues(label, item.Targets);
            }

            option.Combo = new ComboBox(model);
            option.Check = new CheckButton();

            option.Combo.PackStart(renderer, true);
            option.Combo.AddAttribute(renderer, "text", 0);

            option.Combo.Active = 0;

            option.Check.Show();
            option.Combo.Show();

            option.Combo.Changed += (sender, e) => {
                if (option.Check.Active)
                {
                    TargetFrameworkChanged(option);
                }
            };
            option.Check.Toggled += (sender, e) => {
                TargetFrameworkChanged(option);
            };

            var hbox = new HBox();

            hbox.PackStart(option.Check, false, false, 0);
            hbox.PackStart(option.Combo, true, true, 0);
            hbox.Show();

            var alignment = new Alignment(0.0f, 0.5f, 1.0f, 1.0f)
            {
                LeftPadding = 18, RightPadding = 18
            };

            alignment.Add(hbox);
            alignment.Show();

            vbox1.PackStart(alignment, false, true, 0);
        }
Esempio n. 20
0
        protected override void CreateBody()
        {
            CreateBody(Translator.GetString("Choose your locations"));

            WrapLabel footer = new WrapLabel
            {
                Markup = string.Format(Translator.GetString(
                                           "Locations are used for your physical locations where you store items, place orders, or make purchases from. To create the locations quickly use the form bellow. To edit your locations later go to:{0}{1}"),
                                       Environment.NewLine,
                                       new PangoStyle
                {
                    Italic = true,
                    Bold   = true,
                    Text   = Translator.GetString("Edit->Locations...")
                })
            };

            footer.Show();
            vboBody.PackStart(footer, false, true, 0);

            if (schemas.Count == 0)
            {
                foreach (TypeExtensionNode node in AddinManager.GetExtensionNodes("/Warehouse/Presentation/SetupAssistant/LocationsSetup"))
                {
                    object         instance = node.CreateInstance();
                    LocationsSetup schema   = instance as LocationsSetup;
                    if (schema != null)
                    {
                        schemas.Add(schema);
                    }
                }
                schemas.Sort((p1, p2) => Math.Max(-1, Math.Min(1, p1.Ordinal - p2.Ordinal)));
            }

            if (schemas.Count > 1)
            {
                nbkMain = new Notebook();
                foreach (LocationsSetup schema in schemas)
                {
                    Label lblTab = new Label(schema.Label)
                    {
                        Xpad = 4
                    };
                    Widget page = schema.GetPageWidget();
                    page.Show();

                    Alignment alg = new Alignment(.5f, .5f, 1f, 1f)
                    {
                        LeftPadding = 4, RightPadding = 4, TopPadding = 4, BottomPadding = 4
                    };
                    alg.Add(page);
                    alg.Show();

                    EventBox evb = new EventBox {
                        alg
                    };
                    evb.Show();

                    nbkMain.AppendPage(evb, lblTab);
                }
                nbkMain.Show();
                vboBody.PackStart(nbkMain, true, true, 10);
            }
            else if (schemas.Count == 1)
            {
                Widget page = schemas [0].GetPageWidget();
                page.Show();

                Alignment alg = new Alignment(.5f, .5f, 1f, 1f)
                {
                    LeftPadding = 4, RightPadding = 4, TopPadding = 4, BottomPadding = 4
                };
                alg.Add(page);
                alg.Show();

                vboBody.PackStart(alg, true, true, 10);
            }
        }
Esempio n. 21
0
        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);
        }
Esempio n. 22
0
        public GeneralTitle(EditorManager em)
        {
            this.contentEM    = em;
            this.hBox         = new HBox();
            this._imageWidget = new ImageView();
            this.TitleTable   = new Table(1U, 1U, false);
            Table table = new Table(2U, 1U, false);

            table.Attach((Widget)this._imageWidget, 0U, 1U, 0U, 1U, AttachOptions.Shrink, AttachOptions.Fill, 0U, 0U);
            this._imageWidget.Show();
            this.labelTable  = new Table(2U, 1U, false);
            table.RowSpacing = 6U;
            table.Attach((Widget)this.labelTable, 0U, 1U, 1U, 2U, AttachOptions.Fill, AttachOptions.Fill, 0U, 0U);
            this.labelTable.Show();
            table.Show();
            table.WidthRequest = 38;
            Alignment alignment1 = new Alignment(0.5f, 0.5f, 1f, 1f);

            alignment1.LeftPadding  = 15U;
            alignment1.TopPadding   = 15U;
            alignment1.RightPadding = 15U;
            alignment1.Add((Widget)table);
            alignment1.ShowAll();
            this.hBox.Add((Widget)alignment1);
            Box.BoxChild boxChild1 = this.hBox[(Widget)alignment1] as Box.BoxChild;
            boxChild1.Position = 0;
            boxChild1.Expand   = false;
            boxChild1.Fill     = false;
            VSeparator vseparator = new VSeparator();
            Alignment  alignment2 = new Alignment(0.5f, 0.5f, 1f, 1f);

            alignment2.LeftPadding   = 8U;
            alignment2.TopPadding    = 8U;
            alignment2.BottomPadding = 8U;
            alignment2.Add((Widget)vseparator);
            alignment2.ShowAll();
            vseparator.Show();
            this.hBox.Add((Widget)alignment2);
            Box.BoxChild boxChild2 = this.hBox[(Widget)alignment2] as Box.BoxChild;
            boxChild2.Position            = 1;
            boxChild2.Expand              = false;
            boxChild2.Fill                = false;
            this.ThirdTable               = new Table(2U, 2U, false);
            this.ThirdTable.RowSpacing    = 16U;
            this.ThirdTable.ColumnSpacing = 10U;
            Alignment alignment3 = new Alignment(0.5f, 0.5f, 1f, 1f);

            alignment3.LeftPadding   = 1U;
            alignment3.TopPadding    = 16U;
            alignment3.BottomPadding = 16U;
            alignment3.RightPadding  = 30U;
            alignment3.Add((Widget)this.ThirdTable);
            alignment3.ShowAll();
            this.ThirdTable.Show();
            this.hBox.Add((Widget)alignment3);
            Box.BoxChild boxChild3 = this.hBox[(Widget)this.ThirdTable] as Box.BoxChild;
            boxChild3.Position = 2;
            boxChild3.Expand   = true;
            boxChild3.Fill     = true;
            this.hBox.ShowAll();
        }
Esempio n. 23
0
        public StatusDialog(string dialogTitle, ITranslationProvider translator)
        {
            this.translator = translator;
            lblCount        = new Label {
                UseMarkup = true
            };
            lblCount.SetText(translator.GetString("Generating..."));

            algProgress = new Alignment(0.5f, 0.5f, 1, 1)
            {
                LeftPadding  = 10,
                RightPadding = 10
            };
            algProgress.Add(lblCount);

            VBox da = new VBox {
                WidthRequest = 250
            };

            lblButtonText = new Label {
                Xalign = 1f, UseMarkup = true, Text = "<span size=\"small\">lblText</span>"
            };
            lblButtonText.Show();
            pgbCount = new ProgressBar();
            pgbCount.Show();

            #region Stop button setup

            Alignment algButtonIcon = new Alignment(0.5f, 0.5f, 1f, 1f)
            {
                ComponentHelper.LoadImage("Warehouse.Component.Printing.Icon.Cancel24.png")
            };

            HBox hboButton = new HBox {
                WidthRequest = 100
            };
            hboButton.PackStart(algButtonIcon, false, false, 0);
            hboButton.PackStart(lblButtonText, true, true, 0);

            Alignment algButton = new Alignment(0.5f, 0.5f, 0f, 0f)
            {
                hboButton
            };

            button = new Button {
                WidthRequest = 110, HeightRequest = 34
            };
            button.Add(algButton);
            button.Clicked += button_Clicked;

            #endregion

            dlgStatus = new Dialog {
                Title = dialogTitle
            };
            dlgStatus.VBox.PackStart(da, true, true, 0);
            dlgStatus.VBox.PackEnd(algProgress, true, true, 20);
            dlgStatus.AddActionWidget(button, ResponseType.Cancel);
            dlgStatus.DeleteEvent += dlgStatus_DeleteEvent;
            ButtonText             = translator.GetString("Cancel");
        }
Esempio n. 24
0
        public override Widget CreatePanelWidget()
        {
            HBox  hbox  = new HBox(false, 6);
            Label label = new Label();

            label.MarkupWithMnemonic = GettextCatalog.GetString("_Policy:");
            hbox.PackStart(label, false, false, 0);

            store       = new ListStore(typeof(string), typeof(PolicySet));
            policyCombo = new ComboBox(store);
            CellRenderer renderer = new CellRendererText();

            policyCombo.PackStart(renderer, true);
            policyCombo.AddAttribute(renderer, "text", 0);

            label.MnemonicWidget         = policyCombo;
            policyCombo.RowSeparatorFunc = (TreeModel model, TreeIter iter) =>
                                           ((string)model.GetValue(iter, 0)) == "--";
            hbox.PackStart(policyCombo, false, false, 0);

            VBox vbox = new VBox(false, 6);

            vbox.PackStart(hbox, false, false, 0);
            vbox.ShowAll();

            // Warning message to be shown when the user modifies the default policy

            warningMessage         = new HBox();
            warningMessage.Spacing = 6;
            Image img = new Image(Gtk.Stock.DialogWarning, IconSize.LargeToolbar);

            warningMessage.PackStart(img, false, false, 0);
            Label wl = new Label(GettextCatalog.GetString("Changes done in this section will only be applied to new projects. " +
                                                          "Settings for existing projects can be modified in the project (or solution) options dialog."));

            wl.Xalign       = 0;
            wl.Wrap         = true;
            wl.WidthRequest = 450;
            warningMessage.PackStart(wl, true, true, 0);
            warningMessage.ShowAll();
            warningMessage.Visible = false;
            vbox.PackEnd(warningMessage, false, false, 0);

            notebook = new Notebook();

            // Get the panels for all mime types

            List <string> types = new List <string> ();

            types.AddRange(DesktopService.GetMimeTypeInheritanceChain(mimeType));

            panelData.SectionLoaded = true;
            panels = panelData.Panels;
            foreach (IMimeTypePolicyOptionsPanel panel in panelData.Panels)
            {
                panel.SetParentSection(this);
                Widget child = panel.CreateMimePanelWidget();

                Label tlabel = new Label(panel.Label);
                label.Show();
                child.Show();
                Alignment align = new Alignment(0.5f, 0.5f, 1f, 1f);
                align.BorderWidth = 6;
                align.Add(child);
                align.Show();

                notebook.AppendPage(align, tlabel);
                panel.LoadCurrentPolicy();
            }

            notebook.Show();
            vbox.PackEnd(notebook, true, true, 0);

            FillPolicies();
            policyCombo.Active = 0;

            loading = false;

            if (!isRoot && panelData.UseParentPolicy)
            {
                //in this case "parent" is always first in the list
                policyCombo.Active = 0;
                notebook.Sensitive = false;
            }
            else
            {
                UpdateSelectedNamedPolicy();
            }

            policyCombo.Changed += HandlePolicyComboChanged;

            return(vbox);
        }
Esempio n. 25
0
        public StatusArea()
        {
            theme     = new StatusAreaTheme();
            renderArg = new RenderArg();

            ctxHandler    = new StatusBarContextHandler(this);
            VisibleWindow = false;
            NoShowAll     = true;
            WidgetFlags  |= Gtk.WidgetFlags.AppPaintable;

            statusIconBox.BorderWidth = 0;
            statusIconBox.Spacing     = 3;

            Action <bool> animateProgressBar =
                showing => this.Animate("ProgressBarFade",
                                        val => renderArg.ProgressBarAlpha = val,
                                        renderArg.ProgressBarAlpha,
                                        showing ? 1.0f : 0.0f,
                                        easing: Easing.CubicInOut);

            ProgressBegin += delegate {
                renderArg.ShowProgressBar = true;
//				StartBuildAnimation ();
                renderArg.ProgressBarFraction = 0;
                QueueDraw();
                animateProgressBar(true);
            };

            ProgressEnd += delegate {
                renderArg.ShowProgressBar = false;
//				StopBuildAnimation ();
                QueueDraw();
                animateProgressBar(false);
            };

            ProgressFraction += delegate(object sender, FractionEventArgs e) {
                renderArg.ProgressBarFraction = (float)e.Work;
                QueueDraw();
            };

            contentBox.PackStart(messageBox, true, true, 0);
            contentBox.PackEnd(statusIconBox, false, false, 0);
            contentBox.PackEnd(statusIconSeparator = new StatusAreaSeparator(), false, false, 0);
            contentBox.PackEnd(buildResultWidget   = CreateBuildResultsWidget(Orientation.Horizontal), false, false, 0);

            HasTooltip    = true;
            QueryTooltip += messageBoxToolTip;

            mainAlign              = new Alignment(0, 0.5f, 1, 0);
            mainAlign.LeftPadding  = 12;
            mainAlign.RightPadding = 8;
            mainAlign.Add(contentBox);
            Add(mainAlign);

            mainAlign.ShowAll();
            statusIconBox.Hide();
            statusIconSeparator.Hide();
            buildResultWidget.Hide();
            Show();

            this.ButtonPressEvent += delegate {
                if (sourcePad != null)
                {
                    sourcePad.BringToFront(true);
                }
            };

            statusIconBox.Shown += delegate {
                UpdateSeparators();
            };

            statusIconBox.Hidden += delegate {
                UpdateSeparators();
            };

            messageQueue = new Queue <Message> ();

            tracker                 = new MouseTracker(this);
            tracker.MouseMoved     += (sender, e) => QueueDraw();
            tracker.HoveredChanged += (sender, e) => {
                this.Animate("Hovered",
                             x => renderArg.HoverProgress = x,
                             renderArg.HoverProgress,
                             tracker.Hovered ? 1.0f : 0.0f,
                             easing: Easing.SinInOut);
            };

            IdeApp.FocusIn += delegate {
                // If there was an error while the application didn't have the focus,
                // trigger the error animation again when it gains the focus
                if (errorAnimPending)
                {
                    errorAnimPending = false;
                    TriggerErrorAnimation();
                }
            };
        }
Esempio n. 26
0
        public BubbleChartView(ViewBase owner = null) : base(owner)
        {
            vpaned1               = new VPaned();
            mainWidget            = vpaned1;
            mainWidget.Destroyed += OnDestroyed;

            graphView = new DirectedGraphView(this);
            vpaned1.Pack1(graphView.MainWidget, true, true);

            VBox vbox1 = new VBox(false, 0);

            ctxBox = new VBox(false, 0);

            // Arc selection: rules & actions
            VBox arcSelBox = new VBox();

            Label l1 = new Label("Rules");

            l1.Xalign = 0;
            arcSelBox.PackStart(l1, true, true, 0);
            RuleList = new EditorView(owner);
            RuleList.TextHasChangedByUser += OnRuleChanged;
            //RuleList.ScriptMode = false;

            ScrolledWindow rules = new ScrolledWindow();

            rules.ShadowType = ShadowType.EtchedIn;
            rules.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);

            rules.Add((RuleList as ViewBase).MainWidget);

            (RuleList as ViewBase).MainWidget.ShowAll();
            arcSelBox.PackStart(rules, true, true, 0);
            rules.Show();

            Label l2 = new Label("Actions");

            l2.Xalign = 0;
            arcSelBox.PackStart(l2, true, true, 0);
            ActionList = new EditorView(owner);
            ActionList.TextHasChangedByUser += OnActionChanged;
            //ActionList.ScriptMode = false;

            ScrolledWindow actions = new ScrolledWindow();

            actions.ShadowType = ShadowType.EtchedIn;
            actions.SetPolicy(PolicyType.Automatic, PolicyType.Automatic);

            actions.Add((ActionList as ViewBase).MainWidget);

            (ActionList as ViewBase).MainWidget.ShowAll();
            arcSelBox.PackStart(actions, true, true, 0); actions.Show();
            arcSelWdgt = arcSelBox as Widget;
            arcSelWdgt.Hide();
            ctxBox.PackStart(arcSelWdgt, true, true, 0);

            // Node selection:

            Grid t1 = new Grid();

            Label l3 = new Label("Name");

            l3.Xalign = 0;
            t1.Attach(l3, 0, 0, 1, 1);

            Label l4 = new Label("Description");

            l4.Xalign = 0;
            t1.Attach(l4, 0, 1, 1, 1);

            Label l5 = new Label("Colour");

            l5.Xalign = 0;
            t1.Attach(l5, 0, 2, 1, 1);

            nameEntry          = new Entry();
            nameEntry.Changed += OnNameChanged;
            nameEntry.Xalign   = 0;

            // Setting the WidthRequest to 350 will effectively
            // set the minimum size, beyond which it cannot be further
            // shrunk by dragging the HPaned's splitter.
            nameEntry.WidthRequest = 350;
            t1.Attach(nameEntry, 1, 0, 1, 1);

            descEntry              = new Entry();
            descEntry.Xalign       = 0;
            descEntry.Changed     += OnDescriptionChanged;
            descEntry.WidthRequest = 350;
            t1.Attach(descEntry, 1, 1, 1, 1);
            colourChooser              = new ColorButton();
            colourChooser.Xalign       = 0;
            colourChooser.ColorSet    += OnColourChanged;
            colourChooser.WidthRequest = 350;
            t1.Attach(colourChooser, 1, 2, 1, 1);
            nodeSelWdgt = t1;
            ctxBox.PackStart(t1, true, true, 0);

            // Info
            Label l6 = new Label();

            l6.LineWrap = true;
            l6.Text     = "<left-click>: select a node or arc.\n" +
                          "<right-click>: shows a context-sensitive menu.\n\n" +
                          "Once a node/arc is selected, it can be dragged to a new position.\n\n" +
                          "Nodes are created by right-clicking on a blank area.\n\n" +
                          "Transition arcs are created by firstly selecting a source node,\n" +
                          "then right-clicking over a target node.";
            infoWdgt = l6 as Widget;
            infoWdgt.ShowAll();
            l6.Xalign = 0;
            l6.Yalign = 0;
            l6.Wrap   = false;
            Alignment infoWdgtWrapper = new Alignment(0, 0, 1, 0);

            infoWdgtWrapper.Add(infoWdgt);
            //ctxBox.PackStart(infoWdgt, true, true, 0);
            //vbox1.PackStart(ctxBox, false, false, 0);

            PropertiesView = new PropertyView(this);
            ((ScrolledWindow)((ViewBase)PropertiesView).MainWidget).HscrollbarPolicy = PolicyType.Never;
            // settingsBox = new Table(2, 2, false);
            // settingsBox.Attach(new Label("Initial State"), 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Fill, 0, 0);
            // combobox1 = new ComboBox();
            // combobox1.PackStart(comboRender, false);
            // combobox1.AddAttribute(comboRender, "text", 0);
            // combobox1.Model = comboModel;
            // settingsBox.Attach(combobox1, 1, 2, 0, 1, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Fill, 0, 0);

            // chkVerbose = new CheckButton();
            // chkVerbose.Toggled += OnToggleVerboseMode;
            // settingsBox.Attach(new Label("Verbose Mode"), 0, 1, 1, 2, AttachOptions.Fill, AttachOptions.Fill, 0, 0);
            // settingsBox.Attach(chkVerbose, 1, 2, 1, 2, AttachOptions.Expand | AttachOptions.Fill, AttachOptions.Fill, 0, 0);

            hpaned1 = new HPaned();
            hpaned2 = new HPaned();
            Frame frame1 = new Frame("Rotation Settings");

            frame1.Add(((ViewBase)PropertiesView).MainWidget);
            frame1.ShadowType = ShadowType.In;
            Frame frame2 = new Frame();

            frame2.Add(hpaned2);
            frame2.ShadowType = ShadowType.In;
            ctxFrame          = new Frame();
            ctxFrame.Add(ctxBox);
            ctxFrame.ShadowType = ShadowType.In;
            Frame frame4 = new Frame("Instructions");

            frame4.Add(infoWdgtWrapper);
            frame4.ShadowType = ShadowType.In;
            hpaned1.Pack1(frame1, false, false);
            hpaned1.Pack2(frame2, true, false);
            hpaned2.Pack1(ctxFrame, true, false);
            hpaned2.Pack2(frame4, true, false);
            hpaned1.ShowAll();
            Alignment halign = new Alignment(0, 0, 1, 1);

            halign.Add(hpaned1);

            vpaned1.Pack2(halign, false, false);
            vpaned1.Show();

            graphView.OnGraphObjectSelected += OnGraphObjectSelected;
            graphView.OnGraphObjectMoved    += OnGraphObjectMoved;
            //combobox1.Changed += OnComboBox1SelectedValueChanged;

            contextMenuHelper              = new ContextMenuHelper(graphView.MainWidget);
            contextMenuHelper.ContextMenu += OnPopup;

            ContextMenu.SelectionDone += OnContextMenuDeactivated;
            ContextMenu.Mapped        += OnContextMenuRendered;

            // Ensure the menu is populated
            Select(null);
        }
Esempio n. 27
0
        private void BuildFooter()
        {
            if (mode == EditorMode.View || TrackCount < 2)
            {
                return;
            }

            HBox button_box = new HBox();

            button_box.Spacing = 6;

            if (TrackCount > 1)
            {
                sync_all_button = new PulsingButton();
                sync_all_button.FocusInEvent += delegate {
                    ForeachWidget <SyncButton> (delegate(SyncButton button) {
                        button.StartPulsing();
                    });
                };

                sync_all_button.FocusOutEvent += delegate {
                    if (sync_all_button.State == StateType.Prelight)
                    {
                        return;
                    }

                    ForeachWidget <SyncButton> (delegate(SyncButton button) {
                        button.StopPulsing();
                    });
                };

                sync_all_button.StateChanged += delegate {
                    if (sync_all_button.HasFocus)
                    {
                        return;
                    }

                    ForeachWidget <SyncButton> (delegate(SyncButton button) {
                        if (sync_all_button.State == StateType.Prelight)
                        {
                            button.StartPulsing();
                        }
                        else
                        {
                            button.StopPulsing();
                        }
                    });
                };

                sync_all_button.Clicked += delegate {
                    InvokeFieldSync();
                };

                Alignment alignment = new Alignment(0.5f, 0.5f, 0.0f, 0.0f);
                HBox      box       = new HBox();
                box.Spacing = 2;
                box.PackStart(new Image(Stock.Copy, IconSize.Button), false, false, 0);
                box.PackStart(new Label(Catalog.GetString("Sync all field _values")), false, false, 0);
                alignment.Add(box);
                sync_all_button.Add(alignment);

                TooltipSetter.Set(tooltip_host, sync_all_button, Catalog.GetString(
                                      "Apply the values of all common fields set for this track to all of the tracks selected in this editor"));

                button_box.PackStart(sync_all_button, false, false, 0);

                foreach (Widget child in ActionArea.Children)
                {
                    child.SizeAllocated += OnActionAreaChildSizeAllocated;
                }

                edit_notif_label        = new Label();
                edit_notif_label.Xalign = 1.0f;
                button_box.PackEnd(edit_notif_label, false, false, 0);
            }

            main_vbox.PackStart(button_box, false, false, 0);
            button_box.ShowAll();
        }
Esempio n. 28
0
        public MainToolbar()
        {
            executionTargetsChanged = DispatchService.GuiDispatch(new EventHandler(HandleExecutionTargetsChanged));

            IdeApp.Workspace.ActiveConfigurationChanged += (sender, e) => UpdateCombos();
            IdeApp.Workspace.ConfigurationsChanged      += (sender, e) => UpdateCombos();

            IdeApp.Workspace.SolutionLoaded   += (sender, e) => UpdateCombos();
            IdeApp.Workspace.SolutionUnloaded += (sender, e) => UpdateCombos();

            IdeApp.ProjectOperations.CurrentSelectedSolutionChanged += HandleCurrentSelectedSolutionChanged;

            WidgetFlags |= Gtk.WidgetFlags.AppPaintable;

            AddWidget(button);
            AddSpace(8);

            configurationCombo       = new Gtk.ComboBox();
            configurationCombo.Model = configurationStore;
            var ctx = new Gtk.CellRendererText();

            configurationCombo.PackStart(ctx, true);
            configurationCombo.AddAttribute(ctx, "text", 0);

            configurationCombosBox = new HBox(false, 8);

            var configurationComboVBox = new VBox();

            configurationComboVBox.PackStart(configurationCombo, true, false, 0);
            configurationCombosBox.PackStart(configurationComboVBox, false, false, 0);

            runtimeCombo       = new Gtk.ComboBox();
            runtimeCombo.Model = runtimeStore;
            ctx = new Gtk.CellRendererText();
            if (Platform.IsWindows)
            {
                ctx.Ellipsize = Pango.EllipsizeMode.Middle;
            }
            runtimeCombo.PackStart(ctx, true);
            runtimeCombo.SetCellDataFunc(ctx, RuntimeRenderCell);
            runtimeCombo.RowSeparatorFunc = RuntimeIsSeparator;

            var runtimeComboVBox = new VBox();

            runtimeComboVBox.PackStart(runtimeCombo, true, false, 0);
            configurationCombosBox.PackStart(runtimeComboVBox, false, false, 0);
            AddWidget(configurationCombosBox);

            buttonBarBox             = new Alignment(0.5f, 0.5f, 0, 0);
            buttonBarBox.LeftPadding = (uint)7;
            buttonBarBox.Add(buttonBar);
            buttonBarBox.NoShowAll = true;
            AddWidget(buttonBarBox);
            AddSpace(24);

            statusArea = new StatusArea();
            statusArea.ShowMessage(BrandingService.ApplicationName);

            var statusAreaAlign = new Alignment(0, 0, 1, 1);

            statusAreaAlign.Add(statusArea);
            contentBox.PackStart(statusAreaAlign, true, true, 0);
            AddSpace(24);

            statusAreaAlign.SizeAllocated += (object o, SizeAllocatedArgs args) => {
                Gtk.Widget toplevel = this.Toplevel;
                if (toplevel == null)
                {
                    return;
                }

                var pixel_scale = GtkWorkarounds.GetPixelScale();

                int  windowWidth   = toplevel.Allocation.Width;
                int  center        = windowWidth / 2;
                int  left          = Math.Max(center - (int)(300 * pixel_scale), args.Allocation.Left);
                int  right         = Math.Min(left + (int)(600 * pixel_scale), args.Allocation.Right);
                uint left_padding  = (uint)(left - args.Allocation.Left);
                uint right_padding = (uint)(args.Allocation.Right - right);

                if (left_padding != statusAreaAlign.LeftPadding || right_padding != statusAreaAlign.RightPadding)
                {
                    statusAreaAlign.SetPadding(0, 0, (uint)left_padding, (uint)right_padding);
                }
            };

            matchEntry = new SearchEntry();

            var searchFiles = this.matchEntry.AddMenuItem(GettextCatalog.GetString("Search Files"));

            searchFiles.Activated += delegate {
                SetSearchCategory("files");
            };
            var searchTypes = this.matchEntry.AddMenuItem(GettextCatalog.GetString("Search Types"));

            searchTypes.Activated += delegate {
                SetSearchCategory("type");
            };
            var searchMembers = this.matchEntry.AddMenuItem(GettextCatalog.GetString("Search Members"));

            searchMembers.Activated += delegate {
                SetSearchCategory("member");
            };

            matchEntry.ForceFilterButtonVisible = true;
            matchEntry.Entry.FocusOutEvent     += delegate {
                matchEntry.Entry.Text = "";
            };
            var cmd = IdeApp.CommandService.GetCommand(Commands.NavigateTo);

            cmd.KeyBindingChanged += delegate {
                UpdateSearchEntryLabel();
            };
            UpdateSearchEntryLabel();

            matchEntry.Ready       = true;
            matchEntry.Visible     = true;
            matchEntry.IsCheckMenu = true;
            matchEntry.Entry.ModifyBase(StateType.Normal, Style.Light(StateType.Normal));
            matchEntry.WidthRequest = 240;
            if (!Platform.IsMac && !Platform.IsWindows)
            {
                matchEntry.Entry.ModifyFont(Pango.FontDescription.FromString("Sans 9"));                   // TODO: VV: "Segoe UI 9"
            }
            matchEntry.RoundedShape   = true;
            matchEntry.Entry.Changed += HandleSearchEntryChanged;
            matchEntry.Activated     += (sender, e) => {
                var pattern = SearchPopupSearchPattern.ParsePattern(matchEntry.Entry.Text);
                if (pattern.Pattern == null && pattern.LineNumber > 0)
                {
                    popup.Destroy();
                    var doc = IdeApp.Workbench.ActiveDocument;
                    if (doc != null && doc.Editor != null)
                    {
                        doc.Select();
                        doc.Editor.Caret.Location = new Mono.TextEditor.DocumentLocation(pattern.LineNumber, pattern.Column > 0 ? pattern.Column : 1);
                        doc.Editor.CenterToCaret();
                        doc.Editor.Parent.StartCaretPulseAnimation();
                    }
                    return;
                }
                if (popup != null)
                {
                    popup.OpenFile();
                }
            };
            matchEntry.Entry.KeyPressEvent += (o, args) => {
                if (args.Event.Key == Gdk.Key.Escape)
                {
                    var doc = IdeApp.Workbench.ActiveDocument;
                    if (doc != null)
                    {
                        if (popup != null)
                        {
                            popup.Destroy();
                        }
                        doc.Select();
                    }
                    return;
                }
                if (popup != null)
                {
                    args.RetVal = popup.ProcessKey(args.Event.Key, args.Event.State);
                }
            };
            IdeApp.Workbench.RootWindow.WidgetEvent += delegate(object o, WidgetEventArgs args) {
                if (args.Event is Gdk.EventConfigure)
                {
                    PositionPopup();
                }
            };
            SizeAllocated += delegate {
                PositionPopup();
            };

            BuildToolbar();
            IdeApp.CommandService.RegisterCommandBar(buttonBar);

            AddinManager.ExtensionChanged += OnExtensionChanged;

            contentBox.PackStart(matchEntry, false, false, 0);

            var align = new Gtk.Alignment(0, 0, 1f, 1f);

            align.Show();
            align.TopPadding    = (uint)5;
            align.LeftPadding   = (uint)9;
            align.RightPadding  = (uint)18;
            align.BottomPadding = (uint)10;
            align.Add(contentBox);

            Add(align);
            SetDefaultSizes(-1, 21);

            configurationCombo.Changed += HandleConfigurationChanged;
            runtimeCombo.Changed       += HandleRuntimeChanged;
            UpdateCombos();

            button.Clicked += HandleStartButtonClicked;
            IdeApp.CommandService.RegisterCommandBar(this);

            IdeApp.CommandService.ActiveWidgetChanged += (sender, e) => {
                lastCommandTarget = new WeakReference(e.OldActiveWidget);
            };

            this.ShowAll();
            this.statusArea.statusIconBox.HideAll();
        }
Esempio n. 29
0
    public MainWindow() : base(Gtk.WindowType.Toplevel)
    {
        Build();
        ModifyBg(StateType.Normal, new Gdk.Color(50, 50, 50));
        //Design
        VBox allContent = new VBox(false, 2);
        //Alignment hAllign = new Alignment(0, 0, 0, 0);
        //hBox.PackStart(hAllign, false, false, 1);
        //connectionStatus.SetSizeRequest(50, 50);

        Label compLabel       = new Label("Compression Ratio");
        Label imgSizeLabel    = new Label("Image size");
        Label colorDepthLabel = new Label("Color depth");
        Label FPSLabel        = new Label("Frames per second");

        strImgSize.Value = 300;
        FPS.Value        = 60;

        Label uncprsDataLable   = new Label("Uncopressed data");
        Label cprsDataLabel     = new Label("Compressed data");
        Label cycleReceiveLAbel = new Label("Receive cycles per second");
        Label cycleSendLabel    = new Label("Sending cycles per second");
        Label thrSleepLabel     = new Label("Thread sleep time");

        rightSide.Add(imgSizeLabel);
        rightSide.Add(strImgSize);
        rightSide.Add(compLabel);
        rightSide.Add(strImgCompression);
        rightSide.Add(colorDepthLabel);
        rightSide.Add(strImgCD);
        rightSide.Add(FPSLabel);
        rightSide.Add(FPS);
        rightSide.Add(cycleReceiveLAbel);
        rightSide.Add(cycleSpeedReceive);
        rightSide.Add(cycleSendLabel);
        rightSide.Add(cycleSpeedSend);
        rightSide.Add(thrSleepLabel);
        rightSide.Add(thrSleepTime);
        //rightSide.Add(connectionStatus);
        rightSide.Add(aliveMeter);
        //rightSide.Add(currIP);
        rightSide.Add(uncprsDataLable);
        rightSide.Add(dataAmount);
        rightSide.Add(cprsDataLabel);
        rightSide.Add(compressedDataAmount);

        Alignment vAlignRP = new Alignment(0, 0, 1, 0);

        vAlignRP.Add(rightSide);
        vAlignRP.SetSizeRequest(200, 300);

        VBox   connectPart = new VBox(true, 0);
        Button connectBtn  = new Button("Connect");

        connectBtn.Pressed += NetworkLogic.ConnectBtnPressed;
        connectPart.Add(connectIP);
        connectPart.Add(connectBtn);
        Alignment vAlignConnect = new Alignment(0, 0, 1, 0);

        vAlignConnect.Add(connectPart);
        vAlignConnect.SetSizeRequest(200, 200);

        Alignment consoleTop = new Alignment(0, 0, 0, 0);

        consoleTop.Add(consoleTxt);
        VBox consoleLabelHolder = new VBox(false, 0);

        consoleLabelHolder.PackStart(consoleTop);
        consoleLabelHolder.SetSizeRequest(500, 500);


        HBox mainBox = new HBox(false, 0);

        mainBox.SetSizeRequest(600, 480);
        mainBox.Add(vAlignConnect);
        mainBox.Add(vAlignRP);
        mainBox.PackEnd(consoleLabelHolder);

        MenuBar  menuBar  = new MenuBar();
        Menu     fileMenu = new Menu();
        MenuItem file     = new MenuItem("File");

        file.Submenu = fileMenu;
        MenuItem exit = new MenuItem("Exit");

        exit.Activated += OnExitEvent;
        fileMenu.Append(exit);
        menuBar.Append(file);

        allContent.PackStart(menuBar, false, false, 0);
        allContent.PackEnd(mainBox, false, false, 0);

        Add(allContent);

        ShowAll();

        Thread aMC = new Thread(AliveMeterCount);

        aMC.Start();
    }
Esempio n. 30
0
        private void InitUI()
        {
            try
            {
                bool                  debug                = false;
                uint                  padding              = 5;
                decimal               exchangeRate         = _configurationCurrency.ExchangeRate;
                List <Label>          labelsTitle          = new List <Label>();
                List <Label>          labelsValue          = new List <Label>();
                Pango.FontDescription fontDescriptionTitle = Pango.FontDescription.FromString("Bold 11");
                Pango.FontDescription fontDescriptionValue = Pango.FontDescription.FromString("11");

                //Titles: Table Tax
                Label labelTitleTaxDesignation = new Label(Resx.global_designation);
                Label labelTitleTaxValue       = new Label(Resx.global_tax);
                Label labelTitleTaxBase        = new Label(Resx.global_total_tax_base);
                Label labelTitleTaxTotal       = new Label(Resx.global_total);
                //Titles: Table Totals
                Label labelTitleDiscount                  = new Label(Resx.global_discount);
                Label labelTitleTotalNet                  = new Label(Resx.global_documentfinance_totalgross);
                Label labelTitleDiscountCustomer          = new Label(Resx.global_documentfinance_discount_customer);
                Label labelTitleDiscountPaymentConditions = new Label(Resx.global_documentfinance_discount_payment_conditions);
                Label labelTitleTotalTax                  = new Label(Resx.global_documentfinance_totaltax);
                Label labelTitleTotalFinal                = new Label(Resx.global_documentfinance_totalfinal);
                //Values: Table Totals
                Label labelValueDiscount = new Label(FrameworkUtils.DecimalToString(_articleBag.DiscountGlobal))
                {
                    WidthRequest = 100
                };
                Label labelValueTotalNet                  = new Label(FrameworkUtils.DecimalToString(_articleBag.TotalNet * exchangeRate));
                Label labelValueDiscountCustomer          = new Label(FrameworkUtils.DecimalToString(_articleBag.TotalDiscount * exchangeRate));
                Label labelValueDiscountPaymentConditions = new Label(FrameworkUtils.DecimalToString(0.0m));
                Label labelValueTotalTax                  = new Label(FrameworkUtils.DecimalToString(_articleBag.TotalTax * exchangeRate));
                Label labelValueTotalFinal                = new Label(FrameworkUtils.DecimalToString(_articleBag.TotalFinal * exchangeRate));
                //Add to Titles List
                labelsTitle.Add(labelTitleTaxDesignation);
                labelsTitle.Add(labelTitleTaxValue);
                labelsTitle.Add(labelTitleTaxBase);
                labelsTitle.Add(labelTitleTaxTotal);
                labelsTitle.Add(labelTitleDiscount);
                labelsTitle.Add(labelTitleTotalNet);
                labelsTitle.Add(labelTitleDiscountCustomer);
                labelsTitle.Add(labelTitleDiscountPaymentConditions);
                labelsTitle.Add(labelTitleTotalTax);
                labelsTitle.Add(labelTitleTotalFinal);
                //Add Values to List
                labelsValue.Add(labelValueDiscount);
                labelsValue.Add(labelValueTotalNet);
                labelsValue.Add(labelValueDiscountCustomer);
                labelsValue.Add(labelValueDiscountPaymentConditions);
                labelsValue.Add(labelValueTotalTax);
                labelsValue.Add(labelValueTotalFinal);

                //Add Tax Table and Rows
                uint  row      = 0;
                Table tableTax = new Table(Convert.ToUInt16(_articleBag.TaxBag.Count), 4, false);
                //tableTax.WidthRequest = 380;
                //Row0
                tableTax.Attach(labelTitleTaxDesignation, 0, 1, row, row + 1, AttachOptions.Fill, AttachOptions.Fill, padding, padding);
                tableTax.Attach(labelTitleTaxValue, 1, 2, row, row + 1, AttachOptions.Fill, AttachOptions.Fill, padding, padding);
                tableTax.Attach(labelTitleTaxBase, 2, 3, row, row + 1, AttachOptions.Fill, AttachOptions.Fill, padding, padding);
                tableTax.Attach(labelTitleTaxTotal, 3, 4, row, row + 1, AttachOptions.Fill, AttachOptions.Fill, padding, padding);
                foreach (var item in _articleBag.TaxBag.OrderBy(i => i.Key))
                {
                    row++;
                    if (_debug)
                    {
                        _log.Debug(string.Format("{0}:{1}:{2}:{3}", item.Value.Designation, item.Key, item.Value.TotalBase, item.Value.Total));
                    }
                    //Prepare Labels
                    Label labelDesignation = new Label(item.Value.Designation);
                    Label labelValue       = new Label(FrameworkUtils.DecimalToString(item.Key));
                    Label labelTotalBase   = new Label(FrameworkUtils.DecimalToString(item.Value.TotalBase * exchangeRate));
                    Label labelTotal       = new Label(FrameworkUtils.DecimalToString(item.Value.Total * exchangeRate));
                    //Add Row
                    tableTax.Attach(labelDesignation, 0, 1, row, row + 1, AttachOptions.Fill, AttachOptions.Fill, padding, padding);
                    tableTax.Attach(labelValue, 1, 2, row, row + 1, AttachOptions.Fill, AttachOptions.Fill, padding, padding);
                    tableTax.Attach(labelTotalBase, 2, 3, row, row + 1, AttachOptions.Fill, AttachOptions.Fill, padding, padding);
                    tableTax.Attach(labelTotal, 3, 4, row, row + 1, AttachOptions.Fill, AttachOptions.Fill, padding, padding);
                    //Add References to List
                    labelsValue.Add(labelDesignation);
                    labelsValue.Add(labelValue);
                    labelsValue.Add(labelTotalBase);
                    labelsValue.Add(labelTotal);
                }

                //Add Totals Table and Rows
                row = 0;
                Table tableTotal = new Table(6, 2, false);
                //tableTax.WidthRequest = 280;
                //Row0
                tableTotal.Attach(labelTitleDiscount, 0, 1, row, row + 1, AttachOptions.Fill, AttachOptions.Fill, padding, padding);
                tableTotal.Attach(labelValueDiscount, 1, 2, row, row + 1, AttachOptions.Fill, AttachOptions.Fill, padding, padding);
                //Row1
                row++;
                tableTotal.Attach(labelTitleTotalNet, 0, 1, row, row + 1, AttachOptions.Fill, AttachOptions.Fill, padding, padding);
                tableTotal.Attach(labelValueTotalNet, 1, 2, row, row + 1, AttachOptions.Fill, AttachOptions.Fill, padding, padding);
                //Row2
                row++;
                tableTotal.Attach(labelTitleDiscountCustomer, 0, 1, row, row + 1, AttachOptions.Fill, AttachOptions.Fill, padding, padding);
                tableTotal.Attach(labelValueDiscountCustomer, 1, 2, row, row + 1, AttachOptions.Fill, AttachOptions.Fill, padding, padding);
                //Row3
                row++;
                tableTotal.Attach(labelTitleDiscountPaymentConditions, 0, 1, row, row + 1, AttachOptions.Fill, AttachOptions.Fill, padding, padding);
                tableTotal.Attach(labelValueDiscountPaymentConditions, 1, 2, row, row + 1, AttachOptions.Fill, AttachOptions.Fill, padding, padding);
                //Row4
                row++;
                tableTotal.Attach(labelTitleTotalTax, 0, 1, row, row + 1, AttachOptions.Fill, AttachOptions.Fill, padding, padding);
                tableTotal.Attach(labelValueTotalTax, 1, 2, row, row + 1, AttachOptions.Fill, AttachOptions.Fill, padding, padding);
                //Row5
                row++;
                tableTotal.Attach(labelTitleTotalFinal, 0, 1, row, row + 1, AttachOptions.Fill, AttachOptions.Fill, padding, padding);
                tableTotal.Attach(labelValueTotalFinal, 1, 2, row, row + 1, AttachOptions.Fill, AttachOptions.Fill, padding, padding);

                //Format labels Title
                foreach (Label label in labelsTitle)
                {
                    label.ModifyFont(fontDescriptionTitle);
                    label.SetAlignment(1.0F, 0.5F);
                }
                //Format labels Value
                foreach (Label label in labelsValue)
                {
                    label.ModifyFont(fontDescriptionValue);
                    label.SetAlignment(1.0F, 0.5F);
                }

                //Final Pack
                HBox hbox = new HBox(false, 20);

                EventBox eventboxTax = new EventBox()
                {
                    VisibleWindow = debug
                };
                eventboxTax.ModifyBg(StateType.Normal, Utils.ColorToGdkColor(Color.LightGray));
                eventboxTax.Add(tableTax);
                EventBox eventboxTotal = new EventBox()
                {
                    VisibleWindow = debug
                };
                eventboxTotal.ModifyBg(StateType.Normal, Utils.ColorToGdkColor(Color.LightGray));
                eventboxTotal.Add(tableTotal);

                hbox.PackStart(eventboxTax, true, true, 0);
                hbox.PackStart(eventboxTotal, false, false, 0);

                EventBox eventbox = new EventBox()
                {
                    VisibleWindow = debug, BorderWidth = padding
                };
                eventbox.ModifyBg(StateType.Normal, Utils.ColorToGdkColor(Color.LightCoral));
                eventbox.Add(hbox);

                _alignmentWindow = new Alignment(0.5f, 0.5f, 0.5f, 0.5f);
                _alignmentWindow.Add(eventbox);
            }
            catch (Exception ex)
            {
                _log.Error(ex.Message, ex);
            }
        }
Esempio n. 31
0
        private void ShowCalendar()
        {
            popup        = new Window(WindowType.Popup);
            popup.Screen = this.Screen;

            Frame frame = new Frame();

            frame.Shadow = ShadowType.Out;
            frame.Show();

            popup.Add(frame);

            VBox box = new VBox(false, 0);

            box.Show();
            frame.Add(box);

            cal = new Calendar();
            cal.DisplayOptions = CalendarDisplayOptions.ShowHeading
                                 | CalendarDisplayOptions.ShowDayNames
                                 | CalendarDisplayOptions.ShowWeekNumbers;

            cal.KeyPressEvent      += OnCalendarKeyPressed;
            popup.ButtonPressEvent += OnButtonPressed;

            cal.Show();

            Alignment calAlignment = new Alignment(0.0f, 0.0f, 1.0f, 1.0f);

            calAlignment.Show();
            calAlignment.SetPadding(4, 4, 4, 4);
            calAlignment.Add(cal);

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

            Requisition req = SizeRequest();
            int         x = 0, y = 0;

            GdkWindow.GetOrigin(out x, out y);
            popup.Move(x + Allocation.X, y + Allocation.Y + req.Height + 3);
            popup.Show();
            popup.GrabFocus();

            Grab.Add(popup);

            Gdk.GrabStatus grabbed = Gdk.Pointer.Grab(popup.GdkWindow, true,
                                                      Gdk.EventMask.ButtonPressMask
                                                      | Gdk.EventMask.ButtonReleaseMask
                                                      | Gdk.EventMask.PointerMotionMask, null, null, CURRENT_TIME);

            if (grabbed == Gdk.GrabStatus.Success)
            {
                grabbed = Gdk.Keyboard.Grab(popup.GdkWindow,
                                            true, CURRENT_TIME);

                if (grabbed != Gdk.GrabStatus.Success)
                {
                    Grab.Remove(popup);
                    popup.Destroy();
                    popup = null;
                }
            }
            else
            {
                Grab.Remove(popup);
                popup.Destroy();
                popup = null;
            }

            cal.DaySelectedDoubleClick += OnCalendarDaySelected;
            cal.ButtonPressEvent       += OnCalendarButtonPressed;

            cal.Date = date;
        }
Esempio n. 32
0
        public UserBrowserPage()
        {
            // Create the files tree
            filesList = new TreeView();
            filesList.RowActivated     += on_filesList_row_activated;
            filesList.ButtonPressEvent += filesList_ButtonPressEvent;

            // Create the navigation bar
            Alignment navigationBarAlignment = new Alignment(0, 0, 1, 1);

            navigationBarAlignment.TopPadding    = 3;
            navigationBarAlignment.BottomPadding = 3;
            navigationBar = new NavigationBar();
            navigationBar.PathButtonClicked += on_navigationBar_PathButtonClicked;
            navigationBarAlignment.Add(navigationBar);
            base.PackStart(navigationBarAlignment, false, false, 0);
            navigationBarAlignment.ShowAll();

            // Load some images
            stockDirectoryPixbuf = Gui.LoadIcon(16, "folder");
            stockFilePixbuf      = Gui.LoadIcon(16, "text-x-generic");
            networkIcon          = Gui.LoadIcon(16, "stock_internet");

            // Set up the file list
            filesList.Selection.Changed += filesList_Selection_Changed;
            filesList.Selection.Mode     = SelectionMode.Browse;

            /*
             * filesList.Selection.Mode = SelectionMode.Multiple;
             * filesList.RubberBanding = true;
             */

            filesListStore  = new ListStore(typeof(IDirectoryItem));
            filesList.Model = filesListStore;

            TreeViewColumn column;

            // Add Name column
            column           = new TreeViewColumn();
            column.Title     = "Name";
            column.Resizable = true;

            Gtk.CellRendererPixbuf fileListRowIcon = new Gtk.CellRendererPixbuf();
            column.PackStart(fileListRowIcon, false);
            column.SetCellDataFunc(fileListRowIcon, new TreeCellDataFunc(FileNameIconFunc));

            Gtk.CellRendererText fileListRowText = new Gtk.CellRendererText();
            column.PackStart(fileListRowText, true);
            column.SetCellDataFunc(fileListRowText, new TreeCellDataFunc(FileNameTextFunc));

            filesList.AppendColumn(column);

            // Add Size Column
            column           = filesList.AppendColumn("Size", new CellRendererText(), new TreeCellDataFunc(FileSizeFunc));
            column.Resizable = true;

            // Add Type Column
            column           = filesList.AppendColumn("Type", new CellRendererText(), new TreeCellDataFunc(FileTypeFunc));
            column.Resizable = true;

            // Add InfoHash Column
            column           = filesList.AppendColumn("Info Hash", new CellRendererText(), new TreeCellDataFunc(FileInfoHashFunc));
            column.Resizable = true;

            base.PackStart(Gui.AddScrolledWindow(filesList), true, true, 0);
            filesList.ShowAll();

            waitingBoxAlignment = new Alignment(0.5f, 0.5f, 0, 0);
            VBox waitingBox = new VBox();

            waitProgressBar = new ProgressBar();
            waitLabel       = new Label();
            waitingBox.PackStart(waitProgressBar, false, false, 0);
            waitingBox.PackStart(waitLabel, false, false, 0);
            waitingBoxAlignment.Add(waitingBox);
            this.PackStart(waitingBoxAlignment, true, true, 0);

            Core.NetworkAdded += Core_NetworkAdded;
            foreach (Network network in Core.Networks)
            {
                Core_NetworkAdded(network);
            }

            resultPopupMenu = new Menu();

            ImageMenuItem item = new ImageMenuItem("Download");

            item.Image      = new Image(Gui.LoadIcon(16, "go-down"));
            item.Activated += on_mnuFileDownload_activate;
            resultPopupMenu.Append(item);

            item            = new ImageMenuItem(Gtk.Stock.Properties, null);
            item.Activated += filePropertiesMenuItem_Activated;
            resultPopupMenu.Append(item);

            NavigateTo("/");
        }
Esempio n. 33
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;
            }
        }
Esempio n. 34
0
        /// <summary>
        /// Default constructor.
        /// </summary>
        public AzureCredentialsSetup() : base("Azure Batch and Storage Account Information")
        {
            WidthRequest = 500;
            // initialise input fields with the last values used
            batchAccountInput   = new Entry();
            batchUrlInput       = new Entry();
            batchKeyInput       = new Entry();
            storageAccountInput = new Entry();
            storageKeyInput     = new Entry();
            emailSenderInput    = new Entry();
            emailPWInput        = new Entry();

            try
            {
                PopulateInputs();
            }
            catch
            {
            }

            btnLoad          = new Button("Load from File");
            btnLoad.Clicked += LoadCredentialsFromFile;

            btnSave          = new Button("Save");
            btnSave.Clicked += SaveCredentials;

            btnHelp          = new Button("Help");
            btnHelp.Clicked += ProvideHelp;

            HBox buttonContainer = new HBox();

            buttonContainer.PackStart(btnLoad, false, false, 0);
            buttonContainer.PackStart(btnHelp, false, false, 0);
            buttonContainer.PackEnd(btnSave, false, false, 0);

#if NETFRAMEWORK
            Table primaryContainer = new Table(10, 2, false);
#else
            Grid primaryContainer = new Grid();
#endif

            primaryContainer.Attach(new Label("Batch Account:")
            {
                Xalign = 0
            }, 0, 1, 0, 1, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);
            primaryContainer.Attach(batchAccountInput, 1, 2, 0, 1, (AttachOptions.Fill | AttachOptions.Expand), AttachOptions.Shrink, 0, 0);

            primaryContainer.Attach(new Label("Batch URL:")
            {
                Xalign = 0
            }, 0, 1, 1, 2, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);
            primaryContainer.Attach(batchUrlInput, 1, 2, 1, 2, (AttachOptions.Fill | AttachOptions.Expand), AttachOptions.Shrink, 0, 0);

            primaryContainer.Attach(new Label("Batch Key:")
            {
                Xalign = 0
            }, 0, 1, 2, 3, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);
            primaryContainer.Attach(batchKeyInput, 1, 2, 2, 3, (AttachOptions.Fill | AttachOptions.Expand), AttachOptions.Shrink, 0, 0);

            primaryContainer.Attach(new Label("Storage Account:")
            {
                Xalign = 0
            }, 0, 1, 3, 4, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);
            primaryContainer.Attach(storageAccountInput, 1, 2, 3, 4, (AttachOptions.Fill | AttachOptions.Expand), AttachOptions.Shrink, 0, 0);

            primaryContainer.Attach(new Label("Storage Key:")
            {
                Xalign = 0
            }, 0, 1, 4, 5, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);
            primaryContainer.Attach(storageKeyInput, 1, 2, 4, 5, (AttachOptions.Fill | AttachOptions.Expand), AttachOptions.Shrink, 0, 0);

            primaryContainer.Attach(new Label(""), 0, 2, 5, 6, (AttachOptions.Fill | AttachOptions.Expand), AttachOptions.Shrink, 0, 0);

            primaryContainer.Attach(new Label("Email Address:")
            {
                Xalign = 0
            }, 0, 1, 6, 7, AttachOptions.Fill, AttachOptions.Shrink, 0, 0);
            primaryContainer.Attach(emailSenderInput, 1, 2, 6, 7, (AttachOptions.Fill | AttachOptions.Expand), AttachOptions.Shrink, 0, 0);

            primaryContainer.Attach(new Label("Email Password:"******""), 0, 2, 8, 9, (AttachOptions.Fill | AttachOptions.Expand), AttachOptions.Shrink, 0, 0);

            primaryContainer.Attach(buttonContainer, 0, 2, 9, 10, (AttachOptions.Fill | AttachOptions.Expand), AttachOptions.Shrink, 0, 0);

            Alignment adj = new Alignment(0f, 0f, 1f, 0f); // 3rd argument is 1 to make the controls to scale (horizontally) with viewport size
            adj.LeftPadding = adj.RightPadding = adj.TopPadding = adj.BottomPadding = 15;
            adj.Add(primaryContainer);
            Add(adj);

            WindowPosition = WindowPosition.Center;

            ShowAll();
        }
Esempio n. 35
0
        /// <summary>
        /// Constructor
        /// </summary>
        public UpgradeView(ViewBase owner) : base(owner)
        {
            Builder builder = BuilderFromResource("ApsimNG.Resources.Glade.UpgradeView.glade");

            window1         = (Window)builder.GetObject("window1");
            button1         = (Button)builder.GetObject("button1");
            button2         = (Button)builder.GetObject("button2");
            table1          = (Table)builder.GetObject("table1");
            table2          = (Table)builder.GetObject("table2");
            firstNameBox    = (Entry)builder.GetObject("firstNameBox");
            lastNameBox     = (Entry)builder.GetObject("lastNameBox");
            organisationBox = (Entry)builder.GetObject("organisationBox");
            emailBox        = (Entry)builder.GetObject("emailBox");
            countryBox      = (ComboBox)builder.GetObject("countryBox");
            label1          = (Label)builder.GetObject("label1");
            htmlAlign       = (Alignment)builder.GetObject("HTMLalign");
            checkbutton1    = (CheckButton)builder.GetObject("checkbutton1");
            listview1       = (Gtk.TreeView)builder.GetObject("listview1");
            alignment7      = (Alignment)builder.GetObject("alignment7");
            oldVersions     = (CheckButton)builder.GetObject("checkbutton2");
            listview1.Model = listmodel;

            CellRendererText textRender = new Gtk.CellRendererText();

            textRender.Editable = false;

            TreeViewColumn column0 = new TreeViewColumn("Version", textRender, "text", 0);

            listview1.AppendColumn(column0);
            column0.Sizing    = TreeViewColumnSizing.Autosize;
            column0.Resizable = true;

            TreeViewColumn column1 = new TreeViewColumn("Description", textRender, "text", 1);

            listview1.AppendColumn(column1);
            column1.Sizing    = TreeViewColumnSizing.Autosize;
            column1.Resizable = true;

            // Populate the combo box with a list of valid country names.
            ListStore countries = new ListStore(typeof(string));

            foreach (string country in Constants.Countries)
            {
                countries.AppendValues(country);
            }
            countryBox.Model = countries;

            // Add a cell renderer to the combo box.
            CellRendererText cell = new CellRendererText();

            countryBox.PackStart(cell, false);
            countryBox.AddAttribute(cell, "text", 0);

            // Make the tab order a little more sensible than the defaults
            table1.FocusChain = new Widget[] { alignment7, button1, button2 };
            table2.FocusChain = new Widget[] { firstNameBox, lastNameBox, emailBox, organisationBox, countryBox };

            htmlView = new HTMLView(new ViewBase(null));
            htmlAlign.Add(htmlView.MainWidget);
            tabbedExplorerView   = owner as IMainView;
            window1.TransientFor = owner.MainWidget.Toplevel as Window;
            window1.Modal        = true;
            oldVersions.Toggled += OnShowOldVersionsToggled;
            button1.Clicked     += OnUpgrade;
            button2.Clicked     += OnViewMoreDetail;
            window1.Destroyed   += OnFormClosing;
            window1.MapEvent    += OnShown;
        }
Esempio n. 36
0
        public void UpdateTab()
        {
            if (Child != null)
            {
                Widget w = Child;
                Remove(w);
                w.Destroy();
            }

            mainBox = new Alignment(0, 0, 1, 1);
            if (bar.Orientation == Gtk.Orientation.Horizontal)
            {
                box = new HBox();
                mainBox.LeftPadding = mainBox.RightPadding = 2;
            }
            else
            {
                box = new VBox();
                mainBox.TopPadding = mainBox.BottomPadding = 2;
            }

            Gtk.Widget customLabel = null;
            if (it.DockLabelProvider != null)
            {
                customLabel = it.DockLabelProvider.CreateLabel(bar.Orientation);
            }

            if (customLabel != null)
            {
                customLabel.ShowAll();
                box.PackStart(customLabel, true, true, 0);
            }
            else
            {
                if (it.Icon != null)
                {
                    box.PackStart(new Gtk.Image(it.Icon), false, false, 0);
                }

                if (!string.IsNullOrEmpty(it.Label))
                {
                    label           = new Gtk.Label(it.Label);
                    label.UseMarkup = true;
                    if (bar.Orientation == Gtk.Orientation.Vertical)
                    {
                        label.Angle = 270;
                    }
                    box.PackStart(label, true, true, 0);
                }
                else
                {
                    label = null;
                }
            }

            box.BorderWidth = 2;
            box.Spacing     = 2;
            mainBox.Add(box);
            mainBox.ShowAll();
            Add(mainBox);
            SetNormalColor();
        }
Esempio n. 37
0
 protected virtual void Build()
 {
     // Widget BizeeBirdBoarding.Ui.MainWindow
     Name           = "BizeeBirdBoarding.Ui.MainWindow";
     Title          = "BiZee Bird Boarding";
     WindowPosition = WindowPosition.CenterOnParent;
     DefaultWidth   = 1115;
     DefaultHeight  = 480;
     // Container child BizeeBirdBoarding.Ui.MainWindow.Container+ContainerChild
     topLevelVbox         = new VBox();
     topLevelVbox.Name    = "topLevelVbox";
     topLevelVbox.Spacing = 6;
     // Container child topLevelVbox.Box+BoxChild
     toolbarButtonBox             = new HButtonBox();
     toolbarButtonBox.Name        = "toolbarButtonBox";
     toolbarButtonBox.LayoutStyle = ButtonBoxStyle.Start;
     // Container child toolbarButtonBox.ButtonBox+ButtonBoxChild
     button1              = new Button();
     button1.CanFocus     = true;
     button1.Name         = "button1";
     button1.UseUnderline = true;
     button1.Label        = "New Customer";
     toolbarButtonBox.Add(button1);
     ButtonBox.ButtonBoxChild w1 = (ButtonBox.ButtonBoxChild)toolbarButtonBox[button1];
     w1.Expand = false;
     w1.Fill   = false;
     // Container child toolbarButtonBox.ButtonBox+ButtonBoxChild
     button2              = new Button();
     button2.CanFocus     = true;
     button2.Name         = "button2";
     button2.UseUnderline = true;
     button2.Label        = "New Appointment";
     toolbarButtonBox.Add(button2);
     ButtonBox.ButtonBoxChild w2 = (ButtonBox.ButtonBoxChild)toolbarButtonBox[button2];
     w2.Position = 1;
     w2.Expand   = false;
     w2.Fill     = false;
     topLevelVbox.Add(toolbarButtonBox);
     Box.BoxChild w3 = ((Box.BoxChild)(topLevelVbox[toolbarButtonBox]));
     w3.Position = 0;
     w3.Expand   = false;
     w3.Fill     = false;
     // Container child topLevelVbox.Box+BoxChild
     notebook             = new Notebook();
     notebook.CanFocus    = true;
     notebook.Name        = "notebook";
     notebook.CurrentPage = 0;
     // Container child notebook.Notebook+NotebookChild
     appointmentsTabHPaned      = new HPaned();
     appointmentsTabHPaned.Name = "appointmentsTabHPaned";
     // Container child appointmentsTabHPaned.Paned+PanedChild
     upcomingDropOffsFrame = new Frame();
     upcomingDropOffsFrame.WidthRequest = 450;
     upcomingDropOffsFrame.Name         = "upcomingDropOffsFrame";
     upcomingDropOffsFrame.ShadowType   = ShadowType.In;
     // Container child upcomingDropOffsFrame.Container+ContainerChild
     upcomingDropOffsGtkAlignment             = new Alignment(0F, 0F, 1F, 1F);
     upcomingDropOffsGtkAlignment.Name        = "upcomingDropOffsGtkAlignment";
     upcomingDropOffsGtkAlignment.LeftPadding = 12;
     // Container child upcomingDropOffsGtkAlignment.Container+ContainerChild
     upcomingDropOffsGtkScrolledWindow            = new ScrolledWindow();
     upcomingDropOffsGtkScrolledWindow.Name       = "upcomingDropOffsGtkScrolledWindow";
     upcomingDropOffsGtkScrolledWindow.ShadowType = ShadowType.In;
     // Container child upcomingDropOffsGtkScrolledWindow.Container+ContainerChild
     upcomingDropOffsTreeView          = new TreeView();
     upcomingDropOffsTreeView.CanFocus = true;
     upcomingDropOffsTreeView.Name     = "upcomingDropOffsTreeView";
     upcomingDropOffsGtkScrolledWindow.Add(upcomingDropOffsTreeView);
     upcomingDropOffsGtkAlignment.Add(upcomingDropOffsGtkScrolledWindow);
     upcomingDropOffsFrame.Add(upcomingDropOffsGtkAlignment);
     upcomingDropOffsLabel             = new Label();
     upcomingDropOffsLabel.Name        = "upcomingDropOffsLabel";
     upcomingDropOffsLabel.LabelProp   = "<b>Upcoming Drop Offs</b>";
     upcomingDropOffsLabel.UseMarkup   = true;
     upcomingDropOffsFrame.LabelWidget = upcomingDropOffsLabel;
     appointmentsTabHPaned.Add(upcomingDropOffsFrame);
     Paned.PanedChild w7 = (Paned.PanedChild)appointmentsTabHPaned[upcomingDropOffsFrame];
     w7.Resize = false;
     // Container child appointmentsTabHPaned.Paned+PanedChild
     upcomingPickupsFrame            = new Frame();
     upcomingPickupsFrame.Name       = "upcomingPickupsFrame";
     upcomingPickupsFrame.ShadowType = ShadowType.In;
     // Container child upcomingPickupsFrame.Container+ContainerChild
     upcomingPickupsAlignment             = new Alignment(0F, 0F, 1F, 1F);
     upcomingPickupsAlignment.Name        = "upcomingPickupsAlignment";
     upcomingPickupsAlignment.LeftPadding = 12;
     // Container child upcomingPickupsAlignment.Container+ContainerChild
     upcomingPickupsScrolledWindow            = new ScrolledWindow();
     upcomingPickupsScrolledWindow.Name       = "upcomingPickupsScrolledWindow";
     upcomingPickupsScrolledWindow.ShadowType = ShadowType.In;
     // Container child upcomingPickupsScrolledWindow.Container+ContainerChild
     upcomingPickupsTreeview          = new TreeView();
     upcomingPickupsTreeview.CanFocus = true;
     upcomingPickupsTreeview.Name     = "upcomingPickupsTreeview";
     upcomingPickupsScrolledWindow.Add(upcomingPickupsTreeview);
     upcomingPickupsAlignment.Add(upcomingPickupsScrolledWindow);
     upcomingPickupsFrame.Add(upcomingPickupsAlignment);
     upcomingPickupsLabel             = new Label();
     upcomingPickupsLabel.Name        = "upcomingPickupsLabel";
     upcomingPickupsLabel.LabelProp   = "<b>Upcoming Pickups</b>";
     upcomingPickupsLabel.UseMarkup   = true;
     upcomingPickupsFrame.LabelWidget = upcomingPickupsLabel;
     appointmentsTabHPaned.Add(upcomingPickupsFrame);
     notebook.Add(appointmentsTabHPaned);
     // Notebook tab
     appointmentsTabLabel           = new Label();
     appointmentsTabLabel.Name      = "appointmentsTabLabel";
     appointmentsTabLabel.LabelProp = "Appointments";
     notebook.SetTabLabel(appointmentsTabHPaned, appointmentsTabLabel);
     appointmentsTabLabel.ShowAll();
     // Container child notebook.Notebook+NotebookChild
     customerTabVbox         = new VBox();
     customerTabVbox.Name    = "customerTabVbox";
     customerTabVbox.Spacing = 6;
     // Container child customerTabVbox.Box+BoxChild
     hbox1         = new HBox();
     hbox1.Name    = "hbox1";
     hbox1.Spacing = 6;
     // Container child hbox1.Box+BoxChild
     customerSearchLabel           = new Label();
     customerSearchLabel.Name      = "customerSearchLabel";
     customerSearchLabel.LabelProp = "Search";
     hbox1.Add(customerSearchLabel);
     Box.BoxChild w13 = (Box.BoxChild)hbox1[customerSearchLabel];
     w13.Position = 0;
     w13.Expand   = false;
     w13.Fill     = false;
     // Container child hbox1.Box+BoxChild
     customerSearchEntry            = new Entry();
     customerSearchEntry.CanFocus   = true;
     customerSearchEntry.Name       = "customerSearchEntry";
     customerSearchEntry.IsEditable = true;
     hbox1.Add(customerSearchEntry);
     Box.BoxChild w14 = (Box.BoxChild)hbox1[customerSearchEntry];
     w14.Position = 1;
     customerTabVbox.Add(hbox1);
     Box.BoxChild w15 = (Box.BoxChild)customerTabVbox[hbox1];
     w15.Position = 0;
     w15.Expand   = false;
     w15.Fill     = false;
     // Container child customerTabVbox.Box+BoxChild
     customersScrolledWindow            = new ScrolledWindow();
     customersScrolledWindow.Name       = "customersScrolledWindow";
     customersScrolledWindow.ShadowType = ShadowType.In;
     // Container child customersScrolledWindow.Container+ContainerChild
     customersTreeview          = new TreeView();
     customersTreeview.CanFocus = true;
     customersTreeview.Name     = "customersTreeview";
     customersScrolledWindow.Add(customersTreeview);
     customerTabVbox.Add(customersScrolledWindow);
     Box.BoxChild w17 = (Box.BoxChild)customerTabVbox[customersScrolledWindow];
     w17.Position = 1;
     notebook.Add(customerTabVbox);
     Notebook.NotebookChild w18 = (Notebook.NotebookChild)notebook[customerTabVbox];
     w18.Position = 1;
     // Notebook tab
     customerTabLabel           = new Label();
     customerTabLabel.Name      = "customerTabLabel";
     customerTabLabel.LabelProp = "Customers";
     notebook.SetTabLabel(customerTabVbox, customerTabLabel);
     customerTabLabel.ShowAll();
     // Container child notebook.Notebook+NotebookChild
     historyTablVbox         = new VBox();
     historyTablVbox.Name    = "historyTablVbox";
     historyTablVbox.Spacing = 6;
     // Container child historyTablVbox.Box+BoxChild
     historySearchHbox         = new HBox();
     historySearchHbox.Name    = "historySearchHbox";
     historySearchHbox.Spacing = 6;
     // Container child historySearchHbox.Box+BoxChild
     historySearchLabel           = new Label();
     historySearchLabel.Name      = "historySearchLabel";
     historySearchLabel.LabelProp = "Search";
     historySearchHbox.Add(historySearchLabel);
     Box.BoxChild w19 = (Box.BoxChild)historySearchHbox[historySearchLabel];
     w19.Position = 0;
     w19.Expand   = false;
     w19.Fill     = false;
     // Container child historySearchHbox.Box+BoxChild
     historySearchEntry            = new Entry();
     historySearchEntry.CanFocus   = true;
     historySearchEntry.Name       = "historySearchEntry";
     historySearchEntry.IsEditable = true;
     historySearchHbox.Add(historySearchEntry);
     Box.BoxChild w20 = (Box.BoxChild)historySearchHbox[historySearchEntry];
     w20.Position = 1;
     historyTablVbox.Add(historySearchHbox);
     Box.BoxChild w21 = (Box.BoxChild)historyTablVbox[historySearchHbox];
     w21.Position = 0;
     w21.Expand   = false;
     w21.Fill     = false;
     // Container child historyTablVbox.Box+BoxChild
     historyScrolledWindow            = new ScrolledWindow();
     historyScrolledWindow.Name       = "historyScrolledWindow";
     historyScrolledWindow.ShadowType = ShadowType.In;
     // Container child historyScrolledWindow.Container+ContainerChild
     historyTreeview          = new TreeView();
     historyTreeview.CanFocus = true;
     historyTreeview.Name     = "historyTreeview";
     historyScrolledWindow.Add(historyTreeview);
     historyTablVbox.Add(historyScrolledWindow);
     Box.BoxChild w23 = (Box.BoxChild)historyTablVbox[historyScrolledWindow];
     w23.Position = 1;
     notebook.Add(historyTablVbox);
     Notebook.NotebookChild w24 = (Notebook.NotebookChild)notebook[historyTablVbox];
     w24.Position = 2;
     // Notebook tab
     historyTabLabel           = new Label();
     historyTabLabel.Name      = "historyTabLabel";
     historyTabLabel.LabelProp = "History";
     notebook.SetTabLabel(historyTablVbox, historyTabLabel);
     historyTabLabel.ShowAll();
     topLevelVbox.Add(notebook);
     Box.BoxChild w25 = (Box.BoxChild)topLevelVbox[notebook];
     w25.Position = 1;
     Add(topLevelVbox);
     if ((Child != null))
     {
         Child.ShowAll();
     }
     Show();
     DeleteEvent     += new DeleteEventHandler(OnDeleteEvent);
     button1.Clicked += new System.EventHandler(onNewCustomerClicked);
     button2.Clicked += new System.EventHandler(onNewApointmentButtonClicked);
     upcomingDropOffsTreeView.RowActivated += new RowActivatedHandler(onUpcomingDropOffsRowActivated);
     upcomingPickupsTreeview.RowActivated  += new RowActivatedHandler(onUpcomingPickupsRowActivated);
     customerSearchEntry.Changed           += new System.EventHandler(onCustomerSearchEntryChanged);
     customersTreeview.RowActivated        += new RowActivatedHandler(onCustomersRowActivated);
     historySearchEntry.Changed            += new System.EventHandler(onHistorySearchEntryChanged);
     historyTreeview.RowActivated          += new RowActivatedHandler(onHistoryRowActivated);
 }
Esempio n. 38
0
 public void SetImage(Image img)
 {
     algIcon.DestroyChild();
     img.Show();
     algIcon.Add(img);
 }
Esempio n. 39
0
            public GameEditor(GameViewer viewer)
                : base(Catalog.
								    GetString
								    ("Rating"))
            {
                this.viewer = viewer;
                viewer.ChessGameWidget.GameLoadedEvent +=
                    OnGameLoaded;
                combo = new ComboBox (new string[]
                              {
                              Catalog.
                              GetString
                              ("Not interested"),
                              Catalog.
                              GetString
                              ("Average Game"),
                              Catalog.
                              GetString ("Good Game"),
                              Catalog.
                              GetString
                              ("Excellent Game"),
                              Catalog.
                              GetString ("Must Have")}
                );
                save = new Button (Stock.Save);
                save.Sensitive = false;
                save.Clicked += OnSave;
                combo.Changed +=
                    delegate (object o, EventArgs args)
                {
                    save.Sensitive = true;
                };

                ratings = new GameRating[]
                {
                GameRating.Ignore,
                        GameRating.Average,
                        GameRating.Good,
                        GameRating.Excellent,
                        GameRating.MustHave};
                tagsStore = new ListStore (typeof (string));
                tagsCombo = new ComboBoxEntry (tagsStore, 0);
                tagsCombo.Entry.Activated +=
                    OnTagsComboActivated;

                Table table = new Table (3, 2, false);
                table.RowSpacing = 2;
                table.ColumnSpacing = 2;
                uint row = 0, col = 0;
                Label label =
                    new Label (Catalog.
                           GetString ("My Rating"));
                label.Xalign = 0;
                label.Yalign = 0;
                table.Attach (label, col, col + 1, row,
                          row + 1);
                col++;
                table.Attach (combo, col, col + 1, row,
                          row + 1);

                label = new Label (Catalog.
                           GetString ("Tags"));
                label.Xalign = 0;
                label.Yalign = 0;
                col = 0;
                row++;
                table.Attach (label, col, col + 1, row,
                          row + 1);
                col++;
                table.Attach (tagsCombo, col, col + 1, row,
                          row + 1);

                col = 1;
                row++;
                Alignment align = new Alignment (1, 0, 0, 0);
                align.Add (save);
                table.Attach (align, col, col + 1, row,
                          row + 1);

                Add (table);

                ShowAll ();
            }
            private VBox GetRightPane()
            {
                VBox vbox = new VBox ();

                // labels
                moveNumberLabel = new Label ();
                nagCommentLabel = new Label ();
                nagCommentLabel.Xalign = 0;
                HBox hbox = new HBox ();
                hbox.PackStart (moveNumberLabel, false, false,
                        2);
                hbox.PackStart (nagCommentLabel, false, false,
                        2);

                vbox.PackStart (hbox, false, false, 2);

                // board
                chessGameDetailsBox = new VBox ();
                chessGameDetailsBox.PackStart (gameView,
                                   true, true, 4);

                vbox.PackStart (chessGameDetailsBox, true,
                        true, 2);

                // buttons
                firstButton = new Button ();
                firstButton.Clicked += on_first_clicked;
                firstButton.Image =
                    new Image (Stock.GotoFirst,
                           IconSize.Button);
                prevButton = new Button ();
                prevButton.Clicked += on_prev_clicked;
                prevButton.Image =
                    new Image (Stock.GoBack,
                           IconSize.Button);
                nextButton = new Button ();
                nextButton.Clicked += on_next_clicked;
                nextButton.Image =
                    new Image (Stock.GoForward,
                           IconSize.Button);
                lastButton = new Button ();
                lastButton.Clicked += on_last_clicked;
                lastButton.Image =
                    new Image (Stock.GotoLast,
                           IconSize.Button);

                HBox bbox = new HBox ();
                bbox.PackStart (firstButton, false, false, 1);
                bbox.PackStart (prevButton, false, false, 1);
                bbox.PackStart (nextButton, false, false, 1);
                bbox.PackStart (lastButton, false, false, 1);
                Alignment alignment =
                    new Alignment (0.5f, 1, 0, 0);
                alignment.Add (bbox);
                alignment.Show ();

                vbox.PackStart (alignment, false, false, 2);

                return vbox;
            }