コード例 #1
0
ファイル: AddLevelWindow.cs プロジェクト: tomlangan/VRTD
        public AddLevelWindow(Window parent) :
            base(WindowType.Toplevel)
        {
            Parent = parent;
            Modal  = true;

            SetDefaultSize(200, 50);
            SetPosition(WindowPosition.Center);

            /* Set a handler for delete_event that immediately
             * exits GTK. */
            DeleteEvent += delete_event;


            /* Create a 2x2 table */
            HBox layout = new HBox(false, 30);

            /* Put the table in the main window */
            Add(layout);

            Label NameLabel = new Label("Level Name");

            layout.Add(NameLabel);
            NameLabel.Show();


            NameInput = new Entry();
            NameInput.WidthRequest = 200;
            layout.Add(NameInput);
            NameInput.Show();

            Button cancelButton = new Button("Cancel");

            cancelButton.Clicked     += CancelButton_Clicked;
            cancelButton.WidthRequest = 50;
            layout.Add(cancelButton);
            cancelButton.Show();

            Button doneButton = new Button("Done");

            doneButton.Clicked     += DoneButton_Clicked;
            doneButton.WidthRequest = 50;
            layout.Add(doneButton);
            doneButton.Show();

            layout.Show();
            ShowAll();
        }
コード例 #2
0
        void Build()
        {
            Title         = GettextCatalog.GetString("Exception Caught");
            DefaultHeight = 500;
            DefaultWidth  = 600;
            VBox.Spacing  = 0;

            VBox.PackStart(CreateExceptionHeader(), false, true, 0);

            var paned = new VPaned();

            paned.Add1(CreateExceptionValueTreeView());
            paned.Add2(CreateStackTraceTreeView());
            paned.Show();

            var vbox = new VBox(false, 0);

            vbox.PackStart(CreateSeparator(), false, true, 0);
            vbox.PackStart(paned, true, true, 0);
            vbox.PackStart(CreateSeparator(), false, true, 0);
            vbox.Show();

            VBox.PackStart(vbox, true, true, 0);

            var actionArea = new HBox(false, 12)
            {
                BorderWidth = 6
            };

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

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

            alignment.Show();

            actionArea.PackStart(alignment, true, true, 0);
            actionArea.PackStart(CreateButtonBox(), false, true, 0);
            actionArea.Show();

            VBox.PackStart(actionArea, false, true, 0);
            ActionArea.Hide();
        }
コード例 #3
0
ファイル: PropertyDialog.cs プロジェクト: LesCol/FamiStudio
        public PropertyDialog(System.Drawing.Point pt, int width, bool leftAlign = false) : base(WindowType.Toplevel)
        {
            var hbox = 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;

            hbox.PackStart(buttonYes, false, false, 0);
            hbox.PackStart(buttonNo, false, false, 0);
            hbox.Show();

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

            align.TopPadding = 5;
            align.Show();
            align.Add(hbox);

            var vbox = new VBox();

            vbox.PackStart(propertyPage, false, false, 0);
            vbox.PackStart(align, false, false, 0);
            vbox.Show();

            Add(vbox);

            propertyPage.PropertyWantsClose += propertyPage_PropertyWantsClose;
            propertyPage.Show();

            BorderWidth  = 5;
            Resizable    = false;
            Decorated    = false;
            KeepAbove    = true;
            Modal        = true;
            WidthRequest = width;

            if (leftAlign)
            {
                pt.X -= width;
            }

            Move(pt.X, pt.Y);
        }
コード例 #4
0
        private Gtk.Button StockButton(string stockid, string label)
        {
            Gtk.HBox button_contents = new HBox(false, 0);
            button_contents.Show();
            Gtk.Widget button_image = new Gtk.Image(stockid, Gtk.IconSize.Button);
            button_image.Show();
            button_contents.PackStart(button_image, false, false, 1);
            Gtk.Label button_label = new Gtk.Label(label);
            button_label.Show();
            button_contents.PackStart(button_label, false, false, 1);

            Gtk.Button button = new Gtk.Button();
            button.Add(button_contents);

            return(button);
        }
