Exemplo n.º 1
0
        private void Init()
        {
            var suffix = GLTheme.DialogScaling >= 2.0f ? "@2x" : "";

            buttonLeft  = new FlatButton(Gdk.Pixbuf.LoadFromResource($"FamiStudio.Resources.ArrowLeft{suffix}.png"));
            buttonRight = new FlatButton(Gdk.Pixbuf.LoadFromResource($"FamiStudio.Resources.ArrowRight{suffix}.png"));

            checkBoxDontShow = new CheckButton();
            checkBoxDontShow.Show();

            var checkLabel = new Label();

            checkLabel.Text = "Do not show again";
            checkLabel.Show();

            buttonLeft.Show();
            buttonLeft.ButtonPressEvent += ButtonLeft_ButtonPressEvent;
            buttonRight.Show();
            buttonRight.ButtonPressEvent += ButtonRight_ButtonPressEvent;

            var buttonsHbox = new HBox(false, 0);

            buttonsHbox.PackStart(buttonLeft, false, false, 0);
            buttonsHbox.PackStart(buttonRight, false, false, 0);
            buttonsHbox.Show();

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

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

            var checkBoxHBox = new HBox(false, 0);

            checkBoxHBox.PackStart(checkBoxDontShow, false, false, 0);
            checkBoxHBox.PackStart(checkLabel, false, false, 0);
            checkBoxHBox.Show();

            var checkBoxAlign = new Alignment(0.0f, 0.5f, 0.0f, 0.0f);

            checkBoxAlign.TopPadding = 5;
            checkBoxAlign.Show();
            checkBoxAlign.Add(checkBoxHBox);

            var hbox = new HBox(true, 0);

            hbox.PackStart(checkBoxAlign);
            hbox.PackStart(buttonsAlign);
            hbox.Show();

            label = new Label();
            label.WidthRequest  = 736;
            label.HeightRequest = 64;
            label.SetAlignment(0.0f, 0.0f);
            label.Wrap = true;
            label.Show();

            image = new Image();
            image.WidthRequest  = 736;
            image.HeightRequest = 414;
            image.Show();

#if FAMISTUDIO_LINUX
            var vbox = VBox;
#else
            var vbox = new VBox();
            Add(vbox);
#endif

            vbox.PackStart(label, false, false, 0);
            vbox.PackStart(image, false, false, 0);
            vbox.PackStart(hbox, false, false, 0);
            vbox.Show();

            BorderWidth     = 10;
            Resizable       = false;
            Decorated       = false;
            Modal           = true;
            SkipTaskbarHint = true;

            SetPage(0);
        }
Exemplo n.º 2
0
        public MultiPropertyDialog(int width, int height, int tabWidth = 160)
        {
            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;

            buttonYes.TooltipText = "Accept";
            buttonNo.TooltipText  = "Cancel";

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

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

            buttonsAlign.TopPadding = (uint)GtkUtils.ScaleGtkWidget(5);
            buttonsAlign.Show();
            buttonsAlign.Add(buttonsHBox);

            buttonsVBox = new VBox();
            buttonsVBox.Show();
            buttonsVBox.WidthRequest = GtkUtils.ScaleGtkWidget(tabWidth);

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

            buttonsVBoxPadding.RightPadding = (uint)GtkUtils.ScaleGtkWidget(5);
            buttonsVBoxPadding.Show();
            buttonsVBoxPadding.Add(buttonsVBox);

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

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

            var vbox = VBox;

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

            WidthRequest  = GtkUtils.ScaleGtkWidget(width);
            HeightRequest = GtkUtils.ScaleGtkWidget(height);

            BorderWidth     = (uint)GtkUtils.ScaleGtkWidget(5);
            Resizable       = false;
            Decorated       = false;
            Modal           = true;
            SkipTaskbarHint = true;
            SetPosition(WindowPosition.CenterOnParent);
            TransientFor = FamiStudioForm.Instance;
        }
Exemplo n.º 3
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;

            Move(x, y);
        }
Exemplo n.º 4
0
        private void Init()
        {
            var suffix = DpiScaling.Dialog >= 2.0f ? "@2x" : "";

            buttonLeft  = new FlatButton(Gdk.Pixbuf.LoadFromResource($"FamiStudio.Resources.ArrowLeft{suffix}.png"));
            buttonRight = new FlatButton(Gdk.Pixbuf.LoadFromResource($"FamiStudio.Resources.ArrowRight{suffix}.png"));

            checkBoxDontShow          = new CheckButton();
            checkBoxDontShow.CanFocus = false;
            checkBoxDontShow.Show();

            var checkLabel = new Label();

            checkLabel.Text = "Do not show again";
            checkLabel.Show();

            buttonLeft.Show();
            buttonLeft.ButtonPressEvent += ButtonLeft_ButtonPressEvent;
            buttonRight.Show();
            buttonRight.ButtonPressEvent += ButtonRight_ButtonPressEvent;

            buttonLeft.TooltipText  = "Previous";
            buttonRight.TooltipText = "Next";

            var buttonsHbox = new HBox(false, 0);

            buttonsHbox.PackStart(buttonLeft, false, false, 0);
            buttonsHbox.PackStart(buttonRight, false, false, 0);
            buttonsHbox.Show();

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

            buttonsAlign.TopPadding = (uint)GtkUtils.ScaleGtkWidget(5);
            buttonsAlign.Show();
            buttonsAlign.Add(buttonsHbox);

            var checkBoxHBox = new HBox(false, 0);

            checkBoxHBox.PackStart(checkBoxDontShow, false, false, 0);
            checkBoxHBox.PackStart(checkLabel, false, false, 0);
            checkBoxHBox.Show();

            var checkBoxAlign = new Alignment(0.0f, 0.5f, 0.0f, 0.0f);

            checkBoxAlign.TopPadding = (uint)GtkUtils.ScaleGtkWidget(5);
            checkBoxAlign.Show();
            checkBoxAlign.Add(checkBoxHBox);

            var hbox = new HBox(true, 0);

            hbox.PackStart(checkBoxAlign);
            hbox.PackStart(buttonsAlign);
            hbox.Show();

            label = new Label();
            label.WidthRequest  = GtkUtils.ScaleGtkWidget(736);
            label.HeightRequest = GtkUtils.ScaleGtkWidget(64);
            label.SetAlignment(0.0f, 0.0f);
            label.Wrap = true;
            label.Show();

            image = new Image();
            image.WidthRequest  = GtkUtils.ScaleGtkWidget(736);
            image.HeightRequest = GtkUtils.ScaleGtkWidget(414);
            image.Show();

            var vbox = VBox;

            vbox.PackStart(label, false, false, 0);
            vbox.PackStart(image, false, false, 0);
            vbox.PackStart(hbox, false, false, 0);
            vbox.Show();

            BorderWidth     = (uint)GtkUtils.ScaleGtkWidget(10);
            Resizable       = false;
            Decorated       = false;
            Modal           = true;
            SkipTaskbarHint = true;

            SetPage(0);
        }