示例#1
0
        private void AddTeamNamesWidget()
        {
            Gtk.Frame sframe, tframe;
            EventBox  ebox;

            sframe = new Gtk.Frame("<b>" + Catalog.GetString("Shield") + "</b>");
            (sframe.LabelWidget as Label).UseMarkup = true;
            sframe.ShadowType = ShadowType.None;
            tframe            = new Gtk.Frame("<b>" + Catalog.GetString("Team Name") + "</b>");
            (tframe.LabelWidget as Label).UseMarkup = true;
            tframe.ShadowType = ShadowType.None;

            ebox = new EventBox();
            ebox.ButtonPressEvent += OnImageClicked;

            shieldImage        = new Gtk.Image();
            shieldImage.Pixbuf = IconLoader.LoadIcon(this, "gtk-execute", IconSize.Dialog);
            box = new VBox();

            teamentry          = new Entry();
            teamentry.Changed += delegate(object sender, EventArgs e) {
                Template.TeamName = teamentry.Text;
            };

            sframe.Add(ebox);
            ebox.Add(shieldImage);
            tframe.Add(teamentry);

            box.PackStart(sframe, false, false, 0);
            box.PackStart(tframe, false, false, 0);
            box.ShowAll();
            box.Sensitive = false;
            AddUpperWidget(box);
        }
示例#2
0
        private void AddBackgroundsSelectionWidget()
        {
            Gtk.Frame fframe, gframe, hfframe;
            EventBox  febox, gebox, hfebox;
            HBox      fieldBox, halfFieldBox, goalBox;
            HBox      periodsBox;
            Button    periodsButton;

            fframe = new Gtk.Frame("<b>" + Catalog.GetString("Field background") + "</b>");
            (fframe.LabelWidget as Label).UseMarkup = true;
            fframe.ShadowType = ShadowType.None;
            hfframe           = new Gtk.Frame("<b>" + Catalog.GetString("Half field background") + "</b>");
            (hfframe.LabelWidget as Label).UseMarkup = true;
            hfframe.ShadowType = ShadowType.None;
            gframe             = new Gtk.Frame("<b>" + Catalog.GetString("Goal background") + "</b>");
            (gframe.LabelWidget as Label).UseMarkup = true;
            gframe.ShadowType = ShadowType.None;
            periodsFrame      = new Frame("<b>" + Catalog.GetString("Game periods") + "</b>");
            (periodsFrame.LabelWidget as Label).UseMarkup = true;
            periodsFrame.ShadowType = ShadowType.None;

            febox           = new EventBox();
            fieldBox        = new HBox();
            fReset          = new Button(Catalog.GetString("Reset"));
            fReset.Clicked += (sender, e) => {
                Template.FieldBackground = null;
                SetFieldImage(null);
            };
            febox.ButtonPressEvent += OnFieldImageClicked;
            fieldImage              = new Gtk.Image();
            SetFieldImage(null);

            hfebox           = new EventBox();
            halfFieldBox     = new HBox();
            hfReset          = new Button(Catalog.GetString("Reset"));
            hfReset.Clicked += (sender, e) => {
                Template.HalfFieldBackground = null;
                SetHalfFieldImage(null);
            };
            hfebox.ButtonPressEvent += OnHalfFieldImageClicked;
            halffieldImage           = new Gtk.Image();
            SetHalfFieldImage(null);

            gebox           = new EventBox();
            goalBox         = new HBox();
            gReset          = new Button(Catalog.GetString("Reset"));
            gReset.Clicked += (sender, e) => {
                Template.GoalBackground = null;
                SetGoalImage(null);
            };
            gebox.ButtonPressEvent += OnGoalImageClicked;
            goalImage = new Gtk.Image();
            SetGoalImage(null);

            periodsBox    = new HBox();
            periodsButton = new Button("gtk-edit");
            periodsLabel  = new Label();
            periodsBox.PackStart(periodsLabel);
            periodsBox.PackStart(periodsButton);
            periodsButton.Clicked += HandlePeriodsClicked;

            febox.Add(fieldImage);
            hfebox.Add(halffieldImage);
            gebox.Add(goalImage);

            fieldBox.PackStart(febox, true, true, 0);
            fieldBox.PackStart(fReset, false, false, 0);
            halfFieldBox.PackStart(hfebox, true, true, 0);
            halfFieldBox.PackStart(hfReset, false, false, 0);
            goalBox.PackStart(gebox, true, true, 0);
            goalBox.PackStart(gReset, false, false, 0);

            fframe.Add(fieldBox);
            hfframe.Add(halfFieldBox);
            gframe.Add(goalBox);
            periodsFrame.Add(periodsBox);

            box = new VBox();
            box.PackStart(fframe, false, false, 0);
            box.PackStart(hfframe, false, false, 0);
            box.PackStart(gframe, false, false, 0);
            box.PackStart(periodsFrame, false, false, 0);
            box.ShowAll();
            box.Sensitive = false;
            AddUpperWidget(box);
        }