Subject Re: Form requires forced input
From Michael <michael@abstractservices.com.au>
Date Tue, 08 Aug 2017 19:53:37 -0400
Newsgroups dbase.getting-started

Andy Taylor Wrote:

Hi Andy,

Yes I did, cute.

Ok, so I am calling the form from another program. So i am using your testform as an example and you will see how the window size reacts but the main problem is using the open then the focus can be shifted off the window.

Here is a simple call program. Use this to see the different effect between f.open() and f.readmodal(). You will see what I mean.

* file testpop.prg *

set procedure to testform.wfm ADDITIVE
                                
f = NEW modalform()
f.mdi = .f.
F.SYSMENU = .f.
f.open()            && change this to f.readmodal() to see the difference

* end testpop.prg

A slight modification to your test form:

*--Modal.wfm starts here--*
** END HEADER -- do not remove this line
//
// Generated on 09/08/2017
//
parameter bModal
local f
f = new ModalForm()
if (bModal)
   f.mdi = false // ensure not MDI
   f.readModal()
else
   f.open()
endif

class ModalForm of FORM
   with (this)
      canClose = class::CANCLOSE
      onOpen = class::ONOPEN
      height = 11.9545
      left = 91.0
      top = 11.1818
      width = 39.5714
      text = "You will obey me"
      topMost = true
      mdi = false
      showTaskBarButton = false
      smallTitle = true
      sizeable = false
      moveable = false
      escExit = false
      maximize = false
      minimize = false
   endwith

   this.PUSHBUTTON1 = new PUSHBUTTON(this)
   with (this.PUSHBUTTON1)
      onClick = {;this.text = "Thankyou. You may proceed"; form.jobDone=true}
      height = 1.0909
      left = 1.8571
      top = 8.5455
      width = 35.5714
      text = "I apologise"
   endwith

   this.PUSHBUTTON2 = new PUSHBUTTON(this)
   with (this.PUSHBUTTON2)
      onClick = {;form.close()}
      height = 1.0909
      left = 11.0
      top = 10.0909
      width = 15.2857
      text = "Close"
   endwith

   this.TEXT1 = new TEXT(this)
   with (this.TEXT1)
      height = 7.2727
      left = 1.7143
      top = 0.5455
      width = 35.8571
      colorNormal = "DarkRed/White"
      marginHorizontal = 2.0
      marginVertical = 2.0
      text = "Admit your error: Push the button!"
      borderStyle = 1        // Raised
   endwith


        function onOpen
                form.jobDone = false        // mark job as not done

        function canClose
                return form.jobDone

endclass

*--Modal.wfm ends here--*


