Example #1
0
void iupdrvListRemoveItem(Ihandle* ih, int pos)
{
  /* The utility functions use 0=last 1=first */
  if (ih->data->is_dropdown || ih->data->has_editbox)
  {
    if (ih->data->is_dropdown && !ih->data->has_editbox)
    {
      /* must check if removing the current item */
      int curpos;
      XtVaGetValues(ih->handle, XmNselectedPosition, &curpos, NULL);
      if (pos == curpos && iupdrvListGetCount(ih)>1)
      {
        if (curpos > 0) curpos--;
        else curpos++;

        XtRemoveCallback(ih->handle, XmNselectionCallback, (XtCallbackProc)motListComboBoxSelectionCallback, (XtPointer)ih);
        XtVaSetValues(ih->handle, XmNselectedPosition, curpos, NULL);  
        XtAddCallback(ih->handle, XmNselectionCallback, (XtCallbackProc)motListComboBoxSelectionCallback, (XtPointer)ih);
      }
    }
    XmComboBoxDeletePos(ih->handle, pos+1);
  }
  else
    XmListDeletePos(ih->handle, pos+1);

  iupListUpdateOldValue(ih, pos, 1);
}
Example #2
0
void wxComboBox::Delete(unsigned int n)
{
    XmComboBoxDeletePos((Widget) m_mainWidget, n+1);
    wxStringList::Node *node = m_stringList.Item(n);
    if (node)
    {
        delete[] node->GetData();
        delete node;
    }
    m_clientDataDict.Delete(n, HasClientObjectData());
    m_noStrings--;
}