private void entrar_Click(object sender, EventArgs e)
        {
            // 1 es Verdadero
            // 0 es falso
            if (this.password.Text == "")
            {
                MessageBox.Show("Tenes que ingresar una password");
                return;
            }

            if (this.usuario.Text == "")
            {
                MessageBox.Show("Debe ingresar un usuario");
                return;
            }

            Usuario usr = new Usuario();
            usr = usr.buscar(this.usuario.Text);

            if (usr != null)
            {
                if (usr.IntentosFallidos >= 3)
                {
                    MessageBox.Show("Su usuario fue inhabilitado. Comunicate con el administrador");
                    return;
                }

                byte[] data = Utiles.encriptar(this.password.Text);

                if (!(usr.Password.SequenceEqual(data)))
                {
                    MessageBox.Show("Clave Incorrecta");
                    usr.IntentosFallidos = usr.IntentosFallidos + 1;
                    usr.update();

                    if (usr.IntentosFallidos > 3)
                    {
                        MessageBox.Show("Supero la cantidad de intentos. Su usuario fue inhabilitado. Comunicate con el administrador");
                        return;
                    }
                    return;
                }

            }
            else
            {
                MessageBox.Show("Usuario no encontrado");
                return;
            }

            usr.IntentosFallidos = 0;
            usr.update();

            MenuForm menu = new MenuForm();
            menu.setPermisos(1);
            this.Hide();
            menu.ShowDialog();
            this.Close();
        }
 private void button2_Click(object sender, EventArgs e)
 {
     MenuForm menu = new MenuForm();
     menu.setPermisos(0);
     this.Hide();
     menu.ShowDialog();
     this.Show();
 }
Esempio n. 3
0
        void btnDone_Click(object sender, EventArgs e)
        {
            var name   = this.txtName.Text;
            var gender = false;

            if (this.rdbMale.Checked == true)
            {
                gender = true;
            }
            else
            {
                gender = false;
            }
            var birthday = this.dtpBirthday.Value;
            var heigth   = int.Parse(this.txtHeight.Text);
            var weight   = int.Parse(this.txtWeight.Text);
            var active   = this.cbxActive.SelectedValue.ToString();

            var menu = new MenuForm(name, gender, heigth, weight, birthday, active);

            menu.Show();
            this.Visible = false;
        }
Esempio n. 4
0
        private void frmSample25_Load(object sender, System.EventArgs e)
        {
            grid.Redim(1, 3);

            grid[0, 0] = new SourceGrid.Cells.ColumnHeader("Date");
            grid[0, 1] = new SourceGrid.Cells.ColumnHeader("Type");
            grid[0, 2] = new SourceGrid.Cells.ColumnHeader("Description");

            grid.AutoStretchColumnsToFitWidth = true;
            grid.Selection.SelectionMode      = SourceGrid.GridSelectionMode.Row;


            AddLog("Log", "Application Started");



            //Create Data Cells
            System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
            Type[] assemblyTypes = assembly.GetTypes();
            for (int i = 0; i < assemblyTypes.Length; i++)
            {
                object[] attributes = assemblyTypes[i].GetCustomAttributes(typeof(SampleAttribute), true);
                if (attributes != null && attributes.Length > 0)
                {
                    SampleAttribute sampleAttribute = (SampleAttribute)attributes[0];

                    AddLog("Log Menu", "Add menu for " + sampleAttribute.Description + " " + assemblyTypes[i].Name);

                    if (assemblyTypes[i] != this.GetType())
                    {
                        MenuItem menu = new MenuForm(this, assemblyTypes[i], sampleAttribute.Description + " " + sampleAttribute.SampleNumber.ToString());
                        mnWindow.MenuItems.Add(menu);
                    }
                }
            }
        }
Esempio n. 5
0
        private void LoadServiceData(ServiceDocument serviceDocument)
        {
            Dictionary <Component, IConnection> widgetEquivalences = new Dictionary <Component, IConnection>();

            foreach (Component component in serviceDocument.Components)
            {
                Type type = component.GetType();
                switch (type.Name)
                {
                case "DataSource":
                    DataSource            dataSource            = component as DataSource;
                    DataSourceSilverlight dataSourceSilverlight = new DataSourceSilverlight(dataSource);
                    Builder(dataSourceSilverlight);
                    widgetEquivalences.Add(dataSource, dataSourceSilverlight);
                    break;

                case "ListForm":
                    ListForm            listForm            = component as ListForm;
                    ListFormSilverlight listFormSilverlight = new ListFormSilverlight(listForm);
                    Builder(listFormSilverlight);
                    widgetEquivalences.Add(listForm, listFormSilverlight);
                    break;

                case "ShowDataForm":
                    ShowDataForm            showDataForm            = component as ShowDataForm;
                    ShowDataFormSilverlight showDataFormSilverlight = new ShowDataFormSilverlight(showDataForm);
                    Builder(showDataFormSilverlight);
                    widgetEquivalences.Add(showDataForm, showDataFormSilverlight);
                    break;

                case "EnterSingleDataForm":
                    EnterSingleDataForm            enterSingleDataForm   = component as EnterSingleDataForm;
                    EnterSingleDataFormSilverlight singleDataSilverlight = new EnterSingleDataFormSilverlight(enterSingleDataForm);
                    Builder(singleDataSilverlight);
                    widgetEquivalences.Add(enterSingleDataForm, singleDataSilverlight);
                    break;

                case "MenuForm":
                    MenuForm            menuForm        = component as MenuForm;
                    MenuFormSilverlight menuSilverlight = new MenuFormSilverlight(menuForm);
                    Builder(menuSilverlight);
                    widgetEquivalences.Add(menuForm, menuSilverlight);
                    foreach (MenuItemSilverlight menuItemSilverlight in menuSilverlight.MenuItemsSilverlight)
                    {
                        widgetEquivalences.Add(menuItemSilverlight.FormMenuItem, menuItemSilverlight);
                    }
                    break;

                default:
                    throw new ArgumentException(SilverlightVisualDesigners.Properties.Resources.InvalidTypeOfWidget);
                }
            }

            this.canvasDraw.UpdateLayout();

            foreach (Connection connection in serviceDocument.Connections)
            {
                IConnection from   = widgetEquivalences[connection.Source.Parent];
                IConnection target = widgetEquivalences[connection.Target.Parent];

                ConnectionSilverlight connectionSilverlight = new ConnectionSilverlight(from, target);
                connectionSilverlight.Connection = connection;
                AddRelation(connectionSilverlight);
            }
        }
