Itextctl | developer.brewmp.com Itextctl | developer.brewmp.com

Developer

Itextctl

Forums:

When I create and display an ITEXTCTL control there is a white bar that appears at the top of the screen and wipes out the contents. I am not interested in the softkey bar associated with the ITEXTCTL. Is there a way to get rid of this and have only the text box displayed ?

When I create and display an ITEXTCTL control there is a white bar that appears at the top of the screen and wipes out the contents. I am not interested in the softkey bar associated with the ITEXTCTL. Is there a way to get rid of this and have only the text box displayed ?

When I create and display an ITEXTCTL control there is a white bar that appears at the top of the screen and wipes out the contents. I am not interested in the softkey bar associated with the ITEXTCTL. Is there a way to get rid of this and have only the text box displayed ?

Are you sure it is a soft key menu that you are seeing?
Creating an ITextCtl (as well as calling some of the ITextCtl APIs) has the unfortunate side effect of also causing BREW to redraw the ITextCtl. With ITEXTCTL_SetRect(), for example, it will "clear" the old rect with the CLR_SYS_WIN color and then redraw the ITextCtl with the new size.
If you are creating or setting the ITextCtl after you have already drawn parts of your screen, then those sections may get overdrawn by the ITextCtl, causing you to see a white rectangle. One way to avoid this is to create and set up the ITextCtl before doing the drawing.

Are you sure it is a soft key menu that you are seeing?
Creating an ITextCtl (as well as calling some of the ITextCtl APIs) has the unfortunate side effect of also causing BREW to redraw the ITextCtl. With ITEXTCTL_SetRect(), for example, it will "clear" the old rect with the CLR_SYS_WIN color and then redraw the ITextCtl with the new size.
If you are creating or setting the ITextCtl after you have already drawn parts of your screen, then those sections may get overdrawn by the ITextCtl, causing you to see a white rectangle. One way to avoid this is to create and set up the ITextCtl before doing the drawing.

Hi Greg,
i have a similar issue.
i have created and set up the ITextCtl box before some drawing on the screen.. but every time i enter a text it clears all the drwaing on the screen.
i also tried to set the color of rect associated with ITextCtl but it also gets clear at every event handled by ITextCtl.
Can you help me in this issue?

Hi Greg,
i have a similar issue.
i have created and set up the ITextCtl box before some drawing on the screen.. but every time i enter a text it clears all the drwaing on the screen.
i also tried to set the color of rect associated with ITextCtl but it also gets clear at every event handled by ITextCtl.
Can you help me in this issue?

check the rect u r setting in SetRect is proper.

check the rect u r setting in SetRect is proper.

Ok, here's the answer, and this probably should make it into the api docs, because (at least to me) this was not obvious and cost me 1/2 a day).
ITEXCTL_SetRect() clears the screen and leaves it white. As far as I can see this is unavoidable, so, the solution is to call it before you do any other drawing.
so, this is what you want to do...
....
ITEXTCTL_SetRect( tc, &yourNarrowTextRectangle);//set a text input rect shape that is smaller than the screen!
//draw your background
//draw your other crap
ITEXTCTL_SetProperties(tc, SOME_PROPERTY_THAT WORKS_FOR_YOU);//this seems to actually draw the white rect. My experience is that it doesn't matter which value you pass in... I may be wrong here.
//the LAST thing you do before updating screen is set your text to black so that //the user's input will be black (or whatever other color you feel like that is visible //on top of the white rectangle
IDISPLAY_SetColor(displayPointer, CLR_USER_TEXT, RGB_BLACK);
YouTube_Update(g_pMe);
.....
this will set you up for input. Now all you need to do is test to see if the control is active where you capture your key events and if it is active just pass those key events on to ITEXTCTL_HandleEvent. That part is documented nicely and makes sense... the only part that I think is confusing is how the SetRect wipes the screen.

Ok, here's the answer, and this probably should make it into the api docs, because (at least to me) this was not obvious and cost me 1/2 a day).
ITEXCTL_SetRect() clears the screen and leaves it white. As far as I can see this is unavoidable, so, the solution is to call it before you do any other drawing.
so, this is what you want to do...
....
ITEXTCTL_SetRect( tc, &yourNarrowTextRectangle);//set a text input rect shape that is smaller than the screen!
//draw your background
//draw your other crap
ITEXTCTL_SetProperties(tc, SOME_PROPERTY_THAT WORKS_FOR_YOU);//this seems to actually draw the white rect. My experience is that it doesn't matter which value you pass in... I may be wrong here.
//the LAST thing you do before updating screen is set your text to black so that //the user's input will be black (or whatever other color you feel like that is visible //on top of the white rectangle
IDISPLAY_SetColor(displayPointer, CLR_USER_TEXT, RGB_BLACK);
YouTube_Update(g_pMe);
.....
this will set you up for input. Now all you need to do is test to see if the control is active where you capture your key events and if it is active just pass those key events on to ITEXTCTL_HandleEvent. That part is documented nicely and makes sense... the only part that I think is confusing is how the SetRect wipes the screen.

.. It seems that the rectange you are setting for ITextCtl is not sufficient, thats why it is using whole screen as its rect. Set dy appropriately, (you can use font height for getting the reqd dy)

.. It seems that the rectange you are setting for ITextCtl is not sufficient, thats why it is using whole screen as its rect. Set dy appropriately, (you can use font height for getting the reqd dy)

No, Softeast, marges_sisters has it right. ITEXCTL_SetRect() will clear the screen, no matter what size you are setting it to.
-Erik

No, Softeast, marges_sisters has it right. ITEXCTL_SetRect() will clear the screen, no matter what size you are setting it to.
-Erik