About Store Forum Documentation Contact



Post Reply 
ComboBox draw behavior
Author Message
Esenthel Offline
Administrator

Post: #16
RE: ComboBox draw behavior
for 2D graphics usually no, however CMenu can be an exception, because it's drawn on top of other Gui objects, so it can be drawn at last stage.
06-08-2010 10:56 PM
Find all posts by this user Quote this message in a reply
Impz0r Offline
Member

Post: #17
RE: ComboBox draw behavior
I've one question left regarding the combobox smile

I want to fill it with a couple of strings, well there's the way you proposed:
Code:
static CChar8 *t[]=
{
   "test",
   "test aj",
   "test ajshdkjas asjdhkqugwjeg jasda vb",
};
...
Gui+=combo.create(Rect_C(0.5f,-0.6,0.3,0.06),t,ELMS(t));

But I want it to fill it by using a std::vector of Str16 like:
Code:
void UICombobox::SetText(const std::vector<EE::Str16> & _value)
{
    EE::Node<EE::CMenuElm> elements;

    for (Int i=0; i < _value.size(); ++i)
    {
        EE::Node<EE::CMenuElm> &node = elements.add();
        node.data.name = _value[i];
        node.data.display_name = _value[i];
    }

    m_pEEControl->setData(elements);
}

This somehow works, but produces a much shorter context menu as with your method. Shorter means, it is scaled down to some unknown degree.
So the Button is within the normal size I designed it but if I click it the context menu pops up but is about 1/3 in size of the button.. don't know how this actually happens. Any idea?

Does setData(...) make a deep copy of the data or do I have to keep the strings i add within my own structure?

Thanks in advance!


Mfg Imp
06-08-2010 11:20 PM
Find all posts by this user Quote this message in a reply
Esenthel Offline
Administrator

Post: #18
RE: ComboBox draw behavior
please try setting TextDS settings before calling setData
Quote:Does setData(...) make a deep copy of the data or do I have to keep the strings i add within my own structure?
for setData with Node<CMenuElm> I think it copies the data to helper memory (but not sure)
06-08-2010 11:22 PM
Find all posts by this user Quote this message in a reply
Impz0r Offline
Member

Post: #19
RE: ComboBox draw behavior
Thanks Esenthel, but it does not have any impact on setting TextDS bevor setData().. unfortunatly wink

Maybe it has something to to with the way i setup the EE::Node<EE::CMenuElm> ?

Mfg Imp
06-09-2010 01:18 AM
Find all posts by this user Quote this message in a reply
Post Reply