상속: PointerEventController, IDisposable
예제 #1
0
        public LevelPanel()
        {
            InitializeComponent();

            _layerControl = new LayerGraphicsControl();
            _layerControl.Dock = DockStyle.Fill;

            _viewportControl.Control = _layerControl;

            _pointerController = new ControlPointerEventController(_layerControl, _layerControl);
        }
예제 #2
0
        public TilePoolPane()
        {
            InitializeComponent();

            ResetComponent();

            // Load form elements

            _buttonRemove.Image = Properties.Resources.Minus;
            _buttonAdd.Image = Properties.Resources.Plus;
            _buttonProperties.Image = Properties.Resources.Tags;

            ToolStripMenuItem tilePropertiesItem = new ToolStripMenuItem("Tile Properties") {
                Image = Properties.Resources.Tags,
            };
            ToolStripMenuItem tileDeleteItem = new ToolStripMenuItem("Delete Tile") {
                Image = Properties.Resources.Cross,
            };

            _tileContextMenu = new ContextMenuStrip();
            _tileContextMenu.Items.AddRange(new ToolStripItem[] {
                tileDeleteItem,
                new ToolStripSeparator(),
                tilePropertiesItem,
            });

            _commandController = new UICommandController();
            _commandController.MapButtons(new Dictionary<CommandKey, ToolStripButton>() {
                { CommandKey.TilePoolDelete, _buttonRemove },
                { CommandKey.TilePoolProperties, _buttonProperties },
            });
            _commandController.MapMenuItems(new Dictionary<CommandKey, ToolStripMenuItem>() {
                { CommandKey.TilePoolImport, importNewToolStripMenuItem },
                { CommandKey.TilePoolImportMerge, importMergeToolStripMenuItem },
                { CommandKey.TileProperties, tilePropertiesItem },
                { CommandKey.TileDelete, tileDeleteItem },
            });

            _pointerController = new ControlPointerEventController(_layerControl, _layerControl);

            // Setup control

            _poolComboBox.ComboBox.DisplayMember = "Name";

            _layerControl.BackColor = System.Drawing.Color.SlateGray;
            _layerControl.WidthSynced = true;
            _layerControl.CanvasAlignment = CanvasAlignment.UpperLeft;

            // Wire events

            _poolComboBox.SelectedIndexChanged += SelectTilePoolHandler;
        }
예제 #3
0
        public LevelPanel()
        {
            InitializeComponent();

            _layerControl = new LayerGraphicsControl();
            _layerControl.Dock = DockStyle.Fill;

            _layerControl.Scroll += (s, e) => InvalidateGeometry();
            _layerControl.VirtualSizeChanged += (s, e) => InvalidateGeometry();

            _viewportControl.Control = _layerControl;

            _pointerController = new ControlPointerEventController(_layerControl, _layerControl);
        }
예제 #4
0
        public TilePoolPane()
        {
            InitializeComponent();

            ResetComponent();

            // Load form elements

            System.Reflection.Assembly assembly = System.Reflection.Assembly.GetExecutingAssembly();

            _buttonRemove.Image = Image.FromStream(assembly.GetManifestResourceStream("Treefrog.Icons.minus16.png"));
            _buttonAdd.Image = Image.FromStream(assembly.GetManifestResourceStream("Treefrog.Icons.plus16.png"));
            _buttonProperties.Image = Image.FromStream(assembly.GetManifestResourceStream("Treefrog.Icons._16.tags.png"));

            ToolStripMenuItem tilePropertiesItem = new ToolStripMenuItem("Tile Properties") {
                Image = Image.FromStream(assembly.GetManifestResourceStream("Treefrog.Icons._16.tags.png")),
            };

            _tileContextMenu = new ContextMenuStrip();
            _tileContextMenu.Items.AddRange(new ToolStripItem[] {
                tilePropertiesItem,
            });

            _commandController = new UICommandController();
            _commandController.MapButtons(new Dictionary<CommandKey, ToolStripButton>() {
                { CommandKey.TilePoolDelete, _buttonRemove },
                { CommandKey.TilePoolProperties, _buttonProperties },
            });
            _commandController.MapMenuItems(new Dictionary<CommandKey, ToolStripMenuItem>() {
                { CommandKey.TilePoolImport, importNewToolStripMenuItem },
                { CommandKey.TileProperties, tilePropertiesItem },
            });

            _pointerController = new ControlPointerEventController(_layerControl, _layerControl);

            // Setup control

            _poolComboBox.ComboBox.DisplayMember = "Name";

            _layerControl.BackColor = System.Drawing.Color.SlateGray;
            _layerControl.WidthSynced = true;
            _layerControl.CanvasAlignment = CanvasAlignment.UpperLeft;

            // Wire events

            _poolComboBox.SelectedIndexChanged += SelectTilePoolHandler;
        }
예제 #5
0
        public MinimapPanel()
        {
            InitializeComponent();

            _pointerController = new ControlPointerEventController(_layerControl, _layerControl);
        }