Hello, Vincent Snijders.

On 20.04.2007 you wrote:

VS> 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.

VS> In all implementations a TFileDialogAccess is needed to call 
UpdateFilterIndex. I
VS> think this method is like several IntfXXX methods found in the LCL, for 
example
VS> TApplication.IntfEndSession. They are messages from the widget set to the 
interface,
VS> that could be implemented with LM_XXX message, but recently we chose for 
new methods
VS> starting with IntfXXX, in this change I would choose IntfFileTypeChanged.

Renamed from UpdateFilterIndex to IntfFileTypeChanged.

VS> The TOpenFileDialogRec is a packed record. Why? It is better not to used 
packed
VS> records, unless you have a specific reason to dictate the memory layout.

Sorry, this is my internal love to packed records. For this case I
think there is no difference between them. Changed to record.

VS> I see that FileNameBuffer is allocated on the stack and assigned to the 
lpStrFile
VS> field. But because of the methods are now split, the stack is cleared. So I 
wonder
VS> if the lpStrFile field contains a valid pointer in ProcessFileDialogResult.

Thanks. I've missed that while changing code. Changed from array to LPTSTR.

VS> Could you test this on windows 98 / ME? Things are a bit different there 
due to the
VS> different size of the OpenFile struct. I did not see any problems at first 
glance.

sorry, I dont have win98/ME.


-- 
Best regards,
 Paul Ishenin                          mailto:[EMAIL PROTECTED]

Attachment: TypeChange_1.patch
Description: Binary data

Reply via email to