Paul Ishenin schreef:
Hello, [EMAIL PROTECTED]
There are several request about OnTypeChange event implementation for
TOpenDialog/TSaveDialog (e.g. report 619, 8349).
This patch implements this feature for win32, gtk1 and gtk2
widgetsets.
I ask you to review this patch, especially win32 part. I've made some
restructuring of ShowFileDialog function
(interfaces/win32/win32wsdialogs.pp).
I've splitted it into 3 parts (as it was suggested in TWSCommonDialog):
- CreateHandle - returns pointer to OPENFILENAME struct,
- ShowModal - calls apropriate windows dialog function with OPENFILENAME struct
- DestroyHandle - destroys OPENFILENAME struct
Ofcource, LPOPENFILENAME is not handle, but there is no handle at all
for windows dialogs.
In all implementations a TFileDialogAccess is needed to call UpdateFilterIndex. I
think this method is like several IntfXXX methods found in the LCL, for example
TApplication.IntfEndSession. They are messages from the widget set to the interface,
that could be implemented with LM_XXX message, but recently we chose for new methods
starting with IntfXXX, in this change I would choose IntfFileTypeChanged.
The TOpenFileDialogRec is a packed record. Why? It is better not to used packed
records, unless you have a specific reason to dictate the memory layout.
I see that FileNameBuffer is allocated on the stack and assigned to the lpStrFile
field. But because of the methods are now split, the stack is cleared. So I wonder
if the lpStrFile field contains a valid pointer in ProcessFileDialogResult.
Could you test this on windows 98 / ME? Things are a bit different there due to the
different size of the OpenFile struct. I did not see any problems at first glance.
If there will be no remarks for this mail, I'll apply this patch.
Vincent
P.S. Can you remove the reply to header?
_________________________________________________________________
To unsubscribe: mail [EMAIL PROTECTED] with
"unsubscribe" as the Subject
archives at http://www.lazarus.freepascal.org/mailarchives