Forums | developer.brewmp.com Forums | developer.brewmp.com

Developer

Forums

Forums:

Hi,

I'm trying to use 2 text control objects.
When I'm done with first textctl, I call ITEXTCTL_SetActive(pITextCtl1, 0) on first textctl. It disappears from the screen.

Is it possible to keep the first textctl but switch the focus to second text ctl and start drawing the second one?

Thanks

The problem will be something todo with drawing screen. SetActive should not affect this.

The problem will be something todo with drawing screen. SetActive should not affect this.

hi jsum.
Can u paste your code

hi jsum.
Can u paste your code

You mean text control rectangle should stay on screen even after I set the textctl to inactive state - ITEXTCTL_SetActive(pITextCtl, 0)?
Thanks

You mean text control rectangle should stay on screen even after I set the textctl to inactive state - ITEXTCTL_SetActive(pITextCtl, 0)?
Thanks

The rectangle will stay whether it is active true/false. But the cursor will move from one to another which is active true.

The rectangle will stay whether it is active true/false. But the cursor will move from one to another which is active true.

Yes. It's something in my code.
Works now.
Is it possible to change text color or background color?
And font or size? Couldn't find anything in BREW reference.
Thanks

Yes. It's something in my code.
Works now.
Is it possible to change text color or background color?
And font or size? Couldn't find anything in BREW reference.
Thanks

You can change the font color with
IDISPLAY_SetColor(pMe->m_pIDisplay, CLR_USER_TEXT, MAKE_RGB(0xff,0xff,0xff));
Also you can check CLR_USER_BACKGROUND to change bg color.
You have 3 different font size by default (AEE_FONT_NORMAL, AEE_FONT_BOLD, AEE_FONT_LARGE). You can also change different font size pixel wise using IDISPLAY_SetFont. Check the param for this API also.

You can change the font color with
IDISPLAY_SetColor(pMe->m_pIDisplay, CLR_USER_TEXT, MAKE_RGB(0xff,0xff,0xff));
Also you can check CLR_USER_BACKGROUND to change bg color.
You have 3 different font size by default (AEE_FONT_NORMAL, AEE_FONT_BOLD, AEE_FONT_LARGE). You can also change different font size pixel wise using IDISPLAY_SetFont. Check the param for this API also.

Looks like only AEE_FONT_NORMAL is working.
Thanks

Looks like only AEE_FONT_NORMAL is working.
Thanks

Again you are making mistake in the code. Give the code block here.

Again you are making mistake in the code. Give the code block here.

