Ejemplo n.º 1
0
        protected Tool(PinballEditControl control)
        {
            Editor = control;

            Label = "Unnamed Tool";
            Icon  = new Bitmap(1, 1);
        }
Ejemplo n.º 2
0
        public EditorForm()
        {
            InitializeComponent();

            PlayFieldEditor = new PinballEditControl();
            EditorContainer = new WPFContainer(PlayFieldEditor);
            playFieldPanel.Controls.Add(EditorContainer);

            TitleLabel.Font = new Font(FontManager.Courgette, 40);

            // Set up menu
            editToolStripMenuItem.DropDownItems.Add(new UndoItem(PlayFieldEditor.History));
            editToolStripMenuItem.DropDownItems.Add(new RedoItem(PlayFieldEditor.History));

            // Set up left panel
            populateElementPanel();
            populateToolPanel();

            // Set up playfield and element inspector
            PlayFieldEditor.History.Change += () => { elementInspector.Refresh(); machineInspector.Refresh(); };
            elementInspector.PropertyValueChanged += onElementPropertyChanged;
            machineInspector.PropertyValueChanged += onMachinePropertyChanged;
            machineInspector.SelectedObject = PlayFieldEditor.PinballMachine;

            // Set up zoom bar
            zoomBar.Trackbar.Minimum = 5;
            zoomBar.Trackbar.Maximum = 20;
            zoomBar.Trackbar.Value = 10;
            zoomBar.Trackbar.ValueChanged += (sender, e) => { PlayFieldEditor.ScaleFactor = zoomBar.Trackbar.Value / 10f; };

            PlayFieldEditor.MouseWheel += onMouseWheel;

            FileName = null;

            // PlayFieldEditor
            //EditorContainer.AllowDrop = true;
            PlayFieldEditor.AllowDrop = true;
            EditorContainer.Location = new System.Drawing.Point(3, 3);
            EditorContainer.TabIndex = 2;

            PlayFieldEditor.SelectionChanged += new Sketchball.Controls.PinballEditControl.SelectionChangedHandler(this.onSelectionChanged);

            PlayFieldEditor.Drop += this.onDragDrop;
            PlayFieldEditor.DragEnter += this.onDragEnter;
            PlayFieldEditor.DragOver += this.onDragOver;
            PlayFieldEditor.DragLeave += this.onDragLeave;
            PlayFieldEditor.QueryContinueDrag += this.onQueryContinueDrag;

            //PlayFieldEditor.Background = System.Windows.Media.Brushes.White;
        }
Ejemplo n.º 3
0
 public MultiLineTool(PinballEditControl control)
     : base(control)
 {
     Icon = Properties.Resources.MultiLineTool;
     Label = "Multi Line tool";
 }
Ejemplo n.º 4
0
 /// <summary>
 /// Instantiates a new circle tool.
 /// </summary>
 /// <param name="control">Control where this tool operates on.</param>
 public CircleTool(PinballEditControl control)
     : base(control)
 {
     Label = "Circle";
     Icon = Properties.Resources.circle_outline_512;
 }