Example #1
0
 private void AddImageBoxControls(PhysicalWorkspace physicalWorkspace)
 {
     foreach (ImageBox imageBox in physicalWorkspace.ImageBoxes)
     {
         AddImageBoxControl(imageBox);
     }
 }
        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (_parentForm != null)
                {
                    _parentForm.Move -= OnParentMoved;
                    _parentForm       = null;
                }

                if (_component != null)
                {
                    _component.Closing -= OnComponentClosing;
                    _component          = null;
                }

                if (_delayedEventPublisher != null)
                {
                    _delayedEventPublisher.Dispose();
                    _delayedEventPublisher = null;
                }

                if (_physicalWorkspace != null)
                {
                    _physicalWorkspace.Drawing                -= OnPhysicalWorkspaceDrawing;
                    _physicalWorkspace.LayoutCompleted        -= OnLayoutCompleted;
                    _physicalWorkspace.ScreenRectangleChanged -= OnScreenRectangleChanged;

                    _physicalWorkspace = null;
                }
            }

            base.Dispose(disposing);
        }
		internal ImageViewerControl(ImageViewerComponent component)
		{
			_component = component;
			_physicalWorkspace = _component.PhysicalWorkspace as PhysicalWorkspace;
			InitializeComponent();

			this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);

			this.BackColor = Color.Black;

			_component.Closing += new EventHandler(OnComponentClosing);
			_physicalWorkspace.Drawing += new EventHandler(OnPhysicalWorkspaceDrawing);
			_physicalWorkspace.LayoutCompleted += new EventHandler(OnLayoutCompleted);
			_physicalWorkspace.ScreenRectangleChanged += new EventHandler(OnScreenRectangleChanged);

			_delayedEventPublisher = new DelayedEventPublisher(OnRecalculateImageBoxes, 50);
		}
Example #4
0
        internal ImageViewerControl(ImageViewerComponent component)
        {
            _component         = component;
            _physicalWorkspace = _component.PhysicalWorkspace as PhysicalWorkspace;
            InitializeComponent();

            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);

            this.BackColor = Color.Black;

            _component.Closing                        += new EventHandler(OnComponentClosing);
            _physicalWorkspace.Drawing                += new EventHandler(OnPhysicalWorkspaceDrawing);
            _physicalWorkspace.LayoutCompleted        += new EventHandler(OnLayoutCompleted);
            _physicalWorkspace.ScreenRectangleChanged += new EventHandler(OnScreenRectangleChanged);

            _delayedEventPublisher = new DelayedEventPublisher(OnRecalculateImageBoxes, 50);
        }
		internal ImageViewerControl(ImageViewerComponent component)
		{
			_component = component;
			_physicalWorkspace = (PhysicalWorkspace) _component.PhysicalWorkspace;

			SuspendLayout();
			Name = "ImageViewerControl";
			ResumeLayout(false);
			SetStyle(ControlStyles.AllPaintingInWmPaint, true);

			base.BackColor = Color.Black;

			_component.Closing += OnComponentClosing;
			_physicalWorkspace.Drawing += OnPhysicalWorkspaceDrawing;
			_physicalWorkspace.LayoutCompleted += OnLayoutCompleted;
			_physicalWorkspace.ScreenRectangleChanged += OnScreenRectangleChanged;

			_delayedEventPublisher = new DelayedEventPublisher(OnRecalculateImageBoxes, 50);
		}
        internal ImageViewerControl(ImageViewerComponent component)
        {
            _component         = component;
            _physicalWorkspace = (PhysicalWorkspace)_component.PhysicalWorkspace;

            SuspendLayout();
            Name = "ImageViewerControl";
            ResumeLayout(false);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true);

            base.BackColor = Color.Black;

            _component.Closing                        += OnComponentClosing;
            _physicalWorkspace.Drawing                += OnPhysicalWorkspaceDrawing;
            _physicalWorkspace.LayoutCompleted        += OnLayoutCompleted;
            _physicalWorkspace.ScreenRectangleChanged += OnScreenRectangleChanged;

            _delayedEventPublisher = new DelayedEventPublisher(OnRecalculateImageBoxes, 50);
        }
        protected override void LayoutPhysicalWorkspace()
        {
            StoredLayout layout = null;

            //take the first opened study, enumerate the modalities and compute the union of the layout configuration (in case there are multiple modalities in the study).
            if (LogicalWorkspace.ImageSets.Count > 0)
            {
                IImageSet firstImageSet = LogicalWorkspace.ImageSets[0];
                foreach (IDisplaySet displaySet in firstImageSet.DisplaySets)
                {
                    if (displaySet.PresentationImages.Count <= 0)
                    {
                        continue;
                    }

                    if (layout == null)
                    {
                        layout = LayoutSettings.GetMinimumLayout();
                    }

                    StoredLayout storedLayout = LayoutSettings.DefaultInstance.GetLayout(displaySet.PresentationImages[0] as IImageSopProvider);
                    layout.ImageBoxRows    = Math.Max(layout.ImageBoxRows, storedLayout.ImageBoxRows);
                    layout.ImageBoxColumns = Math.Max(layout.ImageBoxColumns, storedLayout.ImageBoxColumns);
                    layout.TileRows        = Math.Max(layout.TileRows, storedLayout.TileRows);
                    layout.TileColumns     = Math.Max(layout.TileColumns, storedLayout.TileColumns);
                }
            }

            if (layout == null)
            {
                layout = LayoutSettings.DefaultInstance.DefaultLayout;
            }

            PhysicalWorkspace.SetImageBoxGrid(layout.ImageBoxRows, layout.ImageBoxColumns);
            for (int i = 0; i < PhysicalWorkspace.ImageBoxes.Count; ++i)
            {
                PhysicalWorkspace.ImageBoxes[i].SetTileGrid(layout.TileRows, layout.TileColumns);
            }
        }
