ianharrigan / haxeui

IMPORTANT NOTE! This repository is no longer maintained. Please consider the newer version: https://github.com/haxeui/haxeui-core
http://haxeui.org/
392 stars 47 forks source link

[Feature] Tab between multiple TextInput #79

Open julsam opened 10 years ago

julsam commented 10 years ago

Being able to press <tab> to switch between text inputs would be great. I tried implementing it myself, but couldn't find a way to do it...

ianharrigan commented 10 years ago

Thanks,

Yes, this is certainly a needed feature.

julsam commented 10 years ago

See the above commit, I made some inline comments in Github.

I made 2 demos to see the difference:

  1. one before the commit
  2. one after the commit

Try to tab between TextInputs, it should work perfectly in the second one, even with TabViews. Then, try the Popup button with more TextInputs in it, that's where I have trouble. As you can see, if you tab between the Popup's inputs, you'll go behind the modal overlay to the underlying inputs. I'm not sure how to disable them when there is an overlay.

ianharrigan commented 10 years ago

Right, but this will only work for flash, right? I dont think it will work for cpp/neko... i think proper way to do it is to create a FocusManager

julsam commented 10 years ago

this will only work for flash, right?

That's right. 'tabEnabled' doesn't seem to be implemented in openfl. I'll try to take some time to look into FocusManager

ianharrigan commented 10 years ago

Well, its on my list defo... So i will get round to it... ideally it wouldnt be for just textinputs either... I think should should be able to tab focus through most/all haxeui components, but it needs some thought

ianharrigan commented 10 years ago

As you can see, there is:

https://github.com/ianharrigan/haxeui/blob/master/src/haxe/ui/toolkit/core/FocusManager.hx

and

https://github.com/ianharrigan/haxeui/blob/master/src/haxe/ui/toolkit/core/interfaces/IFocusable.hx

But then dont do anything and are more there as a reminder really.

julsam commented 10 years ago

Alright then, that's great ! :)

julsam commented 10 years ago

Yeah, the FocusManager is definitively the proper way to do it, especially with multiple target.

naturally-intelligent commented 10 years ago

Tab key would be great to use to jump around all inputs. Also, a "tab order" value on widgets would be valuable, like in HTML.

ianharrigan commented 10 years ago

Yeah, agreed, its an important feature. It should also work for popups also... so a new FocusManager for each popup that goes back to the previous one when the popup is dismissed.