コード例 #5
0
        public GtkShellDocumentViewContainer()
        {
            rootTabsBox = new VBox();
            rootTabsBox.Accessible.SetShouldIgnore(true);

            bottomBarBox = new HBox(false, 0);
            bottomBarBox.Show();
            rootTabsBox.PackEnd(bottomBarBox, false, false, 0);

            tabstrip = new Tabstrip();
            tabstrip.Show();
            bottomBarBox.PackStart(tabstrip, true, true, 0);

            rootTabsBox.Show();
            Add(rootTabsBox);
        }
コード例 #6
0
ファイル: ModeButton.cs プロジェクト: siaf/custom-gtk-widgets
        public ModeButton()
        {
            this.Events |= EventMask.PointerMotionMask
                           | EventMask.ButtonPressMask
                           | EventMask.VisibilityNotifyMask;

            this.VisibilityNotifyEvent += delegate { this.QueueDraw(); };

            m_box             = new HBox(true, 6);
            m_box.BorderWidth = 6;
            this.Add(m_box);
            m_box.Show();

            m_button = new Button();
            m_box.PackStart(m_button, false, false, 0);
        }
コード例 #7
0
        public MessageBar() : base(0.0f, 0.5f, 1.0f, 0.0f)
        {
            win      = new Window(WindowType.Popup);
            win.Name = "gtk-tooltips";

            HBox shell_box = new HBox();

            shell_box.Spacing = 10;

            box         = new HBox();
            box.Spacing = 10;

            image = new AnimatedImage();
            try {
                image.Pixbuf      = Gtk.IconTheme.Default.LoadIcon("process-working", 22, IconLookupFlags.NoSvg);
                image.FrameHeight = 22;
                image.FrameWidth  = 22;
                Spinning          = false;
                image.Load();
            } catch {
            }

            label = new WrapLabel();
            label.Show();

            box.PackStart(image, false, false, 0);
            box.PackStart(label, true, true, 0);
            box.Show();

            button_box         = new HBox();
            button_box.Spacing = 3;

            close_button          = new Button(new Image(Stock.Close, IconSize.Menu));
            close_button.Relief   = ReliefStyle.None;
            close_button.Clicked += delegate { Hide(); };
            close_button.ShowAll();
            close_button.Hide();

            shell_box.PackStart(box, true, true, 0);
            shell_box.PackStart(button_box, false, false, 0);
            shell_box.PackStart(close_button, false, false, 0);
            shell_box.Show();

            Add(shell_box);

            BorderWidth = 3;
        }
コード例 #8
0
ファイル: LogicWidget.cs プロジェクト: f-spot/f-spot-xplat
        void Preview()
        {
            if (sepBox == null)
            {
                sepBox = new HBox();
                Widget sep = Root.SeparatorWidget();
                if (sep != null)
                {
                    sep.Show();
                    sepBox.PackStart(sep, false, false, 0);
                }
                rootBox.Add(sepBox);
            }

            help.Hide();
            sepBox.Show();
        }
コード例 #9
0
        private Widget CreateContentArea()
        {
            EventBox eb = new EventBox();

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

            HBox hbox = new HBox(false, 0);

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

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

            return(eb);
        }
コード例 #10
0
        Widget CreateExceptionHeader()
        {
            var icon = new ImageView(WarningIconPixbuf);

            icon.Show();

            var hbox = new HBox(false, 12)
            {
                BorderWidth = 12
            };

            hbox.PackStart(icon, false, true, 0);
            hbox.PackStart(CreateExceptionInfoHeader(), true, true, 0);
            hbox.Show();

            return(hbox);
        }
コード例 #11
0
        public NavigationBar() : base(new Adjustment(0, 0, 0, 0, 0, 0), new Adjustment(0, 0, 0, 0, 0, 0))
        {
            mainHBox         = new HBox();
            mainHBox.Spacing = 3;
            mainHBox.Show();
            base.Put(mainHBox, 0, 0);
            base.HeightRequest = 30;

            base.Hadjustment.StepIncrement = 10;

            mainHBox.SizeAllocated += mainHBox_SizeAllocated;

            base.ScrollEvent += base_ScrollEvent;

            homeIcon    = Gui.LoadIcon(16, "user-home");
            networkIcon = Gui.LoadIcon(16, "stock_internet");
        }
コード例 #12
0
        private void Init()
        {
            var hbox = new HBox(false, 0);

            var suffix = GLTheme.DialogScaling >= 2.0f ? "@2x" : "";

            buttonYes = new FlatButton(Gdk.Pixbuf.LoadFromResource($"FamiStudio.Resources.Yes{suffix}.png"));
            buttonNo  = new FlatButton(Gdk.Pixbuf.LoadFromResource($"FamiStudio.Resources.No{suffix}.png"));

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

            hbox.PackStart(buttonYes, false, false, 0);
            hbox.PackStart(buttonNo, false, false, 0);
            hbox.Show();

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

            align.TopPadding = 5;
            align.Show();
            align.Add(hbox);

            var vbox = new VBox();

            vbox.PackStart(propertyPage, false, false, 0);
            vbox.PackStart(align, false, false, 0);
            vbox.Show();

            Add(vbox);

            propertyPage.PropertyWantsClose += propertyPage_PropertyWantsClose;
            propertyPage.Show();

            BorderWidth     = 5;
            Resizable       = false;
            Decorated       = false;
            KeepAbove       = true;
            Modal           = true;
            SkipTaskbarHint = true;
#if FAMISTUDIO_LINUX
            TransientFor = FamiStudioForm.Instance;
#endif
        }
コード例 #13
0
        private HBox BuildLimitFooter()
        {
            HBox limitFooter = new HBox();

            limitFooter.Show();
            limitFooter.Spacing = 5;

            limitCheckBox = new CheckButton("Limit to");
            limitCheckBox.Show();
            limitCheckBox.Toggled += OnLimitCheckBoxToggled;
            limitFooter.PackStart(limitCheckBox, false, false, 0);

            limitEntry = new Entry("25");
            limitEntry.Show();
            limitEntry.SetSizeRequest(50, -1);
            limitFooter.PackStart(limitEntry, false, false, 0);

            limitComboBox = ComboBox.NewText();
            limitComboBox.Show();
            foreach (string criteria in model.LimitCriteria)
            {
                limitComboBox.AppendText(criteria);
            }
            limitComboBox.Active = 0;
            limitFooter.PackStart(limitComboBox, false, false, 0);

            Label orderLabel = new Label("selected by");

            orderLabel.Show();
            limitFooter.PackStart(orderLabel, false, false, 0);

            orderComboBox = ComboBox.NewText();
            orderComboBox.Show();
            foreach (string order in model.OrderCriteria)
            {
                orderComboBox.AppendText(order);
            }
            orderComboBox.Active = 0;
            limitFooter.PackStart(orderComboBox, false, false, 0);

            limitCheckBox.Active = false;
            OnLimitCheckBoxToggled(limitCheckBox, null);

            return(limitFooter);
        }
コード例 #14
0
 private HBox GetRow(int i)
 {
     if (i < rows.Count)
     {
         return(rows[i]);
     }
     else
     {
         var box = new HBox()
         {
             Spacing = HSpacing
         };
         rows.Add(box);
         PackStart(box, false, false, 0);
         box.Show();
         return(box);
     }
 }
コード例 #15
0
        public PanelButton()
        {
            button        = new PanelButtonWidget(this);
            button.Events = EventMask.AllEventsMask;
            //button.WidthRequest = 100;

            box = new HBox();
            button.Add(box);

            label           = new Gtk.Label();
            label.Ellipsize = Pango.EllipsizeMode.End;
            label.Halign    = Align.Start;
            box.PackEnd(label, true, true, 0);

            button.Show();
            label.Show();
            box.Show();
        }
