You've already forked lazarus-ccr
tvplanit: In WavDlg, replace FileListbox by ShellListview. Some gui improvements in WavDlg.
git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@4741 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
@ -714,6 +714,10 @@ msgctxt "vpsr.rsnoteslbl"
|
|||||||
msgid "Notes:"
|
msgid "Notes:"
|
||||||
msgstr "Notizen:"
|
msgstr "Notizen:"
|
||||||
|
|
||||||
|
#: vpsr.rsnothingtoselectfrom
|
||||||
|
msgid "There is nothing to select if default sound is used."
|
||||||
|
msgstr "Keine Auswahl möglich, wenn der Standard-Klang verwendet wird."
|
||||||
|
|
||||||
#: vpsr.rsnotimersavail
|
#: vpsr.rsnotimersavail
|
||||||
msgid "No Window's timers are available."
|
msgid "No Window's timers are available."
|
||||||
msgstr "Es sind keine Windows-Timer mehr verfügbar"
|
msgstr "Es sind keine Windows-Timer mehr verfügbar"
|
||||||
|
@ -704,6 +704,10 @@ msgctxt "vpsr.rsnoteslbl"
|
|||||||
msgid "Notes:"
|
msgid "Notes:"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
|
||||||
|
#: vpsr.rsnothingtoselectfrom
|
||||||
|
msgid "There is nothing to select if default sound is used."
|
||||||
|
msgstr ""
|
||||||
|
|
||||||
#: vpsr.rsnotimersavail
|
#: vpsr.rsnotimersavail
|
||||||
msgid "No Window's timers are available."
|
msgid "No Window's timers are available."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
|
@ -680,7 +680,7 @@ begin
|
|||||||
if SoundFinder.CBDefault.Checked then
|
if SoundFinder.CBDefault.Checked then
|
||||||
AlarmWavPath := ''
|
AlarmWavPath := ''
|
||||||
else
|
else
|
||||||
AlarmWavPath := SoundFinder.FileListBox1.FileName;
|
AlarmWavPath := SoundFinder.GetSelectedFilename;
|
||||||
end;
|
end;
|
||||||
finally
|
finally
|
||||||
SoundFinder.Release;
|
SoundFinder.Release;
|
||||||
|
@ -217,6 +217,7 @@ resourcestring
|
|||||||
RSSelectASound = 'Select A Sound';
|
RSSelectASound = 'Select A Sound';
|
||||||
RSSoundFinder = 'Sound Finder';
|
RSSoundFinder = 'Sound Finder';
|
||||||
RSDefaultSound = 'Use the default sound';
|
RSDefaultSound = 'Use the default sound';
|
||||||
|
RSNothingToSelectFrom = 'There is nothing to select if default sound is used.';
|
||||||
|
|
||||||
{ Event Edit Dialog Captions }
|
{ Event Edit Dialog Captions }
|
||||||
RSDlgEventEdit = 'Event';
|
RSDlgEventEdit = 'Event';
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
object FrmSoundDialog: TFrmSoundDialog
|
object FrmSoundDialog: TFrmSoundDialog
|
||||||
Left = 328
|
Left = 323
|
||||||
Height = 474
|
Height = 474
|
||||||
Top = 242
|
Top = 278
|
||||||
Width = 736
|
Width = 736
|
||||||
HorzScrollBar.Page = 401
|
HorzScrollBar.Page = 401
|
||||||
VertScrollBar.Page = 261
|
VertScrollBar.Page = 261
|
||||||
@ -28,24 +28,25 @@ object FrmSoundDialog: TFrmSoundDialog
|
|||||||
ClientHeight = 446
|
ClientHeight = 446
|
||||||
ClientWidth = 728
|
ClientWidth = 728
|
||||||
object RightPanel: TPanel
|
object RightPanel: TPanel
|
||||||
Left = 453
|
Left = 395
|
||||||
Height = 446
|
Height = 446
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 275
|
Width = 333
|
||||||
Align = alRight
|
Align = alRight
|
||||||
BevelOuter = bvNone
|
BevelOuter = bvNone
|
||||||
|
Caption = 'Nothing to select from...'
|
||||||
ClientHeight = 446
|
ClientHeight = 446
|
||||||
ClientWidth = 275
|
ClientWidth = 333
|
||||||
TabOrder = 2
|
TabOrder = 2
|
||||||
object Panel1: TPanel
|
object Panel1: TPanel
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 34
|
Height = 34
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 275
|
Width = 333
|
||||||
Align = alTop
|
Align = alTop
|
||||||
BevelOuter = bvNone
|
BevelOuter = bvNone
|
||||||
ClientHeight = 34
|
ClientHeight = 34
|
||||||
ClientWidth = 275
|
ClientWidth = 333
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
object CBDefault: TCheckBox
|
object CBDefault: TCheckBox
|
||||||
Left = 8
|
Left = 8
|
||||||
@ -61,11 +62,11 @@ object FrmSoundDialog: TFrmSoundDialog
|
|||||||
Left = 0
|
Left = 0
|
||||||
Height = 38
|
Height = 38
|
||||||
Top = 408
|
Top = 408
|
||||||
Width = 275
|
Width = 333
|
||||||
Align = alBottom
|
Align = alBottom
|
||||||
BevelOuter = bvNone
|
BevelOuter = bvNone
|
||||||
ClientHeight = 38
|
ClientHeight = 38
|
||||||
ClientWidth = 275
|
ClientWidth = 333
|
||||||
TabOrder = 2
|
TabOrder = 2
|
||||||
object PlayButton: TSpeedButton
|
object PlayButton: TSpeedButton
|
||||||
Left = 8
|
Left = 8
|
||||||
@ -94,7 +95,7 @@ object FrmSoundDialog: TFrmSoundDialog
|
|||||||
OnClick = PlayButtonClick
|
OnClick = PlayButtonClick
|
||||||
end
|
end
|
||||||
object OkBtn: TButton
|
object OkBtn: TButton
|
||||||
Left = 112
|
Left = 170
|
||||||
Height = 25
|
Height = 25
|
||||||
Top = 8
|
Top = 8
|
||||||
Width = 75
|
Width = 75
|
||||||
@ -105,7 +106,7 @@ object FrmSoundDialog: TFrmSoundDialog
|
|||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
end
|
end
|
||||||
object CancelBtn: TButton
|
object CancelBtn: TButton
|
||||||
Left = 192
|
Left = 250
|
||||||
Height = 25
|
Height = 25
|
||||||
Top = 8
|
Top = 8
|
||||||
Width = 75
|
Width = 75
|
||||||
@ -115,22 +116,34 @@ object FrmSoundDialog: TFrmSoundDialog
|
|||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object FileListBox1: TFileListBox
|
object ShellListView: TShellListView
|
||||||
Left = 0
|
Left = 0
|
||||||
Height = 374
|
Height = 374
|
||||||
Top = 34
|
Top = 34
|
||||||
Width = 271
|
Width = 329
|
||||||
Align = alClient
|
Align = alClient
|
||||||
BorderSpacing.Right = 4
|
BorderSpacing.Right = 4
|
||||||
Directory = 'D:\lazarus'
|
Color = clDefault
|
||||||
ItemHeight = 0
|
HideSelection = False
|
||||||
Mask = '*.wav'
|
Mask = '*.wav'
|
||||||
OnChange = FileListBox1Change
|
|
||||||
TabOrder = 1
|
TabOrder = 1
|
||||||
|
ObjectTypes = [otNonFolders]
|
||||||
|
ShellTreeView = ShellTreeView
|
||||||
|
end
|
||||||
|
object Panel3: TPanel
|
||||||
|
Left = 61
|
||||||
|
Height = 90
|
||||||
|
Top = 110
|
||||||
|
Width = 170
|
||||||
|
BevelOuter = bvNone
|
||||||
|
BorderStyle = bsSingle
|
||||||
|
Caption = 'Nothing to select from'
|
||||||
|
TabOrder = 3
|
||||||
|
Wordwrap = True
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
object Splitter1: TSplitter
|
object Splitter1: TSplitter
|
||||||
Left = 448
|
Left = 390
|
||||||
Height = 446
|
Height = 446
|
||||||
Top = 0
|
Top = 0
|
||||||
Width = 5
|
Width = 5
|
||||||
@ -141,15 +154,27 @@ object FrmSoundDialog: TFrmSoundDialog
|
|||||||
Left = 4
|
Left = 4
|
||||||
Height = 438
|
Height = 438
|
||||||
Top = 4
|
Top = 4
|
||||||
Width = 444
|
Width = 386
|
||||||
Align = alClient
|
Align = alClient
|
||||||
BorderSpacing.Left = 4
|
BorderSpacing.Left = 4
|
||||||
BorderSpacing.Top = 4
|
BorderSpacing.Top = 4
|
||||||
BorderSpacing.Bottom = 4
|
BorderSpacing.Bottom = 4
|
||||||
FileSortType = fstNone
|
FileSortType = fstNone
|
||||||
|
ReadOnly = True
|
||||||
TabOrder = 0
|
TabOrder = 0
|
||||||
OnChange = ShellTreeViewChange
|
Options = [tvoAutoItemHeight, tvoHideSelection, tvoKeepCollapsedNodes, tvoReadOnly, tvoShowButtons, tvoShowLines, tvoShowRoot, tvoToolTips, tvoThemedDraw]
|
||||||
ObjectTypes = [otFolders]
|
ObjectTypes = [otFolders]
|
||||||
|
ShellListView = ShellListView
|
||||||
|
end
|
||||||
|
object Panel4: TPanel
|
||||||
|
Left = 61
|
||||||
|
Height = 90
|
||||||
|
Top = 110
|
||||||
|
Width = 170
|
||||||
|
BevelOuter = bvNone
|
||||||
|
BorderStyle = bsSingle
|
||||||
|
Caption = 'Nothing to select from'
|
||||||
|
TabOrder = 3
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -51,14 +51,14 @@ type
|
|||||||
PageControl1: TPageControl;
|
PageControl1: TPageControl;
|
||||||
Panel1: TPanel;
|
Panel1: TPanel;
|
||||||
Panel2: TPanel;
|
Panel2: TPanel;
|
||||||
|
Panel3: TPanel;
|
||||||
|
Panel4: TPanel;
|
||||||
RightPanel: TPanel;
|
RightPanel: TPanel;
|
||||||
|
ShellListView: TShellListView;
|
||||||
ShellTreeView: TShellTreeView;
|
ShellTreeView: TShellTreeView;
|
||||||
Splitter1: TSplitter;
|
Splitter1: TSplitter;
|
||||||
TabSheet1: TTabSheet;
|
TabSheet1: TTabSheet;
|
||||||
PlayButton: TSpeedButton;
|
PlayButton: TSpeedButton;
|
||||||
// DriveComboBox1: TDriveComboBox;
|
|
||||||
// DirectoryListBox1: TDirectoryListBox;
|
|
||||||
FileListBox1: TFileListBox;
|
|
||||||
CBDefault: TCheckBox;
|
CBDefault: TCheckBox;
|
||||||
OkBtn: TButton;
|
OkBtn: TButton;
|
||||||
CancelBtn: TButton;
|
CancelBtn: TButton;
|
||||||
@ -70,12 +70,13 @@ type
|
|||||||
procedure CancelBtnClick(Sender: TObject);
|
procedure CancelBtnClick(Sender: TObject);
|
||||||
procedure FormKeyDown(Sender: TObject; var Key: Word;
|
procedure FormKeyDown(Sender: TObject; var Key: Word;
|
||||||
Shift: TShiftState);
|
Shift: TShiftState);
|
||||||
procedure ShellTreeViewChange(Sender: TObject; Node: TTreeNode);
|
|
||||||
private
|
private
|
||||||
FOnPlaySound: TVpPlaySoundEvent;
|
FOnPlaySound: TVpPlaySoundEvent;
|
||||||
|
function FindFileItem(AFilename: String): TListItem;
|
||||||
public
|
public
|
||||||
DingPath: string;
|
DingPath: string;
|
||||||
ReturnCode : TVpEditorReturnCode;
|
ReturnCode : TVpEditorReturnCode;
|
||||||
|
function GetSelectedFileName: String;
|
||||||
procedure Populate;
|
procedure Populate;
|
||||||
property OnPlaySound: TVpPlaySoundEvent read FOnPlaySound write FOnPlaySound;
|
property OnPlaySound: TVpPlaySoundEvent read FOnPlaySound write FOnPlaySound;
|
||||||
end;
|
end;
|
||||||
@ -94,9 +95,9 @@ uses
|
|||||||
|
|
||||||
procedure TFrmSoundDialog.FileListBox1Change(Sender: TObject);
|
procedure TFrmSoundDialog.FileListBox1Change(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
if FileListBox1.Items.Count > 0 then begin
|
if ShellListview.Items.Count > 0 then begin
|
||||||
PlayButton.Enabled := true;
|
PlayButton.Enabled := true;
|
||||||
DingPath := FileListBox1.FileName;
|
DingPath := GetSelectedFileName;
|
||||||
end else begin
|
end else begin
|
||||||
PlayButton.Enabled := false;
|
PlayButton.Enabled := false;
|
||||||
DingPath := '';
|
DingPath := '';
|
||||||
@ -108,55 +109,63 @@ procedure TFrmSoundDialog.PlayButtonClick(Sender: TObject);
|
|||||||
begin
|
begin
|
||||||
if Assigned(FOnPlaySound) then begin
|
if Assigned(FOnPlaySound) then begin
|
||||||
PlayButton.Enabled := false;
|
PlayButton.Enabled := false;
|
||||||
FOnPlaySound(self, FileListbox1.FileName, psmSync);
|
FOnPlaySound(self, GetSelectedFileName, psmSync);
|
||||||
PlayButton.Enabled := true;
|
PlayButton.Enabled := true;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
{=====}
|
{=====}
|
||||||
|
|
||||||
procedure TFrmSoundDialog.Populate;
|
function TFrmSoundDialog.FindFileItem(AFileName: String): TListItem;
|
||||||
var
|
var
|
||||||
Drive: char;
|
i: Integer;
|
||||||
|
begin
|
||||||
|
AFileName := ExtractFileName(AFileName);
|
||||||
|
for i:=0 to ShellListview.Items.Count-1 do
|
||||||
|
if ShellListview.Items[i].Caption = AFilename then begin
|
||||||
|
Result := ShellListview.Items[i];
|
||||||
|
exit;
|
||||||
|
end;
|
||||||
|
Result := nil;
|
||||||
|
end;
|
||||||
|
|
||||||
|
procedure TFrmSoundDialog.Populate;
|
||||||
begin
|
begin
|
||||||
TabSheet1.Caption := RSSelectASound;
|
TabSheet1.Caption := RSSelectASound;
|
||||||
Self.Caption := RSSoundFinder;
|
Self.Caption := RSSoundFinder;
|
||||||
CBDefault.Caption := RSDefaultSound;
|
CBDefault.Caption := RSDefaultSound;
|
||||||
OkBtn.Caption := RSOkBtn;
|
OkBtn.Caption := RSOkBtn;
|
||||||
CancelBtn.Caption := RSCancelBtn;
|
CancelBtn.Caption := RSCancelBtn;
|
||||||
|
Panel3.Caption := RSNothingToSelectFrom;
|
||||||
|
Panel4.Caption := RSNothingToSelectFrom;
|
||||||
if DingPath = '' then begin
|
if DingPath = '' then begin
|
||||||
CBDefault.Checked := true;
|
CBDefault.Checked := true;
|
||||||
ShellTreeView.Path := ExtractFileDir(ParamStr(0));
|
ShellTreeView.Path := ExtractFileDir(ParamStr(0));
|
||||||
// DirectoryListBox1.Directory := ExtractFileDir(ParamStr(0));
|
end else
|
||||||
|
if FileExists(DingPath) then begin
|
||||||
|
ShellTreeview.Path := ExtractFileDir(DingPath);
|
||||||
|
ShellListview.Selected := FindFileItem(DingPath);
|
||||||
end else begin
|
end else begin
|
||||||
Drive := UpCase(ExtractFileDrive(DingPath)[1]);
|
ShellTreeView.Path := ExtractFileDir(ParamStr(0));
|
||||||
if FileExists(DingPath) and (Drive in ['A'..'Z']) then begin
|
|
||||||
ShellTreeview.Path := ExtractFileDir(DingPath);
|
|
||||||
FileListBox1.FileName := DingPath;
|
|
||||||
end else begin
|
|
||||||
ShellTreeView.Path := ExtractFileDir(ParamStr(0));
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
end;
|
CBDefaultClick(nil);
|
||||||
|
|
||||||
procedure TFrmSoundDialog.ShellTreeViewChange(Sender: TObject; Node: TTreeNode);
|
|
||||||
begin
|
|
||||||
FileListbox1.Directory := ShellTreeView.Path;
|
|
||||||
end;
|
end;
|
||||||
|
|
||||||
{=====}
|
{=====}
|
||||||
|
|
||||||
procedure TFrmSoundDialog.CBDefaultClick(Sender: TObject);
|
procedure TFrmSoundDialog.CBDefaultClick(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
// DriveComboBox1.Enabled := not CBDefault.Checked;
|
ShellTreeview.Visible := not CBDefault.Checked;
|
||||||
// DirectoryListBox1.Enabled := not CBDefault.Checked;
|
ShellListview.Visible := not CBDefault.Checked;
|
||||||
ShellTreeview.Enabled := not CBDefault.Checked;
|
Panel3.Visible := CBDefault.Checked;
|
||||||
FileListBox1.Enabled := not CBDefault.Checked;
|
Panel4.Visible := CBDefault.Checked;
|
||||||
PlayButton.Enabled := not CBDefault.Checked;
|
PlayButton.Visible := not CBDefault.Checked;
|
||||||
end;
|
end;
|
||||||
{=====}
|
{=====}
|
||||||
|
|
||||||
procedure TFrmSoundDialog.FormCreate(Sender: TObject);
|
procedure TFrmSoundDialog.FormCreate(Sender: TObject);
|
||||||
begin
|
begin
|
||||||
|
Panel3.Align := alClient;
|
||||||
|
Panel4.Align := alClient;
|
||||||
ReturnCode := rtAbandon;
|
ReturnCode := rtAbandon;
|
||||||
end;
|
end;
|
||||||
{=====}
|
{=====}
|
||||||
@ -181,5 +190,13 @@ begin
|
|||||||
Close;
|
Close;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
function TFrmSoundDialog.GetSelectedFileName: String;
|
||||||
|
begin
|
||||||
|
if ShellListview.ItemFocused <> nil then
|
||||||
|
Result := IncludeTrailingPathDelimiter(ShellTreeView.Path) + ShellListview.ItemFocused.Caption
|
||||||
|
else
|
||||||
|
Result := '';
|
||||||
|
end;
|
||||||
|
|
||||||
end.
|
end.
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user