tvplanit: Restore basic functionality of WavDlg.

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4737 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2016-06-13 10:06:54 +00:00
parent 4688f2e91d
commit d22805889a
4 changed files with 145 additions and 75 deletions

View File

@ -204,7 +204,7 @@ object DlgEventEdit: TDlgEventEdit
7671328DB5B6E607EA5FBE1E3353EA940000000049454E44AE426082 7671328DB5B6E607EA5FBE1E3353EA940000000049454E44AE426082
} }
end end
object SpeedButton1: TSpeedButton object SoundFinderBtn: TSpeedButton
Left = 312 Left = 312
Height = 22 Height = 22
Top = 167 Top = 167
@ -219,6 +219,7 @@ object DlgEventEdit: TDlgEventEdit
8888008880088808888888088088880808888880808888088088888808088088 8888008880088808888888088088880808888880808888088088888808088088
8808888880808088888888888800088888888888888888888888 8808888880808088888888888800088888888888888888888888
} }
OnClick = SoundFinderBtnClick
end end
object imgClock: TImage object imgClock: TImage
Left = 13 Left = 13

View File

@ -84,7 +84,7 @@ type
Bevel3: TBevel; Bevel3: TBevel;
IntervalLbl: TLabel; IntervalLbl: TLabel;
Image1: TImage; Image1: TImage;
SpeedButton1: TSpeedButton; SoundFinderBtn: TSpeedButton;
DescriptionEdit: TEdit; DescriptionEdit: TEdit;
AlarmSet: TCheckBox; AlarmSet: TCheckBox;
Category: TComboBox; Category: TComboBox;
@ -112,7 +112,7 @@ type
procedure AlarmSetClick(Sender: TObject); procedure AlarmSetClick(Sender: TObject);
procedure EndDateChange(Sender: TObject); procedure EndDateChange(Sender: TObject);
procedure CBAllDayClick(Sender: TObject); procedure CBAllDayClick(Sender: TObject);
procedure SpeedButton1Click(Sender: TObject); procedure SoundFinderBtnClick(Sender: TObject);
procedure FormShow(Sender: TObject); procedure FormShow(Sender: TObject);
procedure StartTimeExit(Sender: TObject); procedure StartTimeExit(Sender: TObject);
procedure EndTimeExit(Sender: TObject); procedure EndTimeExit(Sender: TObject);
@ -655,7 +655,7 @@ begin
end; end;
{=====} {=====}
procedure TDlgEventEdit.SpeedButton1Click(Sender: TObject); procedure TDlgEventEdit.SoundFinderBtnClick(Sender: TObject);
begin begin
ExecuteSoundFinder(AlarmWavPath); ExecuteSoundFinder(AlarmWavPath);
end; end;

View File

@ -1,14 +1,13 @@
object FrmSoundDialog: TFrmSoundDialog object FrmSoundDialog: TFrmSoundDialog
Left = 328 Left = 328
Height = 262 Height = 474
Top = 242 Top = 242
Width = 402 Width = 736
HorzScrollBar.Page = 401 HorzScrollBar.Page = 401
VertScrollBar.Page = 261 VertScrollBar.Page = 261
BorderStyle = bsDialog
Caption = 'FrmSoundDialog' Caption = 'FrmSoundDialog'
ClientHeight = 262 ClientHeight = 474
ClientWidth = 402 ClientWidth = 736
KeyPreview = True KeyPreview = True
OnCreate = FormCreate OnCreate = FormCreate
OnKeyDown = FormKeyDown OnKeyDown = FormKeyDown
@ -16,9 +15,9 @@ object FrmSoundDialog: TFrmSoundDialog
LCLVersion = '1.7' LCLVersion = '1.7'
object PageControl1: TPageControl object PageControl1: TPageControl
Left = 0 Left = 0
Height = 262 Height = 474
Top = 0 Top = 0
Width = 402 Width = 736
TabStop = False TabStop = False
ActivePage = TabSheet1 ActivePage = TabSheet1
Align = alClient Align = alClient
@ -26,13 +25,53 @@ object FrmSoundDialog: TFrmSoundDialog
TabOrder = 0 TabOrder = 0
object TabSheet1: TTabSheet object TabSheet1: TTabSheet
Caption = 'Select A Sound' Caption = 'Select A Sound'
ClientHeight = 236 ClientHeight = 446
ClientWidth = 394 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 object PlayButton: TSpeedButton
Left = 204 Left = 8
Height = 22 Height = 25
Top = 163 Top = 8
Width = 26 Width = 29
Glyph.Data = { Glyph.Data = {
DE010000424DDE01000000000000760000002800000024000000120000000100 DE010000424DDE01000000000000760000002800000024000000120000000100
0400000000006801000000000000000000001000000010000000000000000000 0400000000006801000000000000000000001000000010000000000000000000
@ -54,44 +93,62 @@ object FrmSoundDialog: TFrmSoundDialog
NumGlyphs = 2 NumGlyphs = 2
OnClick = PlayButtonClick OnClick = PlayButtonClick
end 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 object FileListBox1: TFileListBox
Left = 204 Left = 0
Height = 121 Height = 374
Top = 29 Top = 34
Width = 185 Width = 271
Align = alClient
BorderSpacing.Right = 4
Directory = 'D:\lazarus' Directory = 'D:\lazarus'
ItemHeight = 0 ItemHeight = 0
Mask = '*.wav' Mask = '*.wav'
OnChange = FileListBox1Change OnChange = FileListBox1Change
TabOrder = 1
end
object CBDefault: TCheckBox
Left = 204
Height = 19
Top = 5
Width = 73
Caption = 'CBDefault'
OnClick = CBDefaultClick
TabOrder = 0
end
object OkBtn: TButton
Left = 220
Height = 25
Top = 205
Width = 75
Caption = 'OkBtn'
Default = True
OnClick = OkBtnClick
TabOrder = 2 TabOrder = 2
end end
object CancelBtn: TButton end
Left = 308 object Splitter1: TSplitter
Height = 25 Left = 448
Top = 205 Height = 446
Width = 75 Top = 0
Caption = 'CancelBtn' Width = 5
OnClick = CancelBtnClick Align = alRight
TabOrder = 3 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
ObjectTypes = [otFolders]
end end
end end
end end

View File

@ -41,11 +41,19 @@ uses
Windows, Windows,
{$ENDIF} {$ENDIF}
Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
FileCtrl, StdCtrls, ExtCtrls, Buttons, VpBase, ComCtrls; FileCtrl, StdCtrls, ExtCtrls, Buttons, VpBase, ComCtrls, ShellCtrls;
type type
{ TFrmSoundDialog }
TFrmSoundDialog = class(TForm) TFrmSoundDialog = class(TForm)
PageControl1: TPageControl; PageControl1: TPageControl;
Panel1: TPanel;
Panel2: TPanel;
RightPanel: TPanel;
ShellTreeView: TShellTreeView;
Splitter1: TSplitter;
TabSheet1: TTabSheet; TabSheet1: TTabSheet;
PlayButton: TSpeedButton; PlayButton: TSpeedButton;
// DriveComboBox1: TDriveComboBox; // DriveComboBox1: TDriveComboBox;
@ -141,15 +149,18 @@ begin
CancelBtn.Caption := RSCancelBtn; CancelBtn.Caption := RSCancelBtn;
if DingPath = '' then begin if DingPath = '' then begin
CBDefault.Checked := true; CBDefault.Checked := true;
ShellTreeView.Path := ExtractFileDir(ParamStr(0));
// DirectoryListBox1.Directory := ExtractFileDir(ParamStr(0)); // DirectoryListBox1.Directory := ExtractFileDir(ParamStr(0));
end else begin end else begin
Drive := UpCase(ExtractFileDrive(DingPath)[1]); Drive := UpCase(ExtractFileDrive(DingPath)[1]);
if FileExists(DingPath) and (Drive in ['A'..'Z']) then begin if FileExists(DingPath) and (Drive in ['A'..'Z']) then begin
// DriveComboBox1.Drive := Drive; // DriveComboBox1.Drive := Drive;
// DirectoryListBox1.Directory := ExtractFileDir(DingPath); // DirectoryListBox1.Directory := ExtractFileDir(DingPath);
ShellTreeview.Path := ExtractFileDir(DingPath);
FileListBox1.FileName := DingPath; FileListBox1.FileName := DingPath;
end else begin end else begin
// DirectoryListBox1.Directory := ExtractFileDir(ParamStr(0)); // DirectoryListBox1.Directory := ExtractFileDir(ParamStr(0));
ShellTreeView.Path := ExtractFileDir(ParamStr(0));
end; end;
end; end;
end; end;
@ -159,6 +170,7 @@ procedure TFrmSoundDialog.CBDefaultClick(Sender: TObject);
begin begin
// DriveComboBox1.Enabled := not CBDefault.Checked; // DriveComboBox1.Enabled := not CBDefault.Checked;
// DirectoryListBox1.Enabled := not CBDefault.Checked; // DirectoryListBox1.Enabled := not CBDefault.Checked;
ShellTreeview.Enabled := not CBDefault.Checked;
FileListBox1.Enabled := not CBDefault.Checked; FileListBox1.Enabled := not CBDefault.Checked;
PlayButton.Enabled := not CBDefault.Checked; PlayButton.Enabled := not CBDefault.Checked;
end; end;