コード例 #16
0
ファイル: MenuButton.cs プロジェクト: kozlov-d/QSProjects
        public MenuButton()
        {
            hbox = new HBox();

            Image = new Image();
            hbox.PackStart(Image, false, false, 1);
            Image.Show();

            this.titleLabel        = new Label();
            this.titleLabel.Xalign = 0;
            hbox.PackStart(this.titleLabel, true, true, 1);
            this.titleLabel.Show();

            this.arrow = new Arrow(ArrowType.Down, ShadowType.None);
            hbox.PackStart(arrow, false, false, 1);
            arrow.Show();

            this.Add(hbox);
            hbox.Show();
        }
コード例 #17
0
        public GtkShellDocumentViewContainerTabs()
        {
            rootTabsBox = new VBox();
            rootTabsBox.Accessible.SetShouldIgnore(true);

            var bottomBarBox = new HBox(false, 0);

            bottomBarBox.Show();
            rootTabsBox.PackEnd(bottomBarBox, false, false, 0);

            notebook = new EventBox();
            notebook.Show();
            rootTabsBox.PackStart(notebook, true, true, 0);

            tabstrip = new Tabstrip();
            //tabstrip.Show ();
            bottomBarBox.PackStart(tabstrip, true, true, 0);

            rootTabsBox.Show();
        }
コード例 #18
0
        protected static HBox BuildRangeBox(Widget a, Widget b)
        {
            HBox box = new HBox();

            box.Spacing = 5;
            a.Show();
            box.PackStart(a, true, true, 0);

            Label label = new Label(" to ");

            label.Show();
            box.PackStart(label, false, false, 0);

            b.Show();
            box.PackStart(b, true, true, 0);

            box.Show();

            return(box);
        }
コード例 #19
0
/*		private void OnStatusComboKeyPress (object sender, KeyPressEventArgs args)
 *              {
 *                      if (args.Event.Key == Gdk.Key.Return) {
 *                              if (PersonManager.Me != null) {
 *                                      Logger.Debug ("FIXME: Set \"my\" status to: {0}",
 *                                                      statusComboBoxEntry.ActiveText);
 *                                      PersonManager.Me.Presence.Message =
 *                                                      statusComboBoxEntry.ActiveText;
 *                              }
 *                      }
 *              }
 */
/*		private void OnStatusComboChanged (object sender, EventArgs args)
 *              {
 *                      Logger.Debug ("OnStatusComboChanged");
 *              }
 */
        private Widget CreateSidebarSearchEntry()
        {
            VBox vbox = new VBox(false, 0);

            Label l = new Label(
                string.Format("<span size=\"large\">{0}</span>",
                              Catalog.GetString("Filter")));

            l.UseMarkup = true;
            l.ModifyFg(StateType.Normal, this.Style.Base(StateType.Selected));
            l.Xalign = 0;
            l.Show();
            vbox.PackStart(l, false, false, 0);

            searchEntry = new Entry();
            searchEntry.SelectRegion(0, -1);
            searchEntry.CanFocus = true;
            searchEntry.Changed += OnSearchEntryChanged;
            searchEntry.Show();

            Image stopImage = new Image(Stock.Stop, Gtk.IconSize.Menu);

            stopImage.SetAlignment(0.5F, 0.0F);

            cancelSearchButton           = new Button(stopImage);
            cancelSearchButton.Relief    = ReliefStyle.None;
            cancelSearchButton.Sensitive = false;
            cancelSearchButton.Clicked  += OnCancelSearchButton;
            cancelSearchButton.Show();

            HBox searchHBox = new HBox(false, 4);

            searchHBox.PackStart(searchEntry, true, true, 0);
            searchHBox.PackStart(cancelSearchButton, false, false, 0);

            searchHBox.Show();
            vbox.PackStart(searchHBox, false, false, 0);

            return(vbox);
        }
