What is the reason behind this code?

Igor Korot ikorot at earthlink.net
Tue Apr 3 00:28:09 PDT 2007


Hi, ALL,

grid.cpp, void wxGridCellChoiceEditor::BeginEdit(...)

.....
    if (m_allowOthers)
    {
        Combo()->SetValue(m_startValue);
    }
    else
    {
        // find the right position, or default to the first if not found
        int pos = Combo()->FindString(m_startValue);
//        if (pos == wxNOT_FOUND)
//            pos = 0;
        Combo()->SetSelection(pos);
    }

Why do we default to the first value?
There is a possible wxNOT_FOUND choice for the wxCombo/wxChoice control...
Besides it will bring the cell editor in sync with the control behavior.

Thank you.




More information about the wx-dev mailing list