skin-able combo box patch

tdev

03-06-2008 09:14:15




Index: QuickGUIComboBox.cpp ===================================================================
--- QuickGUIComboBox.cpp (revision 1172)
+++ QuickGUIComboBox.cpp (working copy)
@@ -51,6 +51,7 @@
mMenuLabel->setPropagateEventFiring(EVENT_LOSE_FOCUS,true);
mMenuLabel->setPropagateEventFiring(EVENT_MOUSE_ENTER,true);
mMenuLabel->setPropagateEventFiring(EVENT_MOUSE_LEAVE,true);
+ mMenuLabel->setHorizontalAlignment(QuickGUI::Label::HA_LEFT);

mButton = dynamic_cast<Button*>(_createComponent(mInstanceName+".DropDownButton",TYPE_BUTTON));
mButton->setSkinComponent(".combobox.button");
@@ -74,6 +75,19 @@
mHighlightPanel->setOffset(mOffset+3);
mHighlightPanel->_notifyQuadContainer(mQuadContainer);
}
+
+ void ComboBox::setSkinComponent(const std::string& skinComponent)
+ {
+ Widget::setSkinComponent(skinComponent);
+ mMenuLabel->setSkinComponent(skinComponent);
+ mList->setSkinComponent(skinComponent+".list");
+ mButton->setSkinComponent(skinComponent+".button");
+
+ // mHighlightPanel skin
+ SkinSet* ss = SkinSetManager::getSingleton().getSkinSet(mSkinName);
+ mHighlightPanel->setMaterial(ss->getMaterialName());
+ mHighlightPanel->setTextureCoordinates(ss->getTextureCoordinates(mSkinName + skinComponent + ".highlight" + ss->getImageExtension()));
+ }

ComboBox::~ComboBox()
{

or did i miss something? :)


also, i got a problem with the clipping of the highlight area. it stops when the underlying panel ends:


how can i fix that?


EDIT: fixed it by adding:
mHighlightPanel->setClipMode(Quad::CLIPMODE_NONE);
into QuickGUIComboBox.cpp after line 76