June 18, 2024, 08:47:33 AM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Scintilla editor problem

Started by LarryMc, March 15, 2010, 06:42:26 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

LarryMc

I've got a pretty much standard scintilla editor that I've expanded to include Find,Find First, Find Next, Find Prev, and Find Last.
I've added accelerator keys so that the context menu items and the accelrator keys call the appropriate functions
The "F" keys work great for Find First, Find Next, Find Prev, and Find Last

My problem is 'Ctrl-F' for opening the Find dialog.
I've tried both of the following:
ADDACCELERATOR #<window>@hitwindow,@FCONTROL|@FVIRTKEY,ASC("F"),MENU_FIND
ADDACCELERATOR #<window>@hitwindow,@FCONTROL|@FVIRTKEY,0x46,MENU_FIND

either one will open the dialog.
If I cancel the dialog I get an "f" printed in my code window at the current caret position

I added this (for 'Ctrl-G") and get a "g"         
ADDACCELERATOR #<window>@hitwindow,@FCONTROL|@FVIRTKEY,0x47,MENU_FIND

So, the key that I hit with the Ctrl key is being printed when I close the dialog.

Any ideas?

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

aurelCB

<< I've got a pretty much standard scintilla editor that I've expanded to include Find,Find First, Find Next, Find Prev >>

Larrymc
I am interested in this functions

basicgames

Quote from: LarryMc on March 15, 2010, 06:42:26 AMIf I cancel the dialog I get an "f" printed in my code window at the current caret position

I don't think this has anything to do with Scintilla. I was about to post a thread asking a similar question, but decided to see if anyone else asked first.

With my editor programs, I have the same problem using non rtf standard edit forms. ADDACCELERATOR always causes a character to be printed when the dialog is cancelled.

Things I have noticed:

The problem doesn't happen with CTRL+A

The problem doesn't happen when the menu option doesn't open a filerequest, messagebox, or dialog.

If you put a delay loop with a WAIT, the character appears after.

Focus is set away from the window so you cannot see what character was just added.

The undo flag is not set, so there's nothing to undo.

I tried implementing an alternative solution with GETKEYSTATE and had similar problems.

It's something to do with the buffer.

I simply cannot find or come up with a way to clear the input buffer (except in directx windows which are not relevant).

Is there a way to clear the input buffer with SENDMESSAGE maybe?

Brian

Larry,

Are you using the ENABLETABS command at all? Just wondering...

Brian