public AnatomyContextWindow(AnatomyContextWindowManager windowManager, LayerController layerController) : base("Medical.GUI.Anatomy.AnatomyContextWindow.layout") { this.windowManager = windowManager; this.layerController = layerController; captionWidget = window.CaptionWidget as Button; pinButton = (Button)window.findWidgetChildSkin("PinButton"); pinButton.MouseButtonClick += new MyGUIEvent(pinButton_MouseButtonClick); thumbnailImage = (ImageBox)window.findWidget("ThumbnailImage"); captionToBorderDelta = window.Width - captionWidget.getTextRegion().width; IntCoord clientCoord = window.ClientCoord; windowBottomPaddingSize = window.Height - clientCoord.top - clientCoord.height; transparencySlider = new AnatomyTransparencySlider((ScrollBar)window.findWidget("TransparencySlider")); transparencySlider.RecordUndo += transparencySlider_RecordUndo; windowStartSize = new IntSize2(window.Width, window.Height); centerButton = (Button)window.findWidget("CenterButton"); centerButton.MouseButtonClick += new MyGUIEvent(centerMenuItem_MouseButtonClick); featureButton = (Button)window.findWidget("FeatureButton"); featureButton.MouseButtonClick += new MyGUIEvent(featureButton_MouseButtonClick); Button hideButton = (Button)window.findWidget("HideButton"); hideButton.MouseButtonClick += new MyGUIEvent(hideButton_MouseButtonClick); Button showButton = (Button)window.findWidget("ShowButton"); showButton.MouseButtonClick += new MyGUIEvent(showButton_MouseButtonClick); anatomyFinderButton = (Button)window.findWidget("AnatomyFinder"); anatomyFinderButton.MouseButtonClick += anatomyFinderButton_MouseButtonClick; commandScroller = (ScrollView)window.findWidget("CommandScroller"); }
public ShowTasksAnatomyCommand(AnatomyContextWindowManager windowManager, Anatomy anatomy) { this.windowManager = windowManager; this.anatomy = anatomy; }
public AnatomyFinder(AnatomyController anatomyController, SceneViewController sceneViewController, LayerController layerController, AnatomyTaskManager anatomyTaskManager) : base("Medical.GUI.Anatomy.AnatomyFinder.layout") { this.anatomyController = anatomyController; anatomyController.AnatomyChanged += anatomyController_AnatomyChanged; anatomyController.ShowPremiumAnatomyChanged += anatomyController_ShowPremiumAnatomyChanged; anatomyController.ClearDisplayedAnatomy += anatomyController_ClearDisplayedAnatomy; if (PlatformConfig.UnrestrictedEnvironment) { anatomyController.DisplayAnatomy += anatomyController_DisplayAnatomy; } else { anatomyController.DisplayAnatomy += anatomyController_DisplayAnatomy_Restricted; } anatomyController.SelectedAnatomy.SelectedAnatomyChanged += anatomyController_SelectedAnatomyChanged; anatomyController.SearchStarted += anatomyController_SearchStarted; anatomyController.SearchEnded += anatomyController_SearchEnded; anatomyController.SuggestSearchCaption += anatomyController_SuggestSearchCaption; this.sceneViewController = sceneViewController; this.layerController = layerController; this.layerController = layerController; layerController.OnRedo += updateUndoRedo; layerController.OnUndo += updateUndoRedo; layerController.OnUndoRedoChanged += updateUndoRedo; layerController.OnActiveTransparencyStateChanged += updateUndoRedo; anatomyWindowManager = new AnatomyContextWindowManager(sceneViewController, anatomyController, layerController, this, anatomyTaskManager); anatomyFilter = new AnatomyFilter(anatomyController); anatomyFilter.refreshCategories(); anatomyFilter.FilterChanged += anatomyFilter_FilterChanged; anatomyFilter.TopLevelAnatomyChanged += anatomyFilter_TopLevelAnatomyChanged; Button filter = window.findWidget("Filter") as Button; filter.MouseButtonClick += filter_MouseButtonClick; ScrollView anatomyScroll = (ScrollView)window.findWidget("AnatomyList"); anatomyList = new HashSetMultiSelectButtonGrid(anatomyScroll, new ButtonGridListLayout(), naturalSort); anatomyList.ItemActivated += anatomyList_ItemActivated; anatomyList.ItemAdded += anatomyList_ItemAdded; anatomyList.ItemRemoved += anatomyList_ItemRemoved; anatomyList.ItemChosen += anatomyList_ItemChosen; buttonGridThumbs = new ButtonGridLiveThumbnailController <Anatomy>("AnatomyFinder_", new IntSize2(ThumbRenderSize, ThumbRenderSize), sceneViewController, anatomyList, anatomyScroll); searchBox = (EditBox)window.findWidget("SearchBox"); searchBox.EventEditTextChange += new MyGUIEvent(searchBox_EventEditTextChange); clearButton = (Button)searchBox.findWidgetChildSkin("Clear"); clearButton.MouseButtonClick += new MyGUIEvent(clearButton_MouseButtonClick); clearButton.NeedToolTip = true; clearButton.EventToolTip += button_UserObject_EventToolTip; clearButton.UserObject = "Clear Search"; Button unhideAll = window.findWidget("UnhideAll") as Button; unhideAll.MouseButtonClick += (s, e) => { LayerState undo = LayerState.CreateAndCapture(); this.layerController.unhideAll(); this.layerController.pushUndoState(undo); }; undoButton = window.findWidget("Undo") as Button; undoButton.MouseButtonClick += (s, e) => layerController.undo(); redoButton = window.findWidget("Redo") as Button; redoButton.MouseButtonClick += (s, e) => layerController.redo(); PickAnatomy.FirstFrameDownEvent += PickAnatomy_FirstFrameDownEvent; PickAnatomy.OnHeldDown += PickAnatomy_OnHeldDown; PickAnatomy.FirstFrameUpEvent += pickAnatomy_FirstFrameUpEvent; OpenAnatomyFinder.FirstFrameUpEvent += openAnatomyFinder_FirstFrameUpEvent; if (!PlatformConfig.UnrestrictedEnvironment && !anatomyController.ShowPremiumAnatomy) { filter.Visible = false; searchBox.Width = filter.Right - searchBox.Left; } this.Resized += new EventHandler(AnatomyFinder_Resized); fixListItemWidth(); updateSearch(); }