コード例 #20
0
        public MenuButton(string label, Menu menu, ArrowType arrow_type) : base()
        {
            HBox hbox = new HBox();

            this.image = new Image();
            hbox.PackStart(this.image, false, false, 1);
            image.Show();

            this.label        = new Label(label);
            this.label.Xalign = 0;
            hbox.PackStart(this.label, true, true, 1);
            this.label.Show();

            this.arrow = new Arrow(arrow_type, ShadowType.None);
            hbox.PackStart(arrow, false, false, 1);
            arrow.Show();

            Menu = menu;

            this.Add(hbox);
            hbox.Show();
        }
コード例 #21
0
        public void InitializeTestRun(UnitTest test)
        {
            rootTest = test;
            results.Clear();

            testsToRun   = test.CountTestCases();
            error        = null;
            errorMessage = null;

            progressBar.Fraction = 0;
            progressBar.Text     = "";
            progressBar.Text     = "0 / " + testsToRun;
            testsRun             = 0;
            resultSummary        = new UnitTestResult();
            UpdateCounters();

            infoSep.Show();
            infoCurrent.Show();
            progressBar.Show();
            resultLabel.Hide();
            labels.Show();
            buttonStop.Sensitive = true;
            buttonRun.Sensitive  = false;

            if (failuresTreeView.IsRealized)
            {
                failuresTreeView.ScrollToPoint(0, 0);
            }

            failuresStore.Clear();
            outputView.Buffer.Clear();
            outIters.Clear();
            cancel  = false;
            Running = true;

            configuration = IdeApp.Workspace.ActiveConfigurationId;

            AddStartMessage();
        }
コード例 #22
0
        static void SetButtonIcon(Button button, string stockIcon)
        {
            Alignment alignment = new Alignment(0.5f, 0.5f, 0f, 0f);
            Label     label     = new Label(button.Label);
            HBox      hbox      = new HBox(false, 2);
            Image     image     = new Image();

            image.Pixbuf = Stetic.IconLoader.LoadIcon(button, stockIcon, IconSize.Button);
            image.Show();
            hbox.Add(image);

            label.Show();
            hbox.Add(label);

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

            button.Child.Destroy();

            alignment.Show();
            button.Add(alignment);
        }
コード例 #23
0
        public ColorEditor(object @object, PropertyInfo info) : base(@object, info)
        {
            HBox box = new HBox();

            box.Spacing = 6;
            box.Show();

            this.mColorButton = new ColorButton();
            this.mColorButton.Show();
            box.PackStart(this.mColorButton, false, true, 0);

            this.mAlphaScale = new HScale(0, 1, 0.0001);
            this.mAlphaScale.Show();
            box.PackStart(this.mAlphaScale, true, true, 0);

            this.Add(box);

            this.Revert();

            this.mColorButton.ColorSet    += this.OnDirtyAction;
            this.mAlphaScale.ValueChanged += this.OnDirtyAction;
        }
コード例 #24
0
    Widget MakeStringItem(BuildServices services, string prompt, MBString res)
    {
        HBox box = new HBox();

        box.Show();

        Label label = new Label(prompt);

        label.Show();
        label.Xalign = 1.0F;

        Entry entry = new Entry(res.Value);

        entry.Show();
        entry.Data[result_key]   = res;
        entry.Data[services_key] = services;
        entry.Changed           += new EventHandler(OnStringChanged);

        box.PackStart(label, true, true, 2);
        box.PackStart(entry, false, true, 2);
        return(box);
    }
コード例 #25
0
        static void SetButtonIcon(Button button, string stockIcon)
        {
            Alignment alignment = new Alignment(0.5f, 0.5f, 0f, 0f);
            Label     label     = new Label(button.Label);
            HBox      hbox      = new HBox(false, 2);
            ImageView image     = new ImageView();

            image.Image = ImageService.GetIcon(stockIcon, IconSize.Menu);
            image.Show();
            hbox.Add(image);

            label.Show();
            hbox.Add(label);

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

            button.Child.Destroy();

            alignment.Show();
            button.Add(alignment);
        }
