#include "wx/deprecated/resource.h"
#include "wx/deprecated/wxexpr.h"
+#if !WXWIN_COMPATIBILITY_2_4
+static inline wxChar* copystring(const wxChar* s)
+ { return wxStrcpy(new wxChar[wxStrlen(s) + 1], s); }
+#endif
+
// Forward (private) declarations
bool wxResourceInterpretResources(wxResourceTable& table, wxExprDatabase& db);
wxItemResource *wxResourceInterpretDialog(wxResourceTable& table, wxExpr *expr, bool isPanel = FALSE);
wxItemResource::~wxItemResource()
{
- wxNode *node = m_children.First();
+ wxNode *node = m_children.GetFirst();
while (node)
{
- wxItemResource *item = (wxItemResource *)node->Data();
+ wxItemResource *item = (wxItemResource *)node->GetData();
delete item;
delete node;
- node = m_children.First();
+ node = m_children.GetFirst();
}
}
// See if any resource has this as its child; if so, delete from
// parent's child list.
BeginFind();
- wxNode *node = (wxNode *) NULL;
- node = Next();
+ wxNode *node = Next();
while (node != NULL)
{
- wxItemResource *parent = (wxItemResource *)node->Data();
+ wxItemResource *parent = (wxItemResource *)node->GetData();
if (parent->GetChildren().Member(item))
{
parent->GetChildren().DeleteObject(item);
while (node)
{
wxNode *next = Next();
- wxItemResource *item = (wxItemResource *)node->Data();
+ wxItemResource *item = (wxItemResource *)node->GetData();
delete item;
delete node;
node = next;
wxStringList& stringList = childResource->GetStringValues();
wxString *strings = (wxString *) NULL;
int noStrings = 0;
- if (stringList.Number() > 0)
+ if (stringList.GetCount() > 0)
{
- noStrings = stringList.Number();
+ noStrings = stringList.GetCount();
strings = new wxString[noStrings];
- wxNode *node = stringList.First();
+ wxStringListNode *node = stringList.GetFirst();
int i = 0;
while (node)
{
- strings[i] = (wxChar *)node->Data();
+ strings[i] = (wxChar *)node->GetData();
i ++;
- node = node->Next();
+ node = node->GetNext();
}
}
control = new wxListBox(parent, id, pos, size,
wxStringList& stringList = childResource->GetStringValues();
wxString *strings = (wxString *) NULL;
int noStrings = 0;
- if (stringList.Number() > 0)
+ if (stringList.GetCount() > 0)
{
- noStrings = stringList.Number();
+ noStrings = stringList.GetCount();
strings = new wxString[noStrings];
- wxNode *node = stringList.First();
+ wxStringListNode *node = stringList.GetFirst();
int i = 0;
while (node)
{
- strings[i] = (wxChar *)node->Data();
+ strings[i] = (wxChar *)node->GetData();
i ++;
- node = node->Next();
+ node = node->GetNext();
}
}
control = new wxChoice(parent, id, pos, size,
wxStringList& stringList = childResource->GetStringValues();
wxString *strings = (wxString *) NULL;
int noStrings = 0;
- if (stringList.Number() > 0)
+ if (stringList.GetCount() > 0)
{
- noStrings = stringList.Number();
+ noStrings = stringList.GetCount();
strings = new wxString[noStrings];
- wxNode *node = stringList.First();
+ wxStringListNode *node = stringList.GetFirst();
int i = 0;
while (node)
{
- strings[i] = (wxChar *)node->Data();
+ strings[i] = (wxChar *)node->GetData();
i ++;
- node = node->Next();
+ node = node->GetNext();
}
}
control = new wxComboBox(parent, id, childResource->GetValue4(), pos, size,
wxStringList& stringList = childResource->GetStringValues();
wxString *strings = (wxString *) NULL;
int noStrings = 0;
- if (stringList.Number() > 0)
+ if (stringList.GetCount() > 0)
{
- noStrings = stringList.Number();
+ noStrings = stringList.GetCount();
strings = new wxString[noStrings];
- wxNode *node = stringList.First();
+ wxStringListNode *node = stringList.GetFirst();
int i = 0;
while (node)
{
- strings[i] = (wxChar *)node->Data();
+ strings[i] = (wxChar *)node->GetData();
i ++;
- node = node->Next();
+ node = node->GetNext();
}
}
control = new wxRadioBox(parent, (wxWindowID) id, wxString(childResource->GetTitle()), pos, size,
bool wxResourceInterpretResources(wxResourceTable& table, wxExprDatabase& db)
{
- wxNode *node = db.First();
+ wxNode *node = db.GetFirst();
while (node)
{
- wxExpr *clause = (wxExpr *)node->Data();
+ wxExpr *clause = (wxExpr *)node->GetData();
wxString functor(clause->Functor());
wxItemResource *item = (wxItemResource *) NULL;
table.DeleteResource(item->GetName());
table.AddResource(item);
}
- node = node->Next();
+ node = node->GetNext();
}
return TRUE;
}
static bool wxEatWhiteSpace(FILE *fd)
{
- int ch = 0;
+ int ch;
while ((ch = getc(fd)) != EOF)
{
wxItemResource *optResource = (wxItemResource *) NULL;
// Try to find optimum bitmap for this platform/colour depth
- wxNode *node = item->GetChildren().First();
+ wxNode *node = item->GetChildren().GetFirst();
while (node)
{
- wxItemResource *child = (wxItemResource *)node->Data();
+ wxItemResource *child = (wxItemResource *)node->GetData();
int platform = (int)child->GetValue2();
int noColours = (int)child->GetValue3();
/*
default:
break;
}
- node = node->Next();
+ node = node->GetNext();
}
// If no matching resource, fail.
if (!optResource)
wxItemResource *optResource = (wxItemResource *) NULL;
// Try to find optimum icon for this platform/colour depth
- wxNode *node = item->GetChildren().First();
+ wxNode *node = item->GetChildren().GetFirst();
while (node)
{
- wxItemResource *child = (wxItemResource *)node->Data();
+ wxItemResource *child = (wxItemResource *)node->GetData();
int platform = (int)child->GetValue2();
int noColours = (int)child->GetValue3();
/*
default:
break;
}
- node = node->Next();
+ node = node->GetNext();
}
// If no matching resource, fail.
if (!optResource)
wxMenu *wxResourceCreateMenu(wxItemResource *item)
{
wxMenu *menu = new wxMenu;
- wxNode *node = item->GetChildren().First();
+ wxNode *node = item->GetChildren().GetFirst();
while (node)
{
- wxItemResource *child = (wxItemResource *)node->Data();
+ wxItemResource *child = (wxItemResource *)node->GetData();
if ((child->GetType() != wxT("")) && (child->GetType() == wxT("wxMenuSeparator")))
menu->AppendSeparator();
- else if (child->GetChildren().Number() > 0)
+ else if (child->GetChildren().GetCount() > 0)
{
wxMenu *subMenu = wxResourceCreateMenu(child);
if (subMenu)
{
menu->Append((int)child->GetValue1(), child->GetTitle(), child->GetValue4(), (child->GetValue2() != 0));
}
- node = node->Next();
+ node = node->GetNext();
}
return menu;
}
{
if (!menuBar)
menuBar = new wxMenuBar;
- wxNode *node = menuResource->GetChildren().First();
+ wxNode *node = menuResource->GetChildren().GetFirst();
while (node)
{
- wxItemResource *child = (wxItemResource *)node->Data();
+ wxItemResource *child = (wxItemResource *)node->GetData();
wxMenu *menu = wxResourceCreateMenu(child);
if (menu)
menuBar->Append(menu, child->GetTitle());
- node = node->Next();
+ node = node->GetNext();
}
return menuBar;
}
bool wxEatWhiteSpaceString(char *s)
{
- int ch = 0;
+ int ch;
while ((ch = getc_string(s)) != EOF)
{
break;
case '/':
{
- int prev_ch = ch;
ch = getc_string(s);
if (ch == EOF)
{
if (ch == '*')
{
// Eat C comment
- prev_ch = 0;
+ int prev_ch = 0;
while ((ch = getc_string(s)) != EOF)
{
if (ch == '/' && prev_ch == '*')
}
// Now create children
- wxNode *node = resource->GetChildren().First();
+ wxNode *node = resource->GetChildren().GetFirst();
while (node)
{
- wxItemResource *childResource = (wxItemResource *)node->Data();
+ wxItemResource *childResource = (wxItemResource *)node->GetData();
(void) wxCreateItem(thisWindow, childResource, resource, table);
- node = node->Next();
+ node = node->GetNext();
}
return TRUE;
}