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

Developer

Forums

Forums:

Hi,

I have created one sample application with four PropContainers inside RootContainer. I have set listener function to the RootContainer. When I click on any PropContainer it invokes the Listener function, there I am getting Event codes like 4110, 4103, 4117. 

I am unable to find what Model Events are these. Can anyone tell me the probable "Model Events" with its equivalent code values?

 

Thanks in Advance

 

See "aeemodelhelpers.h" for details on model events.
4110: EVT_MDL_ROOTINVAL
4103: EVT_MDL_FOCUS_CHANGE
4117: EVT_MDL_DRAWCOMPLETE

See "aeemodelhelpers.h" for details on model events.
4110: EVT_MDL_ROOTINVAL
4103: EVT_MDL_FOCUS_CHANGE
4117: EVT_MDL_DRAWCOMPLETE

Thanks for the help.
I am expecting the event "EVT_MDL_WIDGETELEM_CLICK" when i click on any PropContainer. Is'nt it possible to get?

Thanks for the help.
I am expecting the event "EVT_MDL_WIDGETELEM_CLICK" when i click on any PropContainer. Is'nt it possible to get?

Can I know what is your exact requirement? why you need "CLICK" event? Are you looking for something like menu with 4 prop containers as its items?If yes, you can use list container.
 
Model events support differs from widget to widget. Also, if you enable touch on root container and pass the raw events to it, root container will automatically delgates the events to child widgets.

Can I know what is your exact requirement? why you need "CLICK" event? Are you looking for something like menu with 4 prop containers as its items?If yes, you can use list container.
 
Model events support differs from widget to widget. Also, if you enable touch on root container and pass the raw events to it, root container will automatically delgates the events to child widgets.

ya here it is, i have an sample app with four PropContainers with each consists of a RadioWidget and StaticWidget in it. i have set different user data to each PropContainers, i wanted to find out which Prop is been clicked so that i can set/reset RadioWidget state as on/off. I added listener to RootContainer (all the four PropContainers are inserted into RootContainer). so in this listener function can I find on which "Prop" i have clicked? 

ya here it is, i have an sample app with four PropContainers with each consists of a RadioWidget and StaticWidget in it. i have set different user data to each PropContainers, i wanted to find out which Prop is been clicked so that i can set/reset RadioWidget state as on/off. I added listener to RootContainer (all the four PropContainers are inserted into RootContainer). so in this listener function can I find on which "Prop" i have clicked? 

I think in this case listener to rootcontainer isn't required. If you have enabled touch on root container and doing proper event handling, click events are automatically sent to prop container and in turn, radio buttons. Radio button should get selected/deselected on clicking prop container area.

I think in this case listener to rootcontainer isn't required. If you have enabled touch on root container and doing proper event handling, click events are automatically sent to prop container and in turn, radio buttons. Radio button should get selected/deselected on clicking prop container area.

Sample code:
//part of applet structure
IRootContainer *picRootText;
IWidget *piwRootText;

//sending all the raw events to root container from applet handleevent
if(pMe->piwRootText)
return SUCCESS == IWidget_HandleEvent(pMe->piwRootText, eCode, wParam, dwParam);

//Draw widgets function
//Common variables
IDisplayCanvas *pDisplayCanvas;
AEERect rect;
int ret = 0; int i;
WidgetExtent pWExtent;
WidgetPos ppos;

//Prop container local variables
IPropContainer *picProp;
IWidget *piwProp;
IWidget *piwStat;
IWidget *piwRadio;
WidgetProp WidProp;

IModel *piViewModel = 0;

/*************************************************************/
// Create Root Container //
// //
/*************************************************************/
//Create display canvas and assign the display
ret = ISHELL_CreateInstance(pMe->piShell, AEECLSID_DisplayCanvas, (void**)&pDisplayCanvas);
IDisplayCanvas_SetDisplay(pDisplayCanvas, pMe->piDisplay);

//Create root container and assign the display canvas
ret = ISHELL_CreateInstance(pMe->piShell, AEECLSID_RootContainer, (void**)&pMe->picRootText);

ret = IRootContainer_QueryInterface(pMe->picRootText, AEEIID_IWidget, (void**)&pMe->piwRootText);