Esempio n. 6
0
 private void SaveToClipboard(Image image)
 {
     Clipboard.SetImage(image);
     MenuForm.MinimizeFootprint();
 }
Esempio n. 7
0
		private void frmSample25_Load(object sender, System.EventArgs e)
		{
			grid.Redim(1, 3);

            grid.Columns[0].AutoSizeMode = SourceGrid.AutoSizeMode.EnableAutoSize;
            grid.Columns[1].AutoSizeMode = SourceGrid.AutoSizeMode.EnableAutoSize;
            grid.Columns[2].AutoSizeMode = SourceGrid.AutoSizeMode.EnableAutoSize | SourceGrid.AutoSizeMode.EnableStretch;

            grid.FixedRows = 1;

			grid[0, 0] = new SourceGrid.Cells.ColumnHeader("Date");
			grid[0, 1] = new SourceGrid.Cells.ColumnHeader("Type");
			grid[0, 2] = new SourceGrid.Cells.ColumnHeader("Description");

			grid.AutoStretchColumnsToFitWidth = true;
			grid.SelectionMode = SourceGrid.GridSelectionMode.Row;

			AddLog("Log", "Application Started");


			//Create Data Cells
			System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();
			Type[] assemblyTypes = assembly.GetTypes();
			for (int i = 0; i < assemblyTypes.Length; i++)
			{
				object[] attributes = assemblyTypes[i].GetCustomAttributes(typeof(SampleAttribute), true);
				if (attributes != null && attributes.Length > 0)
				{
					SampleAttribute sampleAttribute = (SampleAttribute)attributes[0];

					AddLog("Log Menu", "Add menu for " + sampleAttribute.Description + " " + assemblyTypes[i].Name);

					if (assemblyTypes[i] != this.GetType())
					{
						MenuItem menu = new MenuForm(this, assemblyTypes[i], sampleAttribute.Description + " " + sampleAttribute.SampleNumber.ToString());
						mnWindow.MenuItems.Add(menu);
					}
				}
			}

            for (int i = 0; i < 200; i++)
                AddLog("Log", "Application test " + i.ToString());

            grid.Columns.AutoSize(true);
            grid.Columns.StretchToFit();
        }
Esempio n. 8
0
 public CaptureFolio(MenuForm form)
 {
     InitializeComponent();
     menu = form;
 }
Esempio n. 9
0
        /// <summary>
        /// Konstruktor dla gry bez ustawionego "�rodowiska gry" w postaci gracza i planszy
        /// </summary>
        public Game()
        {
            Form = new MenuForm();
            Form.GamePause = false;
            isStarted = false;

            Form.gameInstance = this;
            Form.Show();
            graphics = new GraphicsDeviceManager(this)
            {
                PreferredBackBufferWidth = Form.ViewportSize.Width,
                PreferredBackBufferHeight = Form.ViewportSize.Height
            };
            graphics.PreparingDeviceSettings += graphics_PreparingDeviceSettings;
            System.Windows.Forms.Control.FromHandle(Window.Handle).VisibleChanged += MainGame_VisibleChanged;
            System.Windows.Forms.Control.FromHandle(Form.Handle).KeyUp += new System.Windows.Forms.KeyEventHandler(Game_KeyUp);
            System.Windows.Forms.Control.FromHandle(Form.Handle).KeyPress += new System.Windows.Forms.KeyPressEventHandler(Game_KeyPress);
            System.Windows.Forms.Control.FromHandle(Form.Handle).KeyDown += new System.Windows.Forms.KeyEventHandler(Game_Key);
            Content.RootDirectory = "Content";
            IsMouseVisible = true;
        }
