Normal Topic Pasting from the buffer (Shift-F11) (Read 1024 times)
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Pasting from the buffer (Shift-F11)
Oct 24th, 2007 at 6:22pm
Print Post Print Post  
I want to make buttons that perform F11 and Shift-F11.  Is there a way to test if the Buffer has certain content before allowing the Paste button to paste?  I don't want anyone trying to paste Workorder form data into the Invoice form, and so on.

Also, once these buttons are created I would like to remove the F11 key's functionality, that is, to make the F11 operation only run from the buttons, not the keyboard.  Is this possible?
  

**
Captain Infinity
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Pasting from the buffer (Shift-F11)
Reply #1 - Oct 24th, 2007 at 6:51pm
Print Post Print Post  
Yes, you can disable F11 using IgnoreKey.

As to the rest of it, I recommend you take a different tack.

Have your copy button put the id for the record to be copied into a ClientLocalValue.
Have your Paste button check if there is a value. If there is, open an XResultSet containing that record and pull what you want out of it.

This method gives you both control and validation.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Pasting from the buffer (Shift-F11)
Reply #2 - Oct 24th, 2007 at 8:01pm
Print Post Print Post  
Thank you Erika, but you give me too much credit.  My skills with ClientLocalValue and XResultSet are woefully lacking.

Thing is, I have only one user who uses F11 and its variations, and then only with a single form.  The button for the F11 function is easy.  The Shift-F11 button also includes CLEAR()ing of several values that I don't want transplanted.  Other than that, all is fair game.

If I place the buttons on that single form, use IgnoreKey to kill F11, and then use @HideTreeItem for all the F11 variations, I'm in the clear.  So far the buttons work, IgnoreKey also works, but the following is NOT working:
Code
Select All
Var vHideTreeItem as Int
// Hides "Copy Forms" and "Paste Forms" command tree items
vHideTreeItem = @HideTreeItem("Add Data Menu!Edit Commands!Copy Forms to Buffer (Alt-F11)")
vHideTreeItem = @HideTreeItem("Add Data Menu!Edit Commands!Paste Buffer to Forms (Alt-Shift-F11)")
vHideTreeItem = @HideTreeItem("Search Update Menu!Edit Commands!Copy Forms to Buffer (Alt-F11)")
vHideTreeItem = @HideTreeItem("Search Update Menu!Edit Commands!Paste Buffer to Forms (Alt-Shift-F11)") 


I'm putting this in the application programming, on-application-open, with no success.  I'm pretty sure I'm missing something, though the Program Editor tests it OK.  Do I need to specify a path to every form and mode?  The example in the book is a little confusing as it doesn't directly relate to what I want to do.

Thanks for your help.
  

**
Captain Infinity
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Pasting from the buffer (Shift-F11)
Reply #3 - Oct 24th, 2007 at 8:06pm
Print Post Print Post  
Infinity wrote on Oct 24th, 2007 at 8:01pm:
I'm putting this in the application programming, on-application-open, with no success.  I'm pretty sure I'm missing something, though the Program Editor tests it OK.  Do I need to specify a path to every form and mode?  The example in the book is a little confusing as it doesn't directly relate to what I want to do.

You need to put these in the On Form Entry event for the Form. The command trees you are trying to affect don't exist yet On Application Open.
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Pasting from the buffer (Shift-F11)
Reply #4 - Oct 24th, 2007 at 8:18pm
Print Post Print Post  
D'oh!  Of course.  Thank you.
  

**
Captain Infinity
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Pasting from the buffer (Shift-F11)
Reply #5 - Oct 24th, 2007 at 8:50pm
Print Post Print Post  
Still having trouble with this.  Part of the problem, I think, is that the List Browser, which I've been using to insert the path, has "Copy Forms to Buffer" as (Alt-F11) and "Paste Buffer to Forms" as (Alt-Shift-F11), but when I'm in the actual form the tree shows "Copy Forms to Buffer" as (Ctrl-F11) and "Paste Buffer to Forms" as (Alt-F11).  Not sure which is correct, but there's a disparity.
  

**
Captain Infinity
Back to top
IP Logged
 
Hammer
YaBB Administrator
Lanticans
*****
Offline


Fire bad. Tree pretty.

Posts: 3436
Location: Ohio
Joined: Nov 22nd, 2002
Re: Pasting from the buffer (Shift-F11)
Reply #6 - Oct 24th, 2007 at 8:56pm
Print Post Print Post  
Infinity wrote on Oct 24th, 2007 at 8:50pm:
Still having trouble with this.  Part of the problem, I think, is that the List Browser, which I've been using to insert the path, has "Copy Forms to Buffer" as (Alt-F11) and "Paste Buffer to Forms" as (Alt-Shift-F11), but when I'm in the actual form the tree shows "Copy Forms to Buffer" as (Ctrl-F11) and "Paste Buffer to Forms" as (Alt-F11).  Not sure which is correct, but there's a disparity.

The tree is correct. We'll update the List Browser. Thanks for reporting this!
  

- Hammer
The plural of anecdote is not data.
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Pasting from the buffer (Shift-F11)
Reply #7 - Oct 25th, 2007 at 4:47pm
Print Post Print Post  
Hammer wrote on Oct 24th, 2007 at 8:56pm:
The tree is correct. We'll update the List Browser. Thanks for reporting this!


Found and fixed the problem in the List Browser.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged
 
Infinity
Senior Member
Members
*****
Offline


Diagonally parked in a
parallel dimension

Posts: 1290
Location: Massachusetts
Joined: May 27th, 2005
Re: Pasting from the buffer (Shift-F11)
Reply #8 - Oct 25th, 2007 at 6:11pm
Print Post Print Post  
Quote:
Yes, you can disable F11 using IgnoreKey.

Is this correct to disable the 4 states of F11?
Code
Select All
Application on-application-open event

// Disables the F11 Key functions for non-admins
IF NOT @Group = "Admin"
THEN
	{
	IgnoreKey(KEYCODE_F11, 0)
	IgnoreKey(KEYCODE_F11, KEY_STATE_SHIFT)
	IgnoreKey(KEYCODE_F11, KEY_STATE_ALT)
	IgnoreKey(KEYCODE_F11, KEY_STATE_CTRL)
	}
ELSE ClearIgnoreKey(KEYCODE_F11) 

  

**
Captain Infinity
Back to top
IP Logged
 
Ray the Reaper
Global Moderator
Members
Lantica Support
*****
Offline


The One & The Only

Posts: 2482
Joined: Aug 20th, 2003
Re: Pasting from the buffer (Shift-F11)
Reply #9 - Oct 25th, 2007 at 7:10pm
Print Post Print Post  
Scott,

That'll do it, I do believe.

-Ray
  

Raymond Yoxall Consulting
ray.yoxall@gmail.com
ryoxall@lantica.com
Sesame Applications, Design and Support
Back to top
IP Logged