// common part of all contructors
void Init();
- int m_noStrings;
+ size_t m_noStrings;
WXWidget m_menuWidget;
WXWidget m_buttonWidget;
wxWidgetArray m_widgetArray;
#if wxUSE_CLIPBOARD
+class wxDataObject;
+
#include "wx/list.h"
+WX_DECLARE_LIST(wxDataObject, wxDataObjectList);
bool WXDLLEXPORT wxOpenClipboard();
bool WXDLLEXPORT wxClipboardOpen();
// implementation from now on
bool m_open;
- wxList m_data;
+ wxDataObjectList m_data;
bool m_usePrimary;
private:
if (event.MoreRequested())
needMore = TRUE;
- wxNode* node = win->GetChildren().First();
+ wxWindowList::Node* node = win->GetChildren().GetFirst();
while (node)
{
- wxWindow* win = (wxWindow*) node->Data();
+ wxWindow* win = node->GetData();
if (SendIdleEvents(win))
needMore = TRUE;
- node = node->Next();
+ node = node->GetNext();
}
return needMore ;
}
void wxApp::DeletePendingObjects()
{
- wxNode *node = wxPendingDelete.First();
+ wxNode *node = wxPendingDelete.GetFirst();
while (node)
{
- wxObject *obj = (wxObject *)node->Data();
+ wxObject *obj = node->GetData();
delete obj;
// Deleting one object may have deleted other pending
// objects, so start from beginning of list again.
- node = wxPendingDelete.First();
+ node = wxPendingDelete.GetFirst();
}
}
// Create an application context
bool wxApp::OnInitGui()
{
+ if( !wxAppBase::OnInitGui() )
+ return FALSE;
+
XtToolkitInitialize() ;
wxTheApp->m_appContext = (WXAppContext) XtCreateApplicationContext();
XtAppSetFallbackResources((XtAppContext) wxTheApp->m_appContext, fallbackResources);
// Because it's very hard to find wxButton in the same row,
// correction is straighforward: we set resource for all wxButton
// in this parent (but not sub panels)
- for (wxNode * node = parent->GetChildren().First (); node; node = node->Next ())
+ for (wxWindowList::Node * node = parent->GetChildren().GetFirst ();
+ node; node = node->GetNext ())
{
- wxButton *item = (wxButton *) node->Data ();
- if (item->IsKindOf(CLASSINFO(wxButton)))
+ wxWindow *win = node->GetData ();
+ wxButton *item = wxDynamicCast(win, wxButton);
+ if (item)
{
bool managed = XtIsManaged((Widget) item->GetMainWidget());
if (managed)
void wxChoice::Clear()
{
m_stringList.Clear ();
- int i;
+ size_t i;
for (i = 0; i < m_noStrings; i++)
{
XtRemoveCallback((Widget) m_widgetArray[i],
#if 0
Dimension selectionWidth, selectionHeight;
#endif
- wxXmString text( (char*)node->Data() );
+ wxXmString text( node->GetData() );
// MBN: this seems silly, at best, and causes wxChoices to be clipped:
// will remove "soon"
#if 0
if (width > -1)
{
- int i;
+ size_t i;
for (i = 0; i < m_noStrings; i++)
XtVaSetValues ((Widget) m_widgetArray[i],
XmNwidth, actualWidth,
}
if (height > -1)
{
- int i;
+ size_t i;
for (i = 0; i < m_noStrings; i++)
XtVaSetValues ((Widget) m_widgetArray[i],
XmNheight, actualHeight,
DoChangeBackgroundColour(m_formWidget, m_backgroundColour);
DoChangeBackgroundColour(m_buttonWidget, m_backgroundColour);
DoChangeBackgroundColour(m_menuWidget, m_backgroundColour);
- int i;
+ size_t i;
for (i = 0; i < m_noStrings; i++)
DoChangeBackgroundColour(m_widgetArray[i], m_backgroundColour);
}
DoChangeForegroundColour(m_formWidget, m_foregroundColour);
DoChangeForegroundColour(m_buttonWidget, m_foregroundColour);
DoChangeForegroundColour(m_menuWidget, m_foregroundColour);
- int i;
+ size_t i;
for (i = 0; i < m_noStrings; i++)
DoChangeForegroundColour(m_widgetArray[i], m_foregroundColour);
}
#include "wx/clipbrd.h"
#include "wx/dataobj.h"
+#include "wx/listimpl.cpp"
+WX_DEFINE_LIST(wxDataObjectList);
+
#ifdef __VMS__
#pragma message disable nosimpint
#endif
void wxClipboard::Clear()
{
- wxNode* node = m_data.First();
+ wxDataObjectList::Node* node = m_data.GetFirst();
while (node)
{
- wxDataObject* data = (wxDataObject*) node->Data();
+ wxDataObject* data = node->GetData();
delete data;
- node = node->Next();
+ node = node->GetNext();
}
m_data.Clear();
}
void wxComboBox::Delete(int n)
{
XmComboBoxDeletePos((Widget) m_mainWidget, n+1);
- wxNode *node = m_stringList.Nth(n);
+ wxStringList::Node *node = m_stringList.Item(n);
if (node)
{
- delete[] (char *)node->Data();
+ delete[] node->GetData();
delete node;
}
m_clientDataDict.Delete(n, HasClientObjectData());
wxString wxComboBox::GetString(int n) const
{
- wxNode *node = m_stringList.Nth(n);
+ wxStringList::Node *node = m_stringList.Item(n);
if (node)
- return wxString((char *) node->Data ());
+ return wxString(node->GetData ());
else
return wxEmptyString;
}
wxCursorRefData::~wxCursorRefData()
{
- wxNode* node = m_cursors.First();
+ wxList::Node* node = m_cursors.GetFirst();
while (node)
{
- wxXCursor* c = (wxXCursor*) node->Data();
+ wxXCursor* c = (wxXCursor*) node->GetData();
// TODO: how to delete cursor?
// XDestroyCursor((Display*) c->m_display, (Cursor) c->m_cursor); // ??
delete c;
- node = node->Next();
+ node = node->GetNext();
}
}
{
if (!M_CURSORDATA)
return (WXCursor) 0;
- wxNode* node = M_CURSORDATA->m_cursors.First();
+ wxList::Node* node = M_CURSORDATA->m_cursors.GetFirst();
while (node)
{
- wxXCursor* c = (wxXCursor*) node->Data();
+ wxXCursor* c = (wxXCursor*) node->GetData();
if (c->m_display == display)
return c->m_cursor;
- node = node->Next();
+ node = node->GetNext();
}
// No cursor for this display, so let's see if we're an id-type cursor.
XFlush (display);
- for(wxNode *node = win->GetChildren().First (); node; node = node->Next())
+ for(wxWindowList::Node *node = win->GetChildren().GetFirst (); node;
+ node = node->GetNext())
{
- wxWindow *child = (wxWindow *) node->Data ();
+ wxWindow *child = node->GetData ();
wxXSetBusyCursor (child, cursor);
}
}
wxBusyCursorCount++;
if (wxBusyCursorCount == 1)
{
- for(wxNode *node = wxTopLevelWindows.First (); node; node = node->Next())
+ for(wxWindowList::Node *node = wxTopLevelWindows.GetFirst (); node;
+ node = node->GetNext())
{
- wxWindow *win = (wxWindow *) node->Data ();
+ wxWindow *win = node->GetData ();
wxXSetBusyCursor (win, cursor);
}
}
wxBusyCursorCount--;
if (wxBusyCursorCount == 0)
{
- for(wxNode *node = wxTopLevelWindows.First (); node; node = node->Next())
+ for(wxWindowList::Node *node = wxTopLevelWindows.GetFirst (); node;
+ node = node->GetNext())
{
- wxWindow *win = (wxWindow *) node->Data ();
+ wxWindow *win = node->GetData ();
wxXSetBusyCursor (win, NULL);
}
}
wxFontRefData::~wxFontRefData()
{
- wxNode* node = m_fonts.First();
+ wxList::Node* node = m_fonts.GetFirst();
while (node)
{
- wxXFont* f = (wxXFont*) node->Data();
+ wxXFont* f = (wxXFont*) node->GetData();
delete f;
- node = node->Next();
+ node = node->GetNext();
}
m_fonts.Clear();
}
int pointSize = (M_FONTDATA->m_pointSize * 10 * intScale) / 100;
// search existing fonts first
- wxNode* node = M_FONTDATA->m_fonts.First();
+ wxList::Node* node = M_FONTDATA->m_fonts.GetFirst();
while (node)
{
- wxXFont* f = (wxXFont*) node->Data();
+ wxXFont* f = (wxXFont*) node->GetData();
if ((!display || (f->m_display == display)) && (f->m_scale == intScale))
return f;
- node = node->Next();
+ node = node->GetNext();
}
// not found, create a new one
if (!event.GetActive())
return;
- for(wxNode *node = GetChildren().First(); node; node = node->Next())
+ for(wxWindowList::Node *node = GetChildren().GetFirst(); node;
+ node = node->GetNext())
{
// Find a child that's a subwindow, but not a dialog box.
- wxWindow *child = (wxWindow *)node->Data();
+ wxWindow *child = node->GetData();
if (!child->IsTopLevel())
{
child->SetFocus();
#define DEFAULT_XRESOURCE_DIR "/usr/lib/X11/app-defaults"
#endif
+#if wxUSE_RESOURCES
static char *GetIniFile (char *dest, const char *filename);
+#endif
// ============================================================================
// implementation
// Reading and writing resources (eg WIN.INI, .Xdefaults)
// ----------------------------------------------------------------------------
+#if wxUSE_RESOURCES
+
// Read $HOME for what it says is home, if not
// read $USER or $LOGNAME for user name else determine
// the Real User, then determine the Real home dir.
return dest;
}
-#if wxUSE_RESOURCES
-
static char *GetResourcePath(char *buf, const char *name, bool create = FALSE)
{
if (create && wxFileExists (name) ) {