This repository has been archived by the owner on Dec 1, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 197
Focus on Multiple TextInputs #209
Comments
@noio do you solve it? if yes how? thanks for your time |
I wrote some code "manually" to unselect all textinputs (except one) when a new one is selected:
Then I call this whenever a new textinput is selected in
This does mean you have to keep track of the textinputs:
|
@noio yap, i did the same :D |
@noio . Thanks. it helped me too. After some doubts, finally I defined textInputs and my variables in ofApp.h like this:
|
This happens to me with the ofxUIScrollableCanvas, quick fix: void ofxUIScrollableCanvas::mousePressed(int x, int y, int button)
{
if(sRect->inside(x, y))
{
hit = true;
for(vector<ofxUIWidget *>::iterator it = widgets.begin(); it != widgets.end(); ++it)
{
if((*it)->isVisible())
{
if((*it)->isHit(x, y))
{
if((*it)->isDraggable())
{
hitWidget = true;
}
(*it)->mousePressed(x, y, button);
}
else if((*it)->getKind() == ofxUIWidgetType::OFX_UI_WIDGET_TEXTINPUT)
{
(*it)->mousePressed(x, y, button);
}
}
}
}
isScrolling = false;
vel.set(0,0);
} I think the solution would be making ofxUITextInput always listen to mouse events, then checking for their rects. This way it would be globally fixed, even if you have multiple ofxUICanvas. |
andreirt
added a commit
to andreirt/candle-clock
that referenced
this issue
May 20, 2015
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
When creating a UI with multiple textinputs, the default behavior is for each textfield to stay selected after it's clicked. This often leads to the case where multiple textinputs receive input text.
Would it be an idea to have the Canvas keep track of which textfield is in focus? I might be able to contribute.
The text was updated successfully, but these errors were encountered: