Forum: wxRuby StyledTextCtrl not receiving all entered keys

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Robin R. (Guest)
on 2008-12-15 11:32
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 -
Alex F. (Guest)
on 2008-12-16 06:36
(Received via mailing list)
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
Robin R. (Guest)
on 2008-12-16 12:21
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 -
Alex F. (Guest)
on 2008-12-16 14:26
(Received via mailing list)
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
Robin R. (Guest)
on 2008-12-16 15:52
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 :-)

Greetings from Hamburg / Germany
- rojaro -
This topic is locked and can not be replied to.