[Lazarus] savedialog is not shown
Andrea Mauri
andrea.mauri.75 at gmail.com
Wed Jul 11 12:38:51 CEST 2012
Il 11/07/2012 11:21, Mattias Gaertner ha scritto:
> Can you test if a savedialog can be shown before calling the
> function?
> Maybe it has nothing to do with this function.
Yes, the savedialog is always shown.
In order to be clearer, the software is this
http://talete.mi.it/products/dragon_description.htm
it is a software that calculates molecular descriptors
after calculation descriptors can be saved, the savedialogs (like all
the other dialogs) is always shown when I want to save the descriptors
after calculation
recently I noticed that if I load a particular set of molecules, after
the calculation I am not able to show any dialog, everything in the
software works fine but no dialogs are shown (only on windows, on linux
it works fine)
I am not able to understand why since no particular exceptions are
raised, the only thing is that when I call the execute method the
dialogs are not shown returing mrCancel
as reported in a previous mail I noticed
I look deeper and I found that in:
class procedure TWin32WSOpenDialog.VistaDialogShowModal(ADialog:
IFileDialog; const AOpenDialog: TOpenDialog);
var
FileDialogEvents: IFileDialogEvents;
Cookie: DWord;
CanClose: Boolean;
begin
FileDialogEvents := TFileDialogEvents.Create(AOpenDialog);
ADialog.Advise(FileDialogEvents, @Cookie);
try
AOpenDialog.DoShow;
repeat
ADialog.Show(GetParentWnd);
--> I set a breakpoint on the line below, the dialog is not shown,
UserChoice in the following 'if' line is mrNone, so different from mrOk
and then UserChoice is set to mrCancel
if (AOpenDialog.UserChoice <> mrOk) then
begin
CanClose := True;
AOpenDialog.DoCanClose(CanClose);
AOpenDialog.UserChoice := mrCancel;
end
else
CanClose := True;
until CanClose;
finally
ADialog.unadvise(Cookie);
FileDialogEvents := nil;
end;
end;
More information about the Lazarus
mailing list