View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0037820 | Lazarus | LCL | public | 2020-09-26 22:24 | 2020-11-11 16:56 |
Reporter | winni | Assigned To | Juha Manninen | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Platform | Linux 64 | OS | Suse | ||
Product Version | 2.0.10 | ||||
Summary | 0037820: TOpenPictureDialog - bug with ofAutoPreview | ||||
Description | In the TOpenPictureDialog is a option ofAutoPreview. Enabling this option the dialog shows a small preview at the right side of the dialog. Whatever you do: the preview is not shown if you execute it for the first time. If you execute it the next times the preview is shown - ok. There must be a problem while initialising the dialog. Winni | ||||
Steps To Reproduce | A Form, a TOpenPictureDialog and a Button. Set ofAutoPreview in the Dialog to true. The button executes the Dialog. First Time : No Preview icture. >= Second Time: Preview Picture exists. | ||||
Tags | ofAutoPreview, openPictureDialog | ||||
Fixed in Revision | r63926 | ||||
LazTarget | - | ||||
Widgetset | GTK 2 | ||||
Attached Files |
|
|
Due to forum there are also problems in Windows: https://forum.lazarus.freepascal.org/index.php/topic,51578.msg378794.html#msg378794 |
|
Amazingly, this is LCL problem. Patch attached fixes the logic. extdlgs.diff (1,109 bytes)
Index: lcl/extdlgs.pas =================================================================== --- lcl/extdlgs.pas (revision 63925) +++ lcl/extdlgs.pas (working copy) @@ -51,6 +51,7 @@ TPreviewFileDialog = class(TOpenDialog) private FPreviewFileControl: TPreviewFileControl; + function GetPreviewFileControl:TPreviewFileControl; protected class procedure WSRegisterClass; override; procedure CreatePreviewControl; virtual; @@ -58,7 +59,7 @@ function DoExecute: boolean; override; public constructor Create(TheOwner: TComponent); override; - property PreviewFileControl: TPreviewFileControl read FPreviewFileControl; + property PreviewFileControl: TPreviewFileControl read GetPreviewFileControl; end; { TOpenPictureDialog } @@ -279,6 +280,13 @@ { TPreviewFileDialog } +function TPreviewFileDialog.GetPreviewFileControl: TPreviewFileControl; +begin + if not Assigned(fPreviewFileControl) then + Self.CreatePreviewControl; + Result:=fPreviewFileControl; +end; + class procedure TPreviewFileDialog.WSRegisterClass; begin inherited WSRegisterClass; |
|
Test app attached. It takes me wasting 1 minute of time which can be spent on bug fixing. |
|
|
|
Applied, thanks. |
Date Modified | Username | Field | Change |
---|---|---|---|
2020-09-26 22:24 | winni | New Issue | |
2020-09-26 22:26 | winni | Tag Attached: openPictureDialog | |
2020-09-26 22:26 | winni | Tag Attached: ofAutoPreview | |
2020-09-27 03:04 | winni | Note Added: 0125890 | |
2020-09-27 11:09 | Anton Kavalenka | Note Added: 0125894 | |
2020-09-27 11:09 | Anton Kavalenka | File Added: extdlgs.diff | |
2020-09-27 11:53 | Anton Kavalenka | Note Added: 0125898 | |
2020-09-27 11:53 | Anton Kavalenka | Note Added: 0125899 | |
2020-09-27 11:53 | Anton Kavalenka | File Added: openpic.zip | |
2020-09-27 16:47 | Juha Manninen | Assigned To | => Juha Manninen |
2020-09-27 16:47 | Juha Manninen | Status | new => assigned |
2020-09-27 16:49 | Juha Manninen | Status | assigned => resolved |
2020-09-27 16:49 | Juha Manninen | Resolution | open => fixed |
2020-09-27 16:49 | Juha Manninen | Fixed in Revision | => r63926 |
2020-09-27 16:49 | Juha Manninen | LazTarget | => - |
2020-09-27 16:49 | Juha Manninen | Widgetset | GTK 2 => GTK 2 |
2020-09-27 16:49 | Juha Manninen | Note Added: 0125901 |