Exemple #1
0
        /// <summary>
        /// Build the UI manually to avoid resize glitches when we adjust the widget to the selected image.
        /// </summary>
        /// <param name="width">The image width.</param>
        /// <param name="height">The image height.</param>
        void Build(int width, int height)
        {
            WindowPosition       = WindowPosition.CenterAlways;
            fixed1               = new Fixed();
            fixed1.WidthRequest  = width;
            fixed1.HeightRequest = height;
            fixed1.HasWindow     = false;

            progressbar1 = new ProgressBar();
            progressbar1.WidthRequest  = width * 60 / 100;
            progressbar1.HeightRequest = 20;
            fixed1.Add(progressbar1);
            Fixed.FixedChild w1 = (Fixed.FixedChild)(fixed1 [progressbar1]);
            w1.X = width * 20 / 100;
            w1.Y = height - 50;

            splashimage = new ImageView();
            splashimage.SetSize(width, height);
            fixed1.Add(splashimage);

            Add(fixed1);
            if ((Child != null))
            {
                Child.ShowAll();
            }
            DefaultWidth  = width;
            DefaultHeight = height;
            Show();
        }
 private void BuildSymbol(ref Gtk.Image img, int x = 0, int y = 0)
 {
     img = new Gtk.Image();
     img.WidthRequest  = 16;
     img.HeightRequest = 20;
     fixed1.Add(img);
     Fixed.FixedChild w = ((Fixed.FixedChild)(fixed1[img]));
     w.X = x;
     w.Y = y;
 }
Exemple #3
0
 private void BuildSmallWidget(ref SmallSecretWidget widg, int x = 0, int y = 0)
 {
     widg = new SmallSecretWidget();
     //img.WidthRequest = 16;
     //img.HeightRequest = 20;
     fixed1.Add(widg);
     Fixed.FixedChild w = ((Fixed.FixedChild)(fixed1[widg]));
     w.X = x;
     w.Y = y;
 }
    protected void ReparentTextView(Fixed parent, ScrolledWindow window, int x, int y)
    {
        var source = (Fixed)window.Parent;

        source.Remove(window);

        parent.Add(window);

        Fixed.FixedChild child = ((Fixed.FixedChild)(parent[window]));

        child.X = x;
        child.Y = y;
    }
Exemple #5
0
        public void CreateBackgroundImage(Pixbuf pixbuf)
        {
            choosedImg = new Gtk.Image();
            choosedImg.WidthRequest  = fixedSheme.WidthRequest;
            choosedImg.HeightRequest = fixedSheme.HeightRequest;
            choosedImg.Name          = "BGIMAGE";

            choosedImg.Pixbuf = pixbuf.ScaleSimple(fixedSheme.WidthRequest, fixedSheme.HeightRequest, InterpType.Bilinear);
            fixedSheme.Put(choosedImg, 0, 0);

            Fixed.FixedChild fcImg = ((Fixed.FixedChild)(fixedSheme[choosedImg]));
            fcImg.X = 0;
            fcImg.Y = 0;
            fixedSheme.ShowAll();
        }
Exemple #6
0
        protected void AddNewTableButtonImage(string name, string type, int x, int y, int size = 50)
        {
            Gtk.Image img = new global::Gtk.Image();
            img.Name = type;
            switch (type)
            {
            case "Table2Chair": img.Pixbuf = table2Chair.ScaleSimple(size, size, InterpType.Bilinear); break;

            case "Table4Chair": img.Pixbuf = table4Chair.ScaleSimple(size, size, InterpType.Bilinear); break;

            case "Table6Chair": img.Pixbuf = table6Chair.ScaleSimple(size, size, InterpType.Bilinear); break;

            case "Table8Chair": img.Pixbuf = table8Chair.ScaleSimple(size, size, InterpType.Bilinear); break;
            }

            Button button = new Button();

            button.Relief = ReliefStyle.None;

            button.Image = img;
            button.Name  = name;
            Gtk.Drag.SourceSet(button, Gdk.ModifierType.Button1Mask, source_table, DragAction.Copy);

            button.FocusInEvent += (o, args) => {
                fixedSheme.Foreach((b) => {
                    if (b is Button)
                    {
                        (b as Button).Relief = ReliefStyle.None;
                    }
                });
                (o as Button).Relief       = ReliefStyle.Half;
                labelOznakaStola.LabelProp = (o as Button).Name;
                entryOznaka.Text           = (o as Button).Name;
                OnTableSelection(((o as Button)).Name);
            };

            button.DragBegin   += (o, args) => { (o as Button).Hide(); };
            button.DragBegin   += Drag_Begin;
            button.DragDataGet += Data_Get;
            button.DragEnd     += (o, args) => { (o as Button).Destroy(); };

            fixedSheme.Add(button);

            Fixed.FixedChild fc = ((Fixed.FixedChild)(fixedSheme[button]));
            fc.X = x;
            fc.Y = y;
            fixedSheme.ShowAll();
        }