SETAEERECT(&rect, 0, 0, pMe->deviceInfo.cxScreen, pMe->deviceInfo.cyScreen);
IRootContainer_SetCanvas(pMe->picRootText, (ICanvas*)pDisplayCanvas, &rect);

// Set BG color
IWidget_SetBGColor(pMe->piwRootText, MAKE_RGBA(224, 224, 224, 255));
// Enable touch
IWidget_EnableTouch(pMe->piwRootText);

/*************************************************************/
// Create Prop Container //
// //
/*************************************************************/
for(i = 0; i < 3;i++)//you can have seperate static/radio widgets and prop container pointers.
{
ret = ISHELL_CreateInstance(pMe->piShell, AEECLSID_PropContainer, (void**)&picProp);

WidProp.bVisible = TRUE;
WidProp.prop = WIDGET_KEEP_EXTENT;

ret = IPropContainer_QueryInterface(picProp, AEEIID_IWidget, (void**)&piwProp);

IWidget_SetLayoutStyle(piwProp, LAYOUT_HORZ);
IWidget_SetBGColor(piwProp, MAKE_RGBA(198,198,198,255));
pWExtent.height = rect.dy - 20;
pWExtent.width = rect.dx;
IWidget_SetExtent(piwProp, &pWExtent);

// Create Static and radio widgets //
ret = ISHELL_CreateInstance(pMe->piShell, AEECLSID_RadioWidget, (void**)&piwRadio);
IWidget_SetPreferredExtent(piwRadio, NULL);

// radio widgets - hook view models together
if(!piViewModel)
IWidget_GetViewModel(piwRadio, &piViewModel);
else
IWidget_SetViewModel(piwRadio, piViewModel);

IPropContainer_Insert(picProp, piwRadio, WIDGET_ZNORMAL, &WidProp);
IPropContainer_SetPaddingProportional(picProp, WIDGET_ZNORMAL, 0, 5);

ret = ISHELL_CreateInstance(pMe->piShell, AEECLSID_StaticWidget, (void**)&piwStat);

IWIDGET_SetText(piwStat, L"Favorite color:", FALSE);//can add different texts for statric widgets
IWidget_SetFGColor(piwStat, MAKE_RGBA(0,255,0,0));
IWidget_SetFlags(piwStat, SWF_WRAPTEXT);
pWExtent.height = 20;
pWExtent.width = rect.dx - 60;
IWidget_SetExtent(piwStat, &pWExtent);

IPropContainer_Insert(picProp, piwStat, WIDGET_ZNORMAL, &WidProp);
IPropContainer_SetPaddingProportional(picProp, WIDGET_ZNORMAL, 0, 5);

ppos.bVisible = TRUE;
ppos.x = 0;
ppos.y = i*30;
IRootContainer_Insert(pMe->picRootText, piwProp, WIDGET_ZNORMAL, &ppos);

RELEASEIF(piwStat);
RELEASEIF(piwRadio);
RELEASEIF(picProp);
RELEASEIF(piwProp);
}

// Clean up. Release local references.
RELEASEIF(pDisplayCanvas);
RELEASEIF(piViewModel);

Sample code:
//part of applet structure
IRootContainer *picRootText;
IWidget *piwRootText;

//sending all the raw events to root container from applet handleevent
if(pMe->piwRootText)
return SUCCESS == IWidget_HandleEvent(pMe->piwRootText, eCode, wParam, dwParam);

//Draw widgets function
//Common variables
IDisplayCanvas *pDisplayCanvas;
AEERect rect;
int ret = 0; int i;
WidgetExtent pWExtent;
WidgetPos ppos;

//Prop container local variables
IPropContainer *picProp;
IWidget *piwProp;
IWidget *piwStat;
IWidget *piwRadio;
WidgetProp WidProp;

IModel *piViewModel = 0;

/*************************************************************/
// Create Root Container //
// //
/*************************************************************/
//Create display canvas and assign the display
ret = ISHELL_CreateInstance(pMe->piShell, AEECLSID_DisplayCanvas, (void**)&pDisplayCanvas);
IDisplayCanvas_SetDisplay(pDisplayCanvas, pMe->piDisplay);

