I'm attempting to resize the width and height of a combobox button with no success.
Code: Select all
/*
** tagFontType
*/
CEGUI::URect tagTestRect(CEGUI::UDim(0.0, 10), CEGUI::UDim(0.0, 10), CEGUI::UDim(0.0, 10), CEGUI::UDim(0.0, 10));
CEGUI::Combobox *tagFontType = (CEGUI::Combobox*)
CEGUI::WindowManager::getSingleton().createWindow("SVTLook/Combobox", at+strTagFontType);
assert(tagFontType && "ActorTypeEditor::showEditor: failed to create tagFontType");
SystemFontMgr *tSystemFontMgr = SystemFontMgr::getSingletonPtr();
assert(tSystemFontMgr && "ActorTypeEditor::showEditor: failed to get a pointer to the system font manager");
SystemFontMgr::SystemFontTypeMapIterator sftItr = tSystemFontMgr->getSystemFontTypeMapIterator();
while(sftItr.hasMoreElements())
{
SystemFontType sft = sftItr.getNext();
int count = 0;
CEGUI::colour listboxTextColor(1.0, 0.0, 1.0, 1.0);
std::string font = sft.name;
if(tagFontType->getItemCount() <= 0 ||
tagFontType->findItemWithText(font, tagFontType->getListboxItemFromIndex(0)) == NULL)
{
CEGUI::ListboxTextItem* listboxItem = new CEGUI::ListboxTextItem(font.c_str(), count++);
assert(listboxItem && "ActorTypeEditor::showEditor: failed to create listboxtext item");
listboxItem->setTextColours(listboxTextColor, listboxTextColor, listboxTextColor, listboxTextColor);
listboxItem->setSelectionBrushImage("SVTLook", "Background");
// We lose the pointer here, but the memory will be cleaned up when we delete the fontCombo
tagFontType->addItem(listboxItem);
}
}
tagFontType->setText(dbc.tagFontType);
tabWindow->addChildWindow(tagFontType);
tagFontType->setPosition(CEGUI::UVector2(CEGUI::UDim(0.0, 20), tagLabelRect.d_min.d_y));
tagFontType->getEditbox()->setHeight(CEGUI::UDim(0.0, 10));
tagFontType->getEditbox()->setWidth(CEGUI::UDim(0.0, 10));
tagFontType->getPushButton()->setArea(tagTestRect);
tagFontType->setArea(tagColorRect);
tagFontType->setInheritsAlpha(false);
tagFontType->subscribeEvent(CEGUI::Combobox::EventTextSelectionChanged, CEGUI::Event::Subscriber(&ActorTypeEditor::handleFontChange, this));
std::string fontNameStr = CEGUI::System::getSingleton().getDefaultFont()->getProperty("Name").c_str();
As one can see, I created a test URect and tried to set the area of the PushButton to that. I have also tried to use the following with no success...
tagFontType->getPushButton()->setWidth(CEGUI::UDim(0.0, 10.0));
tagFontType->getPushButton()->setHeight(CEGUI::UDim(0.0, 10.0));
Any help would be much appreciated!

