StyledTextCtrl not receiving all entered keys


#1

Hi,

i am working on a little editor based on the StyledTextCtrl. The
problem: The keys “wrtzfy.-#+124780” are not being received by the
control, so there is no output within the control and no events are
being triggered. I’ve tested this on two different machines running (one
running XP and the other one running Vista), but these keys do work with
other controls within the same application. Any idea what might be the
cause?

Greetings from Hamburg / Germany

  • rojaro -

#2

Hi

Robin Rogge wrote:

i am working on a little editor based on the StyledTextCtrl. The
problem: The keys “wrtzfy.-#+124780” are not being received by the
control, so there is no output within the control and no events are
being triggered. I’ve tested this on two different machines running (one
running XP and the other one running Vista), but these keys do work with
other controls within the same application. Any idea what might be the
cause?

That’s strange. I can’t reproduce the error on XP using the wxRuby
scintilla sample. Could you try running that sample please? If the
sample problem occurs, then I guess it’s a bug with Vista, otherwise
there must be something in your app that’s consuming those characters.
Perhaps an evt_char handler that is not calling skip on the event?

If this doesn’t help, please send a minimal, runnable, self-contained
sample that demonstrates the issue.

a


#3

Hi Alex,

Alex F. wrote:

i am working on a little editor based on the StyledTextCtrl. The
problem: The keys “wrtzfy.-#+124780” are not being received by the
control, so there is no output within the control and no events are
being triggered. I’ve tested this on two different machines running (one
running XP and the other one running Vista), but these keys do work with
other controls within the same application. Any idea what might be the
cause?

That’s strange. I can’t reproduce the error on XP using the wxRuby
scintilla sample. Could you try running that sample please? If the
sample problem occurs, then I guess it’s a bug with Vista, otherwise
there must be something in your app that’s consuming those characters.
Perhaps an evt_char handler that is not calling skip on the event?

Thanks for your response. I actually never saw this demo before and it
works perfectly. So, looking at it, i see the main difference between my
code and the demo code is that i use an extended StyledTextCtrl, while
the demo uses a direct instance of StyledTextCtrl. For testing, i
trimmed my extended class as far as possible until the following code
remained, while the problem still remained:

class EditorPage < Wx::StyledTextCtrl
end

So the demo uses

@sci = Wx::StyledTextControl.new(self)

while i use

@sci = EditorPage.new(self)

Note that this problem occurs on both, Windows XP and Vista.

Greetings from Hamburg / Germany

  • rojaro -

#4

Robin Rogge wrote:

So the demo uses

@sci = Wx::StyledTextControl.new(self)

while i use

@sci = EditorPage.new(self)

I don’t believe there is a problem with subclasses of StyledTextCtrl. If
you put your subclass in the wxRuby demo it still works fine, and I’ve
used complex subclasses of STC in real code without difficulty.

So there is something else wrong in your program. Happy to try out a
minimal runnable sample that demonstrates the issue - you may find that
selectively removing elements from the frame may identify the source of
the difficulty. My guess would be that some other widget (eg a Frame) or
the App is being told to trap and not pass them on.

alex


#5

Hi Alex,

Alex F. wrote:

I don’t believe there is a problem with subclasses of StyledTextCtrl. If
you put your subclass in the wxRuby demo it still works fine, and I’ve
used complex subclasses of STC in real code without difficulty.

So there is something else wrong in your program. Happy to try out a
minimal runnable sample that demonstrates the issue - you may find that
selectively removing elements from the frame may identify the source of
the difficulty. My guess would be that some other widget (eg a Frame) or
the App is being told to trap and not pass them on.

Damn … it just had to be something really stupid. The “CTRL” in front
of some shortcuts for the dynamically created menu items in the menubar
was missing. I just removed them from the item generating method for now
and viola, StyledTextCtrl works. Thanks for your help :slight_smile:

Greetings from Hamburg / Germany

  • rojaro -