Exemple #7
0
    private void LoadSwitchArgument(Argument type, SwitchArgument argument, int index)
    {
        CheckButton checkButton = new CheckButton();

        checkButton.Label = argument.Description;
        checkButton.ShowAll();

        checkButton.Toggled += (object sender, EventArgs e) =>
        {
            argument.Value = checkButton.Active;
        };

        argument.OnValueChanged += (object sender) =>
        {
            checkButton.Active = (bool)((CommandArgument)sender).Value;
        };

        argument.OnInteractableChanged += (object sender) =>
        {
            checkButton.Sensitive = ((CommandArgument)sender).Interactable;
        };

        if (index % 2 == 0)
        {
            this.arguments_left.Add(checkButton);

            // Set CheckButton Position
            Fixed.FixedChild w2 = (Fixed.FixedChild) this.arguments_left[checkButton];
            w2.X = 21;
            w2.Y = 40 + (int)Math.Floor((float)(index / 2)) * 20;
        }
        else
        {
            this.arguments_right.Add(checkButton);

            // Set CheckButton Position
            Fixed.FixedChild w1 = (Fixed.FixedChild) this.arguments_right[checkButton];
            w1.X = 21;
            w1.Y = 40 + (int)Math.Floor((float)(index / 2)) * 20;
        }
    }