Esempio n. 10
0
        public override void InitState()
        {
            GameGlobal.ContentPath = ContentPath;
            base.InitState();

            var split1 = new HorizontalSplitterForm().Set(0, 0, AppInfo.W, AppInfo.H) as HorizontalSplitterForm;

            split1.SetSplit(AppInfo.H - AppInfo.H / 4);

            var tileBrowse = new TileBrowser().Set(0, 0, split1.BotDock.W, split1.BotDock.H) as TileBrowser;;

            split1.SetBottom(tileBrowse);

            var split2 = new HorizontalSplitterForm().Set(0, 0, split1.TopDock.W, split1.TopDock.H) as HorizontalSplitterForm;

            var menu = new MenuForm().Set(0, 0, AppInfo.W, 20) as MenuForm;

            UI.Menu = menu;

            var menu_map = menu.AddItem("Map");

            menu_map.Menu.AddItem("Load Map");
            menu_map.Menu.AddItem("Save Map");
            menu_map.Menu.AddItem("New Map");
            menu_map.Menu.AddItem("Exit", (b) => { Environment.Exit(1); });

            var menu_tiles = menu.AddItem("Tiles");

            var tiles_newSet = menu_tiles.Menu.AddItem("New Set");
            var tiles_addSet = menu_tiles.Menu.AddItem("Add set");

            tiles_newSet.Click = (b) =>
            {
                tileBrowse.newSet();
            };

            tiles_addSet.Click = (b) =>
            {
                var reqs = new RequestFileForm("Load tileset .ts..", ContentPath);
                SUI.Top       = reqs;
                reqs.Selected = (path) =>
                {
                    var ts = new TileSet(path);
                    ts.Load(path);
                    SUI.Top = null;

                    tileBrowse.AddTileSet(ts);
                };
            };


            menu.AddItem("Edit");
            //menu.AddItem("")
            split1.SetTop(split2);

            UIForm topForm = new UIForm().Set(0, 0, split2.TopDock.W, split2.TopDock.H);

            //topForm.Add(menu);
            //split2.SetTop(topForm);

            //split1.SetTop(split2);

            split2.SetSplit(50);

            var split3 = new VerticalSplitterForm().Set(0, 0, split2.BotDock.W, split2.BotDock.H) as VerticalSplitterForm;

            var toolRoot = new UIForm().Set(0, 0, split2.TopDock.W, split2.TopDock.H);


            split2.SetTop(toolRoot);

            split2.SetBottom(split3);

            split3.SetSplit(150);

            var nodeTree = new NodeGraphView().Set(0, 0, split3.LeftDock.W, split3.LeftDock.H, "Scene Nodes") as NodeGraphView;

            split3.SetLeft(nodeTree);



            var nodeBrowse = new NodeBrowser().Set(0, 0, split3.LeftDock.W, split3.LeftDock.H) as NodeBrowser;


            //split3.SetLeft(nodeBrowse);

            var mapEdit = new MapEditForm().Set(0, 0, split3.RightDock.W, split3.RightDock.H) as MapEditForm;

            nodeTree.SetMap(mapEdit.CurMap);

            split3.SetRight(mapEdit);

            SUI      = new UI();
            SUI.Root = split1;


            var toolBar = new ToolBarForm().Set(0, 0, toolRoot.W, 25) as ToolBarForm;

            var tb_paste     = toolBar.AddItem("Paste");
            var tb_rect      = toolBar.AddItem("Rect");
            var tb_oval      = toolBar.AddItem("Oval");
            var tb_fill      = toolBar.AddItem("Fill");
            var tb_smartfill = toolBar.AddItem("Smart-Fill");

            tb_paste.Click = () =>
            {
                mapEdit.Mode = EditMode.Paste;
            };

            tb_fill.Click = () =>
            {
                mapEdit.Mode = EditMode.Fill;
            };



            toolRoot.Add(toolBar);

            var mapMode  = new Texture2D("content/edit/mapmode.png", LoadMethod.Single, true);
            var tileMode = new Texture2D("content/edit/tiles.png", LoadMethod.Single, true);

            SUI.Dock.AddIcon(mapMode, 64);
            var mode_Tiles = SUI.Dock.AddIcon(tileMode, 64);

            mode_Tiles.Click = () => {
                UI.Menu = null;
                Vivid.App.VividApp.PushState(new MapViewer.States.TileSetEditor());
            };
        }
Esempio n. 11
0
 public AssistantCardContainer(List <Tour> tourList, MenuForm form) : base()
 {
     formAnterior = form;
     TourList     = tourList;
     ArrangeCardGrid();
 }
Esempio n. 12
0
 public MenuFormController(IDialogService dialog, MenuForm form)
 {
     _dialog = dialog;
     _form   = form;
 }
Esempio n. 13
0
 public MenuSteps(MenuForm menu)
 {
     this.menu = menu;
 }
