示例#1
0
 private void Awake()
 {
     instance     = this;
     acceptButton = transform.Find("acceptButton").GetComponent <UI_Button>();
     cancelButton = transform.Find("cancelButton").GetComponent <UI_Button>();
     popupText    = transform.Find("popupText").GetComponent <Text>();
 }
示例#2
0
            public ButtonDefinition button_template(string display_text, string internal_name, string icon_path)
            {
                UI_Button MyButton = new UI_Button();

                MyButton.bd = Utilities.CreateButtonDefinition(display_text, internal_name, "", icon_path);
                return(MyButton.bd);
            }
示例#3
0
 private void Awake()
 {
     instance     = this;
     acceptButton = transform.Find("acceptButton").GetComponent <UI_Button>();
     cancelButton = transform.Find("cancelButton").GetComponent <UI_Button>();
     popupText    = transform.Find("popupText").GetComponent <Text>();
     inputField   = transform.Find("inputField").GetComponent <TMPro.TMP_InputField>();
 }
    private void Start()
    {
        UIElements = new UI_Button[transform.childCount];
        int n = 0;

        foreach (Transform child in transform)
        {
            UI_Button b = child.GetComponent <UI_Button>();
            UIElements[n] = b;
            n++;
        }
    }
示例#5
0
    // =================================
    // ========== CONSTRUCTOR ==========
    // =================================

    public UIButtonSystem()
    {
        foreach (GameObject go in _UIClickableButtons)
        {
            UI_Button onClickFunctions = go.GetComponent <UI_Button>();
            Button    button           = go.GetComponent <Button>();

            foreach (string functionName in onClickFunctions.functionNames)
            {
                addListener(go, button, functionName);
            }
        }
    }
示例#6
0
        public override void Open()
        {
            Data.World.Clear();
            Camera.Position = Data.ScreenCentre;

            Button_Play = new UI_Button("Play", Data.ScreenCentre - new Vector2(0f, 80f), () => ScreenManager.EnterScreen(ScreenTypes.GameScreen));
            Button_Play.Open();
            Button_Quit = new UI_Button("Quit", Data.ScreenCentre + new Vector2(0f, 80f), () => Close(ExitAction.ExitGame));
            Button_Quit.Open();
            Button_Editor = new UI_Button("Editor", new Vector2(60 * 4, 25 * 4), () => ScreenManager.EnterScreen(ScreenTypes.EditorLevelSelectScreen));
#if DEBUG
            Button_Editor.Open();
#endif
        }
示例#7
0
    private void Start()
    {
        if (gachaButton == null)
        {
            gachaButton = GetComponent <Button>();
        }
        if (gachaTimeText == null)
        {
            gachaTimeText = GetComponentInChildren <Text>();
        }
        if (buttonScript == null && GetComponent <UI_Button>() != null)
        {
            buttonScript = GetComponent <UI_Button>();
        }
        if (type == 0)
        {
            if (PlayerPrefs.HasKey("LastGachaOpen"))
            {
                lastGachaOpen = ulong.Parse(PlayerPrefs.GetString("LastGachaOpen"));
            }
            else
            {
                lastGachaOpen = (ulong)DateTime.Now.Ticks;
                PlayerPrefs.SetString("LastGachaOpen", lastGachaOpen.ToString());
            }
        }
        else if (type == 1)
        {
            if (PlayerPrefs.HasKey("LastCrystalOpen"))
            {
                lastGachaOpen = ulong.Parse(PlayerPrefs.GetString("LastCrystalOpen"));
            }
            else
            {
                lastGachaOpen = (ulong)DateTime.Now.Ticks;
                PlayerPrefs.SetString("LastCrystalOpen", lastGachaOpen.ToString());
            }
        }



        if (!IsGachaReady())
        {
            gachaButton.interactable = false;
            if (buttonScript != null)
            {
                buttonScript.enabled = false;
            }
        }
    }
        public void LoadUI()
        {
            main_window = new UI_Window(this);
            {
                propietari_text = new UI_Text(new System.Drawing.Point(10, 10), 100, 30, "Selecciona propietari:");
                main_window.AddElement(propietari_text);

                propietaris_combobox = new UI_ComboBox(new System.Drawing.Point(12, 35), 200, 50);
                main_window.AddElement(propietaris_combobox);

                accepta_button = new UI_Button(new System.Drawing.Point(10, 70), 60, 30, "Accepta");
                accepta_button.GetElement().Click += new System.EventHandler(this.Accepta);
                main_window.AddElement(accepta_button);
            }
        }
        public override void Open()
        {
            Camera.Position = Data.ScreenCentre;

            uint level = 0;

            for (uint i = 0; i < Buttons_Levels.GetLength(0); i++)
            {
                for (uint j = 0; j < Buttons_Levels.GetLength(1); j++)
                {
                    Buttons_Levels[i, j] = new UI_Button($"Level {level}", new Vector2(60 + j * 150 * 4, 25 + i * 50 * 4),
                                                         () =>
                    {
                        ScreenManager.EnterScreen(ScreenTypes.EditorScreen);
                    });
                    Buttons_Levels[i, j].Text.Centered = false;
                    level++;
                }
            }
        }