Exemple #8
0
        protected virtual void Build()
        {
            Stetic.Gui.Initialize(this);
            // Widget Toys.Window
            Name           = "ModelViewer";
            Title          = "Window";
            WindowPosition = (WindowPosition)4;
            notebook       = new Notebook();
            // Container child Toys.Window.Gtk.Container+ContainerChild
            fixed1           = new Fixed();
            fixed1.Name      = "fixed1";
            fixed1.HasWindow = false;
            // Container child fixed1.Gtk.Fixed+FixedChild
            scrolledwindow1 = new ScrolledWindow();
            scrolledwindow1.WidthRequest     = 154;
            scrolledwindow1.HeightRequest    = 300;
            scrolledwindow1.CanFocus         = true;
            scrolledwindow1.Name             = "scrolledwindow1";
            scrolledwindow1.VscrollbarPolicy = 0;
            scrolledwindow1.HscrollbarPolicy = (PolicyType)2;
            scrolledwindow1.ShadowType       = (ShadowType)1;
            // Container child scrolledwindow1.Gtk.Container+ContainerChild
            Viewport w1 = new Viewport();

            w1.ShadowType = 0;
            // Container child GtkViewport.Gtk.Container+ContainerChild
            fixedScene           = new Fixed();
            fixedScene.Name      = "fixed2";
            fixedScene.HasWindow = false;
            w1.Add(fixedScene);
            scrolledwindow1.Add(w1);
            fixed1.Add(scrolledwindow1);
            // Container child fixed1.Gtk.Fixed+FixedChild
            scrolledwindow2 = new ScrolledWindow();
            scrolledwindow2.WidthRequest     = 200;
            scrolledwindow2.HeightRequest    = 300;
            scrolledwindow2.CanFocus         = true;
            scrolledwindow2.Name             = "scrolledwindow2";
            scrolledwindow2.HscrollbarPolicy = (PolicyType)2;
            scrolledwindow2.ShadowType       = (ShadowType)1;
            // Container child scrolledwindow2.Gtk.Container+ContainerChild
            Viewport w5 = new Viewport();

            w5.ShadowType = 0;
            // Container child GtkViewport1.Gtk.Container+ContainerChild
            fixedComponents           = new Fixed();
            fixedComponents.Name      = "fixed3";
            fixedComponents.HasWindow = false;
            w5.Add(fixedComponents);
            scrolledwindow2.Add(w5);
            fixed1.Add(scrolledwindow2);

            Fixed.FixedChild w8 = (Fixed.FixedChild)fixed1[scrolledwindow2];
            w8.X = 165;

            /*
             *          // Container child fixed1.Gtk.Fixed+FixedChild
             *          filechooserbutton2 = new FileChooserButton("Select a File", 0);
             *          filechooserbutton2.WidthRequest = 124;
             *          filechooserbutton2.Name = "filechooserbutton2";
             *          fixed1.Add(filechooserbutton2);
             *          Fixed.FixedChild w9 = (Fixed.FixedChild)fixed1[filechooserbutton2];
             *          w9.X = 379;
             *          w9.Y = 19;
             *          // Container child fixed1.Gtk.Fixed+FixedChild
             *          button2 = new Button();
             *          button2.WidthRequest = 109;
             *          button2.CanFocus = true;
             *          button2.Name = "button2";
             *          button2.UseUnderline = true;
             *          button2.Label = "Play";
             *          fixed1.Add(button2);
             *          Fixed.FixedChild w10 = (Fixed.FixedChild)fixed1[button2];
             *          w10.X = 379;
             *          w10.Y = 63;
             *          // Container child fixed1.Gtk.Fixed+FixedChild
             *          button3 = new Button();
             *          button3.WidthRequest = 110;
             *          button3.CanFocus = true;
             *          button3.Name = "button3";
             *          button3.UseUnderline = true;
             *          button3.Label = "Stop";
             *          fixed1.Add(button3);
             *          Fixed.FixedChild w11 = (Fixed.FixedChild)fixed1[button3];
             *          w11.X = 379;
             *          w11.Y = 108;
             *          // Container child fixed1.Gtk.Fixed+FixedChild
             *          button4 = new Button();
             *          button4.WidthRequest = 110;
             *          button4.CanFocus = true;
             *          button4.Name = "button4";
             *          button4.UseUnderline = true;
             *          button4.Label = "Pause";
             *          fixed1.Add(button4);
             *          Fixed.FixedChild w12 = (Fixed.FixedChild)fixed1[button4];
             *          w12.X = 379;
             *          w12.Y = 153;
             */
            scrolledwindow3 = new ScrolledWindow();
            scrolledwindow3.WidthRequest     = 200;
            scrolledwindow3.HeightRequest    = 300;
            scrolledwindow3.CanFocus         = true;
            scrolledwindow3.Name             = "scrolledwindow3";
            scrolledwindow3.VscrollbarPolicy = 0;
            scrolledwindow3.HscrollbarPolicy = (PolicyType)2;
            scrolledwindow3.ShadowType       = (ShadowType)1;
            // Container child scrolledwindow1.Gtk.Container+ContainerChild
            Viewport w4 = new Viewport();

            w4.ShadowType = 0;
            // Container child GtkViewport.Gtk.Container+ContainerChild
            fixed4           = new Fixed();
            fixed4.Name      = "fixed4";
            fixed4.HasWindow = false;
            w4.Add(fixed4);
            scrolledwindow3.Add(w4);
            fixed1.Add(scrolledwindow3);
            Fixed.FixedChild w6 = (Fixed.FixedChild)fixed1[scrolledwindow3];
            w6.X = 370;
            notebook.AppendPage(fixed1, new Label("Scene"));
            BuildClient();

            /*
             * self.page1.set_border_width(10)
             * self.page1.add(Gtk.Label('Default Page!'))
             * self.notebook.append_page(self.page1, Gtk.Label('Plain Title'))
             *
             * self.page2 = Gtk.Box()
             * self.page2.set_border_width(10)
             * self.page2.add(Gtk.Label('A page with an image for a Title.'))
             * self.notebook.append_page(
             * self.page2,
             * Gtk.Image.new_from_icon_name(
             *  "help-about",
             *  Gtk.IconSize.MENU
             * )
             */
            Add(notebook);
            if (Child != null)
            {
                Child.ShowAll();
            }
            DefaultWidth  = 700;
            DefaultHeight = 342;
            Show();

            /*
             * var provider = new CssProvider();
             * string css = ReadFromAssetStream("ModelViewer.gtk_gui.gtkmain.css");
             * provider.LoadFromData(css);
             * StyleContext.AddProviderForScreen(Gdk.Screen.Default, provider, StyleProviderPriority.User);
             */
            BuildMorphs();
        }