Esempio n. 14
0
        public Collection <Error> CheckDesignerLogic()
        {
            List <string>      formTitle = new List <string>();
            Collection <Error> errors    = new Collection <Error>();

            foreach (Widget component in Components)
            {
                DataSource          dataSource          = component as DataSource;
                EnterSingleDataForm enterSingleDataForm = component as EnterSingleDataForm;
                MenuForm            menuDataForm        = component as MenuForm;
                ShowDataForm        showDataForm        = component as ShowDataForm;

                // Verifica si el título esta repetido.
                if (formTitle.Contains(component.Title))
                {
                    errors.Add(new Error(LogicalLibrary.Properties.Resources.FormError, "", LogicalLibrary.Properties.Resources.TitleRepited + component.Title));
                }
                else
                {
                    formTitle.Add(component.Title);
                }

                if (dataSource != null)
                {
                    if (component.OutputDataContext == null || dataSource.RelatedTable.IsStorage)
                    {
                        if (component.InputConnectionPoint.Connection.Count == 0)
                        {
                            errors.Add(new Error(LogicalLibrary.Properties.Resources.DataStorageError, "", LogicalLibrary.Properties.Resources.NoInputToStorage + " " + dataSource.Name));
                        }
                    }
                    else if (component.OutputConnectionPoint.Connection.Count == 0)
                    {
                        errors.Add(new Error(LogicalLibrary.Properties.Resources.DataSourceError, "", LogicalLibrary.Properties.Resources.NoDataSourceConnection + " " + dataSource.Name));
                    }
                }

                else if (component is ListForm)
                {
                    if (component.InputDataContext == null)
                    {
                        errors.Add(new Error(LogicalLibrary.Properties.Resources.FormError, "", LogicalLibrary.Properties.Resources.NoInputContextListForm + " " + component.Title));
                    }
                    if (component.OutputDataContext == null)
                    {
                        errors.Add(new Error(LogicalLibrary.Properties.Resources.FormError, "", LogicalLibrary.Properties.Resources.NoOutputContextListForm + " " + component.Title));
                    }
                }
                else if (menuDataForm != null)
                {
                    if (menuDataForm.MenuItems.Count == 0)
                    {
                        errors.Add(new Error(LogicalLibrary.Properties.Resources.FormError, "", LogicalLibrary.Properties.Resources.NoMenuOptionItem + " " + component.Title));
                    }
                    foreach (FormMenuItem menuItem in menuDataForm.MenuItems)
                    {
                        if (menuItem.OutputConnectionPoint.Connection.Count == 0)
                        {
                            errors.Add(new Error(LogicalLibrary.Properties.Resources.FormError, "", LogicalLibrary.Properties.Resources.NoMenuOptionItemTarget + " " + component.Title));
                        }
                    }
                }

                else if (enterSingleDataForm != null)
                {
                    if (String.IsNullOrEmpty(enterSingleDataForm.DescriptiveText) || String.IsNullOrEmpty(enterSingleDataForm.DataName))
                    {
                        errors.Add(new Error(LogicalLibrary.Properties.Resources.FormError, "", LogicalLibrary.Properties.Resources.InputFormNoEdited + " " + component.Title));
                    }
                    bool haveStorage = false;
                    foreach (Connection con in enterSingleDataForm.OutputConnectionPoint.Connection)
                    {
                        if (con.Target.Parent is DataSource)
                        {
                            haveStorage = true;
                        }
                    }
                    if (!haveStorage)
                    {
                        errors.Add(new Error(LogicalLibrary.Properties.Resources.FormError, "", LogicalLibrary.Properties.Resources.NoStorageForInputForm + " " + component.Title));
                    }
                }
                else if (showDataForm != null)
                {
                    if (component.InputDataContext == null)
                    {
                        errors.Add(new Error(LogicalLibrary.Properties.Resources.FormError, "", LogicalLibrary.Properties.Resources.NoInputContextShowForm + " " + component.Title));
                    }

                    if (component.OutputDataContext == null)
                    {
                        errors.Add(new Error(LogicalLibrary.Properties.Resources.FormError, "", LogicalLibrary.Properties.Resources.NoOutputContextShowForm + " " + component.Title));
                    }
                }
            }
            return(errors);
        }
Esempio n. 15
0
 public MessageComparison(MenuForm form)
 {
     InitializeComponent();
     menu = form;
     setColors(menu.configData);
 }
Esempio n. 16
0
        public void ReInitListboxesTest()
        {
            MenuForm form = new MenuForm(hotel, cleaners, customers, persons, stairs, simplePath);

            form.ReInitListboxes();
        }
Esempio n. 17
0
        public void MenuFormTest()
        {
            MenuForm form = new MenuForm(hotel, cleaners, customers, persons, stairs, simplePath);

            Assert.AreEqual(hotel, form.Hotel);
        }
Esempio n. 18
0
 public WypozyczeniaForm(MenuForm menuForm)
 {
     InitializeComponent();
     this.menuForm       = menuForm;
     _klientRepozytorium = (IRepository <Klient>)Program.ServiceProvider.GetService(typeof(IRepository <Klient>));
 }
Esempio n. 19
0
        private async void dgvCinemas_CellContentClick(object sender, DataGridViewCellEventArgs e)
        {
            if (e.RowIndex >= 0)
            {
                var cinemaId = dgvCinemas.Rows[e.RowIndex].Cells["CinemaId"].Value;
                var action   = dgvCinemas.Columns[e.ColumnIndex].Name;
                var cinema   = await _apiService.GetById <Model.Cinema>(cinemaId);

                CustomMessageBox messageBox = new CustomMessageBox();
                MenuForm         menuForm   = (MenuForm)this.MdiParent;

                if (action == "Edit" || action == "Cinema")
                {
                    AddEditCinemaForm form = new AddEditCinemaForm(menuForm, int.Parse(cinemaId.ToString()))
                    {
                        MdiParent = menuForm,
                        Dock      = DockStyle.Fill
                    };
                    form.Show();
                }
                else if (action == "Delete")
                {
                    DialogResult dialogResult = MessageBox.Show($"Are you sure you want to permanently delete '{cinema.Name}'?", "Delete cinema?", MessageBoxButtons.YesNo);
                    if (dialogResult == DialogResult.Yes)
                    {
                        await _apiService.Delete <Model.Cinema>(cinemaId);

                        foreach (Form frm in menuForm.MdiChildren)
                        {
                            frm.Close();
                        }
                        CinemasForm form = new CinemasForm {
                            MdiParent = menuForm,
                            Dock      = DockStyle.Fill
                        };
                        form.Show();
                        messageBox.Show("Cinema deleted successfully", "success");
                    }
                }
                else if (action == "Halls")
                {
                    var cinemaName     = dgvCinemas.Rows[e.RowIndex].Cells["Cinema"].Value;
                    var cinemaLocation = dgvCinemas.Rows[e.RowIndex].Cells["Location"].Value;

                    CinemasHallsForm cinemasHallsForm = new CinemasHallsForm(menuForm, int.Parse(cinemaId.ToString()), cinemaName.ToString(), cinemaLocation.ToString())
                    {
                    };

                    _helper.ShowForm(cinemasHallsForm, 18);
                }
                else if (action == "Schedule")
                {
                    ScheduleForm scheduleForm = new ScheduleForm(int.Parse(cinemaId.ToString()), menuForm)
                    {
                        MdiParent = menuForm,
                        Dock      = DockStyle.Fill
                    };
                    scheduleForm.Show();
                }
                else if (action == "Products")
                {
                    var cinemaName = dgvCinemas.Rows[e.RowIndex].Cells["Cinema"].Value;
                    CinemasProductsForm cinemasProductsForm = new CinemasProductsForm(menuForm, int.Parse(cinemaId.ToString()), cinemaName.ToString());
                    _helper.ShowForm(cinemasProductsForm, 18);
                }
                else
                {
                    return;
                }
            }
        }
Esempio n. 20
0
 protected override void OnFormClosing(FormClosingEventArgs e)
 {
     MenuForm.Show();
 }
Esempio n. 21
0
 public CreateMenuCommand(MenuForm menuForm)
 {
     this.menuForm = menuForm;
 }
Esempio n. 22
0
    public static void Main()
    {
        MenuForm skel = new MenuForm();

        Application.Run(skel);
    }
Esempio n. 23
0
        /// <summary>
        /// Konstruktor dla nowej gry
        /// </summary>
        /// <param name="form">WskaŸnik do okna aplikacji</param>
        /// <param name="player">Instancja gracza</param>
        public Game(DungeonVandal.MenuForm form, Player player)
        {
            Form = form;
            graphics = new GraphicsDeviceManager(this)
            {
                PreferredBackBufferWidth = Form.ViewportSize.Width,
                PreferredBackBufferHeight = Form.ViewportSize.Height
            };

            this.player = player;
            Form.setPlayerName(player.Name);
            graphics.PreparingDeviceSettings += graphics_PreparingDeviceSettings;
            System.Windows.Forms.Control.FromHandle(Window.Handle).VisibleChanged += MainGame_VisibleChanged;
            System.Windows.Forms.Control.FromHandle(Form.Handle).KeyUp += new System.Windows.Forms.KeyEventHandler(Game_KeyUp);
            System.Windows.Forms.Control.FromHandle(Form.Handle).KeyPress += new System.Windows.Forms.KeyPressEventHandler(Game_KeyPress);
            System.Windows.Forms.Control.FromHandle(Form.Handle).KeyDown += new System.Windows.Forms.KeyEventHandler(Game_Key);
            Content.RootDirectory = "Content";
            IsMouseVisible = true;
        }
 public EnfermoRep(MenuForm MF)
 {
     menuForm = MF;
     InitializeComponent();
 }
Esempio n. 25
0
 public MenuController(MenuForm mf, User logovaniKorisnik)
 {
     this.menuForm         = mf;
     this.logovaniKorisnik = logovaniKorisnik;
     initFormLayer();
 }
Esempio n. 26
0
 public AddEditShowForm(MenuForm menuForm, int?showId = null)
 {
     InitializeComponent();
     _menuForm = menuForm;
     _showId   = showId;
 }
Esempio n. 27
0
 public AddEditCinemaForm(MenuForm menuForm, int?cinemaId = null)
 {
     InitializeComponent();
     _cinemaId = cinemaId;
     _menuForm = menuForm;
 }
Esempio n. 28
0
        public override void InitState()
        {
            base.InitState();
            SUI = new Vivid.Resonance.UI();

            var main_menu = new MenuForm().Set(0, 0, AppInfo.W, 25, "") as MenuForm;

            UIForm ui_Root = new UIForm();

            ui_Root.Add(main_menu);

            SUI.Root = ui_Root;

            var menu_TileSet = main_menu.AddItem("TileSet");

            main_menu.AddItem("Edit");

            var win_NewSet  = new WindowForm().Set(50, 100, 500, 300, "New Tileset") as WindowForm;
            var newSet_Name = new TextBoxForm().Set(85, 5, 120, 25, "") as TextBoxForm;

            win_NewSet.body.Add(newSet_Name);
            var newSet_Label = new LabelForm().Set(5, 5, 35, 25, "SetName");

            var newSet_Create = new ButtonForm().Set(5, 245, 60, 25, "Create");

            win_NewSet.body.Add(newSet_Create);


            win_NewSet.body.Add(newSet_Label);


            void click_NewSet(int b)
            {
                SUI.Top = win_NewSet;
            }

            void click_Exit(int b)
            {
                Environment.Exit(1);
            }

            void click_LoadSet(int b)
            {
                var req = new RequestFileForm("Load set..", ContentPath);

                SUI.Top = req;

                req.Selected = (path) =>
                {
                    CurSet = new SpaceEngine.Map.TileSet.TileSet("");
                    CurSet.Load(path);

                    CurSetLayer.Fill(null);
                    setX = setY = 0;
                    foreach (var t in CurSet.Tiles)
                    {
                        CurSetLayer.SetTile(setX, setY, t);
                        setX++;
                    }

                    tView.UpdateGraph();
                    // tView.Graph.X = -32 + tView.W / 2;
                    // tView.Graph.Y = -32 + tView.H / 2;
                    SUI.Top = null;
                };
            }

            void click_SaveSet(int b)
            {
                var req = new RequestFileForm("Save set as..", ContentPath);

                SUI.Top = req;

                req.Selected = (path) =>
                {
                    CurSet.Save(path + ".ts");
                    SUI.Top = null;
                };
            }

            menu_TileSet.Menu.AddItem("New Set", click_NewSet);
            menu_TileSet.Menu.AddItem("Load Set", click_LoadSet);
            menu_TileSet.Menu.AddItem("Save Set", click_SaveSet);
            menu_TileSet.Menu.AddItem("Exit", click_Exit);

            ui_Root.Add(CrTileSetEditor());
        }