//Create root container and assign the display canvas
ret = ISHELL_CreateInstance(pMe->piShell, AEECLSID_RootContainer, (void**)&pMe->picRootText);

ret = IRootContainer_QueryInterface(pMe->picRootText, AEEIID_IWidget, (void**)&pMe->piwRootText);

SETAEERECT(&rect, 0, 0, pMe->deviceInfo.cxScreen, pMe->deviceInfo.cyScreen);
IRootContainer_SetCanvas(pMe->picRootText, (ICanvas*)pDisplayCanvas, &rect);

// Set BG color
IWidget_SetBGColor(pMe->piwRootText, MAKE_RGBA(224, 224, 224, 255));
// Enable touch
IWidget_EnableTouch(pMe->piwRootText);

/*************************************************************/
// Create Prop Container //
// //
/*************************************************************/
for(i = 0; i < 3;i++)//you can have seperate static/radio widgets and prop container pointers.
{
ret = ISHELL_CreateInstance(pMe->piShell, AEECLSID_PropContainer, (void**)&picProp);

WidProp.bVisible = TRUE;
WidProp.prop = WIDGET_KEEP_EXTENT;

ret = IPropContainer_QueryInterface(picProp, AEEIID_IWidget, (void**)&piwProp);

IWidget_SetLayoutStyle(piwProp, LAYOUT_HORZ);
IWidget_SetBGColor(piwProp, MAKE_RGBA(198,198,198,255));
pWExtent.height = rect.dy - 20;
pWExtent.width = rect.dx;
IWidget_SetExtent(piwProp, &pWExtent);

// Create Static and radio widgets //
ret = ISHELL_CreateInstance(pMe->piShell, AEECLSID_RadioWidget, (void**)&piwRadio);
IWidget_SetPreferredExtent(piwRadio, NULL);

// radio widgets - hook view models together
if(!piViewModel)
IWidget_GetViewModel(piwRadio, &piViewModel);
else
IWidget_SetViewModel(piwRadio, piViewModel);

IPropContainer_Insert(picProp, piwRadio, WIDGET_ZNORMAL, &WidProp);
IPropContainer_SetPaddingProportional(picProp, WIDGET_ZNORMAL, 0, 5);

ret = ISHELL_CreateInstance(pMe->piShell, AEECLSID_StaticWidget, (void**)&piwStat);

IWIDGET_SetText(piwStat, L"Favorite color:", FALSE);//can add different texts for statric widgets
IWidget_SetFGColor(piwStat, MAKE_RGBA(0,255,0,0));
IWidget_SetFlags(piwStat, SWF_WRAPTEXT);
pWExtent.height = 20;
pWExtent.width = rect.dx - 60;
IWidget_SetExtent(piwStat, &pWExtent);

IPropContainer_Insert(picProp, piwStat, WIDGET_ZNORMAL, &WidProp);
IPropContainer_SetPaddingProportional(picProp, WIDGET_ZNORMAL, 0, 5);

ppos.bVisible = TRUE;
ppos.x = 0;
ppos.y = i*30;
IRootContainer_Insert(pMe->picRootText, piwProp, WIDGET_ZNORMAL, &ppos);

RELEASEIF(piwStat);
RELEASEIF(piwRadio);
RELEASEIF(picProp);
RELEASEIF(piwProp);
}

// Clean up. Release local references.
RELEASEIF(pDisplayCanvas);
RELEASEIF(piViewModel);

hi ,
Whats the Model Event for event code 4114?

hi ,
Whats the Model Event for event code 4114?

Please see AEEModelHelpers.h file. 4114: EVT_MDL_WIDGETELEM_STATE

Please see AEEModelHelpers.h file. 4114: EVT_MDL_WIDGETELEM_STATE

hi,
I Assigned one listener to XYContainer and if I select any item Inside it will generate EVT_MDL_FOCUS_CHANGE event, no other events. I am unable to get any Event if I click on Focused element(the element which I have selected on previous click). Is there any way to get Events on Selecting Focused Element(using XYContainer)?
Thanks in Advance

hi,
I Assigned one listener to XYContainer and if I select any item Inside it will generate EVT_MDL_FOCUS_CHANGE event, no other events. I am unable to get any Event if I click on Focused element(the element which I have selected on previous click). Is there any way to get Events on Selecting Focused Element(using XYContainer)?
Thanks in Advance

IXYContainer doesn't send selection events. You can find the widget at the point of touch using IWidget_GetWidgetAtCoordinate() or IWidget_FindElement(). Then you can use IWidget_HasFocus() to know if it has been selected. somehting like this:
case EVT_POINTER_DOWN:
IWidget *piwRadio = NULL;
boolean bSelected = 0;
int x, y;
GetXY(dwParam, &x, &y);
IWidget_GetWidgetAtCoordinate(pMe->piwXYCont, &x, &y, &piwRadio);
if(piwRadio)
IWidget_HasFocus(piwRadio, &bSelected);Otherwise, you need to traverse through entire xy container and then use IWidget_HaFocus to know which widget got selected.

IXYContainer doesn't send selection events. You can find the widget at the point of touch using IWidget_GetWidgetAtCoordinate() or IWidget_FindElement(). Then you can use IWidget_HasFocus() to know if it has been selected. somehting like this:
case EVT_POINTER_DOWN:
IWidget *piwRadio = NULL;
boolean bSelected = 0;
int x, y;
GetXY(dwParam, &x, &y);
IWidget_GetWidgetAtCoordinate(pMe->piwXYCont, &x, &y, &piwRadio);
if(piwRadio)
IWidget_HasFocus(piwRadio, &bSelected);Otherwise, you need to traverse through entire xy container and then use IWidget_HaFocus to know which widget got selected.

Creating the N number of radio widgets using for loop for(i=0;i
Then later how to get the selection for which radio widget has been selected. Which APIs should be used to check the selection of radio widget. If Radio Widgets is somthing kept global like pMe->Radio then can be used as IValueModel_GetBool(pMe->Radio) but if the pointer is local and relased then how to get know it is selected or not. In the above sample code for creating radio widgets all radio widgets pointers has been relesed.
Pls provide sample code for if N number of radio widgets been created then how get the selected radio widget. This N dynamically changes during run time. 
Thanks

Creating the N number of radio widgets using for loop for(i=0;i
Then later how to get the selection for which radio widget has been selected. Which APIs should be used to check the selection of radio widget. If Radio Widgets is somthing kept global like pMe->Radio then can be used as IValueModel_GetBool(pMe->Radio) but if the pointer is local and relased then how to get know it is selected or not. In the above sample code for creating radio widgets all radio widgets pointers has been relesed.
Pls provide sample code for if N number of radio widgets been created then how get the selected radio widget. This N dynamically changes during run time. 
Thanks

You will insert those radio buttons in some kind of container for display. So if you have that container you can use _GetWidget method of that container to traverse through list of radio buttons. Or you can use IWidget_GetWidgetAtCoordinate() to know which widget is at particular coordinates and then check focus as mentioned above.
If you want notification on selection of radio button, you need to register model listener.

You will insert those radio buttons in some kind of container for display. So if you have that container you can use _GetWidget method of that container to traverse through list of radio buttons. Or you can use IWidget_GetWidgetAtCoordinate() to know which widget is at particular coordinates and then check focus as mentioned above.
If you want notification on selection of radio button, you need to register model listener.

Thanks for the reply!
I have used here XYContainer to insert Radio Widgets.
The same i have used IXYContainer_GetWidget to get the selection of Which Radio Widget.
Here there are N number of Radio Widgets inserted into XYContainer as Radio with Static widgets are inserted as at last of the Container stack. (topmost). So retriving the topmost widget. As it would be static then next radio so called GetWidget twice.
for(i=0; im_Settingsdata.m_pSetGrpListCont, WIDGET_ZTOPMOST, FALSE, FALSE);

piwRadio = IXYContainer_GetWidget(pMe->m_Settingsdata.m_pSetGrpListCont, WIDGET_ZTOPMOST, FALSE, FALSE);

// get the model and state for radio Widget
if (AEE_SUCCESS != IWidget_GetModel(piwRadio, AEEIID_IValueModel, (IModel **)&pRadioValModel)) {
return;
}
radio_selected = IValueModel_GetBool(pRadioValModel);

if(radio_selected == TRUE)
{
//Do the Stuff
break;
}
}  Here when we run the application only the last Radio Widget if selected retrives TRUE. For all the other previous radio widgets if selected retrives false.
When debugged the code, here i can see the same widget pointer addrees for ex(0x05980C10) is retrived for all the times when IXYContainer_GetWidget is called. 
As it should be different pointers for different Radio Widgets.
Please Let if any wrong implementation is done.
Thanks
 
 

Thanks for the reply!
I have used here XYContainer to insert Radio Widgets.
The same i have used IXYContainer_GetWidget to get the selection of Which Radio Widget.
Here there are N number of Radio Widgets inserted into XYContainer as Radio with Static widgets are inserted as at last of the Container stack. (topmost). So retriving the topmost widget. As it would be static then next radio so called GetWidget twice.
for(i=0; im_Settingsdata.m_pSetGrpListCont, WIDGET_ZTOPMOST, FALSE, FALSE);

piwRadio = IXYContainer_GetWidget(pMe->m_Settingsdata.m_pSetGrpListCont, WIDGET_ZTOPMOST, FALSE, FALSE);

// get the model and state for radio Widget
if (AEE_SUCCESS != IWidget_GetModel(piwRadio, AEEIID_IValueModel, (IModel **)&pRadioValModel)) {
return;
}
radio_selected = IValueModel_GetBool(pRadioValModel);

if(radio_selected == TRUE)
{
//Do the Stuff
break;
}
}  Here when we run the application only the last Radio Widget if selected retrives TRUE. For all the other previous radio widgets if selected retrives false.
When debugged the code, here i can see the same widget pointer addrees for ex(0x05980C10) is retrived for all the times when IXYContainer_GetWidget is called. 
As it should be different pointers for different Radio Widgets.
Please Let if any wrong implementation is done.
Thanks
 
 

