[Gambas-user] Workspace editor question

richard terry rterry at ...1823...
Tue Jun 16 00:27:33 CEST 2015


On 15/06/15 22:15, Benoît Minisini wrote:
> 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,
>
Thanks benoit, I'll try again - I'm certain I tried this last time as 
that is where one would logically look,  and wasn't able to get the 
workspace to continue to remove the tab anyway. I want to be able to 
intercept the tab close event e.g with a popup message saying "Are you 
sure you want to close this tab?" and allow a yes/no or whatever to act 
upon, not necessarily use the close event to save the forms contents.

Is that possible?

Regards

Richard





More information about the User mailing list