From a0790eb6442a7246763289e43f795ff1c0ddf6af Mon Sep 17 00:00:00 2001 From: Chris Rorden Date: Wed, 11 Apr 2018 13:15:50 -0400 Subject: [PATCH] Add cancel button to DICOM load --- dcm_load.pas | 13 ++++- define_types.pas | 2 +- mainunit.lfm | 2 +- mainunit.pas | 9 ++- nsappkitext.pas | 4 +- simplelaz.lps | 141 +++++++++++++++++++++++------------------------ 6 files changed, 93 insertions(+), 78 deletions(-) diff --git a/dcm_load.pas b/dcm_load.pas index cbb4e5a..411809f 100755 --- a/dcm_load.pas +++ b/dcm_load.pas @@ -125,7 +125,7 @@ function dcmSeriesSelectForm(dcm2niixExe, dicomDir: string): string; PrefForm: TForm; rg: TRadioGroup; dcmStrings: TStringlist; - OKBtn: TButton; + OKBtn, CancelBtn: TButton; w,h: integer; label 123; @@ -172,9 +172,20 @@ function dcmSeriesSelectForm(dcm2niixExe, dicomDir: string): string; OkBtn.Top := rg.Height+rg.Top+4; OkBtn.Parent:=PrefForm; OkBtn.ModalResult:= mrOK; + //Cancel button + CancelBtn:=TButton.create(PrefForm); + CancelBtn.Caption:='Cancel'; + CancelBtn.Left := 28; + CancelBtn.Width:= 100; + CancelBtn.Top := rg.Height+rg.Top+4; + CancelBtn.Parent:=PrefForm; + CancelBtn.ModalResult:= mrCancel; + PrefForm.Height:= OkBtn.Top + OkBtn.Height+4; PrefForm.ShowModal; result := rg.Items[rg.ItemIndex];//seriesNum(rg.Items[rg.ItemIndex]); + if PrefForm.ModalResult = mrCancel then + result := ''; FreeAndNil(PrefForm); 123: //cleanup dcmStrings.Free; diff --git a/define_types.pas b/define_types.pas index c8a3fb6..f328989 100755 --- a/define_types.pas +++ b/define_types.pas @@ -12,7 +12,7 @@ interface SysUtils,classes,graphics,userdir,math, {$IFDEF GUI} forms,dialogs,controls;{$ELSE} dialogsx;{$ENDIF} const - kVers = 'v1.0.20180331'; + kVers = 'v1.0.20180402'; NaN : double = 1/0; kMagicDouble : double = -111666222; kTxtFilter = 'Text (*.txt)|*.txt;*.csv|Comma Separated (*.csv)|*.csv'; diff --git a/mainunit.lfm b/mainunit.lfm index 67b95f5..7d10176 100755 --- a/mainunit.lfm +++ b/mainunit.lfm @@ -1,5 +1,5 @@ object GLForm1: TGLForm1 - Left = 108 + Left = 248 Height = 787 Top = 23 Width = 1032 diff --git a/mainunit.pas b/mainunit.pas index ecb9298..c5cad8a 100755 --- a/mainunit.pas +++ b/mainunit.pas @@ -635,14 +635,19 @@ function TGLForm1.GLBoxBackingHeight: integer; {$IFDEF LCLCocoa} procedure TGLForm1.SetDarkMode; begin - setThemeModeX(Self.Handle, gPrefs.DarkMode); + setThemeMode(Self.Handle, gPrefs.DarkMode); if gPrefs.DarkMode then begin MosaicText.Color := clGray; ShaderMemo.Color := clGray; StringGrid1.Color := clGray; StringGrid1.AlternateColor:= clGray; StringGrid1.FixedColor:= clBlack; - + (*LeftBtn.Color := clDefault; + AnteriorBtn.Color := clGray; + RightBtn.Color := clSilver; + PosteriorBtn.Color := clMedGray; + SuperiorBtn.Color := clBtnFace; + InferiorBtn.Color := clBlack; *) end else begin MosaicText.Color:= clDefault; ShaderMemo.Color := clDefault; diff --git a/nsappkitext.pas b/nsappkitext.pas index d126a00..9dc4612 100644 --- a/nsappkitext.pas +++ b/nsappkitext.pas @@ -48,7 +48,7 @@ interface // You may want to draw differently if the current apperance is vibrant. function allowsVibrancy: Boolean; message 'allowsVibrancy'; end; - procedure setThemeModeX(FormHandle: HWND; isDarkMode: boolean); + procedure setThemeMode(FormHandle: HWND; isDarkMode: boolean); var @@ -74,7 +74,7 @@ interface implementation -procedure setThemeModeX(FormHandle: HWND; isDarkMode: boolean); +procedure setThemeMode(FormHandle: HWND; isDarkMode: boolean); var theWindow : CocoaAll.NSWindow; begin diff --git a/simplelaz.lps b/simplelaz.lps index 2450953..0f11fca 100644 --- a/simplelaz.lps +++ b/simplelaz.lps @@ -7,7 +7,7 @@ - + @@ -20,9 +20,8 @@ - - - + + @@ -31,9 +30,10 @@ - - - + + + + @@ -41,17 +41,16 @@ - + - - + @@ -61,9 +60,9 @@ - - - + + + @@ -73,7 +72,7 @@ - + @@ -150,7 +149,7 @@ - + @@ -259,9 +258,9 @@ - - - + + + @@ -278,123 +277,123 @@ - + - + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + - - + + - - + + - - + + - - + + - - + + - - + + - - + + - + - +