示例#10
0
        void LoadUI()
        {
            main_window = new UI_Window(this);
            {
                grid = new UI_Grid(new Point(15, 15), 470, 405);
                grid.AddColumn("Nom", 150, true); grid.AddColumn("Num registre", 150, true); grid.AddColumn("Fórmula", 180, true);
                grid.AddColumn("id", 120, true, false);
                grid.GetElement().Click += new System.EventHandler(this.AdobClick);
                grid.SetFont("Courier New", 8.5f);
                main_window.AddElement(grid);

                elimina_button = new UI_Button(new Point(293, 431), 120, 25, "Elimina adob");
                elimina_button.GetElement().Click += new System.EventHandler(this.Elimina);
                elimina_button.AddImage(principal.imageList1, 3);
                elimina_button.SetFont("Courier New", 8.5f);
                main_window.AddElement(elimina_button);

                actualitza_button = new UI_Button(new Point(143, 431), 140, 25, "Actualitza adob");
                actualitza_button.GetElement().Click += new System.EventHandler(this.Actualitza);
                actualitza_button.AddImage(principal.imageList1, 8);
                actualitza_button.SetFont("Courier New", 8.5f);
                main_window.AddElement(actualitza_button);

                crea_button = new UI_Button(new Point(14, 431), 120, 25, "Crea adob");
                crea_button.GetElement().Click += new System.EventHandler(this.Crea);
                crea_button.AddImage(principal.imageList1, 6);
                crea_button.SetFont("Courier New", 8.5f);
                main_window.AddElement(crea_button);

                accepta_button = new UI_Button(new Point(845, 431), 110, 25, "Desa i surt");
                accepta_button.GetElement().Click += new System.EventHandler(this.Accepta);
                accepta_button.AddImage(principal.imageList1, 2);
                accepta_button.SetFont("Courier New", 8.5f);
                accepta_button.SetColor(Color.Cornsilk);
                main_window.AddElement(accepta_button);

                nom_text = new UI_Text(new Point(500, 15), 150, 30, "Nom");
                nom_text.SetFont("Courier New", 8.5f);
                main_window.AddElement(nom_text);

                nom_text_input = new UI_MaskedTextInput(new Point(500, 40), 200, 50);
                nom_text_input.SetFont("Courier New", 8.5f);
                main_window.AddElement(nom_text_input);

                num_registre_text = new UI_Text(new Point(750, 15), 150, 30, "Num registre");
                num_registre_text.SetFont("Courier New", 8.5f);
                main_window.AddElement(num_registre_text);

                num_registre_input = new UI_MaskedTextInput(new Point(750, 40), 200, 50);
                num_registre_input.SetFont("Courier New", 8.5f);
                main_window.AddElement(num_registre_input);

                formula_text = new UI_Text(new Point(500, 85), 150, 30, "Fórmula");
                formula_text.SetFont("Courier New", 8.5f);
                main_window.AddElement(formula_text);

                formula_text_input = new UI_MaskedTextInput(new Point(500, 110), 450, 50);
                formula_text_input.SetFont("Courier New", 8.5f);
                main_window.AddElement(formula_text_input);
            }
        }
