diff --git a/components/tvplanit/source/vpevnteditdlg.pas b/components/tvplanit/source/vpevnteditdlg.pas index c0ba387b0..02b047b83 100644 --- a/components/tvplanit/source/vpevnteditdlg.pas +++ b/components/tvplanit/source/vpevnteditdlg.pas @@ -667,8 +667,8 @@ begin try SoundFinder.DingPath := AlarmWavPath; SoundFinder.Populate; - SoundFinder.ShowModal; SoundFinder.OnPlaySound := DoPlaySound; + SoundFinder.ShowModal; if SoundFinder.ReturnCode = TvpEditorReturnCode(rtCommit) then begin if SoundFinder.CBDefault.Checked then AlarmWavPath := '' diff --git a/components/tvplanit/source/vpwavdlg.lfm b/components/tvplanit/source/vpwavdlg.lfm index 285d04d19..e0556e29a 100644 --- a/components/tvplanit/source/vpwavdlg.lfm +++ b/components/tvplanit/source/vpwavdlg.lfm @@ -36,7 +36,7 @@ object FrmSoundDialog: TFrmSoundDialog BevelOuter = bvNone ClientHeight = 446 ClientWidth = 275 - TabOrder = 0 + TabOrder = 2 object Panel1: TPanel Left = 0 Height = 34 @@ -66,7 +66,7 @@ object FrmSoundDialog: TFrmSoundDialog BevelOuter = bvNone ClientHeight = 38 ClientWidth = 275 - TabOrder = 1 + TabOrder = 2 object PlayButton: TSpeedButton Left = 8 Height = 25 @@ -126,7 +126,7 @@ object FrmSoundDialog: TFrmSoundDialog ItemHeight = 0 Mask = '*.wav' OnChange = FileListBox1Change - TabOrder = 2 + TabOrder = 1 end end object Splitter1: TSplitter @@ -147,7 +147,8 @@ object FrmSoundDialog: TFrmSoundDialog BorderSpacing.Top = 4 BorderSpacing.Bottom = 4 FileSortType = fstNone - TabOrder = 2 + TabOrder = 0 + OnChange = ShellTreeViewChange ObjectTypes = [otFolders] end end diff --git a/components/tvplanit/source/vpwavdlg.pas b/components/tvplanit/source/vpwavdlg.pas index 4c4b9b697..7d1b8a296 100644 --- a/components/tvplanit/source/vpwavdlg.pas +++ b/components/tvplanit/source/vpwavdlg.pas @@ -70,6 +70,7 @@ type procedure CancelBtnClick(Sender: TObject); procedure FormKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); + procedure ShellTreeViewChange(Sender: TObject; Node: TTreeNode); private FOnPlaySound: TVpPlaySoundEvent; public @@ -129,16 +130,19 @@ begin end else begin Drive := UpCase(ExtractFileDrive(DingPath)[1]); if FileExists(DingPath) and (Drive in ['A'..'Z']) then begin -// DriveComboBox1.Drive := Drive; -// DirectoryListBox1.Directory := ExtractFileDir(DingPath); ShellTreeview.Path := ExtractFileDir(DingPath); FileListBox1.FileName := DingPath; end else begin -// DirectoryListBox1.Directory := ExtractFileDir(ParamStr(0)); ShellTreeView.Path := ExtractFileDir(ParamStr(0)); end; end; end; + +procedure TFrmSoundDialog.ShellTreeViewChange(Sender: TObject; Node: TTreeNode); +begin + FileListbox1.Directory := ShellTreeView.Path; +end; + {=====} procedure TFrmSoundDialog.CBDefaultClick(Sender: TObject);