From d22805889aecfc34a4d3283b7127dacd80fdffcd Mon Sep 17 00:00:00 2001 From: wp_xxyyzz Date: Mon, 13 Jun 2016 10:06:54 +0000 Subject: [PATCH] tvplanit: Restore basic functionality of WavDlg. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4737 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/tvplanit/source/vpevnteditdlg.lfm | 3 +- components/tvplanit/source/vpevnteditdlg.pas | 6 +- components/tvplanit/source/vpwavdlg.lfm | 197 ++++++++++++------- components/tvplanit/source/vpwavdlg.pas | 14 +- 4 files changed, 145 insertions(+), 75 deletions(-) diff --git a/components/tvplanit/source/vpevnteditdlg.lfm b/components/tvplanit/source/vpevnteditdlg.lfm index 3bd7b0e14..d24a01697 100644 --- a/components/tvplanit/source/vpevnteditdlg.lfm +++ b/components/tvplanit/source/vpevnteditdlg.lfm @@ -204,7 +204,7 @@ object DlgEventEdit: TDlgEventEdit 7671328DB5B6E607EA5FBE1E3353EA940000000049454E44AE426082 } end - object SpeedButton1: TSpeedButton + object SoundFinderBtn: TSpeedButton Left = 312 Height = 22 Top = 167 @@ -219,6 +219,7 @@ object DlgEventEdit: TDlgEventEdit 8888008880088808888888088088880808888880808888088088888808088088 8808888880808088888888888800088888888888888888888888 } + OnClick = SoundFinderBtnClick end object imgClock: TImage Left = 13 diff --git a/components/tvplanit/source/vpevnteditdlg.pas b/components/tvplanit/source/vpevnteditdlg.pas index 0a36ae309..c3e5ab04b 100644 --- a/components/tvplanit/source/vpevnteditdlg.pas +++ b/components/tvplanit/source/vpevnteditdlg.pas @@ -84,7 +84,7 @@ type Bevel3: TBevel; IntervalLbl: TLabel; Image1: TImage; - SpeedButton1: TSpeedButton; + SoundFinderBtn: TSpeedButton; DescriptionEdit: TEdit; AlarmSet: TCheckBox; Category: TComboBox; @@ -112,7 +112,7 @@ type procedure AlarmSetClick(Sender: TObject); procedure EndDateChange(Sender: TObject); procedure CBAllDayClick(Sender: TObject); - procedure SpeedButton1Click(Sender: TObject); + procedure SoundFinderBtnClick(Sender: TObject); procedure FormShow(Sender: TObject); procedure StartTimeExit(Sender: TObject); procedure EndTimeExit(Sender: TObject); @@ -655,7 +655,7 @@ begin end; {=====} -procedure TDlgEventEdit.SpeedButton1Click(Sender: TObject); +procedure TDlgEventEdit.SoundFinderBtnClick(Sender: TObject); begin ExecuteSoundFinder(AlarmWavPath); end; diff --git a/components/tvplanit/source/vpwavdlg.lfm b/components/tvplanit/source/vpwavdlg.lfm index dcd13441f..285d04d19 100644 --- a/components/tvplanit/source/vpwavdlg.lfm +++ b/components/tvplanit/source/vpwavdlg.lfm @@ -1,14 +1,13 @@ object FrmSoundDialog: TFrmSoundDialog Left = 328 - Height = 262 + Height = 474 Top = 242 - Width = 402 + Width = 736 HorzScrollBar.Page = 401 VertScrollBar.Page = 261 - BorderStyle = bsDialog Caption = 'FrmSoundDialog' - ClientHeight = 262 - ClientWidth = 402 + ClientHeight = 474 + ClientWidth = 736 KeyPreview = True OnCreate = FormCreate OnKeyDown = FormKeyDown @@ -16,9 +15,9 @@ object FrmSoundDialog: TFrmSoundDialog LCLVersion = '1.7' object PageControl1: TPageControl Left = 0 - Height = 262 + Height = 474 Top = 0 - Width = 402 + Width = 736 TabStop = False ActivePage = TabSheet1 Align = alClient @@ -26,72 +25,130 @@ object FrmSoundDialog: TFrmSoundDialog TabOrder = 0 object TabSheet1: TTabSheet Caption = 'Select A Sound' - ClientHeight = 236 - ClientWidth = 394 - object PlayButton: TSpeedButton - Left = 204 - Height = 22 - Top = 163 - Width = 26 - Glyph.Data = { - DE010000424DDE01000000000000760000002800000024000000120000000100 - 0400000000006801000000000000000000001000000010000000000000000000 - 80000080000000808000800000008000800080800000C0C0C000808080000000 - FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00666666666666 - 6666666666666666666666660000666666660066666666666666668866666666 - 0000666666603086666666666666688886666666000066666603077866686666 - 66668887786668660000666660388FF866866666666888877866866600006666 - 03B07FF8686666666688787778686666000066003BF07FF8666666668887F877 - 7866666600006038BFB00FF866666668887F788778666666000063B7FBF080F8 - 6888866877F7F88878688886000063B7BFB070F866666668777F787878666666 - 000063F7FBF00FF866666668F7F7F8877866666600006633BFB07FF868666666 - 887F787778686666000066663BF07FF8668666666687F8777866866600006666 - 63B887F866686666666878877866686600006666663B07766666666666668787 - 7866666600006666666380866666666666666888866666660000666666660066 - 6666666666666688666666660000666666666666666666666666666666666666 - 0000 - } - NumGlyphs = 2 - OnClick = PlayButtonClick - end - object FileListBox1: TFileListBox - Left = 204 - Height = 121 - Top = 29 - Width = 185 - Directory = 'D:\lazarus' - ItemHeight = 0 - Mask = '*.wav' - OnChange = FileListBox1Change - TabOrder = 1 - end - object CBDefault: TCheckBox - Left = 204 - Height = 19 - Top = 5 - Width = 73 - Caption = 'CBDefault' - OnClick = CBDefaultClick + ClientHeight = 446 + ClientWidth = 728 + object RightPanel: TPanel + Left = 453 + Height = 446 + Top = 0 + Width = 275 + Align = alRight + BevelOuter = bvNone + ClientHeight = 446 + ClientWidth = 275 TabOrder = 0 + object Panel1: TPanel + Left = 0 + Height = 34 + Top = 0 + Width = 275 + Align = alTop + BevelOuter = bvNone + ClientHeight = 34 + ClientWidth = 275 + TabOrder = 0 + object CBDefault: TCheckBox + Left = 8 + Height = 19 + Top = 8 + Width = 73 + Caption = 'CBDefault' + OnClick = CBDefaultClick + TabOrder = 0 + end + end + object Panel2: TPanel + Left = 0 + Height = 38 + Top = 408 + Width = 275 + Align = alBottom + BevelOuter = bvNone + ClientHeight = 38 + ClientWidth = 275 + TabOrder = 1 + object PlayButton: TSpeedButton + Left = 8 + Height = 25 + Top = 8 + Width = 29 + Glyph.Data = { + DE010000424DDE01000000000000760000002800000024000000120000000100 + 0400000000006801000000000000000000001000000010000000000000000000 + 80000080000000808000800000008000800080800000C0C0C000808080000000 + FF0000FF000000FFFF00FF000000FF00FF00FFFF0000FFFFFF00666666666666 + 6666666666666666666666660000666666660066666666666666668866666666 + 0000666666603086666666666666688886666666000066666603077866686666 + 66668887786668660000666660388FF866866666666888877866866600006666 + 03B07FF8686666666688787778686666000066003BF07FF8666666668887F877 + 7866666600006038BFB00FF866666668887F788778666666000063B7FBF080F8 + 6888866877F7F88878688886000063B7BFB070F866666668777F787878666666 + 000063F7FBF00FF866666668F7F7F8877866666600006633BFB07FF868666666 + 887F787778686666000066663BF07FF8668666666687F8777866866600006666 + 63B887F866686666666878877866686600006666663B07766666666666668787 + 7866666600006666666380866666666666666888866666660000666666660066 + 6666666666666688666666660000666666666666666666666666666666666666 + 0000 + } + NumGlyphs = 2 + OnClick = PlayButtonClick + end + object OkBtn: TButton + Left = 112 + Height = 25 + Top = 8 + Width = 75 + Anchors = [akTop, akRight] + Caption = 'OkBtn' + Default = True + OnClick = OkBtnClick + TabOrder = 0 + end + object CancelBtn: TButton + Left = 192 + Height = 25 + Top = 8 + Width = 75 + Anchors = [akTop, akRight] + Caption = 'CancelBtn' + OnClick = CancelBtnClick + TabOrder = 1 + end + end + object FileListBox1: TFileListBox + Left = 0 + Height = 374 + Top = 34 + Width = 271 + Align = alClient + BorderSpacing.Right = 4 + Directory = 'D:\lazarus' + ItemHeight = 0 + Mask = '*.wav' + OnChange = FileListBox1Change + TabOrder = 2 + end end - object OkBtn: TButton - Left = 220 - Height = 25 - Top = 205 - Width = 75 - Caption = 'OkBtn' - Default = True - OnClick = OkBtnClick + object Splitter1: TSplitter + Left = 448 + Height = 446 + Top = 0 + Width = 5 + Align = alRight + ResizeAnchor = akRight + end + object ShellTreeView: TShellTreeView + Left = 4 + Height = 438 + Top = 4 + Width = 444 + Align = alClient + BorderSpacing.Left = 4 + BorderSpacing.Top = 4 + BorderSpacing.Bottom = 4 + FileSortType = fstNone TabOrder = 2 - end - object CancelBtn: TButton - Left = 308 - Height = 25 - Top = 205 - Width = 75 - Caption = 'CancelBtn' - OnClick = CancelBtnClick - TabOrder = 3 + ObjectTypes = [otFolders] end end end diff --git a/components/tvplanit/source/vpwavdlg.pas b/components/tvplanit/source/vpwavdlg.pas index 424405e90..cd869f41e 100644 --- a/components/tvplanit/source/vpwavdlg.pas +++ b/components/tvplanit/source/vpwavdlg.pas @@ -41,11 +41,19 @@ uses Windows, {$ENDIF} Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, - FileCtrl, StdCtrls, ExtCtrls, Buttons, VpBase, ComCtrls; + FileCtrl, StdCtrls, ExtCtrls, Buttons, VpBase, ComCtrls, ShellCtrls; type + + { TFrmSoundDialog } + TFrmSoundDialog = class(TForm) PageControl1: TPageControl; + Panel1: TPanel; + Panel2: TPanel; + RightPanel: TPanel; + ShellTreeView: TShellTreeView; + Splitter1: TSplitter; TabSheet1: TTabSheet; PlayButton: TSpeedButton; // DriveComboBox1: TDriveComboBox; @@ -141,15 +149,18 @@ begin CancelBtn.Caption := RSCancelBtn; if DingPath = '' then begin CBDefault.Checked := true; + ShellTreeView.Path := ExtractFileDir(ParamStr(0)); // DirectoryListBox1.Directory := ExtractFileDir(ParamStr(0)); 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; @@ -159,6 +170,7 @@ procedure TFrmSoundDialog.CBDefaultClick(Sender: TObject); begin // DriveComboBox1.Enabled := not CBDefault.Checked; // DirectoryListBox1.Enabled := not CBDefault.Checked; + ShellTreeview.Enabled := not CBDefault.Checked; FileListBox1.Enabled := not CBDefault.Checked; PlayButton.Enabled := not CBDefault.Checked; end;