示例#11
0
        void LoadUI()
        {
            main_window = new UI_Window(this);
            {
                grid = new UI_Grid(new Point(15, 15), 470, 405);
                grid.AddColumn("Tipus", 150, true); grid.AddColumn("Data compra", 150, true);
                grid.AddColumn("ROMA", 120, true); grid.AddColumn("Darrera inspecció", 120, true); grid.AddColumn("id", 120, true, false);
                grid.GetElement().Click += new System.EventHandler(this.MaquinaClick);
                grid.SetFont("Courier New", 8.5f);
                main_window.AddElement(grid);


                elimina_button = new UI_Button(new Point(14, 431), 140, 25, "Elimina màquina");
                elimina_button.GetElement().Click += new System.EventHandler(this.Elimina);
                elimina_button.AddImage(principal.imageList1, 3);
                elimina_button.SetFont("Courier New", 8.5f);
                main_window.AddElement(elimina_button);

                actualitza_button = new UI_Button(new Point(163, 431), 160, 25, "Actualitza màquina");
                actualitza_button.GetElement().Click += new System.EventHandler(this.Actualitza);
                actualitza_button.AddImage(principal.imageList1, 8);
                actualitza_button.SetFont("Courier New", 8.5f);
                main_window.AddElement(actualitza_button);

                crea_button = new UI_Button(new Point(333, 431), 130, 25, "Crea màquina");
                crea_button.GetElement().Click += new System.EventHandler(this.Crea);
                crea_button.AddImage(principal.imageList1, 6);
                crea_button.SetFont("Courier New", 8.5f);
                main_window.AddElement(crea_button);

                accepta_button = new UI_Button(new Point(845, 431), 110, 25, "Desa i surt");
                accepta_button.AddImage(principal.imageList1, 2);
                accepta_button.SetFont("Courier New", 8.5f);
                accepta_button.SetColor(Color.Cornsilk);
                accepta_button.GetElement().Click += new System.EventHandler(this.Accepta);

                main_window.AddElement(accepta_button);

                propietari_text = new UI_Text(new Point(500, 15), 150, 30, "Propietari");
                propietari_text.SetFont("Courier New", 8.5f);
                main_window.AddElement(propietari_text);

                propietari_combo = new UI_ComboBox(new Point(500, 45), 200, 40);
                propietari_combo.SetFont("Courier New", 8.5f);
                main_window.AddElement(propietari_combo);

                tipus_text = new UI_Text(new Point(500, 85), 150, 30, "Tipus màquinaria");
                tipus_text.SetFont("Courier New", 8.5f);
                main_window.AddElement(tipus_text);

                tipus_text_input = new UI_MaskedTextInput(new Point(500, 110), 200, 50);
                tipus_text_input.SetFont("Courier New", 8.5f);
                main_window.AddElement(tipus_text_input);

                data_text = new UI_Text(new Point(750, 85), 150, 30, "Data Compra");
                data_text.SetFont("Courier New", 8.5f);
                main_window.AddElement(data_text);

                data_data = new UI_DateSelect(new Point(750, 110), 200, 50);
                data_data.SetFont("Courier New", 8.5f);
                main_window.AddElement(data_data);


                roma_text = new UI_Text(new Point(500, 155), 150, 30, "Número ROMA");
                roma_text.SetFont("Courier New", 8.5f);
                main_window.AddElement(roma_text);

                roma_text_input = new UI_MaskedTextInput(new Point(500, 180), 200, 50);
                roma_text_input.SetFont("Courier New", 8.5f);
                main_window.AddElement(roma_text_input);

                inspeccio_text = new UI_Text(new Point(750, 155), 150, 30, "Darrera inspecció");
                inspeccio_text.SetFont("Courier New", 8.5f);
                main_window.AddElement(inspeccio_text);

                inspeccio_data = new UI_DateSelect(new Point(750, 180), 200, 50);
                inspeccio_data.SetFont("Courier New", 8.5f);
                main_window.AddElement(inspeccio_data);

                tipus_panel = new UI_Panel(new Point(500, 220), 400, 100);
                tipus_panel.SetFont("Courier New", 8.5f);
                main_window.AddElement(tipus_panel);

                propia_radiobutton = new UI_RadioButton(new Point(0, 0), "Propia");
                propia_radiobutton.SetFont("Courier New", 8.5f);
                tipus_panel.AddElement(propia_radiobutton);

                llogada_radiobutton = new UI_RadioButton(new Point(130, 0), "Llogada");
                llogada_radiobutton.SetFont("Courier New", 8.5f);
                tipus_panel.AddElement(llogada_radiobutton);
            }
        }
