X-Git-Url: http://git.euphorik.ch/?a=blobdiff_plain;f=Parasitemia%2FParasitemiaUI%2FAnalysis.fs;h=25060157c7b527e120ee38767ee53b3b8cd3bcb0;hb=2e3cd07dd099944059ef5e7a7f5ef57ffe3d677b;hp=2ff0b1e31c1612430a6e7d2485639c3f1208ef9b;hpb=85adb74195fe7145535d3d36263aec2f7879cd60;p=master-thesis.git diff --git a/Parasitemia/ParasitemiaUI/Analysis.fs b/Parasitemia/ParasitemiaUI/Analysis.fs index 2ff0b1e..2506015 100644 --- a/Parasitemia/ParasitemiaUI/Analysis.fs +++ b/Parasitemia/ParasitemiaUI/Analysis.fs @@ -21,8 +21,8 @@ open Types let showWindow (parent: Window) (state: State.State) : bool = let win = Views.AnalysisWindow() win.Root.Owner <- parent - win.Root.Left <- parent.Left + parent.ActualWidth / 2. - win.Root.Width / 2. - win.Root.Top <- parent.Top + parent.ActualHeight / 2. - win.Root.Height / 2. + win.Root.Left <- (if parent.WindowState = WindowState.Maximized then 0. else parent.Left) + parent.ActualWidth / 2. - win.Root.Width / 2. + win.Root.Top <- (if parent.WindowState = WindowState.Maximized then 0. else parent.Top) + parent.ActualHeight / 2. - win.Root.Height / 2. let logListener = { new Logger.IListener with @@ -60,8 +60,12 @@ let showWindow (parent: Window) (state: State.State) : bool = imageSourceSelection.lblDateLastAnalysis.Content <- if srcImg.dateLastAnalysis.Ticks = 0L then "" else srcImg.dateLastAnalysis.ToString() imageSourceSelection.txtResolution.Text <- if srcImg.dateLastAnalysis.Ticks = 0L then "" else srcImg.config.Parameters.resolution.ToString() - imageSourceSelection.menuZoom50X.Click.AddHandler(fun obj args -> imageSourceSelection.txtResolution.Text <- "230000") - imageSourceSelection.menuZoom100X.Click.AddHandler(fun obj args -> imageSourceSelection.txtResolution.Text <- "460000") + + for ppi in Utils.predefinedPPI do + let menu = MenuItem() + menu.Header <- ppi.ToString() + menu.Click.AddHandler(fun obj args -> imageSourceSelection.txtResolution.Text <- ppi.ppi.ToString()) + imageSourceSelection.predefinedValuesMenu.Items.Add(menu) |> ignore imageSourceSelection.butPPICalculator.Click.AddHandler(fun obj args -> match PPICalculator.showWindow win.Root with