|
| Re: Copying text without enabling editing |
 |
Sat, 12 Apr 2008 01:42:26 -070 |
"Bruce Beacham" <bbeacham@beacham.no-spam.co.uk> wrote in
message
news:I3548SHnIHA.940@news-server...
> Hi All
>
> This is a bit of Windows basics, I suppose.
>
> In many forms I require a user to click an Edit button to get access to
> entryfields for editing. It stops casual inadvertent changes, of course.
> When not in Edit mode the fields are protected with
>
> when = {|| false }
>
> and, FWIW, I change the mousepointer to 1 (arrow). I don't change the
> enabled property (except for Checkboxes) as it changes the display.
>
> I would like to make it possible for the user casually to highlight the
> text in an entryfield and to copy it to the clipboard (Ctrl+C), but
> without compromising its non-editable status.
>
> Any thoughts?
The Key() event works well for that.
if not nChar = 3
msgbox("ReadOnly Field")
return false
endif
return
Something on those lines.
Greg Hill
|
| Post Reply
|
| Copying text without enabling editing |
 |
Sat, 12 Apr 2008 08:50:43 +010 |
Hi All
This is a bit of Windows basics, I suppose.
In many forms I require a user to click an Edit button to get access to
entryfields for editing. It stops casual inadvertent changes, of
course. When not in Edit mode the fields are protected with
when = {|| false }
and, FWIW, I change the mousepointer to 1 (arrow). I don't change the
enabled property (except for Checkboxes) as it changes the display.
I would like to make it possible for the user casually to highlight the
text in an entryfield and to copy it to the clipboard (Ctrl+C), but
without compromising its non-editable status.
Any thoughts?
|
| Post Reply
|
| Re: Copying text without enabling editing |
 |
Sun, 13 Apr 2008 13:39:23 +010 |
Greg Hill wrote:
>> I would like to make it possible for the user casually to highlight the
>> text in an entryfield and to copy it to the clipboard (Ctrl+C), but
>> without compromising its non-editable status.
>
> The Key() event works well for that.
>
> if not nChar = 3
> msgbox("ReadOnly Field")
> return false
> endif
> return
Thanks, Greg: that's interesting. Testing shows up one hitch - it
allows Ctrl+V Paste to overwrite the value. Further testing shows
that Ctrl+C and Ctrl+V do not trigger the key event handler, even if I
don't have an Edit menu with Cut/Copy/Paste on the form, so the test
if not nChar = 3
is superfluous.
Otherwise it does what I want. Any thoughts on intercepting Paste?
|
| Post Reply
|
| Re: Copying text without enabling editing |
 |
Sun, 13 Apr 2008 21:35:44 -070 |
"Bruce Beacham" <bbeacham@beacham.no-spam.co.uk> wrote in
message
news:QKs86YWnIHA.312@news-server...
> Greg Hill wrote:
>
>>> I would like to make it possible for the user casually to highlight
the
>>> text in an entryfield and to copy it to the clipboard (Ctrl+C), but
>>> without compromising its non-editable status.
>>
>> The Key() event works well for that.
>>
>> if not nChar = 3
>> msgbox("ReadOnly Field")
>> return false
>> endif
>> return
>
> Thanks, Greg: that's interesting. Testing shows up one hitch - it
> allows Ctrl+V Paste to overwrite the value. Further testing shows that
> Ctrl+C and Ctrl+V do not trigger the key event handler, even if I don't
> have an Edit menu with Cut/Copy/Paste on the form, so the test
> if not nChar = 3
> is superfluous.
>
> Otherwise it does what I want. Any thoughts on intercepting Paste?
Hmm.. what version of dBASE and windows are you working with?
The keyboard / keycombo's are protected on mine system, ctrl-v, don't know
why it wouldn't with yours BUT try this:
I can not control popup menus though.
As of right now I don't have an answer for the menu driven paste.
return
|
| Post Reply
|
| Re: Copying text without enabling editing |
 |
Sun, 13 Apr 2008 22:22:16 -070 |
Just to be sure, are you using the Key() or onKey() ?
Greg Hill
|
| Post Reply
|
|
|
|
|
|
|
|
|
|