Esempio n. 29
0
        public override void InitState()
        {
            // GameGlobal.ContentPath = ContentPath;
            base.InitState();

            var split1 = new HorizontalSplitterForm().Set(0, 0, AppInfo.W, AppInfo.H) as HorizontalSplitterForm;

            split1.SetSplit(AppInfo.H - AppInfo.H / 4);

            tileBrowse = new TileBrowser().Set(0, 0, split1.BotDock.W, split1.BotDock.H) as TileBrowser;;

            split1.SetBottom(tileBrowse);

            var split2 = new HorizontalSplitterForm().Set(0, 0, split1.TopDock.W, split1.TopDock.H) as HorizontalSplitterForm;

            var menu = new MenuForm().Set(0, 0, AppInfo.W, 20) as MenuForm;

            UI.Menu = menu;

            var menu_map = menu.AddItem("Map");

            var loadm = menu_map.Menu.AddItem("Load Map");

            loadm.Click = (b) =>
            {
                var req = new RequestFileForm("Select map to load..", GameGlobal.ProjectPath);
                SUI.Top      = req;
                req.Selected = (path) =>
                {
                    mapEdit.LoadMap(path);
                    SUI.Top = null;
                };
            };


            var savem = menu_map.Menu.AddItem("Save Map");

            savem.Click = (b) =>
            {
                var req = new RequestFileForm("Select a name to save..", GameGlobal.ProjectPath);
                SUI.Top      = req;
                req.Selected = (path) =>
                {
                    mapEdit.SaveMap(path);
                    SUI.Top = null;
                };
            };

            var newm = menu_map.Menu.AddItem("New Map");

            newm.Click = (b) =>
            {
                mapEdit.NewMap();


                nodeTree.SetMap(GameGlobal.EditMap);

                SaveEditState();
            };

            var exitm = menu_map.Menu.AddItem("Exit");

            exitm.Click = (b) =>
            {
                SaveEditState();
                Environment.Exit(0);
            };

            //SaveEditState()
            //Environment.Exit(1)


            var menu_tiles = menu.AddItem("Tiles");

            var tiles_newSet = menu_tiles.Menu.AddItem("New Set");
            var tiles_addSet = menu_tiles.Menu.AddItem("Add set");

            tiles_newSet.Click = (b) =>
            {
                tileBrowse.newSet();
                SaveEditState();
            };

            tiles_addSet.Click = (b) =>
            {
                var reqs = new RequestFileForm("Load tileset .ts..", GameGlobal.ContentPath);
                SUI.Top = reqs;

                reqs.Selected = (path) =>
                {
                    var ts = new TileSet(path);
                    ts.Load(path);
                    SUI.Top = null;

                    tileBrowse.AddTileSet(ts);

                    SaveEditState();
                };
            };


            menu.AddItem("Edit");
            //menu.AddItem("")
            split1.SetTop(split2);

            UIForm topForm = new UIForm().Set(0, 0, split2.TopDock.W, split2.TopDock.H);

            //topForm.Add(menu);
            //split2.SetTop(topForm);

            //split1.SetTop(split2);

            split2.SetSplit(50);

            var split3 = new VerticalSplitterForm().Set(0, 0, split2.BotDock.W, split2.BotDock.H) as VerticalSplitterForm;

            var toolRoot = new UIForm().Set(0, 0, split2.TopDock.W, split2.TopDock.H);


            split2.SetTop(toolRoot);

            split2.SetBottom(split3);

            split3.SetSplit(150);

            nodeTree = new NodeGraphView().Set(0, 0, split3.LeftDock.W, split3.LeftDock.H, "Scene Nodes") as NodeGraphView;

            split3.SetLeft(nodeTree);



            var nodeBrowse = new NodeBrowser().Set(0, 0, split3.LeftDock.W, split3.LeftDock.H) as NodeBrowser;


            //split3.SetLeft(nodeBrowse);
            var mapSplit = new VerticalSplitterForm().Set(0, 0, split3.RightDock.W, split3.RightDock.H) as VerticalSplitterForm;

            var classIn = new InspectorForm().Set(0, 0, mapSplit.RightDock.W, mapSplit.RightDock.H) as InspectorForm;

            mapEdit = new MapEditForm().Set(0, 0, split3.RightDock.W, split3.RightDock.H) as MapEditForm;

            mapEdit.Selected = (node) =>
            {
                classIn.SetObj(node);

                //       if (node == null) return;
                //Console.WriteLine("Selected:" + node.Name);
            };

            nodeTree.SetMap(GameGlobal.EditMap);

            split3.SetRight(mapSplit);

            mapSplit.SetLeft(mapEdit);


            mapSplit.SetRight(classIn);

            mapSplit.SetSplit(split3.RightDock.W - 250);


            SUI      = new UI();
            SUI.Root = split1;


            var toolBar = new ToolBarForm().Set(0, 0, toolRoot.W, 25) as ToolBarForm;

            var tb_pick      = toolBar.AddItem("Pick");
            var tb_paste     = toolBar.AddItem("Paste");
            var tb_rect      = toolBar.AddItem("Rect");
            var tb_oval      = toolBar.AddItem("Oval");
            var tb_fill      = toolBar.AddItem("Fill");
            var tb_smartfill = toolBar.AddItem("Smart-Fill");

            tb_pick.Click = () =>
            {
                mapEdit.Mode = EditMode.Pick;
                mapEdit.Rebuild();
            };

            tb_paste.Click = () =>
            {
                mapEdit.Mode = EditMode.Paste;
                mapEdit.Rebuild();
            };


            tb_fill.Click = () =>
            {
                mapEdit.Mode = EditMode.Fill;
                mapEdit.Rebuild();
            };



            toolRoot.Add(toolBar);

            var mapMode  = new Texture2D("content/edit/mapmode.png", LoadMethod.Single, true);
            var tileMode = new Texture2D("content/edit/tiles.png", LoadMethod.Single, true);

            SUI.Dock.AddIcon(mapMode, 64);
            var mode_Tiles = SUI.Dock.AddIcon(tileMode, 64);

            mode_Tiles.Click = () => {
                UI.Menu = null;
                Vivid.App.VividApp.PushState(new MapEditor.States.TileSetEditor());
            };

            LoadEditState();
        }