abhimanyu wrote:hi jsum.
Can u paste your code
static void displayform(form *pMe)
{
AECHAR *temp=L"dilip kumar";
AEERect rect;
AECHAR szBuf[50] = {0};
AEEEvent evt = EVT_KEY; // TextCtl only supports this event
uint16 wParam = AVK_RIGHT; // Supports SELECT, LEFT, RIGHT, UP, DOWN
uint32 dwParam = 0;
int nControlYLoc=0;
SETAEERECT (&rect, pMe->DeviceInfo.cxScreen/8, pMe->DeviceInfo.cyScreen/5,
pMe->DeviceInfo.cxScreen*3/4, pMe->DeviceInfo.cyScreen/4);
ISHELL_CreateInstance(pMe->pIShell ,AEECLSID_TEXTCTL,(void**) &pMe->textctl1);
if(pMe->textctl1)
{
// Set title of the menu control object
STR_TO_WSTR("Consumer's Gas Number ", szBuf, sizeof(szBuf));
ITEXTCTL_SetTitle(pMe->textctl1, NULL, NULL, szBuf);
// Set maximum text size supported by the text control object
ITEXTCTL_SetMaxSize(pMe->textctl1, 100);
// Set properties to have thetext control object have a
// frame and to have a multi-line text edit space.
ITEXTCTL_SetProperties(pMe->textctl1, TP_FRAME | TP_MULTILINE );
ITEXTCTL_SetRect(pMe->textctl1, &rect);
// Set the initial text of the text control object.
STR_TO_WSTR("Enter Text..", szBuf, sizeof(szBuf));
ITEXTCTL_SetText(pMe->textctl1, szBuf, sizeof (szBuf));
// Set the text control object so that the user can edit it's
// text content.
ITEXTCTL_SetActive (pMe->textctl1, TRUE);
// The ITextCtl object is NOT released at this point. The ITextCtl
// object is released in the HandleEvents function under EVT_KEY.
// This gives the user the ability to edit text on an active
// ITextCtl object. The ITextCtl object is released when the user
// selects the Up/Down arrow to move to another main menu selection
// or when the user exits the applet.
}
rect.y+=40;
ISHELL_CreateInstance(pMe->pIShell ,AEECLSID_TEXTCTL,(void**) &pMe->textctl2);
if(pMe->textctl2)
{
// Set title of the menu control object
STR_TO_WSTR("Distributor's Number(with STD code ", szBuf, sizeof(szBuf));
//ITEXTCTL_SetTitle(pMe->textctl2, NULL, NULL, szBuf);
if(!(ITEXTCTL_SetTitle(pMe->textctl2 ,APP_RES_FILE ,IDS_DISTRIBUTOR ,NULL)))
{
IDISPLAY_DrawText(pMe->pIDisplay,AEE_FONT_BOLD ,temp,-1,0,0,NULL,IDF_ALIGN_MIDDLE |IDF_ALIGN_CENTER );
IDISPLAY_Update(pMe->pIDisplay );
}
// Set maximum text size supported by the text control object
ITEXTCTL_SetMaxSize(pMe->textctl2, 100);
// Set properties to have thetext control object have a
// frame and to have a multi-line text edit space.
ITEXTCTL_SetProperties(pMe->textctl2, TP_FRAME | TP_MULTILINE );
ITEXTCTL_SetRect(pMe->textctl2, &rect);
// Set the initial text of the text control object.
STR_TO_WSTR("Enter Text..", szBuf, sizeof(szBuf));
ITEXTCTL_SetText(pMe->textctl2, szBuf, sizeof (szBuf));
// Set the text control object so that the user can edit it's
// text content.
//ITEXTCTL_SetActive (pMe->textctl2, TRUE);
// The ITextCtl object is NOT released at this point. The ITextCtl
// object is released in the HandleEvents function under EVT_KEY.
// This gives the user the ability to edit text on an active
// ITextCtl object. The ITextCtl object is released when the user
// selects the Up/Down arrow to move to another main menu selection
// or when the user exits the applet.
}
IDISPLAY_Update(pMe->pIDisplay );

abhimanyu wrote:hi jsum.
Can u paste your code
static void displayform(form *pMe)
{
AECHAR *temp=L"dilip kumar";
AEERect rect;
AECHAR szBuf[50] = {0};
AEEEvent evt = EVT_KEY; // TextCtl only supports this event
uint16 wParam = AVK_RIGHT; // Supports SELECT, LEFT, RIGHT, UP, DOWN
uint32 dwParam = 0;
int nControlYLoc=0;
SETAEERECT (&rect, pMe->DeviceInfo.cxScreen/8, pMe->DeviceInfo.cyScreen/5,
pMe->DeviceInfo.cxScreen*3/4, pMe->DeviceInfo.cyScreen/4);
ISHELL_CreateInstance(pMe->pIShell ,AEECLSID_TEXTCTL,(void**) &pMe->textctl1);
if(pMe->textctl1)
{
// Set title of the menu control object
STR_TO_WSTR("Consumer's Gas Number ", szBuf, sizeof(szBuf));
ITEXTCTL_SetTitle(pMe->textctl1, NULL, NULL, szBuf);
// Set maximum text size supported by the text control object
ITEXTCTL_SetMaxSize(pMe->textctl1, 100);
// Set properties to have thetext control object have a
// frame and to have a multi-line text edit space.
ITEXTCTL_SetProperties(pMe->textctl1, TP_FRAME | TP_MULTILINE );
ITEXTCTL_SetRect(pMe->textctl1, &rect);
// Set the initial text of the text control object.
STR_TO_WSTR("Enter Text..", szBuf, sizeof(szBuf));
ITEXTCTL_SetText(pMe->textctl1, szBuf, sizeof (szBuf));
// Set the text control object so that the user can edit it's
// text content.
ITEXTCTL_SetActive (pMe->textctl1, TRUE);
// The ITextCtl object is NOT released at this point. The ITextCtl
// object is released in the HandleEvents function under EVT_KEY.
// This gives the user the ability to edit text on an active
// ITextCtl object. The ITextCtl object is released when the user
// selects the Up/Down arrow to move to another main menu selection
// or when the user exits the applet.
}
rect.y+=40;
ISHELL_CreateInstance(pMe->pIShell ,AEECLSID_TEXTCTL,(void**) &pMe->textctl2);
if(pMe->textctl2)
{
// Set title of the menu control object
STR_TO_WSTR("Distributor's Number(with STD code ", szBuf, sizeof(szBuf));
//ITEXTCTL_SetTitle(pMe->textctl2, NULL, NULL, szBuf);
if(!(ITEXTCTL_SetTitle(pMe->textctl2 ,APP_RES_FILE ,IDS_DISTRIBUTOR ,NULL)))
{
IDISPLAY_DrawText(pMe->pIDisplay,AEE_FONT_BOLD ,temp,-1,0,0,NULL,IDF_ALIGN_MIDDLE |IDF_ALIGN_CENTER );
IDISPLAY_Update(pMe->pIDisplay );
}
// Set maximum text size supported by the text control object
ITEXTCTL_SetMaxSize(pMe->textctl2, 100);
// Set properties to have thetext control object have a
// frame and to have a multi-line text edit space.
ITEXTCTL_SetProperties(pMe->textctl2, TP_FRAME | TP_MULTILINE );
ITEXTCTL_SetRect(pMe->textctl2, &rect);
// Set the initial text of the text control object.
STR_TO_WSTR("Enter Text..", szBuf, sizeof(szBuf));
ITEXTCTL_SetText(pMe->textctl2, szBuf, sizeof (szBuf));
// Set the text control object so that the user can edit it's
// text content.
//ITEXTCTL_SetActive (pMe->textctl2, TRUE);
// The ITextCtl object is NOT released at this point. The ITextCtl
// object is released in the HandleEvents function under EVT_KEY.
// This gives the user the ability to edit text on an active
// ITextCtl object. The ITextCtl object is released when the user
// selects the Up/Down arrow to move to another main menu selection
// or when the user exits the applet.
}
IDISPLAY_Update(pMe->pIDisplay );

Hi Dilip,
Are you testing your code on simulator?
In simulators some time the font thing doesn't work properly.
Try using another simulator or execute your code on device. :)

Hi Dilip,
Are you testing your code on simulator?
In simulators some time the font thing doesn't work properly.
Try using another simulator or execute your code on device. :)

