Пример #1
0
void wxComboBox::SetString(unsigned int n, const wxString& s)
{
    // Notice that we shouldn't delete and insert the item in this control
    // itself as this would also affect the client data which we need to
    // preserve here.
    GetComboPeer()->RemoveItem(n);
    GetComboPeer()->InsertItem(n, s);
    SetValue(s); // changing the item in the list won't update the display item
}
Пример #2
0
int wxComboBox::FindString(const wxString& s, bool bCase) const
{
    if (!bCase)
    {
        for (unsigned i = 0; i < GetCount(); i++)
        {
            if (s.IsSameAs(GetString(i), false))
                return i;
        }
        return wxNOT_FOUND;
    }

    return GetComboPeer()->FindString(s);
}
Пример #3
0
int wxComboBox::DoInsertItems(const wxArrayStringsAdapter& items,
                              unsigned int pos,
                              void **clientData, wxClientDataType type)
{
    const unsigned int numItems = items.GetCount();
    for( unsigned int i = 0; i < numItems; ++i, ++pos )
    {
        unsigned int idx;

        idx = pos;
        GetComboPeer()->InsertItem( idx, items[i] );

        if (idx > m_datas.GetCount())
            m_datas.SetCount(idx);
        m_datas.Insert( NULL, idx );
        AssignNewItemClientData(idx, clientData, i, type);
    }

    GetPeer()->SetMaximum( GetCount() );

    return pos - 1;
}
Пример #4
0
wxString wxComboBox::GetString(unsigned int n) const
{
    wxCHECK_MSG( n < GetCount(), wxString(), "Invalid combobox index" );

    return GetComboPeer()->GetStringAtIndex(n);
}
Пример #5
0
void wxComboBox::SetSelection(int n)
{
    GetComboPeer()->SetSelectedItem(n);
}
Пример #6
0
int wxComboBox::GetSelection() const
{
    return GetComboPeer()->GetSelectedItem();
}
Пример #7
0
void wxComboBox::DoClear()
{
    GetComboPeer()->Clear();
}
Пример #8
0
void wxComboBox::DoDeleteOneItem(unsigned int n)
{
    GetComboPeer()->RemoveItem(n);
}
Пример #9
0
unsigned int wxComboBox::GetCount() const
{
    return GetComboPeer()->GetNumberOfItems();
}
Пример #10
0
wxString wxComboBox::GetString(unsigned int n) const
{
    return GetComboPeer()->GetStringAtIndex(n);
}
Пример #11
0
void wxComboBox::Dismiss()
{
    GetComboPeer()->Dismiss();
}
Пример #12
0
void wxComboBox::Popup()
{
    GetComboPeer()->Popup();
}
Пример #13
0
void wxComboBox::DoClear()
{
    m_datas.Clear();
    GetComboPeer()->Clear();
}
Пример #14
0
void wxComboBox::DoDeleteOneItem(unsigned int n)
{
    m_datas.RemoveAt(n);
    GetComboPeer()->RemoveItem(n);
}