Thanks for the reply!
I have used here XYContainer to insert Radio Widgets.
The same i have used IXYContainer_GetWidget to get the selection of Which Radio Widget.
Here there are N number of Radio Widgets inserted into XYContainer as Radio with Static widgets are inserted as at last of the Container stack. (topmost). So retriving the topmost widget. As it would be static then next radio so called GetWidget twice.
for(i=0; im_Settingsdata.m_pSetGrpListCont, WIDGET_ZTOPMOST, FALSE, FALSE);

piwRadio = IXYContainer_GetWidget(pMe->m_Settingsdata.m_pSetGrpListCont, WIDGET_ZTOPMOST, FALSE, FALSE);

// get the model and state for radio Widget
if (AEE_SUCCESS != IWidget_GetModel(piwRadio, AEEIID_IValueModel, (IModel **)&pRadioValModel)) {
return;
}
radio_selected = IValueModel_GetBool(pRadioValModel);

if(radio_selected == TRUE)
{
//Do the Stuff
break;
}
}  Here when we run the application only the last Radio Widget if selected retrives TRUE. For all the other previous radio widgets if selected retrives false.
When debugged the code, here i can see the same widget pointer addrees for ex(0x05980C10) is retrived for all the times when IXYContainer_GetWidget is called. 
As it should be different pointers for different Radio Widgets.
Please Let if any wrong implementation is done.
Thanks
 
 

Thanks for the reply!
I have used here XYContainer to insert Radio Widgets.
The same i have used IXYContainer_GetWidget to get the selection of Which Radio Widget.
Here there are N number of Radio Widgets inserted into XYContainer as Radio with Static widgets are inserted as at last of the Container stack. (topmost). So retriving the topmost widget. As it would be static then next radio so called GetWidget twice.
for(i=0; im_Settingsdata.m_pSetGrpListCont, WIDGET_ZTOPMOST, FALSE, FALSE);

piwRadio = IXYContainer_GetWidget(pMe->m_Settingsdata.m_pSetGrpListCont, WIDGET_ZTOPMOST, FALSE, FALSE);

// get the model and state for radio Widget
if (AEE_SUCCESS != IWidget_GetModel(piwRadio, AEEIID_IValueModel, (IModel **)&pRadioValModel)) {
return;
}
radio_selected = IValueModel_GetBool(pRadioValModel);