Exemple #9
0
    protected virtual void Build()
    {
        global::Stetic.Gui.Initialize(this);
        // Widget MainWindow
        this.Name           = "MainWindow";
        this.Title          = Mono.Unix.Catalog.GetString("LogToCSV");
        this.WindowPosition = (WindowPosition)4;
        this.Resizable      = false;
        this.DefaultWidth   = 0;
        this.DefaultHeight  = 0;
        // Container child MainWindow.Gtk.Container+ContainerChild
        this.fixed2 = new Fixed
        {
            Name      = "fixed2",
            HasWindow = false
        };
        // Container child fixed2.Gtk.Fixed+FixedChild
        this.button6 = new Gtk.Button
        {
            CanFocus     = true,
            Name         = "button6",
            UseUnderline = true,
            Label        = global::Mono.Unix.Catalog.GetString("Dosya Seçiz")
        };
        this.fixed2.Add(this.button6);
        global::Gtk.Fixed.FixedChild w1 = ((global::Gtk.Fixed.FixedChild)(this.fixed2[this.button6]));
        w1.X             = 70;
        w1.Y             = 40;
        button6.Clicked += new EventHandler(FileOpen);
        // Container child fixed2.Gtk.Fixed+FixedChild
        this.button3 = new Gtk.Button
        {
            CanFocus     = true,
            Name         = "button3",
            UseUnderline = true,
            Label        = global::Mono.Unix.Catalog.GetString("Dosyayı Görüntüle")
        };
        this.fixed2.Add(this.button3);
        Fixed.FixedChild w2 = ((Fixed.FixedChild)(this.fixed2[this.button3]));
        w2.X = 70;
        w2.Y = 160;
        this.button3.Clicked += new EventHandler(FileList);
        // Container child fixed2.Gtk.Fixed+FixedChild
        this.button2 = new Gtk.Button
        {
            CanFocus     = true,
            Name         = "button2",
            UseUnderline = true,
            Label        = global::Mono.Unix.Catalog.GetString("Konum Seçiniz")
        };
        this.fixed2.Add(this.button2);
        Fixed.FixedChild w3 = ((Fixed.FixedChild)(this.fixed2[this.button2]));
        w3.X             = 70;
        w3.Y             = 220;
        button2.Clicked += new EventHandler(PathOpen);

        // Container child fixed2.Gtk.Fixed+FixedChild
        this.button1 = new Gtk.Button
        {
            CanFocus     = true,
            Name         = "button1",
            UseUnderline = true,
            Label        = global::Mono.Unix.Catalog.GetString("Dosya Oluştur")
        };
        this.fixed2.Add(this.button1);
        Fixed.FixedChild w4 = ((Fixed.FixedChild)(this.fixed2[this.button1]));
        w4.X             = 70;
        w4.Y             = 280;
        button1.Clicked += new EventHandler(FileCreate);
        // Container child fixed2.Gtk.Fixed+FixedChild
        this.GtkScrolledWindow = new ScrolledWindow
        {
            WidthRequest  = 700,
            HeightRequest = 400,
            Name          = "GtkScrolledWindow",
            ShadowType    = ((global::Gtk.ShadowType)(1))
        };
        // Container child GtkScrolledWindow.Gtk.Container+ContainerChild
        this.textview3 = new TextView
        {
            CanFocus = true,
            Name     = "textview3"
        };
        this.GtkScrolledWindow.Add(this.textview3);
        this.fixed2.Add(this.GtkScrolledWindow);
        Fixed.FixedChild w6 = (Fixed.FixedChild) this.fixed2[this.GtkScrolledWindow];
        w6.X = 265;
        w6.Y = 14;
        // Container child fixed2.Gtk.Fixed+FixedChild
        this.button4 = new Gtk.Button
        {
            CanFocus     = true,
            Name         = "button4",
            UseUnderline = true,
            Label        = Mono.Unix.Catalog.GetString("TcTLO Seçiniz")
        };
        this.fixed2.Add(this.button4);
        Fixed.FixedChild w7 = (Fixed.FixedChild) this.fixed2[this.button4];
        w7.X             = 70;
        w7.Y             = 100;
        button4.Clicked += new EventHandler(TcTLO_O);
        // Container child fixed2.Gtk.Fixed + FixedChild
        this.button5 = new Gtk.Button
        {
            CanFocus     = true,
            Name         = "button5",
            UseUnderline = true,
            Label        = global::Mono.Unix.Catalog.GetString("Bulunamayanlar")
        };
        this.fixed2.Add(this.button5);
        global::Gtk.Fixed.FixedChild w8 = ((global::Gtk.Fixed.FixedChild)(this.fixed2[this.button5]));
        w8.X             = 10;
        w8.Y             = 330;
        button5.Clicked += new EventHandler(NotFound_L);
        // Container child fixed2.Gtk.Fixed+FixedChild
        this.button7 = new Gtk.Button
        {
            CanFocus     = true,
            Name         = "button7",
            UseUnderline = true,
            Label        = Mono.Unix.Catalog.GetString("Temizle")
        };
        this.fixed2.Add(this.button7);
        Fixed.FixedChild w9 = (Fixed.FixedChild)(this.fixed2[this.button7]);
        w9.X             = 180;
        w9.Y             = 380;
        button7.Clicked += new EventHandler(Clear);
        // Container child fixed2.Gtk.Fixed+FixedChild
        this.button8 = new Gtk.Button
        {
            CanFocus     = true,
            Name         = "button8",
            UseUnderline = true,
            Label        = global::Mono.Unix.Catalog.GetString("Analiz Oluştur")
        };
        this.fixed2.Add(this.button8);
        Fixed.FixedChild w10 = (Fixed.FixedChild)(this.fixed2[this.button8]);
        w10.X            = 10;
        w10.Y            = 380;
        button8.Clicked += new EventHandler(Create_analysis);
        this.Add(this.fixed2);
        if ((this.Child != null))
        {
            this.Child.ShowAll();
        }
        this.Show();

        this.DeleteEvent += new DeleteEventHandler(this.OnDeleteEvent);
    }
 protected virtual void Build()
 {
     Gui.Initialize(this);
     base.Name                         = "MainWindow";
     base.Title                        = Catalog.GetString("Assimp-Converter-GUI");
     base.WindowPosition               = WindowPosition.CenterOnParent;
     mainWidget                        = new Fixed();
     mainWidget.Name                   = "mainWidget";
     mainWidget.HasWindow              = false;
     loksimEditPathField               = new Entry();
     loksimEditPathField.WidthRequest  = 484;
     loksimEditPathField.CanFocus      = true;
     loksimEditPathField.Name          = "loksimEditPathField";
     loksimEditPathField.IsEditable    = true;
     loksimEditPathField.InvisibleChar = '●';
     mainWidget.Add(loksimEditPathField);
     Fixed.FixedChild w19 = (Fixed.FixedChild)((Container)mainWidget)[loksimEditPathField];
     w19.X = 28;
     w19.Y = 81;
     loksimeditExeButton              = new Button();
     loksimeditExeButton.CanFocus     = true;
     loksimeditExeButton.Name         = "loksimeditExeButton";
     loksimeditExeButton.UseUnderline = true;
     loksimeditExeButton.Label        = Catalog.GetString("Datei auswählen");
     mainWidget.Add(loksimeditExeButton);
     Fixed.FixedChild w18 = (Fixed.FixedChild)((Container)mainWidget)[loksimeditExeButton];
     w18.X           = 523;
     w18.Y           = 79;
     objectPathEntry = new Entry();
     objectPathEntry.WidthRequest  = 480;
     objectPathEntry.CanFocus      = true;
     objectPathEntry.Name          = "objectPathEntry";
     objectPathEntry.IsEditable    = true;
     objectPathEntry.InvisibleChar = '●';
     mainWidget.Add(objectPathEntry);
     Fixed.FixedChild w17 = (Fixed.FixedChild)((Container)mainWidget)[objectPathEntry];
     w17.X                     = 30;
     w17.Y                     = 168;
     objectButton              = new Button();
     objectButton.CanFocus     = true;
     objectButton.Name         = "objectButton";
     objectButton.UseUnderline = true;
     objectButton.Label        = "Datei auswählen";
     mainWidget.Add(objectButton);
     Fixed.FixedChild w16 = (Fixed.FixedChild)((Container)mainWidget)[objectButton];
     w16.X = 522;
     w16.Y = 166;
     destinationPathLabel           = new Label();
     destinationPathLabel.Name      = "destinationPathLabel";
     destinationPathLabel.LabelProp = "Zielpfad nach der Konvertierung (leerer Ordner!):";
     mainWidget.Add(destinationPathLabel);
     Fixed.FixedChild w15 = (Fixed.FixedChild)((Container)mainWidget)[destinationPathLabel];
     w15.X                     = 35;
     w15.Y                     = 232;
     objectPathLabel           = new Label();
     objectPathLabel.Name      = "objectPathLabel";
     objectPathLabel.LabelProp = "Pfad zum Objekt:";
     mainWidget.Add(objectPathLabel);
     Fixed.FixedChild w14 = (Fixed.FixedChild)((Container)mainWidget)[objectPathLabel];
     w14.X            = 34;
     w14.Y            = 145;
     label1           = new Label();
     label1.Name      = "label1";
     label1.LabelProp = "Pfad zur LoksimEdit.exe:";
     mainWidget.Add(label1);
     Fixed.FixedChild w13 = (Fixed.FixedChild)((Container)mainWidget)[label1];
     w13.X = 32;
     w13.Y = 60;
     destinationPathEntry = new Entry();
     destinationPathEntry.WidthRequest  = 480;
     destinationPathEntry.CanFocus      = true;
     destinationPathEntry.Name          = "destinationPathEntry";
     destinationPathEntry.IsEditable    = true;
     destinationPathEntry.InvisibleChar = '●';
     mainWidget.Add(destinationPathEntry);
     Fixed.FixedChild w12 = (Fixed.FixedChild)((Container)mainWidget)[destinationPathEntry];
     w12.X                          = 25;
     w12.Y                          = 254;
     destinationButton              = new Button();
     destinationButton.CanFocus     = true;
     destinationButton.Name         = "destinationButton";
     destinationButton.UseUnderline = true;
     destinationButton.Label        = Catalog.GetString("Ordner auswählen");
     mainWidget.Add(destinationButton);
     Fixed.FixedChild w11 = (Fixed.FixedChild)((Container)mainWidget)[destinationButton];
     w11.X                      = 520;
     w11.Y                      = 253;
     convertButton              = new Button();
     convertButton.CanFocus     = true;
     convertButton.Name         = "convertButton";
     convertButton.UseUnderline = true;
     convertButton.Label        = Catalog.GetString("Konvertieren");
     mainWidget.Add(convertButton);
     Fixed.FixedChild w10 = (Fixed.FixedChild)((Container)mainWidget)[convertButton];
     w10.X = 646;
     w10.Y = 373;
     base.Add(mainWidget);
     if (base.Child != null)
     {
         base.Child.ShowAll();
     }
     base.DefaultWidth  = 748;
     base.DefaultHeight = 443;
     base.Show();
     base.DeleteEvent            += OnDeleteEvent;
     loksimeditExeButton.Clicked += LoksimExeButtonOnClick;
     objectButton.Clicked        += ObjectButtonOnClick;
     destinationButton.Clicked   += DestinationButtonOnClick;
     convertButton.Clicked       += convertButtonClicked;
 }