Many many thanks.
It looks like this might be a starting point for a non-blind alley.
I tried it very quickly, and found that you can place the wrapper on a form, but not on a user control. I don't imagine that this will be difficult to solve.
Simon
| Stewart Obert <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED] 02/03/2006 20:54
|
To: Discussion of the Scintilla editing component <[email protected]> cc: Subject: Re: [scintilla] ScintillaVB |
Might as a suggestion try another of the scintilla wrapper controls available. I wrote one which I'm actually in the process of rewriting, but it's available at:
http://www.ceditmx.com/products/scintillaax/disp.php?getFile=download.php
The rewrite will be available from
http://www.sourceforge.net/projects/scivb, but this version is still being worked on. This one has a lot more of the common features as I finally took Neil's advice and wrote an autogenerator script to utilize the scintilla.iface file.
I have tried on several occasions to find a way to make the method used in ScintillaVB work where Scintilla is actually stored within the control window. But asside from actually getting each keyboard message recieved from the control and passing it to scintilla threw subclassing I never found a way to achieve it. The problem with the subclassing method is it seems like passing keyboard messages aro! und can become very unstable. I saw a lot of crashing.
The method I used to fix this problem is make the activex control a non visual component which subclasses the form for you and places scintilla on the form directly. This overcame those issues.
Hope this helps some :)
Matt Salmon <[EMAIL PROTECTED]> wrote:
I may be misunderstanding you, but isn't that expected? For example, checkboxes, radio buttons, tab controls etc use the arrow keys to jump between options/tabs. Text controls use the arrow keys to move around their contents.
That's the problem - something housing the underlying Scintilla window is "swallowing" the key events. If ScintillaVB is open source, you may want to look at the code. In all likelihood, the wrapper they'r! e using is creating a control and internally creating the scintilla window and drawing the window onto that. It may well be the container in ScintillaVB that is the problem - maybe it even has a KeyPreview property you can set to false?
Matt
On 02/03/06, [EMAIL PROTECTED] <[EMAIL PROTECTED] > wrote:
Curioser and curiouser.
Even when there is no chain of containers (ScintillaVB direct on the start-up form) this doesn't work. The cursor keys move focus from one control to another - until there is a textbo! x on the form. When the textbox get focus cursor key presses move the cursor around the textbox - and key events for them can be seen from both the text box and the form!! Put the focus on another control and they go again.
Now if some one could explain to me what interface the textbox has - which others don't - that cause it to be treted differently by the container, I'd be there.
Thanks for everything
Simon
|
| "Matt Salmon" <[EMAIL PROTECTED]>
Sent by: [EMAIL PROTECTED] 02/03/2006 13:17 Please respond to Discussion of the Scintilla editing component |
To: "Discussion of the Scintilla editing component" < [email protected]> cc: Subject: Re: [scintilla] ScintillaVB |
|
Hmm, it's been ages since I did any VB, so I can't remember what key events there are - the KeyPreview property sounds right though. Have you tried going up the tree i.e. turned off KeyPreview on the holding container, the form that holds the container, etc? It's definitely getting caught somewhere and then not being forwarded onto Scintilla - it's just a case of finding out where.
If you're unable to find out where it's going wrong, a possible workaround is to catch the key press event and send instructions to Scintilla to do what you want to do, for example SCI_CHARLEFT for the left arrow, etc. This should be a last resort option though - I only suggest it because I vaguely remember VB having an annoying habit of processing key events even before KeyPreview. Still, there must be other users of ScintillaVB who've had thi! s problem before - hopefully one of them will pipe up.
Matt
On 02/03/06, [EMAIL PROTECTED] < [EMAIL PROTECTED] > wrote:
Thnaks for that.
Part 2 seems to work (I'd actually tried to do that, but forgot to give the focus to the ScintillaVB container 1st - then to scintilla control that it creates)
1st 1 seems a bit! more of a problem. VB6 has a 'KeyPreview' property on the container. This means that I get to see key events in the container before they go to the component in the container that has focus. But it appears, as you say, that the unshifted cursor keys are not forwarded to the container in the 1st place. Don't appear to have the facilitity to override either - unless someone can tell me different.
Cheers
Simon
|
| "Matt Salmon" <[EMAIL PROTECTED] >
Sent by: [EMAIL PROTECTED] 02/03/2006 11:56 Please respond to Discussion of the Scintilla editing component |
To: "Discussion of the Scintilla editing component" < [email protected]> cc: Subject: Re: [scintilla] ScintillaVB |
|
Hey Simon
Issue 1: This is occurring because your container is swallowing the
key events. You need to find out which method to override and return
false. For example, embedding Scintilla in a Control in C#, you need
to override the following method:
protected override bool ProcessDialogKey(Keys keyData) {
return false;
}
The control then forwards the necessary key events to scintilla
its! elf. With VB I assume you will add the event handler, and then set
one of the event properties to False.
Issue 2:
How are you settting the caret position and getting focus? In C#, I'd
set the caret position and use the GRABFOCUS call, like so:
scintilla.CurrentPos = 3;
scintilla.SelectionStart = scintilla.CurrentPos;
scintilla.SelectionEnd = scintilla.CurrentPos;
scintilla.GrabFocus();
These will of course need to be adapted to ScintillaVB, but the
concepts should be the same.
If you are moving the caret position to somewhere outside of the
visible area, you will also need to call the ScrollCaret() method to
ensure the current position is scrolled into view.
Hope that helps,
Matt
On 02/03/06, [EMAIL PROTECTED]
<[EMAIL PROTECTED] > wrote:
>
> Question about history.
>
> I'm stuck using a VB6 environment. I've gor ScintillaVB and modified it for
> my application (basically adding extra interfaces). The cursor keys don't
> work, but they do with shify and CTRL.
>
> I searched the archive, and found a previous post on this. The suggestion
> was to try KeyPreview. Ive turned this on and put KeyUp and KeyDown
> handlers (KeyPress event returns ASCII code only - so doesn't work for
> cursor or F keys having KeyUp/KeyDown and KeyPress is nonsense anyway) into
> the form where the ScintillaVB control is placed. Pressing letter keys
> causes the sequence KeyDown event, the letter! appears in the Scintilla
> window, KeyUp event. Pressing a cursor key with shift or CTRL generates a
> KeyDown, text highlights in scintilla widow (for shift), KeyUp. Pressing
> just the cursor key has no effect in the scintilla window and no events are
> generated in the form.
>
> As a second issue, when I set the focus to the scintillaVB control the caret
> does not appear at its current position. Also when I programatically move
> the current position, the text moves, but the caret is not shown.
>
> Clues please - I'm tearing my hair out.
> > TIA
>
> Simon
>
> ______________________________________________________________________
> This email has been scanned by the MessageLabs Email Security System.
> For more information please visit
> http://www.messagelabs.com/email
> ______________________________________________________________________
>
> _______________________________________________
> Scintilla-intere! st mailing list
> [email protected]
> http://mailman.lyra.org/mailman/listinfo/scintilla-interest
>
>
>
_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest
_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest
Yahoo! Mail
Bring photos to life! New PhotoMail makes sharing a breeze.
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest
______________________________________________________________________
This email has been scanned by the MessageLabs Email Security System.
For more information please visit http://www.messagelabs.com/email
______________________________________________________________________
_______________________________________________ Scintilla-interest mailing list [email protected] http://mailman.lyra.org/mailman/listinfo/scintilla-interest
