mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-07-08 21:06:07 +02:00
ExtDlgs: in TOpenPictureDialog.UpdatePreview don't load the selected picture if the "homebrew" preview isn't used.
This commit is contained in:
parent
b6498c7031
commit
ecdfb3dfe3
@ -42,6 +42,7 @@ type
|
|||||||
class function GetControlClassDefaultSize: TSize; override;
|
class function GetControlClassDefaultSize: TSize; override;
|
||||||
procedure SetPreviewFileDialog(const AValue: TPreviewFileDialog);
|
procedure SetPreviewFileDialog(const AValue: TPreviewFileDialog);
|
||||||
procedure CreateParams(var Params: TCreateParams); override;
|
procedure CreateParams(var Params: TCreateParams); override;
|
||||||
|
|
||||||
public
|
public
|
||||||
constructor Create(TheOwner: TComponent); override;
|
constructor Create(TheOwner: TComponent); override;
|
||||||
property PreviewFileDialog: TPreviewFileDialog read FPreviewFileDialog
|
property PreviewFileDialog: TPreviewFileDialog read FPreviewFileDialog
|
||||||
@ -270,6 +271,7 @@ begin
|
|||||||
Params.Style := Params.Style and not WS_CHILD;
|
Params.Style := Params.Style and not WS_CHILD;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
class function TPreviewFileControl.GetControlClassDefaultSize: TSize;
|
class function TPreviewFileControl.GetControlClassDefaultSize: TSize;
|
||||||
begin
|
begin
|
||||||
Result.CX := 200;
|
Result.CX := 200;
|
||||||
@ -378,7 +380,7 @@ begin
|
|||||||
FileIsValid := FileExistsUTF8(FPreviewFilename)
|
FileIsValid := FileExistsUTF8(FPreviewFilename)
|
||||||
and (not DirPathExists(FPreviewFilename))
|
and (not DirPathExists(FPreviewFilename))
|
||||||
and FileIsReadable(FPreviewFilename);
|
and FileIsReadable(FPreviewFilename);
|
||||||
if FileIsValid then
|
if FileIsValid and FPictureGroupBox.HandleAllocated then //on e.g. Vista+ this isn't used, so don't load the image
|
||||||
try
|
try
|
||||||
FImageCtrl.Picture.LoadFromFile(FPreviewFilename);
|
FImageCtrl.Picture.LoadFromFile(FPreviewFilename);
|
||||||
FPictureGroupBox.Caption := Format('(%dx%d)',
|
FPictureGroupBox.Caption := Format('(%dx%d)',
|
||||||
|
Loading…
Reference in New Issue
Block a user