#if wxUSE_LISTBOX
+#include "wx/listbox.h"
+
+#ifndef WX_PRECOMP
+ #include "wx/dynarray.h"
+ #include "wx/log.h"
+ #include "wx/utils.h"
+ #include "wx/settings.h"
+ #include "wx/arrstr.h"
+#endif
+
#ifdef __VMS
#define XtParent XTPARENT
#define XtDisplay XTDISPLAY
#endif
-# include "wx/listbox.h"
-#include "wx/settings.h"
-#include "wx/dynarray.h"
-#include "wx/log.h"
-#include "wx/utils.h"
-#include "wx/arrstr.h"
-
#ifdef __VMS__
#pragma message disable nosimpint
#endif
void wxListBox::Delete(unsigned int n)
{
- wxSizeKeeper sk( this );
Widget listBox = (Widget) m_mainWidget;
- bool managed = XtIsManaged(listBox);
-
- if (managed)
- XtUnmanageChild (listBox);
-
XmListDeletePos (listBox, n + 1);
- if (managed)
- XtManageChild (listBox);
-
- sk.Restore();
m_clientDataDict.Delete(n, HasClientObjectData());
m_noItems --;
}
int wxListBox::DoAppend(const wxString& item)
{
- wxSizeKeeper sk( this );
Widget listBox = (Widget) m_mainWidget;
- bool managed = XtIsManaged(listBox);
-
- if (managed)
- XtUnmanageChild (listBox);
int n;
XtVaGetValues (listBox, XmNitemCount, &n, NULL);
wxXmString text( item );
// selection policy!!
SetSelectionPolicy();
- if (managed)
- XtManageChild (listBox);
-
- sk.Restore();
m_noItems ++;
return GetCount() - 1;
void wxListBox::DoSetItems(const wxArrayString& items, void** clientData)
{
- wxSizeKeeper sk( this );
Widget listBox = (Widget) m_mainWidget;
if( HasClientObjectData() )
m_clientDataDict.DestroyData();
- bool managed = XtIsManaged(listBox);
-
- if (managed)
- XtUnmanageChild (listBox);
XmString *text = new XmString[items.GetCount()];
unsigned int i;
for (i = 0; i < items.GetCount(); ++i)
// selection policy!!
SetSelectionPolicy();
- if (managed)
- XtManageChild (listBox);
-
- sk.Restore();
-
m_noItems = items.GetCount();
}
void wxListBox::DoInsertItems(const wxArrayString& items, unsigned int pos)
{
- wxSizeKeeper sk( this );
Widget listBox = (Widget) m_mainWidget;
- bool managed = XtIsManaged(listBox);
-
- if (managed)
- XtUnmanageChild(listBox);
-
XmString *text = new XmString[items.GetCount()];
unsigned int i;
// Steve Hammes: Motif 1.1 compatibility
// selection policy!!
SetSelectionPolicy();
- if (managed)
- XtManageChild(listBox);
-
- sk.Restore();
-
m_noItems += items.GetCount();
}