MultiListItem text problem(solved)

haibo19981984

09-03-2011 08:12:53

Just as image.
The item text displays partly.
My layout:

<Widget type="MultiListBox" skin="MultiListBox" position="5 150 280 215" layer="Back" name="myMultiList">
<Widget type="MultiListItem" skin="" position="0 0 40 186">
<Property key="Caption" value="Number"/>
<Property key="ItemResizingPolicy" value="Fixed"/>
<Property key="ItemWidth" value="40"/>
</Widget>
<Widget type="MultiListItem" skin="" position="40 0 200 186">
<Property key="Caption" value="ServerName"/>
<Property key="ItemResizingPolicy" value="Fixed"/>
<Property key="ItemWidth" value="200"/>
</Widget>
<Widget type="MultiListItem" skin="" position="240 0 40 186">
<Property key="Caption" value="State"/>
<Property key="ItemResizingPolicy" value="Fixed"/>
<Property key="ItemWidth" value="40"/>
</Widget>
</Widget>

I edit the skip script : Stretch -> HCenter VStretch

<Resource type="ResourceSkin" name="ListBoxItemSkin" size="43 10" texture="MyGUI_BlueWhiteSkins.png">
...
<BasisSkin type="SimpleText" offset="2 2 39 6" align="HCenter VStretch">
<State name="disabled" colour="0.5 0.5 0.5" shift="0"/>
<State name="normal" colour="0 0 0" shift="0"/>
<State name="highlighted" colour="0 0 0" shift="0"/>
<State name="pushed" colour="0 0 0" shift="0"/>
<State name="disabled_checked" colour="0.5 0.5 0.5" shift="0"/>
<State name="normal_checked" colour="0 0 0" shift="0"/>
<State name="highlighted_checked" colour="0 0 0" shift="0"/>
<State name="pushed_checked" colour="0 0 0" shift="0"/>
</BasisSkin>
</Resource>

My code:

m_pMultiList = m_pGUI->findWidget<MyGUI::MultiList>("myMultiList");
m_pMultiList->addItem("1", 1);
m_pMultiList->addItem("2", 2);
m_pMultiList->setSubItemNameAt(1, 0, L"Server1Server1Server1");
m_pMultiList->setSubItemNameAt(1, 1, L"Server2");
m_pMultiList->setSubItemNameAt(2, 0, L"good");
m_pMultiList->setSubItemNameAt(2, 1, L"normal");

Is it normal?

Altren

10-03-2011 21:47:09

You changed tex are align, so it is not increasing it's size anymore. If you need centered text you should change text align, not text area.

You need ListBoxItem as I told earlier, but not ListBoxItemSkin

haibo19981984

11-03-2011 02:07:15

Thanks!