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

Developer

Forums

Forums:

Hi,
I have been struggling with the list widget and I have realized that even though it wraps a static widget, the IWidget_SetExtentof the list widget doesn't set the given extents to the widget itself.
What I have found out is that instead the IWidget_SetItemHeightand IWidget_SetHintRows rule the size of the list widget.
Is this correct at all or maybe I am doing something wrong?

Furthermore, can anyone explain to following description which can be found in the API's doc:

Quote:1) Call ISHELL_CreateInstance() with a class ID of either AEECLSID_ListWidget, AEECLSID_PickWidget or AEECLSID_GridWidget
2) Call IWidget_SetModel() to attach the appropriate model to the list
3) Create the item widget that will be wrapped by the list widget, and identify the value model that is to be associated with this widget
4) Retrieve the height of the item widget by calling IWidget_GetPreferredExtent(), then set the height of the list widget by calling IWidget_SetItemHeight()
5) Call IDecorator_SetWidget() to wrap the list widget around the item widget

In particular the point #3: why another value model is needed to be defined for the widget that will be wrapped by the list widget?

I am using a static widget but I cannot understand why I should set a value model for it, when I am already using a vector model for the list widget.

Thank you.

The value model is the static widget's value model. Since you're just using a static widget, which already has a value model, you don't need to create a value model for the item widget.

The value model is the static widget's value model. Since you're just using a static widget, which already has a value model, you don't need to create a value model for the item widget.

Thank you ErikB, that makes sense.
I still don't understand why setting the extent of the list widget doesn't work properly and instead the actual extents of the widget are determined by the combination of the IWidget_SetItemHeight and IWidget_SetHintRows.
I hope someone can enlighten me on this.
Thanks.

Thank you ErikB, that makes sense.
I still don't understand why setting the extent of the list widget doesn't work properly and instead the actual extents of the widget are determined by the combination of the IWidget_SetItemHeight and IWidget_SetHintRows.
I hope someone can enlighten me on this.
Thanks.

hi m new to this BREW i tried to build list widet,
1.first created instance of root container
2.display canvas
nw need to create lsit widet
1. called create instance with AEECLSID_ListWidget class id
ISHELL_CreateInstance(pMe->piShell, AEECLSID_ListWidget,(void**)&piw);
2.den created item widget
ISHELL_CreateInstance(pMe->piShell, AEECLSID_StaticWidget,(void**)&pisw);
ISHELL_CreateInstance(pMe->piShell, AEECLSID_VectorModel,(void**)&pivm);
3.den set model
IWidget_SetModel(piw, IVectorModel_TO_IMODEL(pivm));
4.IDecorator_SetWidget((IDecorator *)(void*) piw, pisw);
5.IWidget_GetPreferredExtent(pisw, &weStatic);
ERR_TRY( IWidget_SetItemWidth(piw, weStatic.width));
ERR_TRY( IWidget_SetItemHeight(piw, weStatic.height));
n i had declared
IWidget *pisw=0;
IWidget *pivm=0;
IWidget *piw=0; in InitAppData function
but its giving error as
1>widgets.obj : error LNK2019: unresolved external symbol _IVectorModel_TO_IMODEL referenced in function _widgets_InitAppData
CAN PLEASE ANY ONE HELP ME I REALLY DNT KNW WAT TO DO.... PLEASE PLEASE....

hi m new to this BREW i tried to build list widet,
1.first created instance of root container
2.display canvas
nw need to create lsit widet
1. called create instance with AEECLSID_ListWidget class id
ISHELL_CreateInstance(pMe->piShell, AEECLSID_ListWidget,(void**)&piw);
2.den created item widget
ISHELL_CreateInstance(pMe->piShell, AEECLSID_StaticWidget,(void**)&pisw);
ISHELL_CreateInstance(pMe->piShell, AEECLSID_VectorModel,(void**)&pivm);
3.den set model
IWidget_SetModel(piw, IVectorModel_TO_IMODEL(pivm));
4.IDecorator_SetWidget((IDecorator *)(void*) piw, pisw);
5.IWidget_GetPreferredExtent(pisw, &weStatic);
ERR_TRY( IWidget_SetItemWidth(piw, weStatic.width));
ERR_TRY( IWidget_SetItemHeight(piw, weStatic.height));
n i had declared
IWidget *pisw=0;
IWidget *pivm=0;
IWidget *piw=0; in InitAppData function
but its giving error as
1>widgets.obj : error LNK2019: unresolved external symbol _IVectorModel_TO_IMODEL referenced in function _widgets_InitAppData
CAN PLEASE ANY ONE HELP ME I REALLY DNT KNW WAT TO DO.... PLEASE PLEASE....