dear sir,
I have problem in handling multiple textbox controls , when i change the focus from one textbox to another textbox it is not get focus . but when there is some text in them , it work very fine , Also its setinputmode not working i want to enter only numbers. please help me
thanks in advance

dear sir,
I have problem in handling multiple textbox controls , when i change the focus from one textbox to another textbox it is not get focus . but when there is some text in them , it work very fine , Also its setinputmode not working i want to enter only numbers. please help me
thanks in advance

Which handset u r working on??

Which handset u r working on??

dear sir,
Actualy i am working on simulator and one more thing i want to ask how to deploy my application on real device

dear sir,
Actualy i am working on simulator and one more thing i want to ask how to deploy my application on real device

Hi Dilip,
Is it like you are facing this problem in all the simulator skins? :cool:
Why don't you post your sample code for fast response.

Hi Dilip,
Is it like you are facing this problem in all the simulator skins? :cool:
Why don't you post your sample code for fast response.

dear sir,
i am attaching the text file with this quote , please help fast its very urgent
Thanks

dear sir,
i am attaching the text file with this quote , please help fast its very urgent
Thanks

I think removing if(len) check would solve your problem

I think removing if(len) check would solve your problem

sir i had attached my code and yet i cant get your comments from you
please help me . its very urgent
thanks

sir i had attached my code and yet i cant get your comments from you
please help me . its very urgent
thanks

dilip kumar wrote:dear sir,
I have problem in handling multiple textbox controls , when i change the focus from one textbox to another textbox it is not get focus . but when there is some text in them , it work very fine , Also its setinputmode not working i want to enter only numbers. please help me
thanks in advance
Dear Dilip.,
I observed a strange behaviour in your code.
Even though u set the input mode to AEE_TM_NUMBERS u r unable to enter the numbers
Set the input mode just before drawing the text control
//cut line number 519 in your code and paste it just before drawing the text control
ITEXTCTL_SetInputMode(pMe->textctl1 ,AEE_TM_NUMBERS );
ITEXTCTL_Redraw(pMe->textctl1 );
It worked fine...I tested it...dont know why it is behaving like this.

dilip kumar wrote:dear sir,
I have problem in handling multiple textbox controls , when i change the focus from one textbox to another textbox it is not get focus . but when there is some text in them , it work very fine , Also its setinputmode not working i want to enter only numbers. please help me
thanks in advance
Dear Dilip.,
I observed a strange behaviour in your code.
Even though u set the input mode to AEE_TM_NUMBERS u r unable to enter the numbers
Set the input mode just before drawing the text control
//cut line number 519 in your code and paste it just before drawing the text control
ITEXTCTL_SetInputMode(pMe->textctl1 ,AEE_TM_NUMBERS );
ITEXTCTL_Redraw(pMe->textctl1 );
It worked fine...I tested it...dont know why it is behaving like this.

dilip kumar wrote:dear sir,
I have problem in handling multiple textbox controls , when i change the focus from one textbox to another textbox it is not get focus . but when there is some text in them , it work very fine , Also its setinputmode not working i want to enter only numbers. please help me
thanks in advance
and focus shifting problem of the text controls...take the help of DBGPRINTF() statements...It is good practice to use DBGPRINTF s when ever u get this kind of problems...Handle the MenuControl "IMENUCTL_HandleEvent(pMe->m_pSK, eCode, wParam, dwParam)" when ever u required not always.
Have a good day.....!

dilip kumar wrote:dear sir,
I have problem in handling multiple textbox controls , when i change the focus from one textbox to another textbox it is not get focus . but when there is some text in them , it work very fine , Also its setinputmode not working i want to enter only numbers. please help me
thanks in advance
and focus shifting problem of the text controls...take the help of DBGPRINTF() statements...It is good practice to use DBGPRINTF s when ever u get this kind of problems...Handle the MenuControl "IMENUCTL_HandleEvent(pMe->m_pSK, eCode, wParam, dwParam)" when ever u required not always.
Have a good day.....!

thanks very much sir for giving me valuable suggestions for textctl setinputmode. I had tested my application using dbgprintf as you told me but i notice that the control is going there but not staying there. As you have also notice that but i am very much surprised how it is working in reverse direction, as you told me about menuctl actually i want it to get the value of textbox when it was pressed
sir please ask your colleagues also about my problem
thanks in advance

thanks very much sir for giving me valuable suggestions for textctl setinputmode. I had tested my application using dbgprintf as you told me but i notice that the control is going there but not staying there. As you have also notice that but i am very much surprised how it is working in reverse direction, as you told me about menuctl actually i want it to get the value of textbox when it was pressed
sir please ask your colleagues also about my problem
thanks in advance

Delip if u r trying to draw multiple textctl in same screen then try to call Redarw for all the textctl at the end of the function.
Not all sdk have this problem, only with 3.x i was facing this problem.
BR
Nirmesh

Delip if u r trying to draw multiple textctl in same screen then try to call Redarw for all the textctl at the end of the function.
Not all sdk have this problem, only with 3.x i was facing this problem.
BR
Nirmesh

Dear Sir,
I had also tried redrawing the textctl at the end of function but my problem is as it is . is there any other solution ??
thanks in advance

Dear Sir,
I had also tried redrawing the textctl at the end of function but my problem is as it is . is there any other solution ??
thanks in advance

Delip once you set all the properies for all textctl then call redraw for each textctl one after another. It will surely work..
like this
ITEXTCTL_Redraw(textctl1);
ITEXTCTL_Redraw(textctl2);
ITEXTCTL_Redraw(textctl3);

Delip once you set all the properies for all textctl then call redraw for each textctl one after another. It will surely work..
like this
ITEXTCTL_Redraw(textctl1);
ITEXTCTL_Redraw(textctl2);
ITEXTCTL_Redraw(textctl3);

thanks sir for giving me valuable suggestion but the problem is as its, if you say I can attached my updated code as you told me
waiting for your favourable reply
dilip

thanks sir for giving me valuable suggestion but the problem is as its, if you say I can attached my updated code as you told me
waiting for your favourable reply
dilip

dear Rishabh sir
removing of if(len) doesnot solve the problem . waiting for your favourable suggestion
thanks sir
dilip

dear Rishabh sir
removing of if(len) doesnot solve the problem . waiting for your favourable suggestion
thanks sir
dilip

show me the code.

show me the code.

Dear sir,
I am attaching the code . if you comment the line setting the ITEXTCTL_SetText property of textctl2 you see the problem i had told .
thanks in advance
dilip kumar

Dear sir,
I am attaching the code . if you comment the line setting the ITEXTCTL_SetText property of textctl2 you see the problem i had told .
thanks in advance
dilip kumar

dear sir,
i had attached the code and waiting for your response, sir please help me
i am hoping that you had solved my problem
waiting for your favourable reply
thanks in advance
dilip kumar

dear sir,
i had attached the code and waiting for your response, sir please help me
i am hoping that you had solved my problem
waiting for your favourable reply
thanks in advance
dilip kumar

Dilip Try with the following changes, I tried it is working fine
Add the if condition before ITEXTCTL_HandleEvent in your form_HandleEvent as below
if(ITEXTCTL_IsActive(pMe->textctl1))
{
if (ITEXTCTL_HandleEvent(pMe->textctl1, eCode, wParam, dwParam))
{
//Add your code as it is
}

else if(ITEXTCTL_IsActive(pMe->textctl2))
{
if (ITEXTCTL_HandleEvent(pMe->textctl2, eCode, wParam, dwParam))
{
//Add your code as it is
}

Dilip Try with the following changes, I tried it is working fine
Add the if condition before ITEXTCTL_HandleEvent in your form_HandleEvent as below
if(ITEXTCTL_IsActive(pMe->textctl1))
{
if (ITEXTCTL_HandleEvent(pMe->textctl1, eCode, wParam, dwParam))
{
//Add your code as it is
}

else if(ITEXTCTL_IsActive(pMe->textctl2))
{
if (ITEXTCTL_HandleEvent(pMe->textctl2, eCode, wParam, dwParam))
{
//Add your code as it is
}

Thanks very much sir

Thanks very much sir