コード例 #26
0
        protected ToggleButton CreateNewImageButton(string text, Image image, int minWidth)
        {
            image.Show();

            Label lblText = new Label {
                Markup = new PangoStyle {
                    Size = PangoStyle.TextSize.Small, Text = text
                }, Xalign = 1
            };

            lblText.Show();

            Label lblSpace = new Label {
                HeightRequest = 1, WidthRequest = minWidth
            };

            lblSpace.Show();

            VBox vbxLabels = new VBox();

            vbxLabels.PackStart(lblText, true, true, 0);
            vbxLabels.PackStart(lblSpace, false, false, 0);
            vbxLabels.Show();

            HBox hboContents = new HBox(false, 3);

            hboContents.PackStart(image, false, true, 0);
            hboContents.PackStart(vbxLabels, true, true, 0);
            hboContents.Show();

            ToggleButton button = new ToggleButton {
                hboContents
            };

            button.Show();

            return(button);
        }
コード例 #27
0
    protected void CreateTagBarControls()
    {
        for (int i = 0; i < _settings.NumberOfBarOptions; i++)
        {
            HBox hbox = new HBox();
            hbox.Name    = string.Format("tabHBox{0}", i);
            hbox.Spacing = 6;

            Button btn = new Button();
            btn.CanFocus     = true;
            btn.Name         = string.Format("btnTag{0}", i);
            btn.UseUnderline = true;
            btn.Label        = i.ToString();
            hbox.PackStart(btn, true, true, 0);
            btn.Show();

            _tagBarButtons.Add(btn);

            Label lbl = new Label();
            lbl.Name      = string.Format("lblTag{0}", i);
            lbl.LabelProp = string.Format("Alt-{0}", i);
            hbox.PackStart(lbl, false, false, 0);
            lbl.Show();

            _tagBarLabels.Add(lbl);

            panelTagBar.PackStart(hbox, false, false, 0);
            hbox.Show();
        }

        for (int i = 0; i < _tagBarButtons.Count; i++)
        {
            _tagBarButtons [i].Clicked += on_TagBarButtons_Clicked;
        }

        LoadBarOptions();
    }
コード例 #28
0
        private void Refresh()
        {
            box.Show();

            try {
                if (left is string)
                {
                    diff = new Diff((string)left, (string)right, true, true);
                }
                else if (left is string[])
                {
                    diff = new Diff((string[])left, (string[])right, null, null);
                }
            } catch (Exception e) {
                Console.Error.WriteLine(e.ToString());
                return;
            }

            if (widget != null)
            {
                pos = widget.Position;
                box.Remove(widget);
                widget.Dispose();
            }

            DiffWidget.Options opts = new DiffWidget.Options();
            opts.Font      = DesktopService.DefaultMonospaceFont;
            opts.LeftName  = "Repository";
            opts.RightName = "Working Copy";
            widget         = new DiffWidget(diff, opts);

            box.Add(widget);
            box.ShowAll();

            widget.ExposeEvent += new ExposeEventHandler(OnExposed);
        }
コード例 #29
0
        public NotebookTabLabel(string title, string path = "/", Node ura = null)
        {
            Text = title;
            Pth  = path;
            ptr  = ura;

            Button button = new Button();

            button.Image       = new Gtk.Image(Stock.Close, IconSize.SmallToolbar);
            button.TooltipText = "Close";
            button.Relief      = ReliefStyle.None;

            RcStyle rcStyle = new RcStyle();

            rcStyle.Xthickness = 0;
            rcStyle.Ythickness = 0;
            button.ModifyStyle(rcStyle);

            button.FocusOnClick = false;
            button.Clicked     += OnCloseClicked;
            button.Show();

            Label label = new Label(title);

            label.UseMarkup    = false;
            label.UseUnderline = false;
            label.Show();

            HBox hbox = new HBox(false, 0);

            hbox.Spacing = 0;
            hbox.Add(button);
            hbox.Add(label);
            hbox.Show();
            this.Add(hbox);
        }
コード例 #30
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);
            }

            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();

            VBox.PackStart(alignment, false, true, 0);
        }
