[wxruby-users] wxComboBox and wxTE_PROCESS_ENTER
Mario Steele
mario at ruby-im.net
Sun Nov 30 13:11:56 EST 2008
The problem lies in the fact, that Wx::ComboBox has a Drop down, and a Text
Edit in it. I believe that Fabio wants the Enter event, so that he can add
what a person enters into the Drop Down, if I am understanding correctly.
The best thing to do, is to monitor evt_keypress, and create a new item, and
update that item in the combo box, as the person types stuff into it.
Either that, or monitor on focus lost, and check to see if the item is in
the combo box, if not, add it. Though, that can lead to it's own problems,
as a person could switch between the controls several times, and have
several items added if he changes the text each and every time he tabs
between the controls.
Just a couple of suggestions on how to work around it.
On Sun, Nov 30, 2008 at 11:06 AM, Alex Fenton <alex at pressure.to> wrote:
> Fabio Petrucci wrote:
>
>>
>> Wx::TE_PROCESS_ENTER can be set programmatically by
>> window#toggle_window_style(Wx::TE_PROCESS_ENTER)
>>
>> ...now it works, but enabling this flag, the widget loose TAB controls
>> (TAB / SHIFT+TAB)
>>
>
> The fact that setting this style when the control is created suggests to me
> that it's not really meant to work like that, and I don't understand what
> you're trying to do here. Why do you want a ComboBox that processes ENTER?
>
> cb = Wx::ComboBox.new(self, 500, "default value", Wx::Point.new(90,50),
>> Wx::DEFAULT_SIZE,
>> sampleList,
>> Wx::CB_DROPDOWN|Wx::TE_PROCESS_ENTER)
>>
>> i get the enter event but no tabbing is possible.
>>
>> Is it a bug?
>>
>
> I don't know. I expect if the control is told to consume ENTER, it also
> consumes TAB.
>
> alex
> _______________________________________________
> wxruby-users mailing list
> wxruby-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/wxruby-users
>
--
Mario Steele
http://www.trilake.net
http://www.ruby-im.net
http://rubyforge.org/projects/wxruby/
http://rubyforge.org/projects/wxride/
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/wxruby-users/attachments/20081130/4097b533/attachment.html>
More information about the wxruby-users
mailing list