Esempio n. 30
0
        /// <summary>
        /// Konstruktor ³aduj¹cy zapisan¹ grê
        /// </summary>
        /// <param name="form"> WskaŸnik do okna gry</param>
        /// <param name="player">Instancja gracza</param>
        /// <param name="game_state_data_to_load">Dane stany gry do ³adowania</param>
        /// <param name="data_index">Indeks danych w tablicy stanów gry</param>
        public Game(DungeonVandal.MenuForm form, Player player, GameState.GameStateData game_state_data_to_load, int data_index)
        {
            Form = form;
            graphics = new GraphicsDeviceManager(this)
            {
                PreferredBackBufferWidth = Form.ViewportSize.Width,
                PreferredBackBufferHeight = Form.ViewportSize.Height
            };

            data_to_load = game_state_data_to_load;
            this.data_index = data_index;
            this.player = player;
            this.player.Dynamite = data_to_load.Dynamites[data_index];
            this.player.Points = data_to_load.Points[data_index];
            this.player.Rackets = data_to_load.Rackets[data_index];
            totalMinutes = data_to_load.TotalMinutes[data_index];
            totalSeconds = data_to_load.TotalSeconds[data_index];
            Form.setPlayerName(player.Name);
            graphics.PreparingDeviceSettings += graphics_PreparingDeviceSettings;
            System.Windows.Forms.Control.FromHandle(Window.Handle).VisibleChanged += MainGame_VisibleChanged;
            System.Windows.Forms.Control.FromHandle(Form.Handle).KeyUp += new System.Windows.Forms.KeyEventHandler(Game_KeyUp);
            System.Windows.Forms.Control.FromHandle(Form.Handle).KeyPress += new System.Windows.Forms.KeyPressEventHandler(Game_KeyPress);
            System.Windows.Forms.Control.FromHandle(Form.Handle).KeyDown += new System.Windows.Forms.KeyEventHandler(Game_Key);
            System.Windows.Forms.Control.FromHandle(Form.Handle).PreviewKeyDown += new System.Windows.Forms.PreviewKeyDownEventHandler(Game_PreviewKeyDown);

            Content.RootDirectory = "Content";

            IsMouseVisible = true;
        }
 public AddEditDayOfCinemaForm(ScheduleForm scheduleForm, Model.Requests.CinemasScheduleRequest schedule, MenuForm menuForm, int?airingDayId = null)
 {
     InitializeComponent();
     this.StartPosition = FormStartPosition.Manual;
     this.Location      = new Point(Screen.PrimaryScreen.Bounds.Width - 20 - this.Width, Screen.PrimaryScreen.Bounds.Height - this.Height - saveBtn.Height - 20);
     _scheduleForm      = scheduleForm;
     _schedule          = schedule;
     _airingDayId       = airingDayId;
     _menuForm          = menuForm;
 }
Esempio n. 32
0
 public AddMovieForm(ScheduleForm scheduleForm, Model.Requests.CinemasScheduleRequest schedule, MenuForm menuForm, int airingDayId, DateTime date, string day)
 {
     InitializeComponent();
     this.StartPosition = FormStartPosition.Manual;
     this.Location      = new Point(Screen.PrimaryScreen.Bounds.Width - 20 - this.Width, Screen.PrimaryScreen.Bounds.Height - this.Height - saveBtn.Height - 20);
     _scheduleForm      = scheduleForm;
     _schedule          = schedule;
     _airingDayId       = airingDayId;
     _menuForm          = menuForm;
     _date = date;
     _day  = day;
 }