> Michael,
>
> 1) Did you try the modal form I provided?
> 2) What do you mean by frameless window? If you have created one that uses open() instead of readmodal() please post a simple version of it here.
>
> dBASE 11.3 should fly with your new machine with no memory issues.
>
> Andy
>  
> > Hi Andy,
> > Thanks for your reply, I too have been working  way back with DBase IV and for the life of me I cannot see what could be causing the problem.
> > When I say the dev enironment crashes, i mean it randomly crashes, dont know why. Even when running simple forms.
> > I have a brand new Dell i7 with 16gb ram and 256gb ssd. Windows 10.
> > As to the forms, it was rock solid in VDB 7.5. had no known errors and worked well. Had a couple of little niggly things I couldnt work out that were documented VDB 7.5 known bugs but i could live with them.
> > When converted to Dbase 2.6 it seemed ok, but crashed if you had an icon bigger than 16 x 16. Dbase 10 started falling over, functions didnt react the same. Dbase 11.3 the environment seems to be unstable to me before i get to run the software. Alot of the graphics and visuals react differently. The modaless window is one of them and it means I need to resize alot of windows.
> > I created a couple of very simple forms and you can visually see where they react different but some of the features with the frameless windows are lost. The software is approximately 150 files of 10K+ lines in each. Its a fully fetured POS system and to restructure 10years of constant developement may be a problem.
> > I would really love to know how to create a frameless window. that keeps focus. Funny how you can create a framless window using the OPEN() instead of readmodal() but open acts indipendantly and you can click off it and the window falls behind. it didnt in prior versions.
> > Any other suggestions?
> >
> > Andy Taylor Wrote:
> >
> > > Hi Michael,
> > >
> > > I go back to dBase IV and I have to say that this version (11.3) is probably the most stable that I have worked with.
> > > In my experience random crashes are NOT random (there is something in your code causing it; you just don't know why).
> > >
> > > readModal....
> > >  Please find below a modal form that does what you ask. The big Red close button is still there but that's because it is still a form
> > >  and not a message window so some things must remain.  However, by using canClose it can be stopped from closing.
> > >
> > > megaForms
> > >  Do you really need forms to be that big? I would rethink my design as you probably have too many eggs in one basket.
> > >  That said; did this form run properly under Vdb7.5, 2.6 or 10?
> > >  Is this the only form that has the problem?
> > >  Do you use text objects where textlabels will do?
> > >  If it's a memory problem (unlikely) you will usually get a memory error message.
> > >  Have you tried cutting and pasting code into an empty form and spotting the point at which the issue surfaces?
> > >
> > > Let us know more and post the errant form into binaries if you get nowhere...
> > > Andy
> > >  
> > > > Dear Forum,
> > > >
> > > > I just purchased Dbase 11, in fact I started with VDB5.0, VDB7.5, dbase 2.6, dbase 10 and now Dbase 11. I have written a large comprehensive software package over a span of 10 years in VDB7.5. In windows 8 & now 10 the touch and click features no longer work so I am forced to rewrite and convert much of the code to Dbase 11. I am dissappointed that dbase 11 although solved the touch screen issues is quie buggy and the dev environment crashes randomly.
> > > >
> > > > My biggest issue is the Modaless windows using the readmodal() no longer exist. For example, if I open a form from another form using readmodal() i cant get rid of the windows frame with the minimise and maximise and close squares on the top bar. I can if I use open() with a .f. mdi however, if i press a button on a nother window behind it I lose focus. This is terrible when you need the operator to complete working with a window before going back to the original window.
> > > > So Question: How do i lock out the window below and open a frameless window above it and keep focus on it until the upper window is closed?
> > > > Can anybody help?
> > > >
> > > > Problem number 2 is a frightening one, one form has 200 objects on it and it seems to struggle to load and half get chopped off so only half the form loads. For the life of me I cannot see where anything would shorten the window. I am wondering is it a resource problem? how can I manage how much memory I use?
> > > > Please help. Anybody??
> > >
> > > *--Modal.wfm starts here--*
> > > local f
> > > f = new ModalForm()
> > > f.readModal()
> > > return
> > >
> > > ** END HEADER -- do not remove this line
> > > //
> > > // Generated on 08/08/2017
> > > //
> > > parameter bModal
> > > local f
> > > f = new ModalForm()
> > > if (bModal)
> > >    f.mdi = false // ensure not MDI
> > >    f.readModal()
> > > else
> > >    f.open()
> > > endif
> > >
> > > class ModalForm of FORM
> > >    with (this)
> > >       canClose = class::CANCLOSE
> > >       onOpen = class::ONOPEN
> > >       height = 11.9545
> > >       left = 91.0
> > >       top = 11.1818
> > >       width = 39.5714
> > >       text = "You will obey me"
> > >       topMost = true
> > >       mdi = false
> > >       smallTitle = true
> > >       sizeable = false
> > >       escExit = false
> > >       maximize = false
> > >       minimize = false
> > >    endwith
> > >
> > >    this.PUSHBUTTON1 = new PUSHBUTTON(this)
> > >    with (this.PUSHBUTTON1)
> > >       onClick = {;this.text = "Thankyou. You may proceed"; form.jobDone=true}
> > >       height = 1.0909
> > >       left = 1.8571
> > >       top = 8.5455
> > >       width = 35.5714
> > >       text = "I apologise"
> > >    endwith
> > >
> > >    this.PUSHBUTTON2 = new PUSHBUTTON(this)
> > >    with (this.PUSHBUTTON2)
> > >       onClick = {;form.close()}
> > >       height = 1.0909
> > >       left = 11.0
> > >       top = 10.0909
> > >       width = 15.2857
> > >       text = "Close"
> > >    endwith
> > >
> > >    this.TEXT1 = new TEXT(this)
> > >    with (this.TEXT1)
> > >       height = 7.2727
> > >       left = 1.7143
> > >       top = 0.5455
> > >       width = 35.8571
> > >       colorNormal = "DarkRed/White"
> > >       marginHorizontal = 2.0
> > >       marginVertical = 2.0
> > >       text = "Admit your error: Push the button!"
> > >       borderStyle = 1        // Raised
> > >    endwith
> > >
> > >         function onOpen
> > >                 form.jobDone = false        // mark job as not done
> > >
> > >         function canClose
> > >                 return form.jobDone
> > >
> > > endclass
> > > *--Modal.wfm ends here--*
> > >
> > >
> >
>