Alpha Video Training
Results 1 to 22 of 22

Thread: Form not locked down

  1. #1
    Member
    Real Name
    Bob Arbuthnot
    Join Date
    Apr 2005
    Location
    Belleville, KS
    Posts
    598

    Default Form not locked down

    I have a form that is modal entry that I need to control the user's new entries, changes, and saves thru buttons on the form. I have just noticed that when I right click when hovering over a hidden conditional object that right click is active for enter, change, and cancel actions. I also notice that pressing the F3 key on the keyboard puts the form in 'change' mode.

    I have right click turned off in the form properties and also on all fields on the form. What else can I do to finish locking this form down the way I need it to be?

    As always, any help would be greatly appreciated.

    Bob Arbuthnot
    Belleville, KS.

  2. #2
    "Certified" Alphaholic
    Real Name
    John Koh
    Join Date
    Jan 2004
    Location
    Maryland, USA
    Posts
    1,084

    Default Re: Form not locked down

    see,
    <OBJECT>.ALLOW_CHANGE()

  3. #3
    Member
    Real Name
    Bob Arbuthnot
    Join Date
    Apr 2005
    Location
    Belleville, KS
    Posts
    598

    Default Re: Form not locked down

    John, thanks for responding.

    I tried putting cond1.ALLOW_CHANGE(.f.) in the on-activate event for the form, alas right clicking when hovering over the hidden object (cond1) still allows enter, change, and cancel actions off the right click menu. The F3 key still puts the form in change mode. I'm going to let this thread sit out here for another 24 hours or so and see if anyone has any other thoughts. If no one does I'll submit a bug report.

    Bob Arbuthnot

  4. #4
    Member
    Real Name
    Bob Arbuthnot
    Join Date
    Apr 2005
    Location
    Belleville, KS
    Posts
    598

    Default Re: Form not locked down

    OK, I entered the following code in the form's OnKey event to disable the F3 key:

    Code:
    If a_user.key.value="{F3}"
    a_user.key.handled=.T.
    if a_user.key.event="down" then
    end if
    end if
    Also, used the same code to disable the F8 key (opens the underlying table in browse view).

    Am still at a loss as to what to do about the right click over a hidden conditional object that opens up the right click menu for change, enter, and cancel on a modal form with right click disabled for 1)the form, and for 2)all fields on the form.
    Last edited by Bob Arbuthnot; 01-24-2014 at 05:22 PM.

  5. #5
    "Certified" Alphaholic
    Real Name
    John Koh
    Join Date
    Jan 2004
    Location
    Maryland, USA
    Posts
    1,084

    Default Re: Form not locked down

    Bob,

    Preventing any changes to a form
    Perhaps you want to prevent the user from making any changes on your form. That is simple in Xbasic. The
    new properties we will use are:
    <form_pointer>.restrict_enter
    <form_pointer>.restrict_change
    which are akin to changing the properties of the form in design mode, and the property
    browse_name.browse.readonly
    which changes the editing properties of a browse.

  6. #6
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,311

    Default Re: Form not locked down

    Bob, its beginning to sound like you might have to redesign form to work around the CO behavior. You also should consider submitting a formal bug report... or would you consider this a new feature wishlist item?

    Truly locking down a form takes a lot of work. You might be ahead of the game to use an xdialog instead of the form.

    Another idea: what happens if you put a cancel() in the CanArrive event for the CO?

  7. #7
    Member
    Real Name
    Bob Arbuthnot
    Join Date
    Apr 2005
    Location
    Belleville, KS
    Posts
    598

    Default Re: Form not locked down

    Hi, Tom. Long time no taco! Thanks for responding.

    Hadn't thought about creating the form as an xdialog, might explore that.

    To my way of thinking this is a bug. Why would you ever want an action to only be active when right clicking over a hidden object???

    Is CanArrive even available for a CO (especially a hidden one!)???

    ba

  8. #8
    VAR
    Real Name
    Martin W. Cole
    Join Date
    Apr 2000
    Location
    Terrell, Texas (near Dallas)
    Posts
    5,957

    Default Re: Form not locked down

    the best way to handle forms is to set the data entry to modeless, and in the onfetch event say parentform.allow_change(.f.)
    then put a button on the form - Edit, and say parentform.allow_change(.t.)

    this is much better than parentform-modal.
    Cole Custom Programming - Terrell, Texas
    972 524 8714
    martin_w_cole@msn.com

    ____________________
    "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

  9. #9
    "Certified" Alphaholic
    Real Name
    Tom Cone Jr
    Join Date
    Apr 2000
    Location
    Florida
    Posts
    23,311

    Default Re: Form not locked down

    Bob, the docs suggested canArrive is available, but when I try to implement the idea, no can do. Sorry.

  10. #10
    Member
    Real Name
    Bob Arbuthnot
    Join Date
    Apr 2005
    Location
    Belleville, KS
    Posts
    598

    Default Re: Form not locked down

    Martin, thanks for the post and the advice.

    I tried putting parentform.allow_change(.f.) in the form's onfetch event. Still, when you right click on the space occupied by a hidden conditional object the right click menu appears with the options to change, enter, or cancel available. As I stated above, right click menu is turned off for the form and for all fields on the form.

    I think this is a bug. I will try to get a bug report submitted this weekend with a sample form, etc.

    ba

  11. #11
    Member
    Real Name
    Bob Arbuthnot
    Join Date
    Apr 2005
    Location
    Belleville, KS
    Posts
    598

    Default Re: Form not locked down

    Thanks anyway, Tom. I still appreciated the input.

    ba

  12. #12
    VAR
    Real Name
    Martin W. Cole
    Join Date
    Apr 2000
    Location
    Terrell, Texas (near Dallas)
    Posts
    5,957

    Default Re: Form not locked down

    Bob, I doubt that the right click is happening on the conditional, rather the form itself
    Cole Custom Programming - Terrell, Texas
    972 524 8714
    martin_w_cole@msn.com

    ____________________
    "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

  13. #13
    Member
    Real Name
    Bob Arbuthnot
    Join Date
    Apr 2005
    Location
    Belleville, KS
    Posts
    598

    Default Re: Form not locked down

    Martin, see for yourself in attached db. Bottom half of form is a hidden conditional object, top half is not. Right click on bottom half and you get right click menu to cancel, enter, change, or save. Right click on top half and nothing happens.

    ba
    Attached Files Attached Files
    Last edited by Bob Arbuthnot; 01-26-2014 at 07:21 PM.

  14. #14
    Member
    Real Name
    Bob Arbuthnot
    Join Date
    Apr 2005
    Location
    Belleville, KS
    Posts
    598

    Default Re: Form not locked down

    Bug report submitted. I will post here what I hear back.

    ba

  15. #15
    Member
    Real Name
    Bob Arbuthnot
    Join Date
    Apr 2005
    Location
    Belleville, KS
    Posts
    598

    Default Re: Form not locked down

    Work around received back from Selwyn (you gotta admire these guys committment to their product!).

    ba

    thanks.

    i look like it is a limitation, not a bug - you can't set the right click menu for a conditional control.

    there is a work around that might meet your needs. see video.

    http://screencast.com/t/PU20YquRnHxH

  16. #16
    VAR
    Real Name
    Martin W. Cole
    Join Date
    Apr 2000
    Location
    Terrell, Texas (near Dallas)
    Posts
    5,957

    Default Re: Form not locked down

    I tested on 10.5 and 11 and the limitation is there, too
    In Selwyns example, use a separator instead and nothing will show
    Cole Custom Programming - Terrell, Texas
    972 524 8714
    martin_w_cole@msn.com

    ____________________
    "A young man who is not liberal has no heart, but an old man who is not conservative has no mind." GB Shaw

  17. #17
    Member
    Real Name
    Bob Arbuthnot
    Join Date
    Apr 2005
    Location
    Belleville, KS
    Posts
    598

    Default Re: Form not locked down

    Martin,

    Thanks for the 'separator' idea from Selwyn's example. That's a little cleaner fix to his workaround.

    ba

  18. #18
    Member
    Real Name
    Bob Arbuthnot
    Join Date
    Apr 2005
    Location
    Belleville, KS
    Posts
    598

    Default Re: Form not locked down

    Interesting caveat to anyone considering using Selwyn's suggestion from above. It does work, BUT it will make the change on ANY app you run on that PC AND it will be there whether the app is opened or running under the Runtime or Developer's edition. In other words this change for some reason is GLOBAL across all A5 apps running on the same PC.

  19. #19
    Member
    Real Name
    Rui Carvalho
    Join Date
    Feb 2006
    Location
    Connecticut
    Posts
    133

    Default Re: Form not locked down

    Quote Originally Posted by Bob Arbuthnot View Post
    Interesting caveat to anyone considering using Selwyn's suggestion from above. It does work, BUT it will make the change on ANY app you run on that PC AND it will be there whether the app is opened or running under the Runtime or Developer's edition. In other words this change for some reason is GLOBAL across all A5 apps running on the same PC.

    But it appears that the fix only affects one pc but no one else accessing the database. In other words, you will need to apply the suggestion to all the user's PC's. I do not think it would make sense on a multi user LAN unless there is way to push the changes to all users via a script??

  20. #20
    "Certified" Alphaholic
    Real Name
    John Koh
    Join Date
    Jan 2004
    Location
    Maryland, USA
    Posts
    1,084

    Default Re: Form not locked down

    Bob,

    I have enclosed the Screen Shots for you. I hope it will help you.

    I also notice that pressing the F3 key on the keyboard puts the form in 'change' mode.
    Restrict01.jpgrestrict02.jpgrestrict03_save.jpg

    Step 1 - Applied the "Form property" set which is same as this and I prefer use "form Property" instead of use "this code on the Event"
    'Preventing any changes to a form
    'Perhaps you want to prevent the user from making any changes on your form. That is simple in Xbasic. The
    'new properties we will use are:
    '<form_pointer>.restrict_enter = .t. ' No enters allowed at form level
    '<form_pointer>.restrict_change = .t. ' No changes allowed at form level
    'which are akin to changing the properties of the form in design mode, and the property
    '<browse_name>.browse.readonly = .t. ' No enters or changes allowed for invoice header browse
    Step 2 - each button has the code as you wish to have the action such as edit, delete, save ... and "restrict" again.

    Final -- You are not able to change, delete the record from current form even you selected from A5 menu or pressed "F3".

  21. #21
    Member
    Real Name
    Bob Arbuthnot
    Join Date
    Apr 2005
    Location
    Belleville, KS
    Posts
    598

    Default Re: Form not locked down

    John,

    I posted a way to disable the F3 button above.

    In your example of Step 2, is your conditional object hidden on the form? If not, then make it so and then right click on the area where the CO resides. Does the right click menu appear with the options to enter, change, or save? If so, then the user can effectively bypass the buttons you have placed on the form and by doing so they will bypass any extra code you may have on those buttons.

  22. #22
    "Certified" Alphaholic
    Real Name
    John Koh
    Join Date
    Jan 2004
    Location
    Maryland, USA
    Posts
    1,084

    Default Re: Form not locked down

    Bob,

    I did for your
    What else can I do to finish locking this form down the way I need it to be?
    I did not know you are looking for
    a way to disable the F3 button above
    Yes, and Yes. There is a Field property to disable the RIGHT-Click button. you have to set the property for all of the fields. you will not see the right-click menu at all. Note; It will works with the Form Property restriction.

Similar Threads

  1. locked form
    By goldberg2727 in forum Alpha Five Version 9 - Desktop Applications
    Replies: 5
    Last Post: 06-10-2009, 09:37 AM
  2. Locked out
    By Tony in forum Alpha Five Version 9 - Desktop Applications
    Replies: 8
    Last Post: 11-11-2008, 02:30 PM
  3. Replies: 2
    Last Post: 12-21-2005, 07:09 PM
  4. Locked Fields on Tabbed Form?
    By Mark Buonagurio in forum Alpha Five Version 5
    Replies: 3
    Last Post: 08-12-2002, 05:47 AM
  5. HELP !!!! Locked out
    By Scott Emerick in forum Alpha Five Version 4
    Replies: 8
    Last Post: 01-10-2001, 11:17 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •