示例#1
0
        /// <summary>
        /// Constructor
        /// </summary>
        public TileControl(Tile tile, Rectangle parentRectangle, int parentImageBoxInsetWidth)
        {
            _tile            = tile;
            _tileController  = new TileController(_tile, (_tile.ImageViewer as ImageViewerComponent).ShortcutManager);
            _inputTranslator = new TileInputTranslator(this);

            SetParentImageBoxRectangle(parentRectangle, parentImageBoxInsetWidth, true);
            InitializeComponent();

            this.BackColor = Color.Black;
            this.Dock      = DockStyle.None;
            this.Anchor    = AnchorStyles.None;
            this.AllowDrop = true;

            _tile.Drawing               += new EventHandler(OnTileDrawing);
            _tile.RendererChanged       += new EventHandler(OnRendererChanged);
            _tile.InformationBoxChanged += new EventHandler <InformationBoxChangedEventArgs>(OnInformationBoxChanged);
            _tile.EditBoxChanged        += new EventHandler(OnEditBoxChanged);
            _tile.SelectionChanged      += new EventHandler <ItemEventArgs <ITile> >(OnTileSelectionChanged);

            _contextMenuStrip.ImageScalingSize = new Size(24, 24);
            _contextMenuStrip.Opening         += new CancelEventHandler(OnContextMenuStripOpening);

            _tileController.CursorTokenChanged   += new EventHandler(OnCursorTokenChanged);
            _tileController.ContextMenuRequested += new EventHandler <ItemEventArgs <Point> >(OnContextMenuRequested);
            _tileController.CaptureChanging      += new EventHandler <ItemEventArgs <IMouseButtonHandler> >(OnCaptureChanging);

            _editBoxControl = new EditBoxControl();
            this.Controls.Add(_editBoxControl);

            this.DoubleBuffered = false;
            this.SetStyle(ControlStyles.DoubleBuffer, false);
            this.SetStyle(ControlStyles.OptimizedDoubleBuffer, false);
            this.SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque, true);
        }
示例#2
0
		/// <summary>
		/// Constructor
		/// </summary>
		public TileControl(Tile tile, Rectangle parentRectangle, int parentImageBoxInsetWidth)
		{
			_tile = tile;
			_tileController = new TileController(_tile, (_tile.ImageViewer as ImageViewerComponent).ShortcutManager);
			_inputTranslator = new TileInputTranslator(this);

			SetParentImageBoxRectangle(parentRectangle, parentImageBoxInsetWidth, true);
			InitializeComponent();

			this.BackColor = Color.Black;
			this.Dock = DockStyle.None;
			this.Anchor = AnchorStyles.None;
			this.AllowDrop = true;

			_tile.Drawing += new EventHandler(OnTileDrawing);
			_tile.RendererChanged += new EventHandler(OnRendererChanged);
			_tile.InformationBoxChanged += new EventHandler<InformationBoxChangedEventArgs>(OnInformationBoxChanged);
			_tile.EditBoxChanged += new EventHandler(OnEditBoxChanged);
			_tile.SelectionChanged += new EventHandler<ItemEventArgs<ITile>>(OnTileSelectionChanged);

			_contextMenuStrip.ImageScalingSize = new Size(24, 24);
			_contextMenuStrip.Opening += new CancelEventHandler(OnContextMenuStripOpening);

			_tileController.CursorTokenChanged += new EventHandler(OnCursorTokenChanged);
			_tileController.ContextMenuRequested += new EventHandler<ItemEventArgs<Point>>(OnContextMenuRequested);
			_tileController.CaptureChanging += new EventHandler<ItemEventArgs<IMouseButtonHandler>>(OnCaptureChanging);

			_editBoxControl = new EditBoxControl();
			this.Controls.Add(_editBoxControl);

			this.DoubleBuffered = false;
			this.SetStyle(ControlStyles.DoubleBuffer, false);
			this.SetStyle(ControlStyles.OptimizedDoubleBuffer, false);
			this.SetStyle(ControlStyles.UserPaint | ControlStyles.AllPaintingInWmPaint | ControlStyles.Opaque, true);
		}