Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to get copy and paste (ctrl C and ctrl V) in .exe

Status
Not open for further replies.

Nifrabar

Programmer
Joined
Mar 16, 2003
Messages
1,343
Location
NL
Hi to all,
I have an application without menu.
My users like to have copy and paste facilities in my app.
As the app is without menu I am wondering how to achieve that.
Now, when using ctrl-C that keystoke acts like the 'skip'command while ctrl-V works as expected (without explicite doen some work to achieve this).
Any idea ?
-Bart
 
Nifrabar,

There are many topics on this subject. Please read also 184-30500 , 184-695095 and 184-480172.
They explain how to make a shortcut menu.

Regards,

Koen
 
Koen,
thanks for your reply
how to navigate to the threads you marked up ?
-bart
 
Koen,

When you want to quote a thread number in a message, the best way is to copy and paste the entire thread name (including the word 'thread') from the top of the thread's page (just below the thread title). For example: thread184-823135

That way, the thread will appear as a hyperlink.

Mike


Mike Lewis
Edinburgh, Scotland

My Visual Foxpro web site: My Crystal Reports web site:
 
There is an article on my web site that discusses how to include copy, cut, & paste.

Craig Berntson
MCSD, Visual FoxPro MVP, Author, CrysDev: A Developer's Guide to Integrating Crystal Reports"
 
Hi Craig,
Thanks for your reply.
Will there be a way to include the functionality without the need of a toolbar ?
-Bart
 
It seems to me that you could use the _CLIPTEXT system variable and some ON KEY LABEL commands and get all the functionality you wanted.

boyd.gif

craig1442@mchsi.com
"Whom computers would destroy, they must first drive mad." - Anon​
 
Nifrabar,

All you need is to have the Cut, Copy and Paste options on the menues.

Code:
DEFINE POPUP _medit MARGIN RELATIVE SHADOW
DEFINE PAD _msm_edit OF _MSYSMENU PROMPT "\<Edit" KEY ALT+E, "" MESSAGE "Edits text or current selection"
ON PAD _msm_edit OF _MSYSMENU ACTIVATE POPUP _medit
DEFINE BAR _med_undo  OF _medit PROMPT "\<Undo"       KEY CTRL+Z, "Ctrl+Z"  MESSAGE "Undoes the last command or action"
DEFINE BAR _med_redo  OF _medit PROMPT "Re\<do"       KEY CTRL+R, "Ctrl+R"  MESSAGE "Repeats the last command or action"
DEFINE BAR _med_sp100 OF _medit PROMPT "\-"       
DEFINE BAR _med_cut   OF _medit PROMPT "Cu\<t"        KEY CTRL+X, "Ctrl+X"  MESSAGE "Removes the selection and places it onto the Clipboard"
DEFINE BAR _med_copy  OF _medit PROMPT "\<Copy"       KEY CTRL+C, "Ctrl+C"  MESSAGE "Copies the selection onto the Clipboard"
DEFINE BAR _med_paste OF _medit PROMPT "\<Paste"      KEY CTRL+V, "Ctrl+V"  MESSAGE "Pastes the contents of the Clipboard"
DEFINE BAR _med_clear OF _medit PROMPT "Cle\<ar"                            MESSAGE "Removes the selection and does not place it onto the Clipboard"
DEFINE BAR _med_sp200 OF _medit PROMPT "\-"
DEFINE BAR _med_slcta OF _medit PROMPT "Se\<lect All" KEY CTRL+A, "Ctrl+A"  MESSAGE "Selects all text or items in the current window"
DEFINE BAR _med_sp300 OF _medit PROMPT "\-"
DEFINE BAR _med_find  OF _medit PROMPT "\<Find..."    KEY CTRL+F, "Ctrl+F"  MESSAGE "Searches for specified text"
DEFINE BAR _med_finda OF _medit PROMPT "Find A\<gain" KEY CTRL+G, "Ctrl+G"  MESSAGE "Repeats the last search"
DEFINE BAR _med_repl  OF _medit PROMPT "R\<eplace..." KEY CTRL+L, "Ctrl+L"  MESSAGE "Replaces specified text with different text"
DEFINE BAR _med_sp400 OF _medit PROMPT "\-"
DEFINE BAR _med_pref  OF _medit PROMPT "Prope\<rties..."                    MESSAGE "Set editor properties"

Why your "Ctrl+C" acts like "SKIP", I don't know: It could be that you've set an "ON KEY LABEL CTRL+C SKIP" command, which might take precedence over the menu.

All the suggestions on Shortcut menus and _CLIPTEXT, etc, can be used "on top of" having the menu choices available, but I'd advise against "hand coding" ON KEY LABEL CTRL+C/X/V commands, and just let the menu handle those. VFP will enable/disable the choices for when they're appropriate.

 
No toolbar is needed. It's the definition of the menu that makes it work. However, you should provide someway for mouse users to do cut and paste, so that means either a toolbar or a menu of some sort.

Craig Berntson
MCSD, Visual FoxPro MVP, Author, CrysDev: A Developer's Guide to Integrating Crystal Reports&quot;
 
ok fellows, thanks so far.
I think I can go further with the suggestions you gave to me. Maybe I than add a short-menu to the right-click of the textboxes in my lib.
-Bart
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top