if(radio_selected == TRUE)
{
//Do the Stuff
break;
}
}  Here when we run the application only the last Radio Widget if selected retrives TRUE. For all the other previous radio widgets if selected retrives false.
When debugged the code, here i can see the same widget pointer addrees for ex(0x05980C10) is retrived for all the times when IXYContainer_GetWidget is called. 
As it should be different pointers for different Radio Widgets.
Please Let if any wrong implementation is done.
Thanks
 
 

You got same widget everytime because with each call you tried to get previous widget with referene to topmost widget, you are not advancing the reference. Here is how I would traverse through list of widgets in XY container:
1. Get first widget using IXYContainer_GetFirstWidget().
2. Use widget retrieved above as reference and get next widget using IXYContainer_GetWidget(). pwRef ishould be widget retrieved in 1 and bNext should be TRUE.
3. repeat step 2 with reference widget being the previous widget retrieved until call returns NULL.
 
see IXYContainer_GetWidget() API reference comments section for details.

You got same widget everytime because with each call you tried to get previous widget with referene to topmost widget, you are not advancing the reference. Here is how I would traverse through list of widgets in XY container:
1. Get first widget using IXYContainer_GetFirstWidget().
2. Use widget retrieved above as reference and get next widget using IXYContainer_GetWidget(). pwRef ishould be widget retrieved in 1 and bNext should be TRUE.
3. repeat step 2 with reference widget being the previous widget retrieved until call returns NULL.
 
see IXYContainer_GetWidget() API reference comments section for details.

Thanks a lot got it!
The Radio widgets displayed is very small in size, It is very difficult to select the Radio buttons on the device. Can we increase the size of the Radio Buttons displayed(the round in shape)?
Thanks
 
 

Thanks a lot got it!
The Radio widgets displayed is very small in size, It is very difficult to select the Radio buttons on the device. Can we increase the size of the Radio Buttons displayed(the round in shape)?
Thanks
 
 

Yes, you can use your own image strip for radio button widget. Need just 2 calls-
//set custom image strip
IWidget_SetPropImageStrip(piwc1, pIBtmp);//IBitmap*
IWidget_SetNFrames(piwc1, nFrames);//number of frames in bitmap
You can use ISHELL_LoadResBitmap to load bitmap from resource file.
Here is details from API reference on image strip:PROP_IMAGESTRIP         Specifies the Bitmap image resource that will represent the three (or fewer)                        different frames for the check or radio widget.  If this property is not                        set, it will default to IDB_CHECKSTRIP or IDB_RADIOSTRIP.                            IWidget_SetPropImageStripPROP_IMAGE_NFRAMES      Specifies the number of frames that the image resource set with                         PROP_IMAGESTRIP contains. The valid values for this property are zero one                         two or three and they represent the following.                        0 - No imagestrip will be used by the widget, although it will retain its                           reference to the previously loaded image strip should one be loaded prior                           to setting this property.                        1 - The widget will treat the image strip as it was exactly one frame, which                           will be used as the check mark for the checkbox or radio button.                        2 - The widget will treat the image strip as two tiles.  The first tile                           specifies the image that will be used as a checkmark.  The second                           represents a border.                        3 - The widget will treat the image strip as normal with three tiles.  The                           three tiles will be (in order): the check mark, the inactive border, the                           active border.

Yes, you can use your own image strip for radio button widget. Need just 2 calls-
//set custom image strip
IWidget_SetPropImageStrip(piwc1, pIBtmp);//IBitmap*
IWidget_SetNFrames(piwc1, nFrames);//number of frames in bitmap
You can use ISHELL_LoadResBitmap to load bitmap from resource file.
Here is details from API reference on image strip:PROP_IMAGESTRIP         Specifies the Bitmap image resource that will represent the three (or fewer)                        different frames for the check or radio widget.  If this property is not                        set, it will default to IDB_CHECKSTRIP or IDB_RADIOSTRIP.                            IWidget_SetPropImageStripPROP_IMAGE_NFRAMES      Specifies the number of frames that the image resource set with                         PROP_IMAGESTRIP contains. The valid values for this property are zero one                         two or three and they represent the following.                        0 - No imagestrip will be used by the widget, although it will retain its                           reference to the previously loaded image strip should one be loaded prior                           to setting this property.                        1 - The widget will treat the image strip as it was exactly one frame, which                           will be used as the check mark for the checkbox or radio button.                        2 - The widget will treat the image strip as two tiles.  The first tile                           specifies the image that will be used as a checkmark.  The second                           represents a border.                        3 - The widget will treat the image strip as normal with three tiles.  The                           three tiles will be (in order): the check mark, the inactive border, the                           active border.

