[Gambas-user] Workspace editor question

Benoît Minisini gambas at ...1...
Mon Jun 15 14:15:09 CEST 2015


Le 15/06/2015 14:01, richard terry a écrit :
> Hi List,
>
> Long time no post though I read the list daily.
>
> I've asked this question before and probably not understood how to
> implement it but I'll try again.
>
> I use a workspace in my medical program. When the user clicks on buttons
> to access a section, a Form representing the section is added to the
> workspace as a new tab, I guess visually this is the same way the gambas
> IDE works when you click on a form or class to view.
>
> I want to be able to detect when the user clicks on the little 'x' mark
> on the tab, so that I can progress any outstanding information which
> hasn't been saved by the user, I've never been able to figure out how.
> Also how to access the menu events which popup over that tab e.g the one
> saying detach tab etc
>
> When I programatically clear all the tabs in my workspace, as the user
> may want when they have finished a consult and want to load a new
> patient, I can just loop through all the save events on all the forms
> and do this, before the user searches for a new patient, but can't
> figure out how to detect the click on the little 'x' which closes the
> tab itself.
>
> Does this make sense?
>
> Thanks for help in advance.
>
> Richard
>

You have to use the Form_Close() event handler of your form. Because 
your form can be closed with the little 'x' or with the menu, or if you 
call the Close() method of the form.

If you want to cancel the form close, just use STOP EVENT in the 
Form_Close() event handler.

Regards,

-- 
Benoît Minisini




More information about the User mailing list