Hi,
1. ELMouseHint.pas:
I already reported it about three months ago, but the bug is still in place, as I've found after updating to 2015.3. The hint is appended by extra CRLF, which causes its incorrect height. The bugfix is sent to lmdsupport. Hope it will be fixed.
2. LMDVistaDialogs.pas:
This is just a brilliant coding :))
FDialog.SetFileTypeIndex(FFileTypeIndex);
if FFileTypes.Count > 0 then
begin
FFileTypes.AllocNativeBuffer;
try
FDialog.SetFileTypes(FFileTypes.Count, FFileTypes.FillNativeBuffer);
finally
FFileTypes.FreeNativeBuffer;
end;
end;
Did you expect such "SetFileTypeIndex()" will work? Did you ever test your code?
Of course, it should be:
if FFileTypes.Count > 0 then
begin
FFileTypes.AllocNativeBuffer;
try
FDialog.SetFileTypes(FFileTypes.Count, FFileTypes.FillNativeBuffer);
//<abb2015>
FDialog.SetFileTypeIndex(FFileTypeIndex + 1);
//</abb2015>
finally
FFileTypes.FreeNativeBuffer;
end;
end;
First, SetFileTypeIndex must go after SetFileTypes() and
Second, as in vast majority of OLE controls, indexing starts from one, not from zero.
And here is another piece of code:
function TLMDFileDialogEvents.OnTypeChange(const pfd: IFileDialog): HRESULT;
//<abb2015>
var
idx : UINT;
//<abb2015>
begin
//<abb2015>
pfd.GetFileTypeIndex(idx);
FDialog.FFileTypeIndex := idx - 1;
//</abb2015>
if Assigned(FDialog.FOnTypeChange) then
............................
Otherwise the chosen FileTypeIndex is never returned from the dialog.
Patches are sent to lmdsupport.
Also it would be just nice, if you'll consider to do something with this:
SD1.FileName := ExtractFileName(CurrentSchemaFile);
SD1.Dialog.SetFileName(TLMDWideString(SD1.FileName));
and this:
SD1.DefaultFolder := ExtractFileDir(CurrentSchemaFile);
if Succeeded(SHCreateItemFromParsingName(PLMDChar(SD1.DefaultFolder), nil, CLSID_IShellItem, LShellItem)) then
SD1.Dialog.SetFolder(LShellItem);
I have in mind to include the second of lines into the first of them in each case. Otherwise the properties don't work in the dialog events like OnTypeChange. But they should.
Bye!
Comments
Some issue were newer fix or they wait until my subscription expires.
http://forum.lmd.de/discussion/260/showsortmark-dosn039t-work-with-joined-header-rows#Item_5
Every new version fix some issue and introduces new one.
Regards,
Grzegorz
procedure TFMain.OpenFile;
begin
OD1.FileName := ExtractFileName(CurrentModelFile); // <<<<< comment this one to get AV
OD1.DefaultFolder := ExtractFileDir(CurrentModelFile);
OD1.FileTypeIndex := 2;
if OD1.Execute then // <<<<<<<<<<<<<<<<<<<< the AV is here
.................................................
The AV occurs somewhere deeply inside Windows DLL's when the FileName is empty on startup.
The application UI is unaccessible, because the new yet invisible window is modal.
Just a mystique...
Am compiling for x64... W7sp1