Need some help with editor gadget.

Just starting out? Need help? Post your questions and find answers here.
User avatar
treebolt
User
User
Posts: 50
Joined: Thu Feb 21, 2008 4:38 pm
Location: Palm Harbor, FL

Need some help with editor gadget.

Post by treebolt »

The problem is, I have editor gadget and "return" as a keyboard shortcut so when I press enter while cursor is in editor gadget it does not move the cursor to the next line. :?: :?: im using purebasic 4.1 by the way I dont know of this happens with later versions?
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Need some help with editor gadget.

Post by IdeasVacuum »

Hi

If your app is for Windows:

Code: Select all

SendMessage_(GadgetID(#Editor001), #EM_SETTARGETDEVICE, #Null, 0) ;=WordWrap on
.... = no need to enter <Enter>, if not critical for the purposes of your app.
Last edited by IdeasVacuum on Thu Mar 08, 2012 10:56 pm, edited 1 time in total.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
treebolt
User
User
Posts: 50
Joined: Thu Feb 21, 2008 4:38 pm
Location: Palm Harbor, FL

Re: Need some help with editor gadget.

Post by treebolt »

I really needed that code as well I really wanted to turn wordwrap on so thank you so much.

is there any way to send the next line command through a similar method so i can attach it to the keyboard shortcut action of its the active gadget and enter is pushed?
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Need some help with editor gadget.

Post by IdeasVacuum »

Not sure, but having word-wrap on might allow <Enter> to work anyway.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
IdeasVacuum
Always Here
Always Here
Posts: 6426
Joined: Fri Oct 23, 2009 2:33 am
Location: Wales, UK
Contact:

Re: Need some help with editor gadget.

Post by IdeasVacuum »

Another possibility. If the Editor Gadget is the Active Gadget, Then use RemoveKeyboardShortcut() to stop the Window Event picking-up on the <Enter> key. When the Editor Gadget loses focus, re-create the Shortcut.
IdeasVacuum
If it sounds simple, you have not grasped the complexity.
User avatar
skywalk
Addict
Addict
Posts: 4211
Joined: Wed Dec 23, 2009 10:14 pm
Location: Boston, MA

Re: Need some help with editor gadget.

Post by skywalk »

The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum
User avatar
treebolt
User
User
Posts: 50
Joined: Thu Feb 21, 2008 4:38 pm
Location: Palm Harbor, FL

Re: Need some help with editor gadget.

Post by treebolt »

IdeasVacuum wrote:Another possibility. If the Editor Gadget is the Active Gadget, Then use RemoveKeyboardShortcut() to stop the Window Event picking-up on the <Enter> key. When the Editor Gadget loses focus, re-create the Shortcut.
This idea worked perfect. Thank you :D
Post Reply