tvplanit: Improved layout in VpWavDlg

git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@8477 8e941d3f-bd1b-0410-a28a-d453659cc2b4
This commit is contained in:
wp_xxyyzz
2022-09-12 17:04:46 +00:00
parent cf63f75a7a
commit cc58bebf0e
14 changed files with 110 additions and 58 deletions

View File

@@ -61,7 +61,7 @@ type
ShellTreeView: TShellTreeView;
Splitter1: TSplitter;
TabSheet1: TTabSheet;
PlayButton: TSpeedButton;
PlayBtn: TSpeedButton;
CBDefault: TCheckBox;
OkBtn: TButton;
CancelBtn: TButton;
@@ -70,7 +70,7 @@ type
procedure FormCreate(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure OkBtnClick(Sender: TObject);
procedure PlayButtonClick(Sender: TObject);
procedure PlayBtnClick(Sender: TObject);
private
FOnPlaySound: TVpPlaySoundEvent;
function FindFileItem(AFilename: String): TListItem;
@@ -107,7 +107,7 @@ begin
ShellListview.Visible := not CBDefault.Checked;
Panel3.Visible := CBDefault.Checked;
Label4.Visible := CBDefault.Checked;
PlayButton.Visible := not CBDefault.Checked;
PlayBtn.Visible := not CBDefault.Checked;
end;
{=====}
@@ -135,15 +135,15 @@ begin
ShellListView.Mask := '*.wav';
{$ENDIF}
{$ENDIF}
{$IFDEF NEW_ICONS}
LoadGlyphFromRCDATA(PlayBtn.Glyph, 'VpSpeaker', 16, 24, 32);
{$ENDIF}
end;
procedure TFrmSoundDialog.FormShow(Sender: TObject);
begin
{$IFDEF NEW_ICONS}
LoadGlyphFromRCDATA(PlayButton.Glyph, 'VpSpeaker', 16, 24, 32);
{$ENDIF}
AlignOKCancel(OkBtn, CancelBtn, ButtonPanel);
PlayButton.Width := CancelBtn.Width; //MulDiv(PlayButton.Height, 3, 2) ;
PlayBtn.AutoSize := true;
end;
function TFrmSoundDialog.GetSelectedFileName: String;
@@ -159,7 +159,7 @@ begin
StopSound;
end;
procedure TFrmSoundDialog.PlayButtonClick(Sender: TObject);
procedure TFrmSoundDialog.PlayBtnClick(Sender: TObject);
begin
DingPath := GetSelectedFileName;
PlaySound;
@@ -178,6 +178,10 @@ begin
CBDefault.Caption := RSDefaultSound;
OkBtn.Caption := RSOkBtn;
CancelBtn.Caption := RSCancelBtn;
if BiDiMode = bdLeftToRight then
PlayBtn.Caption := RSPlayBtn + ' ' // Workaround for AutoSize bug of TSpeedButton ignoring right Margin
else
PlayBtn.Caption := ' ' + RSPlayBtn;
Label3.Caption := RSNothingToSelectFrom;
Label4.Caption := RSNothingToSelectFrom;