Exemplo n.º 1
0
        public ObjectEditor(double scale, Object obj)
        {
            InitializeComponent();
            window = new Window(Size, Screen.PrimaryScreen.Bounds.Size); // Узнаём размер экрана
            map    = new Map(ref window, "Editor");
            map.InitDrawing(ref pictureBox1, ref map);
            map.Cam.Scale = (float)scale;
            obj_num       = obj.Num;
            map.CreateNewObject();
            map.Objects[0] = new Object(map.Cam.Pos, obj);
            map.Objects[0].Rotate(0);


            map.Drawing.Identif.DrawVertex    = true;
            map.Drawing.Identif.DrawRadPoints = true;

            pictureBox1.Size     = window.ResizePB();
            pictureBox1.Location = window.ReposPB();

            KeyPreview = true;

            EditorClass.InitObj(ref map.Objects[0]);

            timer1.Interval = 16; //60 fps  1000 / 16 ~~ 60 fps
            timer1.Start();
        }
Exemplo n.º 2
0
        public EditorWindow(int choice, EditorClass editorclassfromMain)
        {
            InitializeComponent();
            WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;

            editorclass = editorclassfromMain;
            dataGridLoader();
            //WindowStartupLocation = System.Windows.WindowStartupLocation.CenterScreen;
            //dataGridLoader();

            switch (choice)
            {
            case 0:
            {
                datagridsAll[0].Visibility = Visibility.Visible;
                comboBox.SelectedIndex     = 0;
                ActiveEntity = 0;
            }
            break;

            case 1:
            {
                datagridsAll[1].Visibility   = Visibility.Visible;
                CalendarPagePanel.Visibility = Visibility.Visible;
                comboBox.SelectedIndex       = 1;
                ActiveEntity = 1;
            }
            break;

            case 2:
            {
                datagridsAll[2].Visibility        = Visibility.Visible;
                CalendarDatesPagePanel.Visibility = Visibility.Visible;
                comboBox.SelectedIndex            = 2;
                ActiveEntity = 2;
            }
            break;

            case 3:
            {
                datagridsAll[3].Visibility = Visibility.Visible;
                RoutesPagePanel.Visibility = Visibility.Visible;
                comboBox.SelectedIndex     = 3;
                ActiveEntity = 3;
            }
            break;

            case 4:
            {
                datagridsAll[4].Visibility = Visibility.Visible;
                TripsPagePanel.Visibility  = Visibility.Visible;
                comboBox.SelectedIndex     = 4;
                ActiveEntity = 4;
            }
            break;

            case 5:
            {
                datagridsAll[5].Visibility = Visibility.Visible;
                comboBox.SelectedIndex     = 5;
                StopPagePanel.Visibility   = Visibility.Visible;
                ActiveEntity = 5;
            }
            break;

            case 6:
            {
                datagridsAll[6].Visibility    = Visibility.Visible;
                comboBox.SelectedIndex        = 6;
                StopTimesPagePanel.Visibility = Visibility.Visible;
                ActiveEntity = 6;
            }
            break;
            }
        }