public void Activate()
        {
            object[]          buttonResponses = new object[] { "Accept", ResponseType.Accept, "Cancel", ResponseType.Cancel };
            FileChooserDialog fileDialog      = new FileChooserDialog("Local Studies", (Window)_mainView.GuiElement, FileChooserAction.SelectFolder, buttonResponses);

            int    result = fileDialog.Run();
            string folder = fileDialog.Filename;

            fileDialog.Destroy();               // must manually destroy the dialog

            if (result == (int)ResponseType.Accept)
            {
                LocalImageLoader loader   = new LocalImageLoader();
                string           studyUID = loader.Load(folder);
                //if(studyUID == "" || WorkstationModel.StudyManager.StudyTree.GetStudy(studyUID) == null)
                if (studyUID == "" || ImageWorkspace.StudyManager.StudyTree.GetStudy(studyUID) == null)
                {
                    //Platform.ShowMessageBox(ClearCanvas.Workstation.Model.SR.ErrorUnableToLoadStudy);
                    Platform.ShowMessageBox(ClearCanvas.ImageViewer.SR.ErrorUnableToLoadStudy);
                }
                else
                {
                    ImageWorkspace ws = new ImageWorkspace(studyUID);
                    //WorkstationModel.WorkspaceManager.Workspaces.Add(ws);
                    DesktopApplication.WorkspaceManager.Workspaces.Add(ws);
                }
            }
        }
Exemple #2
0
		public void Activate()
		{
			object[] buttonResponses = new object[] {"Accept", ResponseType.Accept, "Cancel", ResponseType.Cancel};
			FileChooserDialog fileDialog = new FileChooserDialog("Local Studies", (Window)_mainView.GuiElement, FileChooserAction.SelectFolder, buttonResponses);
			
			int result = fileDialog.Run();
			string folder = fileDialog.Filename;
			fileDialog.Destroy();	// must manually destroy the dialog
			
			if(result == (int)ResponseType.Accept)
			{
				LocalImageLoader loader = new LocalImageLoader();
				string studyUID = loader.Load(folder);
				//if(studyUID == "" || WorkstationModel.StudyManager.StudyTree.GetStudy(studyUID) == null)
				if(studyUID == "" || ImageWorkspace.StudyManager.StudyTree.GetStudy(studyUID) == null)
				{
					//Platform.ShowMessageBox(ClearCanvas.Workstation.Model.SR.ErrorUnableToLoadStudy);
					Platform.ShowMessageBox(ClearCanvas.ImageViewer.SR.ErrorUnableToLoadStudy);
				}
				else
				{
					ImageWorkspace ws = new ImageWorkspace(studyUID);
					//WorkstationModel.WorkspaceManager.Workspaces.Add(ws);
					DesktopApplication.WorkspaceManager.Workspaces.Add(ws);
				}
			}
		}
Exemple #3
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
        }
        //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
		}
Exemple #5
0
 public override void Dispose()
 {
     _workspace         = null;
     _physicalWorkspace = null;
     _renderer          = null;
 }
		public void SetWorkspace(Workspace workspace)
		{
			_imageWorkspace = workspace as ImageWorkspace;
			Platform.CheckForInvalidCast(_imageWorkspace, "workspace", "ImageWorkspace");
		}
		public override void Dispose()
		{
			_workspace = null;
			_physicalWorkspace = null;
			_renderer = null;
		}
 public void SetWorkspace(Workspace workspace)
 {
     _imageWorkspace = workspace as ImageWorkspace;
     Platform.CheckForInvalidCast(_imageWorkspace, "workspace", "ImageWorkspace");
 }