Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Textbox SelLength Assign problem
Message
From
01/05/2002 04:38:17
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
01/05/2002 04:07:06
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Miscellaneous
Thread ID:
00650820
Message ID:
00651225
Views:
24
Mark,
Bar# are built_in and accessed with _med_copy, _med_paste etc.
Just define the menu. You don't need to activate-show it.
define popup _medit
DEFINE BAR _med_slcta OF _medit PROMPT '' KEY CTRL+A
DEFINE BAR _med_paste OF _medit PROMPT '' KEY CTRL+V
DEFINE BAR _med_copy OF _medit PROMPT '' KEY CTRL+C
DEFINE BAR _med_cut OF _medit PROMPT '' KEY CTRL+X
DEFINE BAR _med_redo OF _medit PROMPT '' KEY CTRL+R
DEFINE BAR _med_undo OF _medit PROMPT '' KEY CTRL+Z
Cetin

>Hi Mario
>
>Do you have a code snippet showing how to do this. I am a bit confused because you say use Bar# in a menu but later say your app uses no menu at all.
>
>
>>Neil,
>>
>>If you use Bar# with _med_copy, _med_cut and _med_paste in you menu, VFP will handle all these features for you. I have a VFP7 application with no menu and these feature work without any code in the textbox.
>>
>>HTH
>>
>>Mario
>>>Hi All,
>>>
>>> anyone have a solution to this problem? We're trying to put Basic Copy/Paste functionality into a bespoke command group to mimic the Ctrl C / Ctrl X / Ctrl V functions of the FoxPro memu. If a user selects a piece of text in a textbox, either with the mouse or Shift Arrow or Ctrl A, we need to be able to avtivate or deactivate the Copy button based on whether a piece of text is selected or not in the current textbox.
>>>
>>> The trouble is, we can't seem to find an event to do this in. We first tried putting in an assign method on the SelLength property, but this isn't fired is it's the user who changes the length of the selected text. I thought of trapping Key presses and mouse events (MouseUp?), and even using a timer à la Ken Levy, but it seems a bit heavy going, especially since this is going to go into a base textbox class for the project.
>>>
>>> We can't use the When event, since we want this to work as soon as the user selects some text, just as the FoxPro toolbar works is interactive mode. Anyone have any ideas?
>>>
>>>Best wishes,
>>>Neil
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform