Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Dealing with memo field
Message
 
To
01/12/2003 22:09:02
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00854887
Message ID:
00854888
Views:
24
This message has been marked as the solution to the initial question of the thread.
>In our framework, the Escape key is launching the close sequence of the active form. All that works well. But, on the administration options of the application, soemtimes, the admin will double click on a memo field from a grid to open its content. At that level, if the Escape key is done, this will trigger an error as this is not interpreted as a _screen.ActiveForm.
>
>This is what we have in the code to launch the closing sequence:
>
>
>IF _screen.ActiveForm.QueryUnload()
>   IF FormIsObject()
>      _screen.ActiveForm.Release()
>   ENDIF
>ENDIF
>
>
>How can I detect that I am in a memo field?
>
>When I first try to enhance that part, I verified if _screen.ActiveForm was an object. Even at the memo field level, it is. So, that verification was not good. I then tried with the following:
>
>
>IF NOT PEMSTATUS(_screen.ActiveForm,'QueryUnload',5)
>   RETURN
>ENDIF
>
>
>So, from the memo field, this will be used. Now, I just need to find a way to have it closed. As it is now, it will simply return and do nothing. So, the memo field window will remain opened.
>
>The entire code in the close sequence, which is triggered by the Escape key, is the following:
>
>
>IF NOT PEMSTATUS(_screen.ActiveForm,'QueryUnload',5)
>   RETURN
>ENDIF
>
>IF _screen.ActiveForm.QueryUnload()
>   IF FormIsObject()
>      _screen.ActiveForm.Release()
>   ENDIF
>ENDIF
>
Hi Michel!


The native VFP memo window edit class is "Memo", unless the grid.column.textbox.MemoWindow property is set to a previosuly instantiated form, which doesn't seem to be the case here.
Also, as expected in your code, the Memo window doesn't expose a QueryUnload event/method.
Under the circumstances, maybe the following would work:

>
IF NOT PEMSTATUS(_screen.ActiveForm,'QueryUnload',5)
   IF _screen.ActiveForm.Class = "Memo"
      * other classic method calls like _screen.ActiveForm.Release() doesn't seem to work, so try
      RELEASE WINDOW (WONTOP()) 
      RETURN
   ENDIF
ENDIF
>
IF _screen.ActiveForm.QueryUnload()
   IF FormIsObject()
      _screen.ActiveForm.Release()
   ENDIF
ENDIF
>
HTH
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform