Game Development Community

1.4 Unicode tabNext, tabPrev problem

by kingkong · in Torque Game Engine · 06/28/2006 (7:25 am) · 0 replies

GuiTextEditCtrl can't do keyboard translation for unicode on TabNext.
void GuiTextEditCtrl::setFirstResponder()
{
   Parent::setFirstResponder();
   
   Platform::enableKeyboardTranslation();
}
but setFirstResponder is not virtual function, and in GuiCanvas::tabText(), it calls GuiControl::SetFirstResponder(). also in GuiCanvas::tabPrev().

void GuiCanvas::tabNext(void)
{
   GuiControl *ctrl = static_cast<GuiControl *>(last());
   if (ctrl)
   {
      //save the old
      GuiControl *oldResponder = mFirstResponder;

      GuiControl* newResponder = ctrl->findNextTabable(mFirstResponder);
      if ( !newResponder )
          newResponder = ctrl->findFirstTabable();

      if ( newResponder && newResponder != oldResponder )
      {
	newResponder->setFirstResponder(); [b]//====> this function is not virtual[/b]
	if ( oldResponder )
  	    oldResponder->onLoseFirstResponder();
      }
   }
}
how can i solve this problem? is it okay to declare GuiControl::SetFirstResponder() as virtual?
even though i declare it as virtual, i doesn't work properly...
i'm trying to figure out why...

and there is another problem.. if there are two GuiTextEditCtrl, WinState.imeHandle becomes NULL.

void Input::activate()
{
#ifdef UNICODE
   winState.imeHandle = ImmGetContext( winState.appWindow );
   ImmReleaseContext( winState.appWindow, winState.imeHandle );
#endif

....
}
i can't find out why.... can anybody help?


when is tge 1.4.2 release? is this fixed in 1.4.2?

thanks for reading..