Hi Atul,
 
Having a query regarding static Widget.
 
I am using Static Widget to draw a string. I have set a timer so that static widget is called for every 5 secs to redraw with new string.
 
First i have created a static Widget and inserted into XYContainer. Then passing with new string calling these 2 APIS 
IWidget_GetModel(pWidget, AEEIID_IValueModel, (IModel**)((void*)&pValModel));
 
 
IValueModel_SetValue(pValModel, (void*)pszText, WSTRLEN(pszText), pfnFree); 
then IWidget_Invalidate();The problem i am facing is it draws the new string correctly after specified time as set by timer But Some of the times it will not draw or print the string properly. Suppose I am printing 10 strings.In that 2 or 3 string will not print properly just ".." dot will be printed.Please let me know to redraw a static widget. IWidget_Invalite API to be called?Is this correct to redraw the widget with new contents. Please let me know ASAP.Thanks 

Hi Atul,
 
Having a query regarding static Widget.
 
I am using Static Widget to draw a string. I have set a timer so that static widget is called for every 5 secs to redraw with new string.
 
First i have created a static Widget and inserted into XYContainer. Then passing with new string calling these 2 APIS 
IWidget_GetModel(pWidget, AEEIID_IValueModel, (IModel**)((void*)&pValModel));
 
 
IValueModel_SetValue(pValModel, (void*)pszText, WSTRLEN(pszText), pfnFree); 
then IWidget_Invalidate();The problem i am facing is it draws the new string correctly after specified time as set by timer But Some of the times it will not draw or print the string properly. Suppose I am printing 10 strings.In that 2 or 3 string will not print properly just ".." dot will be printed.Please let me know to redraw a static widget. IWidget_Invalite API to be called?Is this correct to redraw the widget with new contents. Please let me know ASAP.Thanks 

Restating same as replied via E-mail:
Looks like problem with IValueModel_SetValue() call… may be static widget is not able to decode the string properly. Use IVALUEMODEL_SetText. No need to use _Invalidate() as changes in related model triggers that internally. Below code worked for me.
static void mytimer(void *p)
{
AECHAR wstr1[30];
IValueModel *pValueModel;

staticwgtapp * pMe = (staticwgtapp*)p;
WSPRINTF(wstr1, 30, L"Testing... %d", pMe->nCount);
pMe->nCount++;
IWidget_GetModel(pMe->piwText, AEEIID_IValueModel, CAST(IModel**, &pValueModel));
IVALUEMODEL_SetText(pValueModel, wstr1, -1);

if(pMe->nCount > 10)
{
ISHELL_CancelTimer(pMe->piShell, NULL, NULL);
return;
}

ISHELL_SetTimer(pMe->piShell, 5000, (PFNNOTIFY)mytimer, (void*)pMe);

Restating same as replied via E-mail:
Looks like problem with IValueModel_SetValue() call… may be static widget is not able to decode the string properly. Use IVALUEMODEL_SetText. No need to use _Invalidate() as changes in related model triggers that internally. Below code worked for me.
static void mytimer(void *p)
{
AECHAR wstr1[30];
IValueModel *pValueModel;

staticwgtapp * pMe = (staticwgtapp*)p;
WSPRINTF(wstr1, 30, L"Testing... %d", pMe->nCount);
pMe->nCount++;
IWidget_GetModel(pMe->piwText, AEEIID_IValueModel, CAST(IModel**, &pValueModel));
IVALUEMODEL_SetText(pValueModel, wstr1, -1);

if(pMe->nCount > 10)
{
ISHELL_CancelTimer(pMe->piShell, NULL, NULL);
return;
}

ISHELL_SetTimer(pMe->piShell, 5000, (PFNNOTIFY)mytimer, (void*)pMe);