Subject Re: Subform canClose
From Peter Hegelbach <peter@hegelbach.com>
Date Mon, 8 Mar 2021 12:54:54 +0100
Newsgroups dbase.getting-started

Hi Andy

I mean it just the other way around. I just want to prevent someone from
closing the subform.

It's ok if the mainform is closed. then the subform should be closed too.


Am 08.03.2021 um 11:34 schrieb Andy Taylor:
> Hi Peter,
>
> In my view this is WAD.
> A sub-form is exactly that; it should have no existence outside of it's parent.
> If the parent closes the sub-form has to close before the parent does.. absolutely.
>
> It might be helpful to explain why you want the sub-form to stick around?
>
> Andy
>
>> Hi
>>
>> I would like to prevent the Subform from closing. But the mainform
>> should close. It seems that subform.canClose is effectiv for both forms.
>>
>> Bug or not?
>>
>> Peter
>>
>>
>>
>> ** END HEADER -- Diese Zeile nicht entfernen
>> //
>> // Erstellt am 08.03.2021
>> //
>> parameter bModal
>> local f
>> f = new neuForm()
>> if (bModal)
>>      f.mdi = false // Nicht-MDI festlegen
>>      f.ReadModal()
>> else
>>      f.Open()
>> endif
>>
>> class neuForm of FORM
>>      with (this)
>>                 onOpen = class::form_onOpen
>>                 canClose = class::form_canClose
>>                 metric = 6
>>         height = 250
>>         left = 100
>>         top = 80
>>         width = 600
>>         text = "Testform"
>>      endwith
>>         
>>         this.SubF = new subform(this)
>>         with (this.SubF)
>>                 canClose = {||false}
>>                 colorNormal = "Moccasin"
>>                 metric = 6
>>                 borderStyle = 4
>>                 left = 600
>>                 top = 60
>>                 width = 400
>>                 height = 230
>>                 text = "Daten bearbeiten"
>>                 visible = true
>>                 sizeable = false
>>                 moveable = false
>>                 systemTheme = false
>>                 maximize = false
>>                 minimize = false
>>                 escExit = false
>>                 smallTitle = true
>>         endwith
>>
>>         function form_onOpen
>>                 form.SubF.open()
>>                 return
>>                 
>>         function form_canClose
>>                 // do my things
>>                 form.close()
>>                 return
>>
>> endclass
>