- GetSize (&width1, &height1);
-
- bool managed = XtIsManaged(listBox);
-
- if (managed)
- XtUnmanageChild (listBox);
-
- XmListDeletePos (listBox, N + 1);
-
- if (managed)
- XtManageChild (listBox);
-
- GetSize (&width2, &height2);
- // Correct for randomly resized listbox - bad boy, Motif!
- if (width1 != width2 || height1 != height2)
- SetSize (-1, -1, width1, height1);
-
- // (JDH) need to add code here to take care of clientDataList
- wxNode *node = m_clientDataList.Find((long)N); // get item from list
- if (node) m_clientDataList.DeleteNode(node); // if existed then delete from list
- node = m_clientDataList.First(); // we now have to adjust all keys that
- while (node) // are >=N+1
- { if (node->GetKeyInteger() >= (long)(N+1))
- node->SetKeyInteger(node->GetKeyInteger() - 1);
- node = node->Next();
- }
-
- m_noItems --;
-}
-
-void wxListBox::Append(const wxString& item)
-{
- int width1, height1;
- int width2, height2;
-
- Widget listBox = (Widget) m_mainWidget;
- GetSize (&width1, &height1);
-
- bool managed = XtIsManaged(listBox);
-
- if (managed)
- XtUnmanageChild (listBox);
- int n;
- XtVaGetValues (listBox, XmNitemCount, &n, NULL);
- XmString text = XmStringCreateSimple ((char*) (const char*) item);
- // XmListAddItem(listBox, text, n + 1);
- XmListAddItemUnselected (listBox, text, 0);
- XmStringFree (text);
-
- // It seems that if the list is cleared, we must re-ask for
- // selection policy!!
- Arg args[3];
- XtSetArg (args[0], XmNlistSizePolicy, XmCONSTANT);
- if (m_windowStyle & wxLB_MULTIPLE)
- XtSetArg (args[1], XmNselectionPolicy, XmMULTIPLE_SELECT);
- else if (m_windowStyle & wxLB_EXTENDED)
- XtSetArg (args[1], XmNselectionPolicy, XmEXTENDED_SELECT);
- else
- XtSetArg (args[1], XmNselectionPolicy, XmBROWSE_SELECT);
- XtSetValues (listBox, args, 2);
-
- if (managed)
- XtManageChild (listBox);
-
- GetSize (&width2, &height2);
- // Correct for randomly resized listbox - bad boy, Motif!
- if (width1 != width2 || height1 != height2)
- SetSize (-1, -1, width1, height1);
- m_noItems ++;
-}