Example #8
0
        //public WorkspaceDrawingArea(Workspace workspace)
        public ImageWorkspaceDrawingArea(Workspace workspace)
        {
            // set background to black
            this.ModifyBg(StateType.Normal, new Gdk.Color(0, 0, 0));

            // tell GTK that we intend to handle painting ourselves
            // hopefully this will suppress the "flashing", but doesn't seem to help much
            this.AppPaintable = true;

            CreateRenderer();

            _workspace         = (ImageWorkspace)workspace;
            _physicalWorkspace = _workspace.PhysicalWorkspace;
            _physicalWorkspace.ImageDrawing += new EventHandler <ImageDrawingEventArgs>(OnDrawImage);

            // tell Gtk that we are interested in receiving these events
            this.AddEvents((int)Gdk.EventMask.PointerMotionMask);
            this.AddEvents((int)Gdk.EventMask.PointerMotionHintMask);                   // suppress queueing of motion messages
            this.AddEvents((int)Gdk.EventMask.ButtonPressMask);
            this.AddEvents((int)Gdk.EventMask.ButtonReleaseMask);
            this.AddEvents((int)Gdk.EventMask.KeyPressMask);

            _lastButtonPressed = 0; // no mouse button pressed
        }
Example #9
0
        //public WorkspaceDrawingArea(Workspace workspace)
        public ImageWorkspaceDrawingArea(Workspace workspace)
		{
            // set background to black
            this.ModifyBg(StateType.Normal, new Gdk.Color(0, 0, 0));

            // tell GTK that we intend to handle painting ourselves
            // hopefully this will suppress the "flashing", but doesn't seem to help much
            this.AppPaintable = true;

			CreateRenderer();

            _workspace = (ImageWorkspace)workspace;
            _physicalWorkspace = _workspace.PhysicalWorkspace;
            _physicalWorkspace.ImageDrawing += new EventHandler<ImageDrawingEventArgs>(OnDrawImage);

            // tell Gtk that we are interested in receiving these events
            this.AddEvents((int)Gdk.EventMask.PointerMotionMask);
			this.AddEvents((int)Gdk.EventMask.PointerMotionHintMask);	// suppress queueing of motion messages
			this.AddEvents((int)Gdk.EventMask.ButtonPressMask);
            this.AddEvents((int)Gdk.EventMask.ButtonReleaseMask);
            this.AddEvents((int)Gdk.EventMask.KeyPressMask);

            _lastButtonPressed = 0; // no mouse button pressed
		}
Example #10
0
 public override void Dispose()
 {
     _workspace         = null;
     _physicalWorkspace = null;
     _renderer          = null;
 }
		private void AddImageBoxControls(PhysicalWorkspace physicalWorkspace)
		{
			foreach (ImageBox imageBox in physicalWorkspace.ImageBoxes)
				AddImageBoxControl(imageBox);
		}
		/// <summary> 
		/// Clean up any resources being used.
		/// </summary>
		/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
		protected override void Dispose(bool disposing)
		{
			if (disposing)
			{
				if (_parentForm != null)
				{
					_parentForm.Move -= OnParentMoved;
					_parentForm = null;
				}

				if (_component != null)
				{
					_component.Closing -= OnComponentClosing;
					_component = null;
				}

				if (_delayedEventPublisher != null)
				{
					_delayedEventPublisher.Dispose();
					_delayedEventPublisher = null;
				}

				if (_physicalWorkspace != null)
				{
					_physicalWorkspace.Drawing -= OnPhysicalWorkspaceDrawing;
					_physicalWorkspace.LayoutCompleted -= OnLayoutCompleted;
					_physicalWorkspace.ScreenRectangleChanged -= OnScreenRectangleChanged;

					_physicalWorkspace = null;
				}
			}

			base.Dispose(disposing);
		}
		public override void Dispose()
		{
			_workspace = null;
			_physicalWorkspace = null;
			_renderer = null;
		}