Esempio n. 33
0
        public MainMenuFlow(ISomeService someService, ITranslationsService translationsService, IHttpRequester httpRequester)
        {
            IFormRenderer <HTMLElement> CreateRenderer() =>
            _baseRenderer.CreateRendererWithBase(
                new ElementWrapperFormCanvas(
                    Toolkit.BaseFormCanvasTitleStrategy,
                    _mainMenuFormView.BodyPanel.Widget,
                    Toolkit.DefaultExitButtonBuilder,
                    Toolkit.DefaultLayoutMode));

            _aboutMsg = new InformationalMessageForm(
                new InformationalMessageFormView(TextType.TreatAsHtml),
                "<b>Philadelphia Toolkit Demo</b><br>by TODO IT spółka z o.o.",
                "About program");
            _aboutMsg.Ended += (x, _) => _lastRenderer.Remove(x);

            _licensesInfoMsg = new InformationalMessageForm(
                new InformationalMessageFormView(TextType.TreatAsHtml),
                OpenSourceLicensesText.OpenSourceLicensesHtml,
                I18n.Translate("Used open source licensed programs and libraries"));
            _licensesInfoMsg.Ended += (x, _) => _lastRenderer.Remove(x);

            var menuItems = new List <MenuItemUserModel> {
                CreateSubTree("Features",
                              CreateLocalLeaf(
                                  "Server-sent events",
                                  () => new SseDemoFlow(someService).Run(CreateRenderer())),
                              CreateLocalLeaf(
                                  "Forms navigation",
                                  () => new NavigationProgram().Run(CreateRenderer())),
                              CreateLocalLeaf(
                                  "Internationalization",
                                  () => new InternationalizationFlow(translationsService).Run(CreateRenderer()))),
                CreateSubTree("Data validation",
                              CreateLocalLeaf(
                                  "Simplest",
                                  () => new ValidationProgram().Run(CreateRenderer())),
                              CreateLocalLeaf(
                                  "Tabbed view indicator",
                                  () => new TabbedViewValidationFlow().Run(CreateRenderer())),
                              CreateLocalLeaf(
                                  "File uploads",
                                  () => new UploaderDemoFlow(someService, httpRequester).Run(CreateRenderer()))),
                CreateSubTree("Widgets",
                              CreateLocalLeaf(
                                  "Databound datagrid",
                                  () => new DataboundDatagridProgram(someService).Run(CreateRenderer())),
                              CreateLocalLeaf(
                                  "Datetime pickers",
                                  () => new DateTimeDemoProgram().Run(CreateRenderer())),
                              CreateLocalLeaf(
                                  "Dropdowns",
                                  () => new DropdownsProgram().Run(CreateRenderer())),
                              CreateLocalLeaf(
                                  "Master details",
                                  () => new MasterDetailsProgram(someService).Run(CreateRenderer())),
                              CreateLocalLeaf(
                                  "Flexible layout",
                                  () => new FlexibleLayoutFlow().Run(CreateRenderer()))),
                CreateSubTree("Help",
                              CreateLocalLeaf(
                                  "About program",
                                  () => {
                    _lastRenderer = CreateRenderer();
                    _lastRenderer.AddPopup(_aboutMsg);
                }),
                              CreateLocalLeaf(
                                  "Open source licenses",
                                  () => {
                    _lastRenderer = CreateRenderer();
                    _lastRenderer.AddPopup(_licensesInfoMsg);
                })
                              )
            };

            //TODO dropdown with not-legal-anymore/scratched value
            //TODO add I18n demo

            _mainMenuFormView = new HorizontalLinksMenuFormView();
            _mainMenuForm     = new MenuForm(_mainMenuFormView, menuItems);
        }
Esempio n. 34
0
        public AddEditAppointmentForm(AppointmentsForm appointmentsForm, ScheduleForm scheduleForm, Model.Requests.CinemasScheduleRequest schedule, MenuForm menuForm, int airingDayId, DateTime date, string day, int cinemaDayMovieId, int movieId, CinemaDayMovieForm cinemaDayMovieForm, int?appointmentId = null)
        {
            InitializeComponent();
            this.StartPosition = FormStartPosition.Manual;
            this.Location      = new Point(Screen.PrimaryScreen.Bounds.Width - 20 - this.Width, Screen.PrimaryScreen.Bounds.Height - this.Height - saveBtn.Height - 20);
            _scheduleForm      = scheduleForm;
            _schedule          = schedule;
            _airingDayId       = airingDayId;
            _menuForm          = menuForm;
            _date               = date;
            _day                = day;
            _cinemaDayMovieId   = cinemaDayMovieId;
            _movieId            = movieId;
            _appointmentId      = appointmentId;
            _cinemaDayMovieForm = cinemaDayMovieForm;
            _appointmentsForm   = appointmentsForm;

            StartsAt.Format       = DateTimePickerFormat.Custom;
            StartsAt.CustomFormat = "HH:mm";
            StartsAt.ShowUpDown   = true;
        }
Esempio n. 35
0
 /// <summary>
 /// Update Menu
 /// </summary>
 /// <param name="menu"></param>
 /// <param name="menuForm"></param>
 public void UpdateMenuEntity(Menu menu, MenuForm menuForm)
 {
     menu.Active = menuForm.Active;
     menu.Name   = menuForm.MenuName;
     menu.Code   = menuForm.MenuCode;
 }