PDA

View Full Version : BasicDialog key events



jarrednicholls
7 Nov 2006, 1:48 PM
Hey Jack,

As I stated before, the BasicDialog addKeyListener doesn't work when specifying an array of key codes. Also, since most sights will have some non-modal dialogs, the chance for multiple dialogs to be open at one time is much higher. If any 2 opened dialogs are listening to the same keydown events, they all react accordingly. It might be better to figure out a way to scope the key events to within the dialog element rather than attaching to "document". This can be done by creating a invisible anchor (<a>) tag and focus it upon showing the dialog and upon clicking on the dialog header, etc. Then, doing a key event listen on "this.el.dom" would work alright. Essentially, turning the BasicDialog into its own windowing system. Might be good to create a DialogManager class to manage such things. Another good feature along the same lines would be to activate/deactivate dialogs (essentially setting focus to a dialog, just like you would set focus to a window in any traditional windowing system).

What do you think about that?

-Jarred Nicholls

jack.slocum
7 Nov 2006, 2:56 PM
Sounds good to me. I will work on it tonight.