示例#12
0
        public void InitializeUISettings(SpriteBatch spritebatch)
        {
            // Play Button Config
            QuickHotbar.ui_elements[0].UpdateFunctions.Add(delegate()
            {
                if (((UI_TexButton)QuickHotbar.ui_elements[0]).IsActivated != Simulator.IsSimulating)
                {
                    App.simulator.SetSimulationState(((UI_TexButton)QuickHotbar.ui_elements[0]).IsActivated);
                }
            });

            //Config Button Configs
            ((UI_Button_Menu)ButtonMenu_Config.ui_elements[0]).GotActivatedLeft += delegate(object sender)
            {
                Simulator.ProjectSizeX = 2048;
                Simulator.ProjectSizeY = 2048;
            };

            ((UI_Button_Menu)ButtonMenu_Config.ui_elements[1]).GotActivatedLeft += delegate(object sender)
            {
                Simulator.ProjectSizeX = 4096;
                Simulator.ProjectSizeY = 4096;
            };
            ((UI_Button_Menu)ButtonMenu_Config.ui_elements[2]).GotActivatedLeft += delegate(object sender)
            {
                Simulator.ProjectSizeX = 6144;
                Simulator.ProjectSizeY = 6144;
            };
            ((UI_Button_Menu)ButtonMenu_Config.ui_elements[3]).GotActivatedLeft += delegate(object sender)
            {
                Simulator.ProjectSizeX = 10240;
                Simulator.ProjectSizeY = 10240;
            };
            ((UI_Button_Menu)ButtonMenu_Config.ui_elements[4]).GotActivatedLeft += delegate(object sender)
            {
                Simulator.ProjectSizeX = 16384;
                Simulator.ProjectSizeY = 16384;
            };

            // Button File
            ((UI_Button_Menu)ButtonMenu_File.ui_elements[0]).GotActivatedLeft += delegate(object sender)
            {
                if (Simulator.cursimframe == 0)
                {
                    FileHandler.Save();
                }
                else
                {
                    UI_Handler.notificationHandler.AddNotification("Cant save circuit when the simulation is not reseted.");
                }
            };
            ((UI_Button_Menu)ButtonMenu_File.ui_elements[1]).GotActivatedLeft += delegate(object sender)
            {
                if (Simulator.cursimframe == 0)
                {
                    FileHandler.SaveAs();
                }
                else
                {
                    UI_Handler.notificationHandler.AddNotification("Cant save circuit when the simulation is not reseted.");
                }
            };
            ((UI_Button_Menu)ButtonMenu_File.ui_elements[2]).GotActivatedLeft += delegate(object sender)
            {
                if (Simulator.cursimframe == 0)
                {
                    FileHandler.OpenFrom();
                }
                else
                {
                    UI_Handler.notificationHandler.AddNotification("Cant load a circuit when the simulation is not reseted.");
                }
            };

            //Reset Button Config
            ((UI_TexButton)QuickHotbar.ui_elements[1]).GotActivatedLeft += delegate(object sender)
            {
                Simulator.cursimframe = 0;
                ((UI_TexButton)QuickHotbar.ui_elements[0]).IsActivated = false;
                Simulator.IsSimulating = false;
                Sim_Component.ClearAllHeighlighting();
            };

            // ComponentBox UI Toggle
            ButtonMenu_View.ui_elements[0].UpdateFunctions.Add(delegate()
            {
                UI_Button_Menu current = (UI_Button_Menu)ButtonMenu_View.ui_elements[0];
                if (current.IsToggle)
                {
                    ComponentBox.GetsUpdated = ComponentBox.GetsDrawn = current.IsActivated;
                }
                else
                {
                    current.IsActivated = ComponentBox.GetsUpdated;
                }
            });
            // Library Window UI Toggle
            ButtonMenu_Tools.ui_elements[0].UpdateFunctions.Add(delegate()
            {
                UI_Button_Menu current = (UI_Button_Menu)ButtonMenu_Tools.ui_elements[0];
                if (current.IsToggle)
                {
                    LibraryEditWindow.GetsUpdated = LibraryEditWindow.GetsDrawn = current.IsActivated;
                }
                else
                {
                    current.IsActivated = LibraryEditWindow.GetsUpdated;
                }
            });
            ButtonMenu_Tools.ui_elements[1].UpdateFunctions.Add(delegate()
            {
                UI_Button_Menu current = (UI_Button_Menu)ButtonMenu_Tools.ui_elements[1];
                if (current.IsToggle)
                {
                    ProjectLibWindow.GetsUpdated = ProjectLibWindow.GetsDrawn = current.IsActivated;
                }
                else
                {
                    current.IsActivated = ProjectLibWindow.GetsUpdated;
                }
            });
            // QuickHotbar UI Toggle
            ButtonMenu_View.ui_elements[1].UpdateFunctions.Add(delegate()
            {
                UI_Button_Menu current = (UI_Button_Menu)ButtonMenu_View.ui_elements[1];
                if (current.IsToggle)
                {
                    QuickHotbar.GetsUpdated = QuickHotbar.GetsDrawn = current.IsActivated;
                }
                else
                {
                    current.IsActivated = QuickHotbar.GetsUpdated;
                }
            });
            // Layer Select UI Toggle
            ButtonMenu_View.ui_elements[2].UpdateFunctions.Add(delegate()
            {
                UI_Button_Menu current = (UI_Button_Menu)ButtonMenu_View.ui_elements[2];
                if (current.IsToggle)
                {
                    LayerSelectHotbar.GetsUpdated = LayerSelectHotbar.GetsDrawn = current.IsActivated;
                }
                else
                {
                    current.IsActivated = LayerSelectHotbar.GetsUpdated;
                }
            });
            // Console Window
            ButtonMenu_View.ui_elements[2].UpdateFunctions.Add(delegate()
            {
                UI_Button_Menu current = (UI_Button_Menu)ButtonMenu_View.ui_elements[3];
                if (current.IsToggle)
                {
                    IntPtr consolewindowhandle = App.GetConsoleWindow();
                    App.IsConsoleWindow        = current.IsActivated;
                    if (App.IsConsoleWindow)
                    {
                        App.ShowWindow(consolewindowhandle, App.SW_SHOW);
                    }
                    else
                    {
                        App.ShowWindow(consolewindowhandle, App.SW_HIDE);
                    }
                }
                else
                {
                    current.IsActivated = App.IsConsoleWindow;
                }
            });

            //Configs for Main Toolbar Buttons
            toolbar_menus = new UI_Element[] { ButtonMenu_File, ButtonMenu_Config, ButtonMenu_View, ButtonMenu_Tools, ButtonMenu_Help };

            for (int i = 0; i < 5; ++i)
            {
                int ii = i;
                toolbar_menus[i].UpdateFunctions.Add(delegate()
                {
                    UI_Button cur = (UI_Button)Toolbar.ui_elements[ii];
                    toolbar_menus[ii].GetsDrawn = toolbar_menus[ii].GetsUpdated = cur.IsActivated;

                    // Deactivate current active button when something else got pressed
                    bool IsInOther = new Rectangle(cur.absolutpos, cur.size).Contains(App.mo_states.New.Position);
                    IsInOther     |= new Rectangle(toolbar_menus[ii].absolutpos, toolbar_menus[ii].size).Contains(App.mo_states.New.Position);
                    if (cur.IsActivated && (App.mo_states.IsLeftButtonToggleOff() || App.mo_states.IsLeftButtonToggleOn()) && !IsInOther)
                    {
                        cur.IsActivated = false;
                    }
                });
            }

            EditLib.UpdateFunctions.Add(delegate()
            {
                if (App.mo_states.IsLeftButtonToggleOff())
                {
                    EditLib.GetsUpdated = EditLib.GetsDrawn = false;
                }
            });
            EditProjectLib.UpdateFunctions.Add(delegate()
            {
                if (App.mo_states.IsLeftButtonToggleOff())
                {
                    EditProjectLib.GetsUpdated = EditProjectLib.GetsDrawn = false;
                }
            });
            EditComp.UpdateFunctions.Add(delegate()
            {
                if (App.mo_states.IsLeftButtonToggleOff())
                {
                    EditComp.GetsUpdated = EditComp.GetsDrawn = false;
                }
            });
            //UI Layer Select Hotbar change
            for (int i = 0; i < LayerSelectHotbar.ui_elements.Count; ++i)
            {
                (LayerSelectHotbar.ui_elements[i] as UI_TexButton).GotToggledLeft += LayerHotBarButton_Pressed;
            }
            for (int i = 0; i < WireMaskHotbar.ui_elements.Count; ++i)
            {
                (WireMaskHotbar.ui_elements[i]).GetsPressedLeft  += WireMaskBar_PressedLeft;
                (WireMaskHotbar.ui_elements[i]).GetsPressedRight += WireMaskBar_PressedRight;
                //(WireMaskHotbar.ui_elements[i]).GetsHovered += WireMaskBar_Hovered;
            }



            //Changin Simspeed int the UI
            (GeneralInfoBox.ui_elements[1] as UI_StringButton).GotToggledLeft += inreaseSimSpeed;
            (GeneralInfoBox.ui_elements[2] as UI_StringButton).GotToggledLeft += decreaseSimSpeed;


            ((UI_TexButton)QuickHotbar.ui_elements[5]).GotActivatedLeft += delegate(object sender)
            {
                ((UI_TexButton)QuickHotbar.ui_elements[5]).IsActivated = true;
                App.simulator.ChangeToolmode(Simulator.TOOL_WIRE);
                ((UI_TexButton)QuickHotbar.ui_elements[4]).IsActivated = false;
            };

            ((UI_TexButton)QuickHotbar.ui_elements[4]).GotToggledLeft += delegate(object sender)
            {
                ((UI_TexButton)QuickHotbar.ui_elements[4]).IsActivated = true;
                App.simulator.ChangeToolmode(Simulator.TOOL_SELECT);
                ((UI_TexButton)QuickHotbar.ui_elements[5]).IsActivated = false;
            };

            ((UI_TexButton)QuickHotbar.ui_elements[2]).GotActivatedLeft += delegate(object sender)
            {
                if (((UI_TexButton)QuickHotbar.ui_elements[2]).IsActivated)
                {
                    if (Simulator.cursimframe == 0)
                    {
                        FileHandler.Save();
                    }
                    else
                    {
                        UI_Handler.notificationHandler.AddNotification("Cant save circuit when the simulation is not reseted.");
                    }
                }
            };

            ((UI_TexButton)QuickHotbar.ui_elements[3]).GotActivatedLeft += delegate(object sender)
            {
                if (((UI_TexButton)QuickHotbar.ui_elements[3]).IsActivated)
                {
                    if (Simulator.cursimframe == 0)
                    {
                        FileHandler.OpenFrom();
                    }
                    else
                    {
                        UI_Handler.notificationHandler.AddNotification("Cant load a circuit when the simulation is not reseted.");
                    }
                }
            };
            WireMaskBar_PressedLeft(WireMaskHotbar.ui_elements[0]);
        }