コード例 #31
0
ファイル: image_test_eblocks.cs プロジェクト: emtees/old-code
  public static void Main(string [] args)
  {	
    Application.Init();

    Window win = new Window("EFL# Demo App");	
    win.Resize(640, 480);

    Application.EE.ResizeEvent += AppResizeHandler;

    /* integrate this code in the Window class */
    Edje win_bg = new Edje(Application.EE.Get());
    win_bg.FileSet(DataConfig.DATADIR + "/data/eblocks/themes/e17.edj","window");
    win_bg.Resize(640, 480);
    win_bg.Move(0, 0);
    win_bg.Lower();
    win_bg.Show();
    
    MenuItem item;    
    MenuItem entry;

    MenuBar mb = new MenuBar();
    mb.Move(0, 0);
    mb.Resize(640, 35);
    mb.Spacing = 15;

    item = new MenuItem("_File");
    Menu file_menu = new Menu();
    
    entry = new MenuItem(file_menu.Canvas, "_Open");
    file_menu.Append(entry);
    entry = new MenuItem(file_menu.Canvas, "_Close");
    file_menu.Append(entry);
    entry = new MenuItem(file_menu.Canvas, "_Save");
    file_menu.Append(entry);
    
    item.SubMenu = file_menu;
    
    mb.Append(item);

    item = new MenuItem("_Edit");
    Menu edit_menu = new Menu();
    
    entry = new MenuItem(edit_menu.Canvas, "_Copy");
    edit_menu.Append(entry);
    entry = new MenuItem(edit_menu.Canvas, "_Cut");
    edit_menu.Append(entry);
    entry = new MenuItem(edit_menu.Canvas, "_Paste");
    edit_menu.Append(entry);
    
    item.SubMenu = edit_menu;
    mb.Append(item);

    item = new MenuItem("_About");
    //item.SubMenu = about_menu;
    mb.Append(item);

    mb.Show();

    Button button;	

    HBox box_left = new HBox();
    box_left.Move(0, 37);
    box_left.Resize(70, 480 - 37);
	
    VBox box_icons = new VBox();
    box_icons.Spacing = 0;
    box_icons.Resize(64, 480 - 37);
	
    button = new Button("Tile");
    button.Resize(64, 64);
    box_icons.PackEnd(button);
    button = new Button("Stretch");
    button.Resize(64, 64);
    box_icons.PackEnd(button);	
    button = new Button("Rotate");
    button.Resize(64, 64);
    box_icons.PackEnd(button);	
    button = new Button("Flip");
    button.Resize(64, 64);
    box_icons.PackEnd(button);	
    button = new Button("Quit");
    button.MouseUpEvent += new Enlightenment.Evas.Item.EventHandler(AppQuitButtonHandler);
    button.Resize(64, 64);	
    box_icons.PackEnd(button);		
	
    box_left.PackEnd(box_icons);
	
    Enlightenment.Eblocks.Line vline = new Enlightenment.Eblocks.Line(Application.EE.Get());
    vline.Vertical = true;
    vline.Resize(6, 480 - 37);
	
    box_left.PackEnd(vline);
	
    box_left.Show();
	
    dir = args[0];	
	       	
    imageTable = new Table(Application.EE.Get(), items);
	
    HBox box_images = new HBox();
    box_images.Move(70, 37);
    box_images.Spacing = 0;
    box_images.Resize(640 - 70 - 2, 480 - 37 - 2);
    box_images.PackStart(imageTable);
	
    Application.EE.DataSet("box_images", box_images);
    Application.EE.DataSet("box_left", box_left);
    Application.EE.DataSet("box_icons", box_icons);
    Application.EE.DataSet("win_bg", win_bg);
    Application.EE.DataSet("vline", vline);
    Application.EE.DataSet("mb", mb);
	
    WaitCallback callback = new WaitCallback(Callback);
    ThreadPool.QueueUserWorkItem(callback);	

    win.ShowAll();
	
    Application.Run();
  }