[Gambas-user] Workspace editor question

richard terry rterry at ...1823...
Thu Jun 18 00:07:12 CEST 2015


Yes of course that will work on the form, but that has not been the 
issue for me.

My gui design is complex. I will try to look at it again this weekend 
and get back to the list.

BTW you don't need to dim an integer in that sub as this does the same 
thing:

     If message.Question("Do you really want to close?", "Yes", "No") = 
2  then


Regards

Richard

On 16/06/15 20:12, Gianluigi wrote:
> This does not work?
>
> Public Sub Form_Close()
>
>    Dim i As Integer
>
>    i = Message.Question("Do you really want to close?", "YES", "NO")
>
>    If i = 2 Then Stop Event
>
> End
>
> Regards
> Gianluigi
>
> 2015-06-16 0:27 GMT+02:00 richard terry <rterry at ...1823...>:
>
>> 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
>>
>>
>>
>> ------------------------------------------------------------------------------
>> _______________________________________________
>> Gambas-user mailing list
>> Gambas-user at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/gambas-user
>>
> ------------------------------------------------------------------------------
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user





More information about the User mailing list