示例#13
0
        void LoadUI()
        {
            main_window = new UI_Window(this);
            {
                grid = new UI_Grid(new Point(15, 15), 470, 405);
                grid.AddColumn("Nom", 150, true); grid.AddColumn("NIF", 150, true); grid.AddColumn("Núm aplicador", 70, true);
                grid.AddColumn("Qualificació", 120, true); grid.AddColumn("id", 120, true, false);
                grid.GetElement().Click += new System.EventHandler(this.PersonalClick);
                grid.SetFont("Courier New", 8.5f);
                main_window.AddElement(grid);


                elimina_button = new UI_Button(new Point(337, 431), 140, 25, "Elimina persona");
                elimina_button.GetElement().Click += new System.EventHandler(this.Elimina);
                elimina_button.AddImage(principal.imageList1, 3);
                elimina_button.SetFont("Courier New", 8.5f);
                main_window.AddElement(elimina_button);

                actualitza_button = new UI_Button(new Point(153, 431), 175, 25, "Actualitza persona");
                actualitza_button.GetElement().Click += new System.EventHandler(this.Actualitza);
                actualitza_button.AddImage(principal.imageList1, 8);
                actualitza_button.SetFont("Courier New", 8.5f);
                main_window.AddElement(actualitza_button);

                crea_button = new UI_Button(new Point(14, 431), 130, 25, "Crea persona");
                crea_button.GetElement().Click += new System.EventHandler(this.Crea);
                crea_button.AddImage(principal.imageList1, 6);
                crea_button.SetFont("Courier New", 8.5f);
                main_window.AddElement(crea_button);

                accepta_button = new UI_Button(new Point(845, 431), 110, 25, "Desa i surt");
                accepta_button.GetElement().Click += new System.EventHandler(this.Accepta);
                accepta_button.AddImage(principal.imageList1, 2);
                accepta_button.SetFont("Courier New", 8.5f);
                accepta_button.SetColor(Color.Cornsilk);
                main_window.AddElement(accepta_button);

                propietari_text = new UI_Text(new Point(500, 15), 150, 30, "Propietari");
                propietari_text.SetFont("Courier New", 8.5f);
                main_window.AddElement(propietari_text);

                propietari_combo = new UI_ComboBox(new Point(500, 45), 200, 40);
                propietari_combo.SetFont("Courier New", 8.5f);
                main_window.AddElement(propietari_combo);

                nom_text = new UI_Text(new Point(500, 85), 150, 30, "Nom");
                nom_text.SetFont("Courier New", 8.5f);
                main_window.AddElement(nom_text);

                nom_text_input = new UI_MaskedTextInput(new Point(500, 110), 200, 50);
                nom_text_input.SetFont("Courier New", 8.5f);
                main_window.AddElement(nom_text_input);

                nif_text = new UI_Text(new Point(750, 85), 150, 30, "NIF");
                nif_text.SetFont("Courier New", 8.5f);
                main_window.AddElement(nif_text);

                nif_text_input = new UI_MaskedTextInput(new Point(750, 110), 200, 50);
                nif_text_input.SetFont("Courier New", 8.5f);
                main_window.AddElement(nif_text_input);


                num_carnet_text = new UI_Text(new Point(500, 155), 150, 30, "Num aplicador");
                num_carnet_text.SetFont("Courier New", 8.5f);
                main_window.AddElement(num_carnet_text);

                num_carnet_text_input = new UI_MaskedTextInput(new Point(500, 180), 200, 50);
                num_carnet_text_input.SetFont("Courier New", 8.5f);
                main_window.AddElement(num_carnet_text_input);

                qualificacio_text = new UI_Text(new Point(750, 155), 150, 30, "Nivell qualificació");
                qualificacio_text.SetFont("Courier New", 8.5f);
                main_window.AddElement(qualificacio_text);

                qualificacio_text_input = new UI_MaskedTextInput(new Point(750, 180), 200, 50);
                qualificacio_text_input.SetFont("Courier New", 8.5f);
                main_window.AddElement(qualificacio_text_input);

                tipus_panel = new UI_Panel(new Point(500, 210), 400, 100);
                main_window.AddElement(tipus_panel);

                propi_radiobutton = new UI_RadioButton(new Point(0, 0), "Propi");
                propi_radiobutton.SetFont("Courier New", 8.5f);
                tipus_panel.AddElement(propi_radiobutton);

                contractat_radiobutton = new UI_RadioButton(new Point(130, 0), "Contractat");
                contractat_radiobutton.SetFont("Courier New", 8.5f);
                tipus_panel.AddElement(contractat_radiobutton);

                serveis_radiobutton = new UI_RadioButton(new Point(260, 0), "Serveis");
                serveis_radiobutton.SetFont("Courier New", 8.5f);
                tipus_panel.AddElement(serveis_radiobutton);
            }
        }