[Lazarus] tFileOpen Action, Is it possible to cancel the dialog...

Wildfire wildfire at windowsbbs.com
Sun Aug 1 11:34:56 CEST 2010


> Cannot you check if the current file needs to be saved and prompt the
> user for it _before_ opening the dialog?

That's one work around, The FileOpen Action is tied to a couple of controls 
though (Menu, ToolButton) and I was hoping to do all the work inside (so the 
menu & toolbutton remain synchronised). It kind of defeats the purpose of 
the actions if I have to handle this myself.

If it can't be done I'll probably write my own action for opening the file 
but it seems to me that this is a very common situation so canceling the 
dialog within the BeforeExecute should be possible returning Cancel as the 
result.

I think I've just answered my own question, changing the dialogs execute 
event ???, is this the way to go or is their a simpler solution?







More information about the Lazarus mailing list